feat: install script to migrate sentry.conf.py config to use pgbouncer#3898
feat: install script to migrate sentry.conf.py config to use pgbouncer#3898
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.
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.
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.
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.
I've re-read the codebase, practically the existing SKIP_USER_PROMPT is SENTRY_NON_INTERACTIVE_INSTALL. I'll just add that.
Co-authored-by: Burak Yigit Kaya <byk@sentry.io>
| 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.
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.
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.
Looks good to me. Not sure if you should be exporting it tho.
There was a problem hiding this comment.
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