Skip to content
代码片段 群组 项目
未验证 提交 c73b27a1 编辑于 作者: Avielle Wolfe's avatar Avielle Wolfe 提交者: GitLab
浏览文件

Merge branch '523238-skip-saving-pipeline-config-when-using-inputs' into 'master'

Skip saving pipeline config when using inputs

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/184318



Merged-by: default avatarAvielle Wolfe <awolfe@gitlab.com>
Approved-by: default avatarLaura Montemayor <lmontemayor@gitlab.com>
Approved-by: default avatarAvielle Wolfe <awolfe@gitlab.com>
Reviewed-by: default avatarFurkan Ayhan <furkanayhn@gmail.com>
Co-authored-by: default avatarFurkan Ayhan <furkanayhn@gmail.com>
No related branches found
No related tags found
无相关合并请求
......@@ -11,7 +11,7 @@ class Content < Chain::Base
def perform!
if pipeline_config&.exists?
@pipeline.build_pipeline_config(content: pipeline_config.content, project_id: @pipeline.project_id)
build_pipeline_config
@command.config_content = pipeline_config.content
@pipeline.config_source = pipeline_config.source
@command.pipeline_config = pipeline_config
......@@ -39,6 +39,16 @@ def pipeline_config
)
end
end
def build_pipeline_config
# Inputs may contain secrets, so we don't want to save them in the DB as plain text.
# It's safe to not save a pipeline-config because we are currently considering
# dropping the `p_ci_pipelines_config` table because it's not used anywhere.
# https://gitlab.com/gitlab-org/gitlab/-/issues/520828#note_2364398251
return if @command.inputs.present?
@pipeline.build_pipeline_config(content: pipeline_config.content, project_id: @pipeline.project_id)
end
end
end
end
......
......@@ -177,7 +177,7 @@
subject.perform!
expect(pipeline.config_source).to eq 'repository_source'
expect(pipeline.pipeline_config.content).to eq(config_content_result)
expect(pipeline.pipeline_config).to be_nil
expect(command.config_content).to eq(config_content_result)
expect(command.pipeline_config.internal_include_prepended?).to eq(true)
expect(command.pipeline_config.inputs_for_pipeline_creation).to eq({})
......@@ -244,7 +244,7 @@
subject.perform!
expect(pipeline.config_source).to eq 'parameter_source'
expect(pipeline.pipeline_config.content).to eq(content)
expect(pipeline.pipeline_config).to be_nil
expect(command.config_content).to eq(content)
expect(command.pipeline_config.internal_include_prepended?).to eq(false)
expect(command.pipeline_config.inputs_for_pipeline_creation).to eq(inputs)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册