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.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Go to the shell in your GDK
gitlab
directory and runbundle exec rake "gitlab:seed:runner_fleet"
. This will seed your GDK with some runners and jobs required for testing this MR; -
Run the migration in this branch:
bundle exec rails db:migrate
; -
Go to the Rails console:
gdk rails console
; -
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. -
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.
-
I have evaluated the MR acceptance checklist for this MR.