diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-01 11:52:43 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-01 11:52:43 +0000 |
commit | 430576c997e7cfc61b003cf6dbf12817ef899eef (patch) | |
tree | 7884f12a7837f5029b971e04121a66fb81ffdb34 /app | |
parent | afbc608ba558c62cc0475dfb95df3f375049973b (diff) | |
download | gitlab-ce-430576c997e7cfc61b003cf6dbf12817ef899eef.tar.gz |
Add latest changes from gitlab-org/security/gitlab@15-5-stable-ee
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/pipelines_controller.rb | 3 | ||||
-rw-r--r-- | app/services/ci/list_config_variables_service.rb | 11 |
2 files changed, 7 insertions, 7 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index 2a8f7171f9c..01f7bb9e2cf 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -239,8 +239,7 @@ class Projects::PipelinesController < Projects::ApplicationController def config_variables respond_to do |format| format.json do - project = @project.uses_external_project_ci_config? ? @project.ci_config_external_project : @project - result = Ci::ListConfigVariablesService.new(project, current_user).execute(params[:sha]) + result = Ci::ListConfigVariablesService.new(@project, current_user).execute(params[:sha]) result.nil? ? head(:no_content) : render(json: result) end diff --git a/app/services/ci/list_config_variables_service.rb b/app/services/ci/list_config_variables_service.rb index c791a89b804..3890882b3d4 100644 --- a/app/services/ci/list_config_variables_service.rb +++ b/app/services/ci/list_config_variables_service.rb @@ -22,12 +22,13 @@ module Ci end def calculate_reactive_cache(sha) - config = project.ci_config_for(sha) - return {} unless config + config = ::Gitlab::Ci::ProjectConfig.new(project: project, sha: sha) - result = Gitlab::Ci::YamlProcessor.new(config, project: project, - user: current_user, - sha: sha).execute + return {} unless config.exists? + + result = Gitlab::Ci::YamlProcessor.new(config.content, project: project, + user: current_user, + sha: sha).execute result.valid? ? result.variables_with_data : {} end |