Commit 5a5cc407 authored by Sincheol (David) Kim's avatar Sincheol (David) Kim

Merge branch '339463-child-compliance-pipelines' into 'master'

Prevent compliance pipelines from overwriting child pipelines

See merge request gitlab-org/gitlab!78878
parents 931cca5c b3dcb160
......@@ -11,6 +11,7 @@ module Gitlab
strong_memoize(:content) do
next unless available?
next unless pipeline_configuration_full_path.present?
next if command.bridge
path_file, path_project = pipeline_configuration_full_path.split('@', 2)
YAML.dump('include' => [{ 'project' => path_project, 'file' => path_file }])
......
......@@ -57,6 +57,12 @@ RSpec.describe ::Gitlab::Ci::Pipeline::Chain::Config::Content do
expect(pipeline.pipeline_config.content).to eq(content_result)
expect(command.config_content).to eq(content_result)
end
context 'when pipeline is downstream of a bridge' do
let(:command) { Gitlab::Ci::Pipeline::Chain::Command.new(project: project, content: content, source: source, bridge: create(:ci_bridge)) }
it_behaves_like 'does not include compliance pipeline configuration content'
end
end
context 'when compliance pipeline configuration is not defined' 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