Skip to content

Filter Admin Runners by Creator

What does this MR do and why?

This MR aims to allow admins to search by runner creator on the admin runners page. This MR includes only the relevant back-end changes.

Part of #378633 (closed)

How to set up and validate locally

Make sure you have at least one GitLab runner registered and running.

  1. Go to http://gdk.test:3000/-/graphql-explorer

  2. Use the following query:

    {
      runners(creatorId: "gid://gitlab/User/1") {
        nodes {
          id,
          createdBy {
            name,
            username,
            id,
          }
        }
      }
    }
  3. The query will return any runners created by user root/1

Database query plan

Filter by creator_id

https://postgres.ai/console/gitlab/gitlab-production-ci/sessions/22750/commands/73321

SELECT "ci_runners".*
FROM "ci_runners"
WHERE "ci_runners"."creator_id" = 1
ORDER BY "ci_runners"."created_at" DESC, "ci_runners"."id" DESC
LIMIT 101
 Limit  (cost=7.85..7.86 rows=4 width=273) (actual time=5.295..5.297 rows=0 loops=1)
   Buffers: shared hit=9 read=3
   I/O Timings: read=5.179 write=0.000
   ->  Sort  (cost=7.85..7.86 rows=4 width=273) (actual time=5.293..5.294 rows=0 loops=1)
         Sort Key: ci_runners.created_at DESC, ci_runners.id DESC
         Sort Method: quicksort  Memory: 25kB
         Buffers: shared hit=9 read=3
         I/O Timings: read=5.179 write=0.000
         ->  Index Scan using index_ci_runners_on_creator_id_where_creator_id_not_null on public.ci_runners  (cost=0.41..7.81 rows=4 width=273) (actual time=5.242..5.242 rows=0 loops=1)
               Index Cond: (ci_runners.creator_id = 1)
               Buffers: shared hit=3 read=3
               I/O Timings: read=5.179 write=0.000
## MR acceptance checklist

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

Edited by Pedro Pombeiro

Merge request reports