-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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: mongo schema collections order of mongo plugin #36062
fix: mongo schema collections order of mongo plugin #36062
Conversation
WalkthroughThe changes involve modifications to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MongoPlugin
participant Database
User->>MongoPlugin: Request collection structure
MongoPlugin->>Database: Fetch collection names
Database-->>MongoPlugin: Return collection names
MongoPlugin->>MongoPlugin: Sort collection names (case-insensitive)
MongoPlugin-->>User: Return sorted collection names
Assessment against linked issues
Poem
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
Early access features: disabledWe are currently testing the following features in early access:
Note:
|
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/MongoPlugin.java (1 hunks)
- app/server/appsmith-plugins/mongoPlugin/src/test/java/com/external/plugins/MongoPluginQueriesTest.java (1 hunks)
Additional comments not posted (2)
app/server/appsmith-plugins/mongoPlugin/src/test/java/com/external/plugins/MongoPluginQueriesTest.java (1)
659-676
: Great job adding this new test method!The
testStructure_should_return_collections_in_order
method is a valuable addition to the test suite. It verifies that thegetStructure
method returns the MongoDB collections in the correct ascending order.The test follows these steps:
- Creates a
DatasourceConfiguration
.- Invokes the
datasourceCreate
method.- Calls the
getStructure
method.- Uses
StepVerifier
to make assertions on the resultingMono<DatasourceStructure>
:
- Checks that the structure is not null.
- Verifies that it contains exactly three tables.
- Asserts that the tables are sorted correctly by name: "address", "teams", and "users".
This test enhances the reliability of the plugin's functionality by ensuring that the collections are always returned in a predictable sorted order.
Keep up the great work in improving the test coverage and validating the expected behavior! 👍
app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/MongoPlugin.java (1)
915-915
: Excellent work on sorting the collection names! This enhances the user experience.By sorting the collection names using
compareToIgnoreCase
, you ensure that the output is consistently ordered regardless of the case. This provides a more predictable and user-friendly result.The subsequent logic remains unaffected, but the introduction of sorting improves the overall behavior of the method.
Hi @NilanshBansal, @sagar-qa007, Could you please review this PR. |
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
Hi @NilanshBansal , Could you please review the PR if possible. It has been opened since last 3 weeks. |
Hey @raushan3737 apologies for the inconvenience, we are starting to review this PR and targeting to complete it by Next Friday. |
Hi @raushan3737 thanks for your patience. We have created shadow PR here to run the tests. |
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11029317630. |
Deploy-Preview-URL: https://ce-36062.dp.appsmith.com |
@raushan3737 thanks for taking out time to contribute to Appsmith! We highly appreciate your effort in making Appsmith better ❤️ |
### PR Description: - **File changes in the PR**: - Integrated the sorting feature to the mongo collections. - Added the unit test for sorting. Fixes appsmithorg#35842 - **Snapshots**: **Before resolving bug:** ![image](https://github.com/user-attachments/assets/34c04ebc-e81b-480c-9a54-1b643b68ffb2) **After resolving bug:** ![image](https://github.com/user-attachments/assets/fd7155e1-e261-491a-b912-7d482b8a9386) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced the MongoDB plugin to return collection names in a case-insensitive sorted order, improving predictability and user experience. - **Tests** - Added a new test to validate that collections returned by the plugin are sorted correctly, ensuring consistent functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
PR Description:
Fixes #35842
Snapshots:
Before resolving bug:
After resolving bug:
Summary by CodeRabbit
New Features
Tests