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.
This commit is contained in:
Alexis Reigel 2017-10-04 15:51:23 +02:00
parent 4ccf734e38
commit d588adff1a
No known key found for this signature in database
GPG key ID: 55ADA7C7B683B329
2 changed files with 1 additions and 17 deletions

View file

@ -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

View file

@ -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