Commit 12f9e6db authored by Allison Browne's avatar Allison Browne

Block execution of cyclical pipelines

Do not allow pipelines that reference one another
to execute infinitely

Changelog: fixed
parent af8f6ed8
......@@ -120,7 +120,6 @@ module Ci
def has_cyclic_dependency?
return false if @bridge.triggers_child_pipeline?
if Feature.enabled?(:ci_drop_cyclical_triggered_pipelines, @bridge.project, default_enabled: :yaml)
pipeline_checksums = @bridge.pipeline.self_and_upstreams.filter_map do |pipeline|
config_checksum(pipeline) unless pipeline.child?
end
......@@ -129,7 +128,6 @@ module Ci
# fail when 2 cycles are detected: A -> B -> A -> B -> A
pipeline_checksums.tally.any? { |_checksum, occurrences| occurrences > 2 }
end
end
def has_max_descendants_depth?
return false unless @bridge.triggers_child_pipeline?
......
---
name: ci_drop_cyclical_triggered_pipelines
introduced_by_url: https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/1195
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/329390
milestone: '13.12'
type: development
group: group::pipeline execution
default_enabled: false
......@@ -485,14 +485,6 @@ RSpec.describe Ci::CreateDownstreamPipelineService, '#execute' do
end
it_behaves_like 'detects cyclical pipelines'
context 'when ci_drop_cyclical_triggered_pipelines is not enabled' do
before do
stub_feature_flags(ci_drop_cyclical_triggered_pipelines: false)
end
it_behaves_like 'passes cyclical pipeline precondition'
end
end
context 'when source in the ancestry differ' do
......
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