Skip to content

Add registration columns to ci_runners table

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR adds a couple of columns to the ci_runners table which allow us to keep track of who registered a runner in the new Runner Token Architecture blueprint.

It adds a LFK for the new creator_id column. The users table already has a deletion tracker, so it is not necessary to introduce one in this MR.

Closes #386491 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

image

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Go to the shell in your GDK gitlab directory and run bundle exec rake "gitlab:seed:runner_fleet". This will seed your GDK with some runners and jobs required for testing this MR;

  2. Run the migration in this branch: bundle exec rails db:migrate;

  3. Go to the Rails console: gdk rails console;

  4. Run the following code to ensure that all records have the default value:

    Ci::Runner.select(:registration_type).distinct

    The result should be a single row with the registration_type: "registration_token" value, meaning that all rows in the table have that value.

  5. Run Ci::Runner.last.creator. It should output nil.

MR acceptance checklist

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

Merge request reports