Skip to content
Snippets Groups Projects
Commit f8f283b2 authored by Erick Bajao's avatar Erick Bajao
Browse files

Quick spike of how to show a bit more detailed missing dependency message

parent 17219cf5
No related merge requests found
......@@ -25,6 +25,8 @@ def self.callout_failure_messages
end
def callout_failure_message
return missing_dependencies_message if failure_reason.to_sym == :missing_dependency_failure
self.class.callout_failure_messages.fetch(failure_reason.to_sym)
end
......@@ -35,4 +37,17 @@ def recoverable?
def unrecoverable?
script_failure? || missing_dependency_failure? || archived_failure?
end
private
def missing_dependencies_message
[
"There were missing dependencies from the following stage(s): #{invalid_stages}",
"Please refer to https://docs.gitlab.com/ce/ci/yaml/README.html#when-a-dependent-job-will-fail"
].join("\n")
end
def invalid_stages
dependencies.reject(&:valid_dependency?).map(&:name).join(', ')
end
end
......@@ -56,6 +56,10 @@ class BuildDetailsEntity < JobEntity
expose :failure_reason, if: -> (*) { build.failed? }
expose :missing_dependencies, using: BuildDetailsEntity do |b|
b.dependencies.reject(&:valid_dependency?)
end
expose :terminal_path, if: -> (*) { can_create_build_terminal? } do |build|
terminal_project_job_path(project, build)
end
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment