Commit db31ee1a authored by Ash McKenzie's avatar Ash McKenzie

Merge branch 'fix-upstream-bridge-stuck-when-non-pending-pipelines' into 'master'

Fix upstream bridge stuck when downstream pipeline is not pending

Closes #202239

See merge request gitlab-org/gitlab!24665
parents dfb172bd ed1e947e
...@@ -216,7 +216,7 @@ module Ci ...@@ -216,7 +216,7 @@ module Ci
end end
end end
after_transition created: :pending do |pipeline| after_transition created: any - [:failed] do |pipeline|
next unless pipeline.bridge_triggered? next unless pipeline.bridge_triggered?
next if pipeline.bridge_waiting? next if pipeline.bridge_waiting?
......
---
title: Fix upstream bridge stuck when downstream pipeline is not pending
merge_request: 24665
author:
type: fixed
...@@ -2953,6 +2953,30 @@ describe Ci::Pipeline, :mailer do ...@@ -2953,6 +2953,30 @@ describe Ci::Pipeline, :mailer do
create(:ci_sources_pipeline, pipeline: pipeline, source_job: bridge) create(:ci_sources_pipeline, pipeline: pipeline, source_job: bridge)
end 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 describe '#bridge_triggered?' do
it 'is a pipeline triggered by a bridge' do it 'is a pipeline triggered by a bridge' do
expect(pipeline).to be_bridge_triggered expect(pipeline).to be_bridge_triggered
......
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