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>2019-10-17 21:08:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 21:08:05 +0300
commit184c2ced0761bd8dd7032619d16d3983fed7944a (patch)
treecc82b32ee7c1797509da3cf384617e4ffa2e1733 /app/serializers/build_details_entity.rb
parent238d22c07218adf2b8f3db630ee8b74ca6f29df5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers/build_details_entity.rb')
-rw-r--r--app/serializers/build_details_entity.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/serializers/build_details_entity.rb b/app/serializers/build_details_entity.rb
index 0c754157267..480a8cab6ff 100644
--- a/app/serializers/build_details_entity.rb
+++ b/app/serializers/build_details_entity.rb
@@ -121,4 +121,28 @@ class BuildDetailsEntity < JobEntity
def can_admin_build?
can?(request.current_user, :admin_build, project)
end
+
+ def callout_message
+ return super unless build.failure_reason.to_sym == :missing_dependency_failure
+
+ docs_url = "https://docs.gitlab.com/ce/ci/yaml/README.html#dependencies"
+
+ [
+ failure_message.html_safe,
+ help_message(docs_url).html_safe
+ ].join("<br />")
+ end
+
+ def invalid_dependencies
+ build.invalid_dependencies.map(&:name).join(', ')
+ end
+
+ def failure_message
+ _("This job depends on other jobs with expired/erased artifacts: %{invalid_dependencies}") %
+ { invalid_dependencies: invalid_dependencies }
+ end
+
+ def help_message(docs_url)
+ _("Please refer to <a href=\"%{docs_url}\">%{docs_url}</a>") % { docs_url: docs_url }
+ end
end