From e9c2bf267862e22c0770cc7b3a1ed97a8b87a7fd Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 3 Mar 2020 18:08:16 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/models/ci/bridge.rb | 4 ++++ app/models/ci/pipeline.rb | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'app/models/ci') diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb index 39be26abc1d..a28e44d44c1 100644 --- a/app/models/ci/bridge.rb +++ b/app/models/ci/bridge.rb @@ -62,6 +62,10 @@ module Ci end end + def has_downstream_pipeline? + sourced_pipelines.exists? + end + def downstream_pipeline_params return child_params if triggers_child_pipeline? return cross_project_params if downstream_project.present? diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index e07abc20dcf..ff257c6cd68 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -227,6 +227,7 @@ module Ci end after_transition created: :pending do |pipeline| + next if Feature.enabled?(:ci_drop_bridge_on_downstream_errors, pipeline.project, default_enabled: true) next unless pipeline.bridge_triggered? next if pipeline.bridge_waiting? @@ -756,6 +757,8 @@ module Ci raise BridgeStatusError unless source_bridge.active? source_bridge.success! + rescue => e + Gitlab::ErrorTracking.track_exception(e, pipeline_id: id) end def bridge_triggered? @@ -774,6 +777,10 @@ module Ci child_pipelines.exists? end + def created_successfully? + persisted? && failure_reason.blank? + end + def detailed_status(current_user) Gitlab::Ci::Status::Pipeline::Factory .new(self, current_user) -- cgit v1.2.1