Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-04 21:12:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-04 21:12:46 +0300
commit8a0a54ab92c509c6b480059a5f2730869c99d454 (patch)
treefd963a83cd9991663b525e485cae8af8b0851b88 /app/presenters/commit_status_presenter.rb
parente9ab4187093f05b873b32045295eeb580c97cdce (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/presenters/commit_status_presenter.rb')
-rw-r--r--app/presenters/commit_status_presenter.rb21
1 files changed, 19 insertions, 2 deletions
diff --git a/app/presenters/commit_status_presenter.rb b/app/presenters/commit_status_presenter.rb
index 2d524fd611e..7919e501bf0 100644
--- a/app/presenters/commit_status_presenter.rb
+++ b/app/presenters/commit_status_presenter.rb
@@ -28,7 +28,12 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated
ci_quota_exceeded: 'No more CI minutes available',
no_matching_runner: 'No matching runner available',
trace_size_exceeded: 'The job log size limit was reached',
- builds_disabled: 'The CI/CD is disabled for this project'
+ 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.'
+ }.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' }
}.freeze
private_constant :CALLOUT_FAILURE_MESSAGES
@@ -40,7 +45,19 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated
end
def callout_failure_message
- self.class.callout_failure_messages.fetch(failure_reason.to_sym)
+ message = self.class.callout_failure_messages.fetch(failure_reason.to_sym)
+
+ if doc = TROUBLESHOOTING_DOC[failure_reason.to_sym]
+ message += " #{help_page_link(doc[:path], doc[:anchor])}"
+ end
+
+ message
+ end
+
+ private
+
+ def help_page_link(path, anchor)
+ ActionController::Base.helpers.link_to('How do I fix it?', help_page_path(path, anchor: anchor))
end
end