From d588adff1a3ce87355c8b5ac09a77e6fc63fe89a Mon Sep 17 00:00:00 2001 From: Alexis Reigel Date: Wed, 4 Oct 2017 15:51:23 +0200 Subject: [PATCH] don't filter group runners by project flag the scope `Ci::Runner.belonging_to_group` does not filter out the runners where the projects has `#group_runners_enabled` set to false anymore. it didn't show up in the runners UI anymore when group runners were disabled. this was confusing. the flag is only relevant when selecting appropriate runner for a build. --- app/models/ci/runner.rb | 10 +--------- spec/models/ci/runner_spec.rb | 8 -------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 586740a4a2a..9efafa8681f 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -37,15 +37,7 @@ module Ci INNER JOIN namespaces ON namespaces.id = ci_runner_groups.group_id INNER JOIN projects ON projects.namespace_id = namespaces.id } - ).where( - %{ - projects.id = :project_id - AND - projects.group_runners_enabled = :true - }, - project_id: project_id, - true: true - ) + ).where('projects.id = :project_id', project_id: project_id) } scope :owned_or_shared, -> (project_id) do diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 308db9e8e68..0cc52acd44d 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -93,14 +93,6 @@ describe Ci::Runner do expect(described_class.belonging_to_group(specific_project.id)).to eq [specific_runner] end - - it 'does not return the group runner if the project has group runners disabled' do - specific_group = create :group - specific_project = create :project, group: specific_group, group_runners_enabled: false - create :ci_runner, :specific, groups: [specific_group] - - expect(described_class.belonging_to_group(specific_project.id)).to be_empty - end end describe '.owned_or_shared' do