The work for this task is to design this feature and present one or more proposals (before implementing).
Expected Behavior
Pipelines need to be able to express Tasks that execute conditionally, e.g.:
- If a Task fails, do X (e.g. notify slack)
- If anything in the Pipeline fails, do Y (e.g. notify slack)
- Regardless of success/failure, do Z (e.g. cleanup)
Additionally (as pointed out by @abayer !) Pipelines may need more complex logic, e.g.:
- Only run this Task/follow this branch of tasks if we're not on a pull request (e.g. only publish an image, etc., from master branch)
This means we need to be able to express conditional execution generally against the state of the Pipeline. We can start with a specific subset, e.g.:
- What Tasks have run
- What Tasks have failed
- The state of the Resources available to this Task (i.e. where you'd get information such as the branch)
Actual Behavior
At the moment, execution of a Pipeline will continue to traverse DAG the user has expressed until either the Pipeline completes or one of the Tasks fails (a step exits with a non-0 code).
Additional Info
For other designs:
This doc has a (very) rough start at expressing some of the requirements for this (note doc visible to members of knative-dev@googlegroups.com).
The work for this task is to design this feature and present one or more proposals (before implementing).
Expected Behavior
Pipelines need to be able to express Tasks that execute conditionally, e.g.:
Additionally (as pointed out by @abayer !) Pipelines may need more complex logic, e.g.:
This means we need to be able to express conditional execution generally against the state of the Pipeline. We can start with a specific subset, e.g.:
Actual Behavior
At the moment, execution of a Pipeline will continue to traverse DAG the user has expressed until either the Pipeline completes or one of the Tasks fails (a step exits with a non-0 code).
Additional Info
For other designs:
This doc has a (very) rough start at expressing some of the requirements for this (note doc visible to members of knative-dev@googlegroups.com).