Skip to content

Commit

Permalink
debug #269 pattern handling, fix for last task config repopulation on…
Browse files Browse the repository at this point in the history
… workflow view
  • Loading branch information
wpbonelli committed Feb 11, 2022
1 parent 62b2f27 commit 02347ac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
22 changes: 11 additions & 11 deletions plantit/front_end/src/components/workflows/workflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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="
Expand Down Expand Up @@ -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 (
Expand Down
23 changes: 12 additions & 11 deletions plantit/plantit/task_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
})

Expand Down
2 changes: 1 addition & 1 deletion plantit/plantit/tasks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 02347ac

Please sign in to comment.