Skip to content

chore: Add Postgres bin to PATH#34265

Merged
sharat87 merged 4 commits intoreleasefrom
chore/pg-to-path
Jun 17, 2024
Merged

chore: Add Postgres bin to PATH#34265
sharat87 merged 4 commits intoreleasefrom
chore/pg-to-path

Conversation

@sharat87
Copy link
Member

@sharat87 sharat87 commented Jun 17, 2024

Instead of using absolute paths to Postgres binaries, and in doing so, hard-coding the Postgres version number, we add the bin folder to PATH so they're available directly.

This also won't need the current symlink we created. That symlink is causing problems in some post-installations scripts in apt/dpkg, since they're expecting a number in that folder, and sees current, it's confused and produces this error:

dpkg: warning: version 'current' has bad syntax: version number does not start with digit

After this is merged, we should be able to get rid of the current symlink as well.

/test sanity

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9541787920
Commit: 1012266
Cypress dashboard.
Tags: @tag.Sanity

Summary by CodeRabbit

  • Chores
    • Updated Docker environment to include PostgreSQL 13 binaries.
    • Simplified PostgreSQL command paths in scripts.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 17, 2024

Warning

Review failed

The pull request is closed.

Walkthrough

The changes focus on updating the Docker files and scripts to streamline the usage of PostgreSQL 13 binaries. This involves modifying the environment variables and executable paths to improve consistency and simplify commands by avoiding explicit version numbers.

Changes

Files Change Summary
deploy/docker/base.dockerfile Added environment variable to update PATH for PostgreSQL 13 binaries
.../deploy/docker/fs/opt/appsmith/entrypoint.sh Updated PATH and PostgreSQL commands to remove explicit version number
.../deploy/docker/fs/opt/appsmith/run-postgres.sh Modified command execution to use PATH updated with PostgreSQL binaries

Poem

In the land of Docker's sea,
PostgreSQL binaries roam free,
Paths made nimble, versions gone,
Commands now a seamless song.
Scripts awake with clearer sight,
Guided by the PATH's new light.
Cheers to changes, simple and bright!


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.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Jun 17, 2024
@sharat87 sharat87 added the ok-to-test Required label for CI label Jun 17, 2024
@sharat87
Copy link
Member Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

@github-actions
Copy link

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

@sharat87 sharat87 marked this pull request as ready for review June 17, 2024 05:07
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

Outside diff range and nitpick comments (2)
deploy/docker/fs/opt/appsmith/entrypoint.sh (2)

Line range hint 65-65: Declare and assign separately to avoid masking return values which can lead to hidden bugs if the commands fail.

- local generated_appsmith_mongodb_password=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13; echo "")
+ local generated_appsmith_mongodb_password
+ generated_appsmith_mongodb_password=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13; echo "")

Also applies to: 69-69, 73-73, 77-77


Line range hint 89-89: Explicitly specify the location of the sourced file to avoid runtime errors and ensure that the script is robust.

- . "$TMP/pre-define.env"
+ if [[ -f "$TMP/pre-define.env" ]]; then
+   . "$TMP/pre-define.env"
+ else
+   echo "Error: Environment file $TMP/pre-define.env not found."
+   exit 1
+ fi
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1007c23 and 1012266.

Files selected for processing (3)
  • deploy/docker/base.dockerfile (1 hunks)
  • deploy/docker/fs/opt/appsmith/entrypoint.sh (3 hunks)
  • deploy/docker/fs/opt/appsmith/run-postgres.sh (1 hunks)
Files not reviewed due to errors (1)
  • deploy/docker/base.dockerfile (no review received)
Files skipped from review due to trivial changes (1)
  • deploy/docker/fs/opt/appsmith/run-postgres.sh
Additional context used
Hadolint
deploy/docker/base.dockerfile

[warning] 17-17: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version> (DL3008)


[info] 17-17: Delete the apt-get lists after installing something (DL3009)


[warning] 17-17: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check (DL4006)


[warning] 17-17: Do not use apt as it is meant to be a end-user tool, use apt-get or apt-cache instead (DL3027)


[warning] 38-38: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check (DL4006)


[info] 38-38: Double quote to prevent globbing and word splitting. (SC2086)


[warning] 49-49: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check (DL4006)


[warning] 55-55: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check (DL4006)

Shellcheck
deploy/docker/fs/opt/appsmith/entrypoint.sh

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


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


[warning] 73-73: Declare and assign separately to avoid masking return values. (SC2155)


[warning] 77-77: Declare and assign separately to avoid masking return values. (SC2155)


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

mohanarpit
mohanarpit previously approved these changes Jun 17, 2024
@sharat87 sharat87 merged commit 929873a into release Jun 17, 2024
@sharat87 sharat87 deleted the chore/pg-to-path branch June 17, 2024 07:23
sharat87 added a commit that referenced this pull request Jun 25, 2024
Reason for this previously documented at #34265 (comment).
sharat87 added a commit that referenced this pull request Jun 25, 2024
Reason for this previously documented at
#34265 (comment).

Cypress tests don' make sense since the only diff is on
`base.dockerfile`.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated Dockerfile to streamline PostgreSQL setup. Removed creation of
a symlink to the current version of PostgreSQL.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Jul 10, 2024
Reason for this previously documented at
appsmithorg#34265 (comment).

Cypress tests don' make sense since the only diff is on
`base.dockerfile`.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated Dockerfile to streamline PostgreSQL setup. Removed creation of
a symlink to the current version of PostgreSQL.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants