-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Add scripts to save and restore baseline data #12947
Add scripts to save and restore baseline data #12947
Conversation
We could delete them all but I want use some of their wisdom for new CI scripts.
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 👍
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.
Good one 👍
I like that it only ever stores one copy, and that it's compressed so we don't need to worry about disk usage ballooning out.
I have a couple of concerns though, can you please take a look?
exit 1 | ||
fi | ||
|
||
dropdb -h localhost -U "$DB_USER" "$DB_DATABASE" --if-exists |
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 postgres blocks you from dropping a db if there's still active connections, do we need to stop puma and sidekiq?
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.
Note, I had an issue before when Metabase was also connected, remotely. We have a solution to force close the connection here:
https://github.com/openfoodfoundation/ofn-install/blob/master/roles/db_restore/tasks/restore_database.yml#L15-L20
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.
👍
Hey @mkllnk , Thanks for this. Maybe a good way to verify all works as expected, could be to:
Then, I think we could test for two distinct scenarios: Then finally, run And verify changes i) and ii) are correctly reverted. I'll give this a try. |
Staging failed in staging-UK: https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/11620487686 But worked for staging-FR: https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/11620645440 Running the command for saving the baseline, took a couple of minutes to complete, and yielded:
Making changes:
After running the restore command: Yielded quite a lot of output, among which these lines:
And ended with:
Checked that:
Looking great!! 🎉 Merging. |
996d2f0
into
openfoodfoundation:master
What? Why?
Sometimes a staging database gets changed by pull requests which are not finished yet. Those changes should be reverted and some of these changes may actually break the application. So here are a couple of scripts for testers to execute on the server.
What should we test?
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates