Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-08 18:08:41 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-08 18:08:41 +0300
commitdc47d7f5c0f1a402463e9c1adaffecf3f465bc7f (patch)
tree5fbe362a06ef1841c73d6b377dbccc5dfc7fcece /lib/gitlab/ci
parenta0158b1a9c21f648fdbf79765bbc1e19e776b5d9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r--lib/gitlab/ci/features.rb4
-rw-r--r--lib/gitlab/ci/pipeline_object_hierarchy.rb33
-rw-r--r--lib/gitlab/ci/status/build/failed.rb3
3 files changed, 39 insertions, 1 deletions
diff --git a/lib/gitlab/ci/features.rb b/lib/gitlab/ci/features.rb
index a03206c1358..3f1d3545fc7 100644
--- a/lib/gitlab/ci/features.rb
+++ b/lib/gitlab/ci/features.rb
@@ -74,6 +74,10 @@ module Gitlab
def self.coverage_report_view?(project)
::Feature.enabled?(:coverage_report_view, project)
end
+
+ def self.child_of_child_pipeline_enabled?(project)
+ ::Feature.enabled?(:ci_child_of_child_pipeline, project, default_enabled: false)
+ end
end
end
end
diff --git a/lib/gitlab/ci/pipeline_object_hierarchy.rb b/lib/gitlab/ci/pipeline_object_hierarchy.rb
new file mode 100644
index 00000000000..55e6cfb1b73
--- /dev/null
+++ b/lib/gitlab/ci/pipeline_object_hierarchy.rb
@@ -0,0 +1,33 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Ci
+ class PipelineObjectHierarchy < ::Gitlab::ObjectHierarchy
+ private
+
+ def middle_table
+ ::Ci::Sources::Pipeline.arel_table
+ end
+
+ def from_tables(cte)
+ [objects_table, cte.table, middle_table]
+ end
+
+ def parent_id_column(_cte)
+ middle_table[:source_pipeline_id]
+ end
+
+ def ancestor_conditions(cte)
+ middle_table[:source_pipeline_id].eq(objects_table[:id]).and(
+ middle_table[:pipeline_id].eq(cte.table[:id])
+ )
+ end
+
+ def descendant_conditions(cte)
+ middle_table[:pipeline_id].eq(objects_table[:id]).and(
+ middle_table[:source_pipeline_id].eq(cte.table[:id])
+ )
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/ci/status/build/failed.rb b/lib/gitlab/ci/status/build/failed.rb
index 88846f724e7..f6562737838 100644
--- a/lib/gitlab/ci/status/build/failed.rb
+++ b/lib/gitlab/ci/status/build/failed.rb
@@ -25,7 +25,8 @@ module Gitlab
insufficient_bridge_permissions: 'no permissions to trigger downstream pipeline',
bridge_pipeline_is_child_pipeline: 'creation of child pipeline not allowed from another child pipeline',
downstream_pipeline_creation_failed: 'downstream pipeline can not be created',
- secrets_provider_not_found: 'secrets provider can not be found'
+ secrets_provider_not_found: 'secrets provider can not be found',
+ reached_max_descendant_pipelines_depth: 'reached maximum depth of child pipelines'
}.freeze
private_constant :REASONS