Fail the validation workflows when sending a "FAILED" message
When Mistral workflows execute a second workflow (a sub-workflow execution), the parent workflow can't easily determine if sub-workflow failed. This is because the failure is communicated via a Zaqar message only and when a workflow ends with a successful Zaqar message it appears have been successful. This problem surfaces because parent workflows should have an "on-error" attribute but it is never called, as the workflow doesn't error. This change marks the workflow as failed if the message has the status "FAILED". Now when a sub-workflow fails, the task that called it should have the on-error triggered. Previously it would always go to on-success. Change-Id: I2170afac89e8261c1e2289da8e9220694fadbad0 Related-Bug: #1651704
This commit is contained in:
parent
a4592519e7
commit
6051a7446b
@ -59,6 +59,11 @@ workflows:
|
|||||||
stdout: <% $.stdout %>
|
stdout: <% $.stdout %>
|
||||||
stderr: <% $.stderr %>
|
stderr: <% $.stderr %>
|
||||||
execution: <% execution() %>
|
execution: <% execution() %>
|
||||||
|
on-success:
|
||||||
|
- fail_workflow: <% $.get('status') = "FAILED" %>
|
||||||
|
|
||||||
|
fail_workflow:
|
||||||
|
action: std.fail
|
||||||
|
|
||||||
run_validations:
|
run_validations:
|
||||||
input:
|
input:
|
||||||
@ -109,6 +114,11 @@ workflows:
|
|||||||
plan: <% $.plan %>
|
plan: <% $.plan %>
|
||||||
status: <% $.get('status', 'SUCCESS') %>
|
status: <% $.get('status', 'SUCCESS') %>
|
||||||
execution: <% execution() %>
|
execution: <% execution() %>
|
||||||
|
on-success:
|
||||||
|
- fail_workflow: <% $.get('status') = "FAILED" %>
|
||||||
|
|
||||||
|
fail_workflow:
|
||||||
|
action: std.fail
|
||||||
|
|
||||||
run_groups:
|
run_groups:
|
||||||
input:
|
input:
|
||||||
@ -167,6 +177,11 @@ workflows:
|
|||||||
plan: <% $.plan %>
|
plan: <% $.plan %>
|
||||||
status: <% $.get('status', 'SUCCESS') %>
|
status: <% $.get('status', 'SUCCESS') %>
|
||||||
execution: <% execution() %>
|
execution: <% execution() %>
|
||||||
|
on-success:
|
||||||
|
- fail_workflow: <% $.get('status') = "FAILED" %>
|
||||||
|
|
||||||
|
fail_workflow:
|
||||||
|
action: std.fail
|
||||||
|
|
||||||
list:
|
list:
|
||||||
input:
|
input:
|
||||||
|
Loading…
Reference in New Issue
Block a user