diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-12 15:09:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-12 15:09:39 +0300 |
commit | f81141c25d0dd79de8c07559bf268cb6e0d287d3 (patch) | |
tree | a0f700b90845f738cc2037cbbfb7a980c36137ac /app/helpers/ci | |
parent | 12de063de4663766a43d6c3e0883a686d66ab401 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/ci')
-rw-r--r-- | app/helpers/ci/jobs_helper.rb | 1 | ||||
-rw-r--r-- | app/helpers/ci/pipeline_editor_helper.rb | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/helpers/ci/jobs_helper.rb b/app/helpers/ci/jobs_helper.rb index 23f2a082a68..882302f05ad 100644 --- a/app/helpers/ci/jobs_helper.rb +++ b/app/helpers/ci/jobs_helper.rb @@ -9,7 +9,6 @@ module Ci "artifact_help_url" => help_page_path('user/gitlab_com/index.html', anchor: 'gitlab-cicd'), "deployment_help_url" => help_page_path('user/project/clusters/index.html', anchor: 'troubleshooting'), "runner_settings_url" => project_runners_path(@build.project, anchor: 'js-runners-settings'), - "variables_settings_url" => project_variables_path(@build.project, anchor: 'js-cicd-variables-settings'), "page_path" => project_job_path(@project, @build), "build_status" => @build.status, "build_stage" => @build.stage, diff --git a/app/helpers/ci/pipeline_editor_helper.rb b/app/helpers/ci/pipeline_editor_helper.rb index 1a30b6bed08..d441ffbb853 100644 --- a/app/helpers/ci/pipeline_editor_helper.rb +++ b/app/helpers/ci/pipeline_editor_helper.rb @@ -9,7 +9,9 @@ module Ci end def js_pipeline_editor_data(project) - commit_sha = project.commit ? project.commit.sha : '' + initial_branch = params[:branch_name] + latest_commit = project.repository.commit(initial_branch) || project.commit + commit_sha = latest_commit ? latest_commit.sha : '' { "ci-config-path": project.ci_config_path_or_default, "ci-examples-help-page-path" => help_page_path('ci/examples/index'), @@ -17,11 +19,11 @@ module Ci "commit-sha" => commit_sha, "default-branch" => project.default_branch_or_main, "empty-state-illustration-path" => image_path('illustrations/empty-state/empty-dag-md.svg'), - "initial-branch-name": params[:branch_name], + "initial-branch-name" => initial_branch, "lint-help-page-path" => help_page_path('ci/lint', anchor: 'validate-basic-logic-and-syntax'), "needs-help-page-path" => help_page_path('ci/yaml/README', anchor: 'needs'), "new-merge-request-path" => namespace_project_new_merge_request_path, - "pipeline_etag" => project.commit ? graphql_etag_pipeline_sha_path(commit_sha) : '', + "pipeline_etag" => latest_commit ? graphql_etag_pipeline_sha_path(commit_sha) : '', "pipeline-page-path" => project_pipelines_path(project), "project-path" => project.path, "project-full-path" => project.full_path, |