Commit d9978b52 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch '340583-remove-projects-from-project-runners-queuing-query' into 'master'

Decouple project runners queuing query from projects table

See merge request gitlab-org/gitlab!70415
parents d454a549 207138f3
......@@ -47,7 +47,7 @@ module Ci
def builds_for_project_runner
relation = new_builds
.where(project: runner.projects.without_deleted.with_builds_enabled)
.where(project: runner_projects_relation)
order(relation)
end
......@@ -87,6 +87,14 @@ module Ci
end
end
end
def runner_projects_relation
if ::Feature.enabled?(:ci_pending_builds_project_runners_decoupling, runner, default_enabled: :yaml)
runner.runner_projects.select(:project_id)
else
runner.projects.without_deleted.with_builds_enabled
end
end
end
end
end
......
---
name: ci_pending_builds_project_runners_decoupling
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70415
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/341005
milestone: '14.4'
type: development
group: group::pipeline execution
default_enabled: false
......@@ -87,6 +87,10 @@ module Ci
end
context 'for specific runner' do
before do
stub_feature_flags(ci_pending_builds_project_runners_decoupling: false)
end
it 'does not pick a build' do
expect(execute(specific_runner)).to be_nil
end
......@@ -242,6 +246,10 @@ module Ci
end
context 'and uses project runner' do
before do
stub_feature_flags(ci_pending_builds_project_runners_decoupling: false)
end
let(:build) { execute(specific_runner) }
it { expect(build).to be_nil }
......
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