Skip to content

Fix db_tasks script

Krasimir Angelov requested to merge ka/fix-db-tasks-script into master

What does this MR do and why?

With !110361 (diffs) we converted scripts/db_tasks from bash to ruby, and we should use # instead of $ when interpolating variable in string.

Currently jobs using this script fail, for example https://gitlab.com/gitlab-org/gitlab/-/jobs/3699879184.

How to set up and validate locally

  1. On master
    $ RAILS_ENV=development scripts/db_tasks db:migrate:status
    Running: `bundle exec rake ${task}:main`
    rake aborted!             
    Don't know how to build task '${task}:main' (See the list of available tasks with `rake --tasks`)
    /Users/krasio/.asdf/installs/ruby/3.0.5/bin/bundle:25:in `load'
    /Users/krasio/.asdf/installs/ruby/3.0.5/bin/bundle:25:in `<main>'
    (See full trace by running task with --trace)
  2. On this branch
    $ RAILS_ENV=development scripts/db_tasks db:migrate:status
    Running: `bundle exec rake db:migrate:status:main`
    
    database: gitlabhq_development
    
     Status   Migration ID    Migration Name
    --------------------------------------------------
       up     20210301200959  ********** NO FILE **********
       up     20210302025305  ********** NO FILE **********
       up     20210302074524  ********** NO FILE **********
       ...

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Krasimir Angelov

Merge request reports

Loading