Skip to content

GraphQL: Add upgrade_status filter to RunnersResolver

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR adds the upgradeStatus filter to the RunnersResolver.

Closes GraphQL: Expose filter on GitLab Runner upgrade... (#358406 - closed)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

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

  1. Open http://gdk.test:3000/-/graphql-explorer

  2. Enter the following query:

    {
      runners(upgradeStatus:RECOMMENDED) {
        count
      }
    }

Assuming that you have Runners whose versions are listed in ci_runner_versions as the appropriate status (which get filled by the !91554 (merged) MR), those runners should be listed in the response.

MR acceptance checklist

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

Database execution plans

SELECT COUNT(*)
FROM "ci_runners"
  INNER JOIN "ci_runner_versions" "runner_version" ON "runner_version"."version" = "ci_runners"."version"
WHERE "runner_version"."status" = 1

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/10974/commands/39439

 Aggregate  (cost=512.52..512.53 rows=1 width=8) (actual time=0.051..0.052 rows=1 loops=1)
   Buffers: shared hit=5
   I/O Timings: read=0.000 write=0.000
   ->  Nested Loop  (cost=0.71..491.92 rows=8238 width=0) (actual time=0.047..0.047 rows=0 loops=1)
         Buffers: shared hit=5
         I/O Timings: read=0.000 write=0.000
         ->  Index Scan using index_ci_runner_versions_on_status on public.ci_runner_versions runner_version  (cost=0.28..10.90 rows=7 width=32) (actual time=0.046..0.046 rows=0 loops=1)
               Index Cond: (runner_version.status = 1)
               Buffers: shared hit=5
               I/O Timings: read=0.000 write=0.000
         ->  Index Only Scan using index_ci_runners_on_version on public.ci_runners  (cost=0.43..47.16 rows=2156 width=7) (actual time=0.000..0.000 rows=0 loops=0)
               Index Cond: (ci_runners.version = runner_version.version)
               Heap Fetches: 0
               I/O Timings: read=0.000 write=0.000

Merge request reports