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

test: Enable server tests for the PRs with base PG branch #33429

Merged
merged 56 commits into from
May 22, 2024

Conversation

abhvsn
Copy link
Contributor

@abhvsn abhvsn commented May 14, 2024

Description

  1. PR to enable server tests on PRs with pg as the base branch.
  2. Replace the DB URI from APPSMITH_MONGODB_URI to APPSMITH_DB_URL

Automation

/ok-to-test tags="@tag.Sanity, @tag.GenerateCRUD, @tag.Fork"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9174148396
Commit: 762b425
Cypress dashboard url: Click here!

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

@abhvsn abhvsn requested a review from sharat87 as a code owner May 14, 2024 08:56
Copy link
Contributor

coderabbitai bot commented May 14, 2024

Walkthrough

Walkthrough

This update introduces a significant change by replacing the environment variable APPSMITH_MONGODB_URI with a more generic APPSMITH_DB_URL across the entire project. This includes modifications to configuration files, scripts, and documentation to support both MongoDB and PostgreSQL databases. Additionally, conditional logic is added to handle PostgreSQL-specific setup and execution in various workflows and scripts.

Changes

Files/Paths Change Summary
.github/workflows/server-build.yml Added is-pg-build parameter for conditional workflow execution, including Python setup and PostgreSQL start.
app/server/build.sh Added check for APPSMITH_DB_URI containing "postgresql://" to execute a Python transformation script.
app/server/.../CommonDBConfig.java Added method for extracting JDBC properties from DB URL.
app/server/.../application.properties Added configuration for MongoDB URI using environment variables.
deploy/docker/.../entrypoint.sh Added logic for handling APPSMITH_DB_URI based on conditions.
app/server/envs/dev.env.example, app/server/envs/test.env.example Renamed APPSMITH_MONGODB_URI to APPSMITH_DB_URL.
contributions/ServerSetup.md Updated environment variable from APPSMITH_MONGODB_URI to APPSMITH_DB_URL.
app/client/.../advanced.ts Renamed setting ID from APPSMITH_MONGODB_URI to APPSMITH_DB_URL.
deploy/docker/.../run-with-env.sh Set APPSMITH_DB_URL to APPSMITH_MONGODB_URI if not set.
deploy/docker/.../docker.env.sh Renamed APPSMITH_MONGODB_URI to APPSMITH_DB_URL.
deploy/docker/.../update-and-restart-supervisor.sh Updated check for local MongoDB instances using APPSMITH_DB_URL.
deploy/docker/.../backup.js Updated references from APPSMITH_MONGODB_URI to APPSMITH_DB_URL for database operations.
deploy/docker/.../check_replica_set.js Updated MongoDB URI environment variable to APPSMITH_DB_URL.
deploy/docker/.../export_db.js Updated MongoDB URI environment variable to APPSMITH_DB_URL in mongodump command.
deploy/docker/.../import_db.js Updated MongoDB URI environment variable to APPSMITH_DB_URL for mongorestore and mongo commands.
deploy/docker/.../index.js Added fallback to set APPSMITH_DB_URL to APPSMITH_MONGODB_URI if not set.
deploy/docker/.../mongo_shell_utils.js Updated environment variable to APPSMITH_DB_URL in the exec function.
deploy/docker/.../restore.js Updated references from APPSMITH_MONGODB_URI to APPSMITH_DB_URL for MongoDB operations.
deploy/helm/README.md Renamed APPSMITH_MONGODB_URI to APPSMITH_DB_URL in configuration.
deploy/heroku/README.MD Renamed APPSMITH_MONGODB_URI to APPSMITH_DB_URL in Heroku setup instructions.

Possibly related issues


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between fb96715 and 2687595.
Files selected for processing (1)
  • deploy/docker/fs/opt/appsmith/entrypoint.sh (3 hunks)
Additional Context Used
ShellCheck (8)
deploy/docker/fs/opt/appsmith/entrypoint.sh (8)

[warning] 57-57: Declare and assign separately to avoid masking return values.


[warning] 61-61: Declare and assign separately to avoid masking return values.


[warning] 65-65: Declare and assign separately to avoid masking return values.


[warning] 69-69: Declare and assign separately to avoid masking return values.


[warning] 79-79: ShellCheck can't follow non-constant source. Use a directive to specify location.


[info] 80-80: Not following: ./pre-define.env was not specified as input (see shellcheck -x).


[style] 136-136: Use -n instead of ! -z.


[info] 480-480: Double quote to prevent globbing and word splitting.


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 the Enhancement New feature or request label May 14, 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: 1

Out of diff range and nitpick comments (2)
.github/workflows/quality-checks.yml (1)

5-5: Add a comment to explain the new branch trigger.

Consider adding a comment to explain why the pg branch is included in the trigger list for better context and maintainability.

.github/workflows/server-build.yml (1)

20-24: Ensure the is-pg parameter is documented.

Make sure to update the documentation to include the new is-pg parameter and its purpose.

.github/workflows/server-build.yml Outdated Show resolved Hide resolved
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: 1

Out of diff range and nitpick comments (1)
app/server/build.sh (1)

Line range hint 48-48: Check exit code directly with if mvn clean package "$@";.

Instead of checking the exit code indirectly with $?, check it directly with if mvn clean package "$@";.

- if [[ $? -eq 0 ]]; then
+ if mvn clean package "$@"; then

app/server/build.sh Outdated Show resolved Hide resolved
Copy link

Failed server tests

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

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: 2

Out of diff range and nitpick comments (1)
app/server/build.sh (1)

Line range hint 48-48: Check exit code directly.

-  if [[ $? -eq 0 ]]; then
+  if mvn clean package "$@"; then

Check the exit code directly with the command instead of using $?.

@abhvsn abhvsn requested a review from mohanarpit May 15, 2024 07:40
Copy link

Failed server tests

  • com.appsmith.server.services.ce.ActionServiceCE_Test#createCopyActionWithAnalyticsData_validateAnalyticsDataPersistsInResponse

Copy link
Member

@sharat87 sharat87 left a comment

Choose a reason for hiding this comment

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

  1. I see both APPSMITH_DB_URL and APPSMITH_DB_URI. Can we fix this and use APPSMITH_DB_URL please?

.github/workflows/server-build.yml Outdated Show resolved Hide resolved
app/server/build.sh Outdated Show resolved Hide resolved
.github/workflows/server-build.yml Outdated Show resolved Hide resolved
@appsmithorg appsmithorg deleted a comment from github-actions bot May 16, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot May 16, 2024
@abhvsn abhvsn added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 20, 2024
@abhvsn
Copy link
Contributor Author

abhvsn commented May 20, 2024

/build-deploy-preview skip-tests=true recreate=true

Copy link

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

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

Out of diff range and nitpick comments (7)
deploy/helm/README.md (7)

Line range hint 2-2: Correct the repeated word "Appsmith".

- # Appsmith Appsmith is a JS-based internal tool development platform.
+ # Appsmith is a JS-based internal tool development platform.

Line range hint 7-7: Correct the spelling of "Elastic Search" to "Elasticsearch".

- Elastic Search, DynamoDB, Redis, & MSFT SQL Server.
+ Elasticsearch, DynamoDB, Redis, & MSFT SQL Server.

Line range hint 20-20: Correct the verb form "bootstrap" to "bootstraps".

- This chart bootstrap an [Appsmith](https://github.com/appsmithorg/appsmith) deployment on a [Kubernetes](kubernetes.io) cluster using [Helm](https://helm.sh) package manager.
+ This chart bootstraps an [Appsmith](https://github.com/appsmithorg/appsmith) deployment on a [Kubernetes](kubernetes.io) cluster using [Helm](https://helm.sh) package manager.

Line range hint 37-37: Correct the phrase "should be enable" to "should be enabled".

- Kubernetes NGINX Ingress Controller should be enable on your cluster by default.
+ Kubernetes NGINX Ingress Controller should be enabled on your cluster by default.

Line range hint 113-113: Remove the duplicated phrase "to expose".

- | Appsmith service node port to expose to expose                              				 		| `8000` 			|
+ | Appsmith service node port to expose                              				 		| `8000` 			|

Line range hint 148-151: Add hyphens to "auto update" to form "auto-update".

- ### Auto update chart's image
+ ### Auto-update chart's image

- | `autoupdate.enabled`		| Enable auto update Helm chart's image					| `true`				|
+ | `autoupdate.enabled`		| Enable auto-update Helm chart's image					| `true`				|

Line range hint 207-208: Correct the verb form "setup" to "set up" and "install" to "installed".

- If you wish to publish your Appsmith to the world through the Internet, you will need to setup the Ingress controller firstly.
+ If you wish to publish your Appsmith to the world through the Internet, you will need to set up the Ingress controller firstly.

- In case of you have not install the Helm chart yet, you can run the below command to install it with exposing Appsmith
+ In case you have not installed the Helm chart yet, you can run the below command to install it while exposing Appsmith

Copy link

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

Copy link

Failed server tests

  • com.appsmith.server.refactors.ce.RefactoringServiceCETest#testRefactorCollection_withModifiedName_ignoresName

@abhvsn abhvsn added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 21, 2024
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
@abhvsn abhvsn requested a review from sharat87 May 21, 2024 09:34
@abhvsn abhvsn added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 21, 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: 4

deploy/docker/fs/opt/appsmith/entrypoint.sh Outdated Show resolved Hide resolved
deploy/docker/fs/opt/appsmith/entrypoint.sh Outdated Show resolved Hide resolved
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: 2

deploy/docker/fs/opt/appsmith/entrypoint.sh Show resolved Hide resolved
deploy/docker/fs/opt/appsmith/entrypoint.sh Show resolved Hide resolved
@abhvsn abhvsn changed the title feat: Enable server tests for the PRs with base PG branch test: Enable server tests for the PRs with base PG branch May 22, 2024
@github-actions github-actions bot added skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test and removed Enhancement New feature or request labels May 22, 2024
@sharat87 sharat87 merged commit 7e339d4 into release May 22, 2024
16 checks passed
@sharat87 sharat87 deleted the feat/enable-server-tests-for-pg branch May 22, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants