-
Notifications
You must be signed in to change notification settings - Fork 222
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
TEP-0049: access aggregate status of the dag tasks from finally #371
TEP-0049: access aggregate status of the dag tasks from finally #371
Conversation
/kind tep |
/assign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excited for this feature 🎉
thanks @pritidesai!
/assign @skaegi |
0864902
to
fac9248
Compare
fac9248
to
935bba6
Compare
Looks great, @pritidesai! You requested my feedback on if this matches my expectations in tektoncd/pipeline#3806 (comment), and it does indeed 👏🏻 It may be out of scope of this TEP, but the coming "pipeline-in-pipeline" proposal may affect this proposal and vice versa. If they work together it will be a pretty cool feature though. Just checking if you thought about any potential issues with the implementation there. Finally, I just wanted to sanity check this proposal. Say we have a pipeline of tasks
Here we have a when condition that checks the status of the final task in the pipeline. If any of the tasks before task C fails, task C will not have the status of "Succeeded", so the finally will run. Thus the final task's status is sort of an aggregate of the pipeline's status. This was not immediately obvious to me earlier, but it seems to work. I'm not sure if this misses any usecases (what about forking pipelines for example), but it's fair to consider it. In any case this proposal provides a nice a nice shorthand and makes it easier to move tasks around. |
Thanks @esphen ❤️
This workaround would not work for the following pipeline with multiple last tasks:
Thank you 👍 |
Proposal to retrieve aggregate status of dag tasks in a finally task.
935bba6
to
469e655
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
finally: | ||
- name: notify-any-failure # executed only when one of the dag tasks fail | ||
when: | ||
- input: $(tasks.status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can maybe leave this to the implementation, but we probably want to put this on the pipeline
not on tasks
like pipeline.status
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerop, pierretasci The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
TEP-0028 implemented params such as
$(tasks.<pipelineTask>.status)
to access the execution status of a dag task from the finally section. This works great for a pipeline where afinally
task depends on the execution status of an individualdag
task. We have discovered additional use cases where afinally
task needs to be executed if ANY one of thedag
tasks fail.This TEP is proposing an additional variable
$(tasks.status)
to access aggregate status of thedag
tasks.Related issues and PR:
tektoncd/pipeline#3806
tektoncd/pipeline#1020 (comment)
tektoncd/pipeline#3738 (comment)