Skip to content

Filter admin runners by runner machine upgrade status

What does this MR do and why?

This MR improves the implementation that changed the runner filtering backend of the admin runners page to filter based on the upgrade status of the runner_manager rather than the runner. This is a change suggested in the review of !118829 (merged). Part of issue #421188 (closed)

How to set up and validate locally

Method 1

  1. Navigate to the Admin page
  2. Navigate to the Ci Runners page
  3. If you do not already have runners visible in the list, add some runners with various runner versions.
  4. In the top search bar, type Status=Offline and use the autocompleting along the way.
  5. The runner list will change according to your selection.

Method 2

  1. Start the GDK console: gdk console

  2. Evaluate the following expression:

    > Ci::Runner.with_upgrade_status(:recommended)
      Ci::Runner Load (1.4ms)  SELECT "ci_runners".* FROM "ci_runners" INNER JOIN "ci_runner_machines" ON "ci_runner_machines"."runner_id" = "ci_runners"."id" INNER JOIN "ci_runner_versions" runner_version ON runner_version.version = "ci_runner_machines".version WHERE "runner_version"."status" = 3 /*application:console,db_config_name:ci,console_hostname:gitlab-macbookpro.work.pombei.ro,console_username:pedropombeiro,line:bin/rails:4:in `<main>'*/
    => []
  3. Switch to master branch and run reload!

  4. Evaluate the expression again:

    > Ci::Runner.with_upgrade_status(:recommended)
      Ci::Runner Load (1.5ms)  SELECT "ci_runners".* FROM "ci_runners" INNER JOIN "ci_runner_machines" ON "ci_runner_machines"."runner_id" = "ci_runners"."id" INNER JOIN "ci_runner_versions" "runner_version" ON "runner_version"."version" = "ci_runner_machines"."version" WHERE "runner_version"."status" = 3 /*application:console,db_config_name:ci,console_hostname:gitlab-macbookpro.work.pombei.ro,console_username:pedropombeiro,line:bin/rails:4:in `<main>'*/

Notice that the only difference in the generated query is the quotes:

image

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