Closed mkllnk closed 3 weeks ago
Hey @mkllnk ,
Thanks for this. Maybe a good way to verify all works as expected, could be to:
~/apps/openfoodnetwork/current/script/ci/save-staging-baseline.sh
Then, I think we could test for two distinct scenarios: i) create some test data - like a new order or user ii) run a migration which could break things somehow, or just change the DB structure somehow
Then finally, run
~/apps/openfoodnetwork/current/script/ci/restore-staging-baseline.sh
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:
Last login: Wed Oct 30 21:50:00 2024 from 220.253.199.227
openfoodnetwork@vps-2a25f087:~$ ~/apps/openfoodnetwork/current/script/ci/save-staging-baseline.sh
Staging baseline data saved.
Making changes:
https://staging.coopcircuits.fr/orders/R555075285?order_token=22284cd168ce8d3a
down 20240828203544 Fully enable admin style v3 flag
After running the restore command:
Yielded quite a lot of output, among which these lines:
ERROR: permission denied to create extension "pg_stat_statements"
HINT: Must be superuser to create this extension.
ERROR: extension "pg_stat_statements" does not exist
And ended with:
ERROR: must be member of role "postgres"
ERROR: must be member of role "postgres"
ERROR: must be member of role "postgres"
ERROR: must be member of role "postgres"
ERROR: must be member of role "postgres"
ERROR: must be member of role "postgres"
Staging baseline data restored.
Checked that:
https://staging.coopcircuits.fr/orders/R555075285?order_token=22284cd168ce8d3a
-> this now throws an error 500, I'd say this is expectedup 20240828203544 Fully enable admin style v3 flag
Looking great!! :tada:
Merging.
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