X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e2a7fe50d3b6e98b7f549c78c4f91dbe4066ddbb..61cd57499905e8e8cca07c774d1bf8c6bfa069a7:/services/api/app/models/pipeline_instance.rb diff --git a/services/api/app/models/pipeline_instance.rb b/services/api/app/models/pipeline_instance.rb index 185bf02d41..f2c930c43b 100644 --- a/services/api/app/models/pipeline_instance.rb +++ b/services/api/app/models/pipeline_instance.rb @@ -8,7 +8,7 @@ class PipelineInstance < ArvadosModel belongs_to :pipeline_template, :foreign_key => :pipeline_template_uuid, :primary_key => :uuid before_validation :bootstrap_components - before_validation :update_success + before_validation :update_state before_validation :verify_status before_create :set_state_before_save before_save :set_state_before_save @@ -17,6 +17,7 @@ class PipelineInstance < ArvadosModel t.add :pipeline_template_uuid t.add :pipeline_template, :if => :pipeline_template t.add :name + t.add :description t.add :components t.add :dependencies t.add :properties @@ -78,7 +79,7 @@ class PipelineInstance < ArvadosModel else row << 0.0 if step['failed'] - self.success = false + self.state = Failed end end row << (step['warehousejob']['id'] rescue nil) @@ -109,9 +110,9 @@ class PipelineInstance < ArvadosModel end end - def update_success + def update_state if components and progress_ratio == 1.0 - self.success = true + self.state = Complete end end @@ -158,9 +159,9 @@ class PipelineInstance < ArvadosModel end def set_state_before_save - if self.components_look_ready? && (!self.state || self.state == New) - self.state = Ready - end + if self.components_look_ready? && (!self.state || self.state == New) + self.state = Ready + end end end