Commit ed1e947e authored by Shinya Maeda's avatar Shinya Maeda

Fix upstream bridge stuck when downstream pipeline is not pending

This commit fixes that upstream bridge stuck when downstream status
transits to non-pending status.
parent 4c94998b
...@@ -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
...@@ -2919,6 +2919,30 @@ describe Ci::Pipeline, :mailer do ...@@ -2919,6 +2919,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