GraphQL: Support membership params for project filter in RunnersFinder
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussion from !103994 (merged) should be addressed:
-
@shinya.maeda started a discussion: (+3 comments) Question: If we filter runners by project-id, I expect it's a project-level runners that belong to a specific project. Why do we include all available runners in the project, including instance-level runners and group-level runners?
Related to the point, would this method should take
@params[:membership]into account, so that it'll be consistent withgroup_runners? It seemsowned_or_instance_wideis corresponding toall_available. If you fetch project-level runners belong to a specific project, it would bedirect. Etc
Implementation plan
-
We need to implement a
CiRunnerProjectMembershipFiltertype similar toCiRunnerMembershipFilterconsisting of the following values:enum value query example PARENT_GROUPS::Ci::Runner.belonging_to_parent_group_of_project(@project.id)https://gitlab.com/gitlab-org/gitlab/blob/b408bc81cb8862071b99ac6dd1327939bb52d276/app/controllers/projects/settings/ci_cd_controller.rb#L132-134 OWNED_OR_INSTANCE_WIDE::Ci::Runner.owned_or_instance_wide(@project.id)https://gitlab.com/gitlab-org/gitlab/blob/b408bc81cb8862071b99ac6dd1327939bb52d276/app/finders/ci/runners_finder.rb#L79-79 DIRECT@project.runnershttps://gitlab.com/gitlab-org/gitlab/blob/9d2d05be54a378581883c00337894288d1ef2efd/app/controllers/projects/settings/ci_cd_controller.rb#L120-120 Normally, the
DIRECTvalue should be the default. However, theOWNED_OR_INSTANCE_WIDEbehavior is the current one. -
We need to create a
Resolvers::Ci::ProjectRunnersResolver(similar toResolvers::Ci::GroupRunnersResolver) to support a:membershipfield and aprojectparent object.