appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

fix: mongo schema collections order of mongo plugin

Open raushan3737 opened this issue 1 year ago • 2 comments

PR Description:

  • Issue fixed: https://github.com/appsmithorg/appsmith/issues/35842

  • File changes in the PR:

    • Integrated the sorting feature to the mongo collections.
    • Added the unit test for sorting.
  • Snapshots:

    Before resolving bug:

    image

    After resolving bug:

    image

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.

raushan3737 avatar Sep 03 '24 04:09 raushan3737

Walkthrough

The changes involve modifications to the getStructure method in the MongoPlugin class to ensure that MongoDB collection names are returned in a case-insensitive sorted order. Additionally, a new test method has been added to verify that the collections are indeed sorted correctly, enhancing the reliability of the plugin's functionality.

Changes

File Change Summary
app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/MongoPlugin.java Modified getStructure method to sort collection names in a case-insensitive manner.
app/server/appsmith-plugins/mongoPlugin/src/test/java/com/external/plugins/MongoPluginQueriesTest.java Added testStructure_should_return_collections_in_order to verify sorted order of collections.

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

Objective Addressed Explanation
Collections are sorted in schemas (Issue #35842)

Poem

In the realm of Mongo, collections align,
With names now sorted, oh how they shine!
From chaos to order, a tidy display,
A plugin enhancement, brightening the day!
Let's celebrate coding, with joy in our heart,
For every small change is a beautiful art! 🎉


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.
Early access features: disabled

We are currently testing the following features in early access:

  • Anthropic claude-3-5-sonnet for code reviews: Anthropic claims that the new Claude model has stronger code understanding and code generation capabilities than their previous models. Note: Our default code review model was also updated late last week. Please compare the quality of the reviews between the two models by toggling the early access feature.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues on the discussion post.

coderabbitai[bot] avatar Sep 03 '24 04:09 coderabbitai[bot]

Hi @NilanshBansal, @sagar-qa007, Could you please review this PR. Thank you.

raushan3737 avatar Sep 04 '24 04:09 raushan3737

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

github-actions[bot] avatar Sep 13 '24 16:09 github-actions[bot]

Hi @NilanshBansal , Could you please review the PR if possible. It has been opened since last 3 weeks.

raushan3737 avatar Sep 19 '24 09:09 raushan3737

Hey @raushan3737 apologies for the inconvenience, we are starting to review this PR and targeting to complete it by Next Friday.

NilanshBansal avatar Sep 19 '24 09:09 NilanshBansal

Hi @raushan3737 thanks for your patience. We have created shadow PR here to run the tests.

NilanshBansal avatar Sep 25 '24 08:09 NilanshBansal

/build-deploy-preview skip-tests=true

NilanshBansal avatar Sep 25 '24 08:09 NilanshBansal

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11029317630. Workflow: On demand build Docker image and deploy preview. skip-tests: true. env: ``. PR: 36062. recreate: .

github-actions[bot] avatar Sep 25 '24 08:09 github-actions[bot]

Deploy-Preview-URL: https://ce-36062.dp.appsmith.com

github-actions[bot] avatar Sep 25 '24 08:09 github-actions[bot]

Tested the DP, it looks good to me. image

NilanshBansal avatar Sep 25 '24 10:09 NilanshBansal

@raushan3737 thanks for taking out time to contribute to Appsmith! We highly appreciate your effort in making Appsmith better ❤️ You can find more issues to contribute from this list!

NilanshBansal avatar Sep 25 '24 14:09 NilanshBansal