Pull latest upgrade stop file in multi-version upgrade unit test
What does this MR do and why?
Updating db:migrate:multi-version-upgrade to pull latest upgrade stop file from PG Dump Generator. This change allows the following:
- Keep
latest_upgrade_stop.gzfile up-to-date with the latest upgrade stop - Not running PG dump creation as part of all GitLab MRs to save cost and pipeline time as it might take over 20 minutes to generate (example https://gitlab.com/gitlab-org/gitlab/-/jobs/6181804106) while the file is not changed often
The existing Data Seeder configuration stays at gitlab/ee/db/seeds/data_seeder/bulk_data.rb to ensure that file is being up-to-date with all fixture changes - context)
The job is marked as allowed to fail. Solutions to promoting it to required to pass will be done in Monitor multi-version upgrades test stability (gitlab-org/quality/quality-engineering/team-tasks#1922 - closed)
Issue
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Testing
-
db:migrate:multi-version-upgradepassed https://gitlab.com/gitlab-org/gitlab/-/jobs/6226975975 -
db:migrate:multi-version-upgradedoesn't block pipeline if failed (allowed to fail) - https://gitlab.com/gitlab-org/gitlab/-/pipelines/1185433644, job - https://gitlab.com/gitlab-org/gitlab/-/jobs/6226720996
How to set up and validate locally
Note that below steps will require to drop DB in your GDK. Alternatively you can run below commands against GitLab Docker image.
- In GDK cd to
gitlaband pull latest upgrade stop file
curl -o latest_upgrade_stop.gz https://gitlab.com/gitlab-org/quality/pg-dump-generator/-/raw/main/pg_dumps/ee/latest_upgrade_stop.gz
-
Unzip the file
gunzip -c latest_upgrade_stop.gz > latest_upgrade_stop -
Edit
gitlabhq_productionfile - update allOWNER TO gitlabtoOWNER TO XandOwner: gitlabtoOwner: Xwhere X is your PG owner in GDK DB - output ofwhoamicommandexport USERNAME=$(whoami) sed -e "s/OWNER TO gitlab/OWNER TO $USERNAME/g" -e "s/Owner: gitlab/Owner: $USERNAME/g" latest_upgrade_stop > gitlabhq_production -
In GDK GitLab console, stop all DB clients:
gdk stop; gdk start postgresql redis -
In GDK GitLab console and drop and recreate DB
bundle exec rake db:drop db:create -
In console import DB dump using
psql, where username is the name of your user in GDK (whoamioutptut)gdk psql -U $USERNAME -d gitlabhq_development < gitlabhq_production -
In run reconfigure to trigger migrations
bundle exec rake gitlab:db:configure