Skip to content
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: connection mode hidden from mysql form config #32487

Merged
merged 5 commits into from
Apr 10, 2024

Conversation

sneha122
Copy link
Contributor

@sneha122 sneha122 commented Apr 8, 2024

Description

MySQL datasource config has a field called Connection mode, which allows users to configure their datasource either in read write / read only mode. This is supposed to block the write queries if datasource is configured with read only mode, but with current implementation, it does not block, it lets us execute write query.

On checking the codebase, it seems that this field is not at all being used in mySQL plugin to configure the datasource, further more mysql driver used may not even support configuring connection mode as of now, hence as preventive solution, hiding the connection mode form config for now.

Fixes #9941

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.Datasource"

🔍 Cypress test results

Important

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8612888064
Commit: 0a0d20e1fb40546e635ba018704b5f13ecc97ab1
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

Copy link
Contributor

coderabbitai bot commented Apr 8, 2024

Walkthrough

Walkthrough

The updates involve refining validation logic for MySQL data sources in the application. Validation for specific dropdown selections has been adjusted for PostgreSQL and MongoDB data sources, while the connection mode dropdown for MySQL is now hidden in the UI due to a backend issue.

Changes

Files Change Summary
.../cypress/support/Pages/DataSources.ts
.../mysqlPlugin/src/main/resources/form.json
Added validation for the "Read / Write" dropdown for PostgreSQL and MongoDB; hid the connection mode dropdown for MySQL in the UI
.../cypress/e2e/Regression/ServerSide/Datasources/ConnectionErrors_Spec.ts Removed a call and assertion related to "READ_ONLY" in ConnectionErrors_Spec.ts

Assessment against linked issues

Objective Addressed Explanation
CRUD operations restricted to Read-Only access in MySQL (#9941) The changes ensure that CRUD operations are appropriately restricted for MySQL data sources with Read-Only access.

Possibly related issues

  • No related issues identified for linking to this PR.

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

@github-actions github-actions bot added Backend This marks the issue or pull request to reference server code BE Coders Pod Issues related to users writing code to fetch and update data Bug Something isn't working High This issue blocks a user from building or impacts a lot of users Integrations Pod Issues related to a specific integration Medium Issues that frustrate users due to poor UX MySQL Issues related to MySQL plugin Production labels Apr 8, 2024
@sneha122 sneha122 added the ok-to-test Required label for CI label Apr 8, 2024
@sneha122
Copy link
Contributor Author

sneha122 commented Apr 8, 2024

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Apr 8, 2024

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

Copy link

github-actions bot commented Apr 8, 2024

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

Copy link

github-actions bot commented Apr 8, 2024

Failed server tests

  • com.appsmith.server.git.ServerSchemaMigrationEnforcerTest#importApplication_ThenExportApplication_MatchJson_equals_Success

@sneha122 sneha122 requested review from rishabhrathod01 and removed request for NilanshBansal April 8, 2024 09:50
@rishabhrathod01
Copy link
Contributor

image

Changes look good on DP, also code looks good to me. Waiting for the CI to pass.

rishabhrathod01
rishabhrathod01 previously approved these changes Apr 8, 2024
Copy link
Contributor

@rishabhrathod01 rishabhrathod01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good.
Need to fix the CI test failure and it will be ready to merge.

@sneha122 sneha122 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 9, 2024
mohanarpit
mohanarpit previously approved these changes Apr 9, 2024
Copy link

github-actions bot commented Apr 9, 2024

Failed server tests

  • com.appsmith.server.solutions.ApplicationForkingServiceTests#forkApplicationToWorkspace_WhenAppHasSystemTheme_SystemThemeSet

@sneha122 sneha122 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 9, 2024
rishabhrathod01
rishabhrathod01 previously approved these changes Apr 9, 2024
Copy link
Contributor

@rishabhrathod01 rishabhrathod01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sneha122 sneha122 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 9, 2024
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

Actionable comments outside the diff hunks (1)
app/client/cypress/e2e/Regression/ServerSide/Datasources/ConnectionErrors_Spec.ts (1)

Line range hint 1-1: Consider adding tests to verify the new behavior with the Connection mode field hidden.

Would you like assistance in drafting tests for the updated UI behavior?

Copy link

github-actions bot commented Apr 9, 2024

Failed server tests

  • com.appsmith.server.refactors.ce.RefactoringServiceCETest#simpleWidgetNameRefactor
  • com.appsmith.server.solutions.ApplicationForkingServiceTests#cloneApplicationMultipleTimes

@sneha122 sneha122 merged commit 4309e9e into release Apr 10, 2024
42 checks passed
@sneha122 sneha122 deleted the fix/mysql-read-write-mode-issue branch April 10, 2024 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend This marks the issue or pull request to reference server code BE Coders Pod Issues related to users writing code to fetch and update data Bug Something isn't working High This issue blocks a user from building or impacts a lot of users Integrations Pod Issues related to a specific integration Medium Issues that frustrate users due to poor UX MySQL Issues related to MySQL plugin ok-to-test Required label for CI Production
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]-[2800]:CRUD happens even with Read-Only access in MYSQL
3 participants