-
Notifications
You must be signed in to change notification settings - Fork 3
JIM-137: Create truncate plugin. #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds a new Drupal Migrate process plugin class Changes
Sequence Diagram(s)sequenceDiagram
participant Migration as Migration Process
participant Truncate as Truncate Plugin
participant Unicode as Unicode Utility
participant Result as Output
Migration ->> Truncate: transform(value, migrate_executable, row, dest)
alt value is empty or not string
Truncate -->> Result: return original value
else
Truncate ->> Unicode: truncate(value, maxLength, wordSafe, addEllipsis)
Unicode -->> Truncate: truncated string
Truncate -->> Result: return truncated string
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/Plugin/migrate/process/Truncate.php(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Code Linting
src/Plugin/migrate/process/Truncate.php
[warning] 21-21: Line exceeds 80 characters; contains 85 characters (Drupal.Files.LineLength.TooLong)
[warning] 22-22: Line exceeds 80 characters; contains 100 characters (Drupal.Files.LineLength.TooLong)
[error] 61-61: There must be exactly one blank line before the tags in a doc comment (Drupal.Commenting.DocComment.SpacingBeforeTags)
[error] 61-61: Data types in @throws tags need to be fully namespaced (Drupal.Commenting.DataTypeNamespace.DataTypeNamespace)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: PHPUnit / Drupal 10.3 | PHP 8.2
- GitHub Check: PHPUnit / Drupal 10.4 | PHP 8.4
- GitHub Check: PHPUnit / Drupal 10.5 | PHP 8.4
- GitHub Check: PHPUnit / Drupal 10.5 | PHP 8.3
- GitHub Check: PHPUnit / Drupal 10.4 | PHP 8.3
🔇 Additional comments (3)
src/Plugin/migrate/process/Truncate.php (3)
1-10: LGTM!The namespace and imports are correctly structured for a Drupal Migrate process plugin.
36-58: LGTM!The class structure and typed properties are well-designed and properly documented.
82-88: LGTM!The transform method correctly handles edge cases (empty and non-string values) and properly delegates to Drupal's
Unicode::truncateutility with the configured parameters.Note:
empty($value)returns TRUE for the string "0", but this is acceptable behavior for truncation since "0" is already a short string that doesn't need processing.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary by CodeRabbit