-
Notifications
You must be signed in to change notification settings - Fork 20
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
Safely Downgrade Bug Fix #2182
base: main
Are you sure you want to change the base?
Safely Downgrade Bug Fix #2182
Conversation
Fixing a bug that fails on downgrade. This will allow this migration to safely upgrade and downgrade without problems
Yep, This works -- Thanks Pat! Co-authored-by: Pat Heard <patrick.heard@cds-snc.ca>
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 discussed, makes sense not to perform the REVOKE
in the downgrade because of the chaos this would cause as the API relies on the app_db_user
to run its migrations.
After further discussions with the team, we have decided that we should make our downgrades more representative of a reversal of what an upgrade does, but while also safely been tested for upgrade and downgrade paths
@patheard @jimleroyer @sastels -- Might be worth having a conversation about this. I think the idea here is that if we downgrade and then upgrade this would be done as a more manual process for now, and only as necessary. I think @jimleroyer and @sastels would prefer to try and focus on doing a more representative 'downgrade' that we test thoroughly as a downgrade and upgrade before we merge these. There are historically many that will break if you do that process. |
made some changes and looking for a bit of conversation with new reviewers
Are we sure about this? we just run
here. I was assuming it was the postgres user or some other flask magic? |
It's true we are using that user to connect with the app though, not just for blazer, as I think you standardized it @sastels (or Pat?). |
oh, 💯 the app would horribly break, but I didn't think flask would. unless flask is magically using Update: ok, here's the relevant code. We set the flask variable |
Just another bit of reassurance on this -- this was tested 100% on dev and the upgrade and downgrade paths were working well. Very very low risk to merge this. We could always try a scenario on staging to see how it reacts in the future. |
@sastels Yes, the app, which is a Flask app, uses the values in the |
dev is just using the |
We talked offline and decided that this user is good for connecting to our app but we will have the admin one to bootstrap the schemas and take in charge the alembic upgrades. This user would be created by Terraform when booting up a new environment. A related task card was created and will be refined for this purpose. |
Summary | Résumé
Fixing a bug that fails on downgrade. This will allow this migration to safely upgrade and downgrade without problems
Test instructions | Instructions pour tester la modification
run Flask db downgrades and upgrades that would affect this migration. ensure all is well in the world.