Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/ci/runners_finder.rb')
-rw-r--r--app/finders/ci/runners_finder.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/finders/ci/runners_finder.rb b/app/finders/ci/runners_finder.rb
index 5d597f94f72..3ebf6bd1562 100644
--- a/app/finders/ci/runners_finder.rb
+++ b/app/finders/ci/runners_finder.rb
@@ -47,15 +47,19 @@ module Ci
end
def group_runners
- raise Gitlab::Access::AccessDeniedError unless can?(@current_user, :admin_group, @group)
+ raise Gitlab::Access::AccessDeniedError unless can?(@current_user, :read_group_runners, @group)
@runners = case @params[:membership]
when :direct
Ci::Runner.belonging_to_group(@group.id)
when :descendants, nil
- # Getting all runners from the group itself and all its descendant groups/projects
- descendant_projects = Project.for_group_and_its_subgroups(@group)
- Ci::Runner.belonging_to_group_or_project(@group.self_and_descendants, descendant_projects)
+ if ::Feature.enabled?(:ci_find_runners_by_ci_mirrors, @group, default_enabled: :yaml)
+ Ci::Runner.belonging_to_group_or_project_descendants(@group.id)
+ else
+ # Getting all runners from the group itself and all its descendant groups/projects
+ descendant_projects = Project.for_group_and_its_subgroups(@group)
+ Ci::Runner.legacy_belonging_to_group_or_project(@group.self_and_descendants, descendant_projects)
+ end
else
raise ArgumentError, 'Invalid membership filter'
end