-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix: conditionally set FqN name for partial import #37694
Conversation
WalkthroughThe changes in the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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: 0
🧹 Outside diff range and nitpick comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/importable/NewActionImportableServiceCEImpl.java (1)
Line range hint
473-491
: Add test coverage for partial import FQN handlingPlease add test cases to verify:
- FQN setting behavior for partial imports
- FQN setting behavior for regular imports
- Edge cases with published/unpublished actions
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/importable/NewActionImportableServiceCEImpl.java
(3 hunks)
🔇 Additional comments (3)
app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/importable/NewActionImportableServiceCEImpl.java (3)
305-306
: LGTM: Method call updated correctly
The isPartialImport
parameter is properly passed from the importing metadata.
473-475
: LGTM: Method signature updated appropriately
The method signature change aligns with the PR objectives to handle partial imports differently.
489-491
: Verify the conditional FQN setting behavior
The conditional logic for setting FQN looks correct, but we should verify that this change doesn't affect existing functionality for non-partial imports.
✅ Verification successful
FQN setting behavior is consistent with codebase patterns
The conditional FQN setting in partial imports aligns with the codebase's established patterns. The search results show that:
- FQN is consistently set alongside name changes in various contexts (LayoutCollectionService, ActionCollectionService)
- For non-partial imports, FQN matches the action name pattern as seen in test cases
- The conditional logic prevents FQN conflicts during partial imports while maintaining expected behavior for full imports
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for other occurrences of setFullyQualifiedName to ensure consistent behavior
ast-grep --pattern 'setFullyQualifiedName($_)'
# Search for tests related to partial imports
rg -l "partial.*import.*test" -g "*.java"
Length of output: 130905
Script:
#!/bin/bash
# Search for setFullyQualifiedName usage in Java files
rg -t java "setFullyQualifiedName" -A 2 -B 2
# Search for tests related to partial imports
rg -t java "partial.*import.*test" -A 2 -B 2
Length of output: 18413
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: 0
🧹 Outside diff range and nitpick comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/refactors/NewActionRefactoringServiceCEImpl.java (1)
136-141
: Consider adding test coverage for the new FQN logic.While the implementation looks correct, it would be beneficial to add test cases covering:
- Non-JS plugins with new FQN provided
- Non-JS plugins falling back to action name
- JS plugins maintaining original behavior
Would you like me to help generate test cases for these scenarios?
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/refactors/NewActionRefactoringServiceCEImpl.java
(1 hunks)
🔇 Additional comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/refactors/NewActionRefactoringServiceCEImpl.java (1)
136-141
: LGTM! The conditional FQN setting for non-JS plugins addresses the issue.
The implementation correctly handles the FQN setting for non-JS plugins while preserving the existing behavior for JS plugins. This fixes the discrepancy between actual names and FQNs during partial imports.
Let's verify the impact on JS plugins:
✅ Verification successful
The conditional FQN handling for non-JS plugins is correctly implemented
The code search confirms that JS plugins have special handling throughout the codebase, and this change maintains that by explicitly skipping FQN updates for JS plugins while properly handling FQN for all other plugin types. The implementation aligns with the existing JS plugin patterns in the codebase, particularly around collection handling and dynamic bindings.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that JS plugins are not affected by this change
# and maintain their original FQN handling behavior
# Search for JS plugin actions and their FQN handling
ast-grep --pattern 'class $_ implements EntityRefactoringServiceCE {
$$$
updateRefactoredEntity($_) {
$$$
if (PluginType.JS.equals($_)) {
$$$
}
$$$
}
$$$
}'
Length of output: 188
Script:
#!/bin/bash
# Let's try a different approach to find JS plugin handling in the refactoring service
# Search for the specific file and show context around plugin type checks
rg -U "PluginType\.JS" app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/refactors/NewActionRefactoringServiceCEImpl.java -B 5 -A 5
# Also search for any other references to JS plugin handling in the codebase
rg -U "PluginType\.JS.*action" --type java -B 3 -A 3
Length of output: 7441
Looks good, let's wait for CI to pass? |
…o fix/partial-ie-action
Looks good, waiting for tests to pass for approval |
Failed server tests
|
1 similar comment
Failed server tests
|
…o fix/partial-ie-action
Failed server tests
|
Failed server tests
|
1 similar comment
Failed server tests
|
…o fix/partial-ie-action
Failed server tests
|
## Description The fullyQulifiedName aka path for used for js objects was set to actions as well during the partial import. This was causing the diff in actual name and fullyQualifiedName when the name is edited in UI. Hence few of the actions were failing in view mode. Fixes appsmithorg#33651 ## Automation /ok-to-test tags="@tag.ImportExport, @tag.Git" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/12290147226> > Commit: e60ca39 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12290147226&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.ImportExport, @tag.Git` > Spec: > <hr>Thu, 12 Dec 2024 05:52:15 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved action refactoring functionality, ensuring consistent naming conventions across different plugin types. - Enhanced handling of action references during refactoring, ensuring robust updates and checks for action configurations. - **Bug Fixes** - Fixed issues related to the retrieval and updating of actions based on context, improving overall efficiency. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: sondermanish <[email protected]>
Description
The fullyQulifiedName aka path for used for js objects was set to actions as well during the partial import. This was causing the diff in actual name and fullyQualifiedName when the name is edited in UI. Hence few of the actions were failing in view mode.
Fixes #33651
Automation
/ok-to-test tags="@tag.ImportExport, @tag.Git"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12290147226
Commit: e60ca39
Cypress dashboard.
Tags:
@tag.ImportExport, @tag.Git
Spec:
Thu, 12 Dec 2024 05:52:15 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes