-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflow final status #13967
Comments
I'm not sure I follow your request well enough. Can you write a workflow we can talk about using enhanced depends and tell us where this doesn't work for you. |
Thanks for your reply. Here is the workflow I was talking about. name: test
outputs: {}
metadata: {}
dag:
tasks:
- name: task1
arguments:
parameters: []
templateRef:
name: root
template: v1
clusterScope: true
- name: task2
arguments:
parameters: []
templateRef:
name: success
template: v1
clusterScope: true
dependencies:
- task1
when: "({{tasks.task1.status}}==Failed)"
- name: task3
arguments:
parameters: []
templateRef:
name: fail
template: v1
clusterScope: true
dependencies:
- task1
when: "({{tasks.task1.status}}==Succeeded)"
failFast: false If the root task(task1) is failed, then it will go to the leaf task(task2), and it will success. The workflow now is completed. When calculating the whole workflow status, the task3(skipped task) will be assigned to its parent status, which is failed. Hence, the whole workflow will be assigned to Failed. Is there anyway to count such scenario as succeeded? |
you could add a task 4 (simple echo) that depends on 2 or 3 succeeded, you could try use depends to make the yaml slightly cleaner |
Thanks for the suggestion. It seems that it could solve the issue. Though, it make the whole workflow weird. lol |
Summary
The current workflow using DAG template will set the skipped task as parent status. Hence if the parent task of the leaf is failed, then the leaf task will be considered as failed. Therefore, the whole workflow will be set as Failed. Handle scenario that set skipped task as succeeded.
Use Cases
Consider we have a DAG that have 3 tasks.
1 ----- 2
|
-------3
The logic is if 1 failed then run 3, if 1 succeeded run 2. Any of 2 or 3 is succeeded, we want the whole workflow as succeeded.
Message from the maintainers:
Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.
The text was updated successfully, but these errors were encountered: