diff options
7 files changed, 2 insertions, 73 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index bc704457be1..3209e077a08 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -214,7 +214,7 @@ module Ci end end - after_transition created: any - [:failed] do |pipeline| + after_transition created: :pending do |pipeline| next unless pipeline.bridge_triggered? next if pipeline.bridge_waiting? diff --git a/app/services/ci/create_cross_project_pipeline_service.rb b/app/services/ci/create_cross_project_pipeline_service.rb index dd15fa8ddb8..8de72ace261 100644 --- a/app/services/ci/create_cross_project_pipeline_service.rb +++ b/app/services/ci/create_cross_project_pipeline_service.rb @@ -18,7 +18,7 @@ module Ci current_user, pipeline_params.fetch(:target_revision)) - downstream_pipeline = service.execute( + service.execute( pipeline_params.fetch(:source), pipeline_params[:execute_params]) do |pipeline| @bridge.sourced_pipelines.build( source_pipeline: @bridge.pipeline, @@ -28,10 +28,6 @@ module Ci pipeline.variables.build(@bridge.downstream_variables) end - - downstream_pipeline.tap do |pipeline| - @bridge.drop!(:downstream_pipeline_creation_failed) if pipeline.errors.any? - end end private diff --git a/changelogs/unreleased/drop-bridge-on-any-pipeline-errors.yml b/changelogs/unreleased/drop-bridge-on-any-pipeline-errors.yml deleted file mode 100644 index 831192fc097..00000000000 --- a/changelogs/unreleased/drop-bridge-on-any-pipeline-errors.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Drop bridge on any downstream pipeline errors -merge_request: 24735 -author: -type: fixed diff --git a/changelogs/unreleased/fix-upstream-bridge-stuck-when-non-pending-pipelines.yml b/changelogs/unreleased/fix-upstream-bridge-stuck-when-non-pending-pipelines.yml deleted file mode 100644 index eed4e811092..00000000000 --- a/changelogs/unreleased/fix-upstream-bridge-stuck-when-non-pending-pipelines.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fix upstream bridge stuck when downstream pipeline is not pending -merge_request: 24665 -author: -type: fixed diff --git a/changelogs/unreleased/mc-bug-fail-upstream-on-invalid-yaml.yml b/changelogs/unreleased/mc-bug-fail-upstream-on-invalid-yaml.yml deleted file mode 100644 index 910f2851400..00000000000 --- a/changelogs/unreleased/mc-bug-fail-upstream-on-invalid-yaml.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fail upstream bridge on downstream pipeline creation failure. -merge_request: 24092 -author: -type: fixed diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 86c3628216e..cf1690df9ba 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -2932,30 +2932,6 @@ describe Ci::Pipeline, :mailer do create(:ci_sources_pipeline, pipeline: pipeline, source_job: bridge) end - context 'when downstream pipeline status transitions to pending' do - it 'updates bridge status ' do - expect(pipeline).to receive(:update_bridge_status!).once - - pipeline.run! - end - end - - context 'when the status of downstream pipeline transitions to waiting_for_resource' do - it 'updates bridge status ' do - expect(pipeline).to receive(:update_bridge_status!).once - - pipeline.request_resource! - end - end - - context 'when the status of downstream pipeline transitions to failed' do - it 'does not update bridge status ' do - expect(pipeline).not_to receive(:update_bridge_status!) - - pipeline.drop! - end - end - describe '#bridge_triggered?' do it 'is a pipeline triggered by a bridge' do expect(pipeline).to be_bridge_triggered diff --git a/spec/services/ci/create_cross_project_pipeline_service_spec.rb b/spec/services/ci/create_cross_project_pipeline_service_spec.rb index 3625bc6ff41..51cf18f8d87 100644 --- a/spec/services/ci/create_cross_project_pipeline_service_spec.rb +++ b/spec/services/ci/create_cross_project_pipeline_service_spec.rb @@ -267,34 +267,6 @@ describe Ci::CreateCrossProjectPipelineService, '#execute' do end end - context 'when downstream pipeline creation errors out' do - let(:stub_config) { false } - - before do - stub_ci_pipeline_yaml_file(YAML.dump(invalid: { yaml: 'error' })) - end - - it 'creates only one new pipeline' do - expect { service.execute(bridge) } - .to change { Ci::Pipeline.count }.by(1) - end - - it 'creates a new pipeline in the downstream project' do - pipeline = service.execute(bridge) - - expect(pipeline.user).to eq bridge.user - expect(pipeline.project).to eq downstream_project - end - - it 'drops the bridge' do - pipeline = service.execute(bridge) - - expect(pipeline.reload).to be_failed - expect(bridge.reload).to be_failed - expect(bridge.failure_reason).to eq('downstream_pipeline_creation_failed') - end - end - context 'when bridge job has YAML variables defined' do before do bridge.yaml_variables = [{ key: 'BRIDGE', value: 'var', public: true }] |