-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
chore: create appsmith schema for the pg branch with user and password #36540
Conversation
WalkthroughThe changes enhance the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
- deploy/docker/fs/opt/appsmith/entrypoint.sh (1 hunks)
🧰 Additional context used
Shellcheck
deploy/docker/fs/opt/appsmith/entrypoint.sh
[error] 469-469: Couldn't parse this here document. Fix to allow more checks.
(SC1073)
[error] 471-471: Remove indentation before end token (or use <<- and indent with tabs).
(SC1039)
echo "Initializing PostgreSQL..." | ||
|
||
# Check if APPSMITH_DB_URL is a PostgreSQL URL | ||
if [[ -n "$APPSMITH_DB_URL" && "$APPSMITH_DB_URL" == postgres*://* ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of now the entrupoint script which is responsible for creating an env file is starting with MongoDB url. How are we testing this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am testing this on the pg branch.
echo "Connecting to PostgreSQL at $DB_HOST:$DB_PORT with user $DB_USER" | ||
|
||
# Execute SQL to create the appsmith schema if it doesn't exist (single line) | ||
PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -p $DB_PORT -U $DB_USER -d $DB_NAME -c "CREATE SCHEMA IF NOT EXISTS appsmith;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also create a separate user in case of embedded Postgres DB alongwith the password.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by separate user for embeded db? The user is hardcoded to appsmith when the username or password is empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to create user statement, you can find more details https://www.postgresql.org/docs/8.0/sql-createuser.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added few comments, but I'm of the opinion if you make these changes on pg branch and then port it here it will be easier to test these changes.
Description
Create schema for the pg used by Appsmith. The default public schema can cause issues and creating a new schema allows us to have isolation with the other data in pg. This also creates a user and password which is used to access the schema.
Automation
/ok-to-test tags="@tag.Sanity"
🔍 Cypress test results
Caution
🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11051541656
Commit: 973dabf
Cypress dashboard.
Tags: @tag.Sanity
Spec:
The following are new failures, please fix them before merging the PR:
Thu, 26 Sep 2024 12:13:36 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes