Commit 1501b1ab authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Fixed bug when a pipeline for latest SHA does not exist

parent 869508341889
......@@ -25,6 +25,11 @@ def ci_label_for_status(status)
end
end
def ci_status_for_statuseable(subject)
status = subject.try(:status) || 'not found'
status.humanize
end
def ci_icon_for_status(status)
icon_name =
case status
......
......@@ -42,7 +42,7 @@
- unless pipeline.latest?
- latest_pipeline = @project.pipeline_for(branch.name)
%li
%span= latest_pipeline.status.humanize
%span= ci_status_for_statuseable(latest_pipeline)
%li.dropdown-header Previous Artifacts
- artifacts.each do |job|
%li
......
......@@ -22,7 +22,7 @@
- unless pipeline.latest?
- latest_pipeline = @project.pipeline_for(@ref)
%li
%span= latest_pipeline.status.humanize
%span= ci_status_for_statuseable(latest_pipeline)
%li.dropdown-header Previous Artifacts
- artifacts.each do |job|
%li
......
......@@ -33,7 +33,7 @@
- unless pipeline.latest?
- latest_pipeline = @project.pipeline_for(ref)
%li
%span= latest_pipeline.status.humanize
%span= ci_status_for_statuseable(latest_pipeline)
%li.dropdown-header Previous Artifacts
- artifacts.each do |job|
%li
......
......@@ -20,7 +20,7 @@
- unless pipeline.latest?
- latest_pipeline = project.pipeline_for(ref)
%li
%span= latest_pipeline.status.humanize
%span= ci_status_for_statuseable(latest_pipeline)
%li.dropdown-header Previous Artifacts
- artifacts.each do |job|
%li
......
Markdown is supported
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