2020-02-08 01:08:50 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class PipelineBridgeStatusService < ::BaseService
|
|
|
|
def execute(pipeline)
|
|
|
|
return unless pipeline.bridge_triggered?
|
|
|
|
|
2020-03-12 05:09:55 -04:00
|
|
|
begin
|
|
|
|
pipeline.source_bridge.inherit_status_from_downstream!(pipeline)
|
|
|
|
rescue StateMachines::InvalidTransition => e
|
|
|
|
Gitlab::ErrorTracking.track_exception(
|
|
|
|
Ci::Bridge::InvalidTransitionError.new(e.message),
|
|
|
|
bridge_id: pipeline.source_bridge.id,
|
|
|
|
downstream_pipeline_id: pipeline.id)
|
|
|
|
end
|
2020-02-08 01:08:50 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
Ci::PipelineBridgeStatusService.prepend_mod_with('Ci::PipelineBridgeStatusService')
|