2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class PipelineBridgeStatusService < ::BaseService
|
|
|
|
def execute(pipeline)
|
|
|
|
return unless pipeline.bridge_triggered?
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
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-03-13 15:44:24 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
Ci::PipelineBridgeStatusService.prepend_mod_with('Ci::PipelineBridgeStatusService')
|