X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1c36703db22a4695f0a2aebaa3ffbd5d8d64997f..068e72307f9ce91538e45cb461b99cf92d2f5666:/apps/workbench/app/models/pipeline_instance_work_unit.rb diff --git a/apps/workbench/app/models/pipeline_instance_work_unit.rb b/apps/workbench/app/models/pipeline_instance_work_unit.rb index 889fa1a7f3..a9bc9cfb59 100644 --- a/apps/workbench/app/models/pipeline_instance_work_unit.rb +++ b/apps/workbench/app/models/pipeline_instance_work_unit.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class PipelineInstanceWorkUnit < ProxyWorkUnit def children return @my_children if @my_children @@ -18,10 +22,10 @@ class PipelineInstanceWorkUnit < ProxyWorkUnit if job[:uuid] and jobs[job[:uuid]] items << jobs[job[:uuid]].work_unit(name) else - items << JobWorkUnit.new(job, name) + items << JobWorkUnit.new(job, name, uuid) end else - items << JobWorkUnit.new(c, name) + items << JobWorkUnit.new(c, name, uuid) end else @unreadable_children = true @@ -51,4 +55,26 @@ class PipelineInstanceWorkUnit < ProxyWorkUnit def title "pipeline" end + + def template_uuid + get(:pipeline_template_uuid) + end + + def state_label + 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" + return "Failed" + end + end + "Cancelled" + end end