Commit ff303b1e authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch '329194-remove-ci_reset_bridge_with_subsequent_jobs' into 'master'

Remove the FF ci_reset_bridge_with_subsequent_jobs

See merge request gitlab-org/gitlab!68295
parents f72f1fb8 a4a75095
......@@ -1220,24 +1220,12 @@ module Ci
self.ci_ref = Ci::Ref.ensure_for(self)
end
# We need `base_and_ancestors` in a specific order to "break" when needed.
# If we use `find_each`, then the order is broken.
# rubocop:disable Rails/FindEach
def reset_source_bridge!(current_user)
if ::Feature.enabled?(:ci_reset_bridge_with_subsequent_jobs, project, default_enabled: :yaml)
return unless bridge_waiting?
return unless bridge_waiting?
source_bridge.pending!
Ci::AfterRequeueJobService.new(project, current_user).execute(source_bridge) # rubocop:disable CodeReuse/ServiceClass
else
self_and_upstreams.includes(:source_bridge).each do |pipeline|
break unless pipeline.bridge_waiting?
pipeline.source_bridge.pending!
end
end
source_bridge.pending!
Ci::AfterRequeueJobService.new(project, current_user).execute(source_bridge) # rubocop:disable CodeReuse/ServiceClass
end
# rubocop:enable Rails/FindEach
# EE-only
def merge_train_pipeline?
......
---
name: ci_reset_bridge_with_subsequent_jobs
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60376
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/329194
milestone: '13.12'
type: development
group: group::pipeline authoring
default_enabled: true
......@@ -4524,51 +4524,6 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
subject(:reset_bridge) { pipeline.reset_source_bridge!(project.owner) }
# This whole block will be removed by https://gitlab.com/gitlab-org/gitlab/-/issues/329194
# It contains some duplicate checks.
context 'when the FF ci_reset_bridge_with_subsequent_jobs is disabled' do
before do
stub_feature_flags(ci_reset_bridge_with_subsequent_jobs: false)
end
context 'when the pipeline is a child pipeline and the bridge is depended' do
let!(:parent_pipeline) { create(:ci_pipeline) }
let!(:bridge) { create_bridge(parent_pipeline, pipeline, true) }
it 'marks source bridge as pending' do
reset_bridge
expect(bridge.reload).to be_pending
end
context 'when the parent pipeline has subsequent jobs after the bridge' do
let!(:after_bridge_job) { create(:ci_build, :skipped, pipeline: parent_pipeline, stage_idx: bridge.stage_idx + 1) }
it 'does not touch subsequent jobs of the bridge' do
reset_bridge
expect(after_bridge_job.reload).to be_skipped
end
end
context 'when the parent pipeline has a dependent upstream pipeline' do
let(:upstream_pipeline) { create(:ci_pipeline, project: create(:project)) }
let!(:upstream_bridge) { create_bridge(upstream_pipeline, parent_pipeline, true) }
let(:upstream_upstream_pipeline) { create(:ci_pipeline, project: create(:project)) }
let!(:upstream_upstream_bridge) { create_bridge(upstream_upstream_pipeline, upstream_pipeline, true) }
it 'marks all source bridges as pending' do
reset_bridge
expect(bridge.reload).to be_pending
expect(upstream_bridge.reload).to be_pending
expect(upstream_upstream_bridge.reload).to be_pending
end
end
end
end
context 'when the pipeline is a child pipeline and the bridge is depended' do
let!(:parent_pipeline) { create(:ci_pipeline) }
let!(:bridge) { create_bridge(parent_pipeline, pipeline, true) }
......
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