From 02347acbf430928d7d0a9708e7243d3a4af66bf2 Mon Sep 17 00:00:00 2001 From: w-bonelli Date: Fri, 11 Feb 2022 12:53:22 -0500 Subject: [PATCH] debug #269 pattern handling, fix for last task config repopulation on workflow view --- .../src/components/workflows/workflow.vue | 22 +++++++++--------- plantit/plantit/task_lifecycle.py | 23 ++++++++++--------- plantit/plantit/tasks/models.py | 2 +- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/plantit/front_end/src/components/workflows/workflow.vue b/plantit/front_end/src/components/workflows/workflow.vue index 68de2f0e..9f8ab270 100644 --- a/plantit/front_end/src/components/workflows/workflow.vue +++ b/plantit/front_end/src/components/workflows/workflow.vue @@ -1393,15 +1393,15 @@ min-width: 60rem; " v-if=" - workflow !== + getWorkflow !== null && getWorkflow .config .input !== undefined && - input.kind !== + getWorkflow.config.input.kind !== undefined && - input.kind !== + getWorkflow.config.input.kind !== null " :bg-variant=" @@ -4273,16 +4273,16 @@ export default { if ('last_config' in this.getWorkflow) { let lastConfig = this.getWorkflow['last_config']; this.params = - lastConfig.parameters !== undefined - ? lastConfig.parameters + lastConfig.workflow.parameters !== undefined + ? lastConfig.workflow.parameters : this.params; - if (lastConfig.input !== undefined) - this.input = lastConfig.input; - if (lastConfig.output !== undefined) - this.output = lastConfig.output; + if (lastConfig.workflow.input !== undefined) + this.input = lastConfig.workflow.input; + if (lastConfig.workflow.output !== undefined) + this.output = lastConfig.workflow.output; if (lastConfig.agent !== undefined) - // make sure the agent used in the last submission still exist - if (this.getAgents.includes(this.selectedAgent)) this.selectedAgent = lastConfig.agent; + // make sure the agent used in the last submission still exists + if (this.getAgents.map(a => a.name).includes(lastConfig.agent)) this.selectedAgent = lastConfig.agent; } if ( diff --git a/plantit/plantit/task_lifecycle.py b/plantit/plantit/task_lifecycle.py index f0da3a38..cb743188 100644 --- a/plantit/plantit/task_lifecycle.py +++ b/plantit/plantit/task_lifecycle.py @@ -451,7 +451,7 @@ def list_result_files(task: Task) -> List[dict]: for name in expected_names: if name in names: exists = True - seen.append(output['name']) + seen.append(name) else: exists = False @@ -481,21 +481,22 @@ def list_result_files(task: Task) -> List[dict]: any_matched = False for name in names: # if this filename matches a pattern and hasn't already been included by name, add it to the list - if not any(s == name for s in seen): - results.append({ - 'name': name, - 'path': join(workdir, name), - 'exists': True - }) + if pattern in name: + if not any(s == name for s in seen): + results.append({ + 'name': name, + 'path': join(workdir, name), + 'exists': True + }) - # if the pattern matched something already included by name, don't count it as missing - any_matched = True + # if the pattern matched something already included by name, don't count it as missing + any_matched = True # otherwise report the pattern missing if not any_matched: results.append({ - 'name': name, - 'path': join(workdir, pattern), + 'name': f"*.{pattern}", + 'path': join(workdir, f"*.{pattern}"), 'exists': False }) diff --git a/plantit/plantit/tasks/models.py b/plantit/plantit/tasks/models.py index e185175e..704e9627 100644 --- a/plantit/plantit/tasks/models.py +++ b/plantit/plantit/tasks/models.py @@ -88,7 +88,7 @@ class Meta: @property def is_success(self): - return self.status == TaskStatus.SUCCESS or self.job_status == 'SUCCESS' or self.job_status == 'COMPLETED' + return self.status == TaskStatus.SUCCESS # or self.job_status == 'SUCCESS' or self.job_status == 'COMPLETED' @property def is_failure(self):