GraphQL API: Support queries used in Projects::Settings::CiCdController#define_runners_variables
Description
This issue depends on #328518 (closed), and will be used to build #33803.
In #328518 (closed) we defined a list of runners for administrators, and now we should do the same for projects.
query getProjectRunners() {
# Return all runners that are available for use by this project, as shown in the CI CD settings
project(fullPath: "my-project") {
runners(
membership: "DIRECT", # CiRunnerProjectMembershipFilter
before: "...", # Pagination arguments
after: "...",
first: "...",
last: "..." ) {
nodes { # CiRunner
id
}
}
}
}
Feature parity requirements:
This GraphQL API to create the UI described at: #33803[Project-runners.png], which will replace our legacy runner UI.
Runners in the list can be filtered by: Project
, Group
or Instance
, which should correspond to the 4 lists fetched by our current UI:
-
Project
:@project_runners
+@assignable_runners
(the list is separate in the original UI, we can consider merging it in the new UI, or adding@assignable_runners
as a new list) -
Instance
:@shared_runners
-
Group
:@group_runners
Implementation plan
The following table summarizes the queries we'll need to provide in order to replace the existing UI and queries that are currently embedded in the controller:
variable | query | location |
---|---|---|
@shared_runners |
project { runners(type: INSTANCE_TYPE, paused: false) } |
https://gitlab.com/gitlab-org/gitlab/blob/9d2d05be54a378581883c00337894288d1ef2efd/app/controllers/projects/settings/ci_cd_controller.rb#L129-129 |
@group_runners |
project { runners(membership: PARENT_GROUPS) } |
https://gitlab.com/gitlab-org/gitlab/blob/9d2d05be54a378581883c00337894288d1ef2efd/app/controllers/projects/settings/ci_cd_controller.rb#L133-133 |
@project_runners |
project { runners(membership: DIRECT) } |
https://gitlab.com/gitlab-org/gitlab/blob/9d2d05be54a378581883c00337894288d1ef2efd/app/controllers/projects/settings/ci_cd_controller.rb#L120-120 |
@assignable_runners |
project { assignableRunners } |
https://gitlab.com/gitlab-org/gitlab/blob/9d2d05be54a378581883c00337894288d1ef2efd/app/controllers/projects/settings/ci_cd_controller.rb#L122-124 |
Edited by Pedro Pombeiro