-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: install script to migrate sentry.conf.py config to use pgbouncer #3898
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
Conversation
This PR may only be merged after #3884 has been merged
install/migrate-pgbouncer.sh
Outdated
| # Guard this file behind SETUP_PGBOUNCER_MIGRATION | ||
| if [ "$SETUP_PGBOUNCER_MIGRATION" == "1" ]; 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.
I will need to remove this flag after #3884 is merged.
|
Test results are ok: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3898 +/- ##
=======================================
Coverage 99.49% 99.49%
=======================================
Files 3 3
Lines 197 197
=======================================
Hits 196 196
Misses 1 1 ☔ View full report in Codecov by Sentry. |
|
@aldy505 LGTM |
|
ping @BYK |
BYK
left a comment
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.
Looks good, just rejecting for my concerns around unattended install as it looks like this may not work with non-interactive TTYs. Not sure how CI passed (or what I missed)
| # } | ||
| # ``` | ||
|
|
||
| if sed -n '/^DATABASES = {$/,/^}$/p' "$SENTRY_CONFIG_PY" | grep -q '"HOST": "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.
I think we should either check SKIP_USER_CREATION, SKIP_USER_PROMPT env vars, check for an interactive TTY and/or add a SENTRY_NON_INTERACTIVE_INSTALL option to skip all prompts in a sane way.
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've re-read the codebase, practically the existing SKIP_USER_PROMPT is SENTRY_NON_INTERACTIVE_INSTALL. I'll just add that.
| if [ ! -z "${SKIP_USER_PROMPT:-}" ]; then | ||
| depwarn "SKIP_USER_PROMPT variable" "SKIP_USER_CREATION" | ||
| SKIP_USER_CREATION="${SKIP_USER_PROMPT}" | ||
| APPLY_AUTOMATIC_CONFIG_UPDATES="${SKIP_USER_PROMPT}" |
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.
Slightly nervous about this.
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.
Why
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.
Because we will be trying the auto migration/config update without asking about it. Ideally this would be no action on non-interactive installs that said since you try to ensure it is unchanged, I'm fine. Just a little bit nervous in case we missed something.
I hope this change won't be troublesome for the S3 Seaweed PR
| read -p "y or n? " yn | ||
| case $yn in | ||
| y | yes | 1) | ||
| export apply_config_changes_pgbouncer=1 |
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.
FYI @BYK I made a change for this one, to not let it populate the global APPLY_AUTOMATIC_CONFIG_UPDATES. Hopefully this is the right approach.
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.
Looks good to me. Not sure if you should be exporting it tho.
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'm not sure about it either. Took the safest way about it.
…pgbouncer (getsentry#3898)" This reverts commit 2e7a3ff.
…pgbouncer (getsentry#3898)" This reverts commit 2e7a3ff.
This PR may only be merged after #3884 has been merged