Capture job executor value in ci_runners table
What does this MR do and why?
Describe in detail what your merge request does and why.
bin/rails db:migrate RAILS_ENV=development
== 20211208111425 AddExecutorTypeColumnToCiRunners: migrating =================
-- add_column(:ci_runners, :executor_type, :smallint, {:null=>true})
-> 0.0036s
== 20211208111425 AddExecutorTypeColumnToCiRunners: migrated (0.0037s) ========
bin/rails db:rollback RAILS_ENV=development
== 20211208111425 AddExecutorTypeColumnToCiRunners: reverting =====================
-- remove_column(:ci_runners, :executor_type, :smallint, {:null=>true})
-> 0.0023s
== 20211208111425 AddExecutorTypeColumnToCiRunners: reverted (0.0045s) ============
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
The second query shows the ci_runners record after being populated by the /jobs/request
endpoint hit by the GitLab Runner.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Run migration:
bin/rails db:migrate RAILS_ENV=development
-
Register a runner against the local GDK:
gitlab-runner register -config /tmp/config.gdk.toml \ --non-interactive \ --executor "shell" \ --url "http://gdk.localhost:3000/" \ --description "Gitlab Org test runner" \ --tag-list "shell,gdk,mac,test" \ --run-untagged="false" \ --locked="false" \ --access-level="not_protected" \ --registration-token="$GITLAB_TOKEN"
-
Start the runner:
gitlab-runner run -config /tmp/config.gdk.toml
-
Open a Rails console:
rails c
-
Query for the executor on the last-registered runner:
Ci::Runner.select(:id, :executor_type).last
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.
Part of #345361 (closed)
Edited by Pedro Pombeiro