Commit d588adff authored by Alexis Reigel's avatar Alexis Reigel

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.
parent 4ccf734e
...@@ -37,15 +37,7 @@ module Ci ...@@ -37,15 +37,7 @@ module Ci
INNER JOIN namespaces ON namespaces.id = ci_runner_groups.group_id INNER JOIN namespaces ON namespaces.id = ci_runner_groups.group_id
INNER JOIN projects ON projects.namespace_id = namespaces.id INNER JOIN projects ON projects.namespace_id = namespaces.id
} }
).where( ).where('projects.id = :project_id', project_id: project_id)
%{
projects.id = :project_id
AND
projects.group_runners_enabled = :true
},
project_id: project_id,
true: true
)
} }
scope :owned_or_shared, -> (project_id) do scope :owned_or_shared, -> (project_id) do
......
...@@ -93,14 +93,6 @@ describe Ci::Runner do ...@@ -93,14 +93,6 @@ describe Ci::Runner do
expect(described_class.belonging_to_group(specific_project.id)).to eq [specific_runner] expect(described_class.belonging_to_group(specific_project.id)).to eq [specific_runner]
end 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 end
describe '.owned_or_shared' do describe '.owned_or_shared' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment