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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reverting the default port numbers for the datasources #32726

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

AmanAgarwal041
Copy link
Contributor

@AmanAgarwal041 AmanAgarwal041 commented Apr 17, 2024

This PR is created to revert the changes from the PR #32592 due to flakiness in the test specs.

Reverts #32592

Automation

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

馃攳 Cypress test results

Caution

馃敶 馃敶 馃敶 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8717847856
Commit: e6b4c32
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts
To know the list of identified flaky tests - Refer here

Copy link
Contributor

coderabbitai bot commented Apr 17, 2024

Walkthrough

Walkthrough

The overarching changes in this update focus on refining error messages and removing default port configurations across various data source integrations in a test suite. Adjustments are made to both client-side Cypress tests and server-side plugin configurations, enhancing clarity and simplifying settings related to ports.

Changes

Files Summary
.../ConnectionErrors_Spec.ts, .../EmptyDataSource_spec.js Updated validation and error messages for missing data in datasource tests.
.../Oracle_Spec.ts, .../Redis_Basic_Spec.ts Adjusted test case descriptions and added cleanup hooks.
.../ArangoDataSourceStub_spec.js, .../ElasticSearchDatasource_spec.js, .../MongoDatasourceURI_spec.ts, .../MsSQL_Basic_Spec.ts, .../MySQL_spec.js, .../PostgresDatasource_spec.js, .../RedshiftDataSourceStub_spec.js, .../SMTPDatasource_spec.js Removed test cases verifying default port values for datasources.
.../dataSourceCommands.js, .../MockPluginsState.ts, .../arangoDBPlugin/.../form.json, .../elasticSearchPlugin/.../form.json, .../mongoPlugin/.../form.json, .../mssqlPlugin/.../form.json, .../mysqlPlugin/.../form.json, .../oraclePlugin/.../form.json, .../postgresPlugin/.../form.json, .../redisPlugin/.../form.json, .../redshiftPlugin/.../form.json, .../smtpPlugin/.../form.json Simplified port setting code and removed default port values from server-side plugin configurations.

Possibly related issues


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 048e3b0 and e6b4c32.
Files selected for processing (24)
  • app/client/cypress/e2e/Regression/ServerSide/Datasources/ConnectionErrors_Spec.ts (4 hunks)
  • app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts (2 hunks)
  • app/client/cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts (2 hunks)
  • app/client/cypress/e2e/Regression/ServerSide/QueryPane/EmptyDataSource_spec.js (1 hunks)
  • app/client/cypress/e2e/Sanity/Datasources/ArangoDataSourceStub_spec.js (1 hunks)
  • app/client/cypress/e2e/Sanity/Datasources/ElasticSearchDatasource_spec.js (2 hunks)
  • app/client/cypress/e2e/Sanity/Datasources/MongoDatasourceURI_spec.ts (1 hunks)
  • app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts (1 hunks)
  • app/client/cypress/e2e/Sanity/Datasources/MySQL_spec.js (1 hunks)
  • app/client/cypress/e2e/Sanity/Datasources/PostgresDatasource_spec.js (1 hunks)
  • app/client/cypress/e2e/Sanity/Datasources/RedshiftDataSourceStub_spec.js (2 hunks)
  • app/client/cypress/e2e/Sanity/Datasources/SMTPDatasource_spec.js (1 hunks)
  • app/client/cypress/support/dataSourceCommands.js (7 hunks)
  • app/client/test/factories/MockPluginsState.ts (1 hunks)
  • app/server/appsmith-plugins/arangoDBPlugin/src/main/resources/form.json (1 hunks)
  • app/server/appsmith-plugins/elasticSearchPlugin/src/main/resources/form.json (1 hunks)
  • app/server/appsmith-plugins/mongoPlugin/src/main/resources/form.json (1 hunks)
  • app/server/appsmith-plugins/mssqlPlugin/src/main/resources/form.json (1 hunks)
  • app/server/appsmith-plugins/mysqlPlugin/src/main/resources/form.json (1 hunks)
  • app/server/appsmith-plugins/oraclePlugin/src/main/resources/form.json (1 hunks)
  • app/server/appsmith-plugins/postgresPlugin/src/main/resources/form.json (1 hunks)
  • app/server/appsmith-plugins/redisPlugin/src/main/resources/form.json (1 hunks)
  • app/server/appsmith-plugins/redshiftPlugin/src/main/resources/form.json (1 hunks)
  • app/server/appsmith-plugins/smtpPlugin/src/main/resources/form.json (1 hunks)
Files not reviewed due to errors (1)
  • Oracle_Spec.ts (no review received)
Files skipped from review due to trivial changes (9)
  • app/client/cypress/e2e/Sanity/Datasources/ArangoDataSourceStub_spec.js
  • app/client/cypress/e2e/Sanity/Datasources/MongoDatasourceURI_spec.ts
  • app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts
  • app/client/cypress/e2e/Sanity/Datasources/MySQL_spec.js
  • app/client/cypress/e2e/Sanity/Datasources/PostgresDatasource_spec.js
  • app/client/cypress/e2e/Sanity/Datasources/RedshiftDataSourceStub_spec.js
  • app/client/cypress/e2e/Sanity/Datasources/SMTPDatasource_spec.js
  • app/client/test/factories/MockPluginsState.ts
  • app/server/appsmith-plugins/redshiftPlugin/src/main/resources/form.json
Additional comments not posted (15)
app/client/cypress/e2e/Regression/ServerSide/QueryPane/EmptyDataSource_spec.js (1)

26-26: Update the error message to reflect the new expected output.

app/client/cypress/e2e/Sanity/Datasources/ElasticSearchDatasource_spec.js (1)

3-3: Ensure that the removal of agHelper does not affect other parts of the test suite where it might be used.

Verification successful

The shell script executed to search for the usage of agHelper in the ElasticSearchDatasource_spec.js file did not return any results. This indicates that agHelper is not used in this specific file. Therefore, the removal of agHelper from this file, as noted in the review comment, does not affect other parts of this test suite.

Conclusion: The removal of agHelper from ElasticSearchDatasource_spec.js does not impact other parts of this test suite as it is not used elsewhere in this file.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for usage of `agHelper` in the ElasticSearchDatasource_spec.js file.
rg 'agHelper' app/client/cypress/e2e/Sanity/Datasources/ElasticSearchDatasource_spec.js

Length of output: 87

app/server/appsmith-plugins/smtpPlugin/src/main/resources/form.json (1)

Line range hint 10-10: Removal of the initialValue field for the "Port" configuration aligns with the PR's objective to revert default port settings.

app/server/appsmith-plugins/elasticSearchPlugin/src/main/resources/form.json (1)

Line range hint 10-10: Removal of the initialValue field for the "Port" configuration aligns with the PR's objective to revert default port settings.

app/server/appsmith-plugins/redisPlugin/src/main/resources/form.json (1)

Line range hint 10-10: Removal of the initialValue field for the "Port" configuration aligns with the PR's objective to revert default port settings.

app/server/appsmith-plugins/oraclePlugin/src/main/resources/form.json (1)

Line range hint 10-10: Removal of the initialValue field for the "Port" configuration aligns with the PR's objective to revert default port settings.

app/server/appsmith-plugins/mssqlPlugin/src/main/resources/form.json (1)

Line range hint 10-10: Removal of the initialValue field for the "Port" configuration aligns with the PR's objective to revert default port settings.

app/server/appsmith-plugins/arangoDBPlugin/src/main/resources/form.json (1)

Line range hint 10-10: Removal of the initialValue field for the "Port" configuration aligns with the PR's objective to revert default port settings.

app/client/cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts (2)

14-20: > 馃摑 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [17-93]

The test case description has been simplified by removing numbering, which enhances readability and maintainability. The test itself appears comprehensive, covering multiple Redis operations such as create, read, update, and delete within a single test. This ensures that the Redis commands are functioning as expected in sequence. However, consider breaking down this test into smaller tests for each operation to isolate failures and improve test clarity.


95-107: The addition of an after hook to clean up by deleting the query and datasource is a good practice as it helps maintain a clean state for subsequent tests. The commented-out code within the after hook suggests an alternative method for deletion that might not be reliable ("we run into risk of not seeing the datasource in EntityExplorer"). It's good that this rationale is documented, but consider removing the commented-out code if it's decided it won't be used, to keep the codebase clean.

app/server/appsmith-plugins/mongoPlugin/src/main/resources/form.json (1)

107-112: > 馃摑 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-253]

The removal of the initialValue for the MongoDB port field aligns with the PR's objective to revert default port settings. This change will prompt users to enter a port explicitly, which can be beneficial for clarity and avoiding assumptions about the environment. Ensure that the UI correctly reflects this change and that there are no issues with form submission when the port is not specified.

app/server/appsmith-plugins/mysqlPlugin/src/main/resources/form.json (1)

62-67: > 馃摑 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-253]

The removal of the initialValue for the MySQL port field aligns with the PR's objective to revert default port settings. This change will prompt users to enter a port explicitly, which can be beneficial for clarity and avoiding assumptions about the environment. Ensure that the UI correctly reflects this change and that there are no issues with form submission when the port is not specified.

app/server/appsmith-plugins/postgresPlugin/src/main/resources/form.json (1)

29-34: > 馃摑 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-253]

The removal of the initialValue for the PostgreSQL port field aligns with the PR's objective to revert default port settings. This change will prompt users to enter a port explicitly, which can be beneficial for clarity and avoiding assumptions about the environment. Ensure that the UI correctly reflects this change and that there are no issues with form submission when the port is not specified.

app/client/cypress/e2e/Regression/ServerSide/Datasources/ConnectionErrors_Spec.ts (1)

81-87: > 馃摑 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [28-169]

The updates to the validation messages in the test cases for PostgreSQL, MySQL, and MongoDB connection errors are more specific and informative, which improves the user experience by making it clearer what information is missing or incorrect. This change aligns with the PR's objective to enhance error messaging in the context of datasource configuration. Ensure that these messages are consistent with the actual application behavior and that they are adequately tested.

app/client/cypress/support/dataSourceCommands.js (1)

113-119: > 馃摑 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [96-253]

The simplification of the code in dataSourceCommands.js by replacing .clear().type() with .type() for setting port values is a good practice as it reduces the complexity and execution time of the commands, assuming the fields are initially empty. This change should not affect the functionality but verify through testing that this assumption holds true in all cases where these commands are used.


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.

@AmanAgarwal041 AmanAgarwal041 added the ok-to-test Required label for CI label Apr 17, 2024
@AmanAgarwal041 AmanAgarwal041 changed the title Revert "fix: default port numbers for the datasources" fix: reverting the default port numbers for the datasources Apr 17, 2024
@github-actions github-actions bot added the Bug Something isn't working label Apr 17, 2024
@trishaanand trishaanand merged commit 2a08e8e into release Apr 17, 2024
51 of 54 checks passed
@trishaanand trishaanand deleted the revert-32592-fix/32136-ds-default-port branch April 17, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working ok-to-test Required label for CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants