diff options
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/ci/pipeline_presenter.rb | 2 | ||||
-rw-r--r-- | app/presenters/commit_status_presenter.rb | 7 | ||||
-rw-r--r-- | app/presenters/deployments/deployment_presenter.rb | 17 | ||||
-rw-r--r-- | app/presenters/project_presenter.rb | 2 |
4 files changed, 25 insertions, 3 deletions
diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb index 887980430f4..32a7d205f46 100644 --- a/app/presenters/ci/pipeline_presenter.rb +++ b/app/presenters/ci/pipeline_presenter.rb @@ -49,7 +49,7 @@ module Ci { merge_train: s_('Pipeline|Merge train pipeline'), merged_result: s_('Pipeline|Merged result pipeline'), - detached: s_('Pipeline|Detached merge request pipeline') + detached: s_('Pipeline|Merge request pipeline') }.freeze end diff --git a/app/presenters/commit_status_presenter.rb b/app/presenters/commit_status_presenter.rb index 815a4da25ab..059d6d06be2 100644 --- a/app/presenters/commit_status_presenter.rb +++ b/app/presenters/commit_status_presenter.rb @@ -26,6 +26,7 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated downstream_pipeline_creation_failed: 'The downstream pipeline could not be created', secrets_provider_not_found: 'The secrets provider can not be found', reached_max_descendant_pipelines_depth: 'You reached the maximum depth of child pipelines', + reached_max_pipeline_hierarchy_size: 'The downstream pipeline tree is too large', project_deleted: 'The job belongs to a deleted project', user_blocked: 'The user who created this job is blocked', ci_quota_exceeded: 'No more CI minutes available', @@ -34,11 +35,13 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated builds_disabled: 'The CI/CD is disabled for this project', environment_creation_failure: 'This job could not be executed because it would create an environment with an invalid parameter.', deployment_rejected: 'This deployment job was rejected.', - ip_restriction_failure: "This job could not be executed because group IP address restrictions are enabled, and the runner's IP address is not in the allowed range." + ip_restriction_failure: "This job could not be executed because group IP address restrictions are enabled, and the runner's IP address is not in the allowed range.", + failed_outdated_deployment_job: 'The deployment job is older than the latest deployment, and therefore failed.' }.freeze TROUBLESHOOTING_DOC = { - environment_creation_failure: { path: 'ci/environments/index', anchor: 'a-deployment-job-failed-with-this-job-could-not-be-executed-because-it-would-create-an-environment-with-an-invalid-parameter-error' } + environment_creation_failure: { path: 'ci/environments/index', anchor: 'a-deployment-job-failed-with-this-job-could-not-be-executed-because-it-would-create-an-environment-with-an-invalid-parameter-error' }, + failed_outdated_deployment_job: { path: 'ci/environments/deployment_safety', anchor: 'skip-outdated-deployment-jobs' } }.freeze private_constant :CALLOUT_FAILURE_MESSAGES diff --git a/app/presenters/deployments/deployment_presenter.rb b/app/presenters/deployments/deployment_presenter.rb new file mode 100644 index 00000000000..5ef6fcff974 --- /dev/null +++ b/app/presenters/deployments/deployment_presenter.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Deployments + class DeploymentPresenter < Gitlab::View::Presenter::Delegated + presents ::Deployment, as: :deployment + + delegator_override :tags + def tags + super.map do |tag| + { + name: tag, + path: "tags/#{tag}" + } + end + end + end +end diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb index 209f016dc6b..0be13197343 100644 --- a/app/presenters/project_presenter.rb +++ b/app/presenters/project_presenter.rb @@ -317,6 +317,8 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated end def autodevops_anchor_data(show_auto_devops_callout: false) + return unless project.feature_available?(:builds, current_user) + if current_user && can?(current_user, :admin_pipeline, project) && repository.gitlab_ci_yml.blank? && !show_auto_devops_callout if auto_devops_enabled? AnchorData.new(false, |