Skip to content

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.gz file 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

Identify solutions for storing DB dumps for mul... (gitlab-org/quality/quality-engineering/team-tasks#2355 - closed)

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

See Draft: Verify multi-version upgrade job update (!145440 - closed) which changed migration file to trigger DB CI jobs:

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.

  1. In GDK cd to gitlab and 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
  1. Unzip the file

    gunzip -c latest_upgrade_stop.gz > latest_upgrade_stop
  2. Edit gitlabhq_production file - update all OWNER TO gitlab to OWNER TO X and Owner: gitlab to Owner: X where X is your PG owner in GDK DB - output of whoami command

    export USERNAME=$(whoami)
    sed -e "s/OWNER TO gitlab/OWNER TO $USERNAME/g" -e "s/Owner: gitlab/Owner: $USERNAME/g" latest_upgrade_stop > gitlabhq_production
  3. In GDK GitLab console, stop all DB clients:

    gdk stop; gdk start postgresql redis
  4. In GDK GitLab console and drop and recreate DB

    bundle exec rake db:drop db:create
  5. In console import DB dump using psql, where username is the name of your user in GDK (whoami outptut)

    gdk psql -U $USERNAME -d gitlabhq_development < gitlabhq_production
  6. In run reconfigure to trigger migrations

    bundle exec rake gitlab:db:configure
Edited by Nailia Iskhakova

Merge request reports

Loading