Skip to content

fix: Update datasource deletion message for clarity#34822

Merged
yatinappsmith merged 2 commits intoappsmithorg:releasefrom
AnnaHariprasad5123:Issue-#34604/bug-datasource-deletion-message
Jul 11, 2024
Merged

fix: Update datasource deletion message for clarity#34822
yatinappsmith merged 2 commits intoappsmithorg:releasefrom
AnnaHariprasad5123:Issue-#34604/bug-datasource-deletion-message

Conversation

@AnnaHariprasad5123
Copy link
Contributor

@AnnaHariprasad5123 AnnaHariprasad5123 commented Jul 9, 2024

Fixes #34604

Hi @nidhi-nair ,

Screenshots :
Earlier :
image
After update the error message :
image
image

Summary by CodeRabbit

  • Bug Fixes

    • Updated error messages during datasource deletion to improve clarity: "Cannot delete datasource since it has 1 query using it."
  • Tests

    • Adjusted test cases to reflect updated error messages and ensure accurate verification.
  • Documentation

    • Improved error message documentation for better user understanding during datasource deletions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 9, 2024

Walkthrough

The changes involve updating error messages related to datasource deletion in both client-side and server-side code. Specifically, the term "action(s)" is replaced with "query" in error messages to make them more user-friendly. The updates span across Cypress tests, server-side service implementations, and test cases.

Changes

Files Change Summary
app/client/cypress/e2e/Regression/ServerSide/QueryPane/MySQL_Spec.ts Updated string message in after block from "action(s)" to "query".
app/server/appsmith-server/src/main/java/com/appsmith/server/datasources/base/... Updated archiveById method to construct an error message based on the count of actions.
app/server/appsmith-server/src/test/java/com/appsmith/server/services/... Added an additional argument "query" in the AppsmithError.DATASOURCE_HAS_ACTIONS.getMessage() call.
app/client/cypress/support/Pages/DataSources.ts Changed error message from "action(s) using it" to "Cannot delete datasource".

Assessment against linked issues

Objective Addressed Explanation
Change error message from "action(s)" to "query" (34604)
Error message should distinguish between singular and plural queries (34604)

Poem

🎉 In code's embrace, changes bright and true,
Error messages now speak clear to you.
No more "actions," just "queries" in sight,
Making deletions a user-friendly delight.
With thoughtful tweaks and gentle care,
Our app evolves, a joy to share! 🚀


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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 08c3ea9 and 43ce6a6.

Files selected for processing (3)
  • app/client/cypress/e2e/Regression/ServerSide/QueryPane/MySQL_Spec.ts (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/datasources/base/DatasourceServiceCEImpl.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java (1 hunks)
Additional context used
Path-based instructions (1)
app/client/cypress/e2e/Regression/ServerSide/QueryPane/MySQL_Spec.ts (1)

Pattern app/client/cypress/**/**.*: Follow best practices for Cypress code and e2e automation.
Avoid using cy.wait in code.
Avoid using cy.pause in code.
Use variables for locators, not strings.
Use data-* attributes for selectors; avoid Xpaths and CSS attributes.
Avoid selectors like .btn.submit or button[type=submit].
Perform logins via API with LoginFromAPI.
Only interact with controlled sites/servers.
Ensure tests can run with it.only and are independent.
Use before, beforeEach, after, afterEach correctly; clean state before tests.
Check new specs for flakiness by running them 10 times on CI.
Use multiple assertions; don't treat Cypress as unit tests.
Use constants for strings.
Include datasource operations in before hooks.

Additional comments not posted (3)
app/client/cypress/e2e/Regression/ServerSide/QueryPane/MySQL_Spec.ts (1)

94-94: LGTM! The updated error message improves clarity.

The change from "action(s)" to "query" or "queries" makes the error message more user-friendly.

app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java (1)

505-505: LGTM! The updated error message improves clarity and provides intelligent error messaging.

The change from "action(s)" to "query" or "queries" based on the count makes the error message more user-friendly.

app/server/appsmith-server/src/main/java/com/appsmith/server/datasources/base/DatasourceServiceCEImpl.java (1)

809-811: LGTM! The updated error message improves clarity and provides intelligent error messaging.

The change from "action(s)" to "query" or "queries" based on the count makes the error message more user-friendly.

@NilanshBansal
Copy link
Contributor

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

@github-actions
Copy link

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

@NilanshBansal
Copy link
Contributor

@AnnaHariprasad5123 thanks for your contribution!
There is one server unit test (deleteDatasourceWithActions) failing in this PR, can you please check.

We might need to add the second parameter "query" also in the error message here

@NilanshBansal
Copy link
Contributor

Other than this failing test, rest changes LGTM.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 43ce6a6 and e0d3d53.

Files selected for processing (1)
  • app/server/appsmith-server/src/test/java/com/appsmith/server/services/DatasourceServiceTest.java (1 hunks)
Additional comments not posted (1)
app/server/appsmith-server/src/test/java/com/appsmith/server/services/DatasourceServiceTest.java (1)

950-951: LGTM! Ensure consistency with the new error message format.

The test method correctly verifies the updated error message. Ensure that all related error messages in the codebase are also updated for consistency.

@AnnaHariprasad5123
Copy link
Contributor Author

Hi @NilanshBansal , Could you check once.

@NilanshBansal
Copy link
Contributor

NilanshBansal commented Jul 11, 2024

@AnnaHariprasad5123 there are a large number of cypress test case failures due to this assertion.

Can you change this assertion to "Cannot delete datasource"
cc: @sneha122 @AmanAgarwal041

@AnnaHariprasad5123 AnnaHariprasad5123 force-pushed the Issue-#34604/bug-datasource-deletion-message branch from e0d3d53 to 766dec4 Compare July 11, 2024 09:32
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e0d3d53 and 766dec4.

Files selected for processing (2)
  • app/client/cypress/support/Pages/DataSources.ts (1 hunks)
  • app/server/appsmith-server/src/test/java/com/appsmith/server/services/DatasourceServiceTest.java (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/cypress/support/Pages/DataSources.ts
Files skipped from review as they are similar to previous changes (1)
  • app/server/appsmith-server/src/test/java/com/appsmith/server/services/DatasourceServiceTest.java

@AnnaHariprasad5123
Copy link
Contributor Author

@AnnaHariprasad5123 there are a large number of cypress test case failures due to this assertion.

Can you change this assertion to "Cannot delete datasource" cc: @sneha122 @AmanAgarwal041

Done

@NilanshBansal
Copy link
Contributor

NilanshBansal commented Jul 11, 2024

The testing on the following has been done. The PR is ready to be merged!

  • Code Review
  • DP Testing
  • Test Suite
    All tests have passed on the clone PR.
    Thanks @AnnaHariprasad5123 for your contribution! Looking forward to more such PRs from you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: datasource deletion refers to "action(s)", which is meaningless to the user

3 participants