12840: Report pipeline state=Failed on job creation failure.
authorTom Clegg <tclegg@veritasgenetics.com>
Thu, 8 Feb 2018 19:04:37 +0000 (14:04 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Thu, 8 Feb 2018 19:04:37 +0000 (14:04 -0500)
There's no failed job in this case, because there's no job, but
a-r-p-i does set components_summary.failed > 0.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

apps/workbench/app/models/pipeline_instance_work_unit.rb

index de706896562c6f6f27c30eedd8432a32537c2f8b..a9bc9cfb5941d3ee559d6dab0b4131df93f2d48d 100644 (file)
@@ -61,11 +61,14 @@ class PipelineInstanceWorkUnit < ProxyWorkUnit
   end
 
   def state_label
-    # Show "Cancelled" instead of "Failed" if there are no failed
-    # components. #12840
     if get(:state) != "Failed"
       return super
     end
+    if get(:components_summary).andand[:failed].andand > 0
+      return super
+    end
+    # Show "Cancelled" instead of "Failed" if there are no failed
+    # components. #12840
     get(:components).each do |_, c|
       jstate = c[:job][:state] rescue nil
       if jstate == "Failed"