diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-04 12:08:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-04 12:08:25 +0000 |
commit | 7928b47c8e06c1ac3f63d321a73dd527aea4e4c3 (patch) | |
tree | dff8cfaaae2fa981b6d95a866ebd1f7b6b86838c /app/helpers/ci | |
parent | 0d8bcdf77d609b3624541de767a0129aa0b7e8d2 (diff) | |
download | gitlab-ce-7928b47c8e06c1ac3f63d321a73dd527aea4e4c3.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/ci')
-rw-r--r-- | app/helpers/ci/pipeline_editor_helper.rb | 12 | ||||
-rw-r--r-- | app/helpers/ci/pipelines_helper.rb | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/app/helpers/ci/pipeline_editor_helper.rb b/app/helpers/ci/pipeline_editor_helper.rb index d00301678dd..99a92ba9b59 100644 --- a/app/helpers/ci/pipeline_editor_helper.rb +++ b/app/helpers/ci/pipeline_editor_helper.rb @@ -11,7 +11,6 @@ module Ci def js_pipeline_editor_data(project) initial_branch = params[:branch_name] latest_commit = project.repository.commit(initial_branch) || project.commit - commit_sha = latest_commit ? latest_commit.sha : '' total_branches = project.repository_exists? ? project.repository.branch_count : 0 { @@ -27,17 +26,26 @@ module Ci "lint-unavailable-help-page-path" => help_page_path('ci/pipeline_editor/index', anchor: 'configuration-validation-currently-not-available-message'), "needs-help-page-path" => help_page_path('ci/yaml/index', anchor: 'needs'), "new-merge-request-path" => namespace_project_new_merge_request_path, - "pipeline_etag" => latest_commit ? graphql_etag_pipeline_sha_path(commit_sha) : '', + "pipeline_etag" => latest_commit ? graphql_etag_pipeline_sha_path(latest_commit.sha) : '', "pipeline-page-path" => project_pipelines_path(project), "project-path" => project.path, "project-full-path" => project.full_path, "project-namespace" => project.namespace.full_path, "simulate-pipeline-help-page-path" => help_page_path('ci/pipeline_editor/index', anchor: 'simulate-a-cicd-pipeline'), "total-branches" => total_branches, + "uses-external-config" => uses_external_config?(project) ? 'true' : 'false', "validate-tab-illustration-path" => image_path('illustrations/project-run-CICD-pipelines-sm.svg'), "yml-help-page-path" => help_page_path('ci/yaml/index') } end + + private + + def uses_external_config?(project) + ci_config_source = Gitlab::Ci::ProjectConfig.new(project: project, sha: nil).source + + [:external_project_source, :remote_source].include?(ci_config_source) + end end end diff --git a/app/helpers/ci/pipelines_helper.rb b/app/helpers/ci/pipelines_helper.rb index a67771116b9..c93c8dd8d76 100644 --- a/app/helpers/ci/pipelines_helper.rb +++ b/app/helpers/ci/pipelines_helper.rb @@ -69,7 +69,8 @@ module Ci end def has_pipeline_badges?(pipeline) - pipeline.child? || + pipeline.schedule? || + pipeline.child? || pipeline.latest? || pipeline.merge_train_pipeline? || pipeline.has_yaml_errors? || |