Commit 3df9df27 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch 'remove-ff-merge_trains_parallel_pipelines' into 'master'

Remove FF merge_trains_parallel_pipelines

See merge request gitlab-org/gitlab!30599
parents 176aadf9 1cf14ae7
......@@ -4,10 +4,7 @@ module MergeTrains
include ::Gitlab::ExclusiveLeaseHelpers
include ::Gitlab::Utils::StrongMemoize
HIGH_CONCURRENCY = 20
MEDIUM_CONCURRENCY = 10
LOW_CONCURRENCY = 4
NO_CONCURRENCY = 1
DEFAULT_CONCURRENCY = 20
##
# merge_request ... A merge request pointer in a merge train.
......@@ -56,17 +53,7 @@ module MergeTrains
def max_concurrency
strong_memoize(:max_concurrency) do
if Feature.enabled?(:merge_trains_parallel_pipelines, project, default_enabled: true)
if Feature.enabled?(:merge_trains_high_concurrency, project, default_enabled: true)
HIGH_CONCURRENCY
elsif Feature.enabled?(:merge_trains_medium_concurrency, project)
MEDIUM_CONCURRENCY
else
LOW_CONCURRENCY
end
else
NO_CONCURRENCY
end
DEFAULT_CONCURRENCY
end
end
end
......
---
title: Change default concurrency of merge trains to twenty
merge_request: 30599
author:
type: changed
......@@ -55,19 +55,6 @@ describe MergeTrains::RefreshMergeRequestsService do
subject
end
context 'when merge_trains_parallel_pipelines feature flag is disabled' do
before do
stub_feature_flags(merge_trains_parallel_pipelines: false)
end
it 'does not refresh merge request 2' do
expect(refresh_service_1).to receive(:execute).with(merge_request_1)
expect(refresh_service_2).not_to receive(:execute).with(merge_request_2)
subject
end
end
context 'when refresh service 1 returns error status' do
let(:refresh_service_1_result) { { status: :error, message: 'Failed to create ref' } }
......@@ -186,60 +173,4 @@ describe MergeTrains::RefreshMergeRequestsService do
end
end
end
describe '#max_concurrency' do
subject { service.send(:max_concurrency) }
context 'when `merge_trains_parallel_pipelines` feature flag is enabled' do
before do
stub_feature_flags(merge_trains_parallel_pipelines: true)
end
context 'when `merge_trains_high_concurrency` feature flag is enabled' do
before do
stub_feature_flags(merge_trains_high_concurrency: true)
end
it 'returns high concurrency' do
is_expected.to eq(described_class::HIGH_CONCURRENCY)
end
end
context 'when `merge_trains_high_concurrency` feature flag is disabled' do
before do
stub_feature_flags(merge_trains_high_concurrency: false)
end
context 'when `merge_trains_medium_concurrency` feature flag is enabled' do
before do
stub_feature_flags(merge_trains_medium_concurrency: true)
end
it 'returns medium concurrency' do
is_expected.to eq(described_class::MEDIUM_CONCURRENCY)
end
end
context 'when `merge_trains_medium_concurrency` feature flag is disabled' do
before do
stub_feature_flags(merge_trains_medium_concurrency: false)
end
it 'returns low concurrency' do
is_expected.to eq(described_class::LOW_CONCURRENCY)
end
end
end
end
context 'when `merge_trains_parallel_pipelines` feature flag is disabled' do
before do
stub_feature_flags(merge_trains_parallel_pipelines: false)
end
it 'returns no concurrency' do
is_expected.to eq(described_class::NO_CONCURRENCY)
end
end
end
end
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