-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support skipping single task only #3176
Conversation
/kind feature |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
however, it seems that need to look into what this means for skipping ordering-dependent tasks as specified by a potential solution could be introducing a field - similar to /hold |
@jerop i think for now it's fine to treat runAfter as the same for all circumstances - however if you wanted to tackle #3109 before this that'd be cool too. basically i dont think either needs to wait on the other this would only be a problem for a fairly specific use case:
imo (2) is actually an error - and i think if you did the same thing with a result, we'd fail it on validation, is that right? So not having #3109 before doing this would mean that there is an error case we aren't able to catch with validation. Definitely it would be better to be able to catch this, but I don't feel like that needs to block this, what do you think? |
The following is the coverage report on the affected files.
|
@bobcatfish thank you for clarifying the use case for |
/hold cancel |
The following is the coverage report on the affected files.
|
Will have to be little more careful here. It sounds like inconsistent behavior for resource dependent task vs ordering dependent task. Also a task could have both runAfter and task result and would be skipped (with these changes) due to resource dependency. The way finally task with resource dependency is being handled is that final task is at least attempted but would fail at the param validation since the task result does not exist. But when we add param level defaults for task results, that final task would be executed with the default value. Unfortunately I dont have any ideas how to fix this inconsistency other than allowing to specify
The long term solution is to support schema validation for params. |
thank you for the review @pritidesai 😊
does this refer to inconsistency in to how we handle the dependencies here compared to finally tasks or inconsistency in how we handle the different kinds of dependencies here by itself?
when expressions use params from the pipeline level and use task results directly (not through params in the task level) -- does this mean we'd have to support default task results in when expressions as well (in addition to params)? (an alternative could be default results in the result-producing task) we proposed that setting |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbwsg 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 |
The following is the coverage report on the affected files.
|
/retest |
The following is the coverage report on the affected files.
|
When `WhenExpressions` evaluate to `False`, the `Task` and its branch (of dependent `Tasks`) will be skipped by default while the rest of the `Pipeline` will execute. A `Task` branch is made up of dependent `Tasks`, where there are two types of dependencies: - _Resource dependency_: based on resources needed from parent `Task`, which includes [`Results`](#using-results) and [`Resources`](#specifying-resources). - _Ordering dependency_: based on [`runAfter`](#using-the-runafter-parameter) which provides sequencing of `Tasks` when there may not be resource dependencies. In some use cases, when `WhenExpressions` evaluate to `False`, users need to skip the guarded `Task` only and allow ordering-dependent `Tasks` to execute. In `Tasks` guarded using `WhenExpressions` and that have ordering dependencies only, use `whenSkipped` to specify what happens when the guarded `Task` is skipped. The `whenSkipped` takes either `SkipBranch` or `RunBranch` policies. To allow execution of ordering-dependent `Tasks`, set `whenSkipped` to `RunBranch` in the guarded parent task. If neither `SkipBranch` nor `RunBranch` is specified, the default one is `SkipBranch`. However, setting `whenSkipped` in `Tasks` without `WhenExpressions` or `Tasks` with resource dependencies is invalid and will cause `Pipeline` validation errors.
The following is the coverage report on the affected files.
|
/hold |
What's the status on this? Is this supposed to land in the next release? FWIW, I ran into this PR because from reading the current docs, I assumed that |
The following is the coverage report on the affected files.
|
@jerop: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@jerop: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
new proposal accepted: https://github.com/tektoncd/community/blob/main/teps/0059-skipping-strategies.md |
Changes
When
WhenExpressions
evaluate to False, the guardedTask
andits branch (dependent
Tasks
) are skippedA
Task
is dependent on and in the branch of anotherTask
as specifiedby ordering using
runAfter
or by resources usingResults
,Workspaces
and
Resources
In some use cases, when
WhenExpressions
evaluate toFalse
,users need to skip the guarded
Task
only and allow ordering-dependentTasks
to executeWhen
WhenExpressions
evaluate toFalse
, it is possible to allow forexecution of ordering-dependent
Tasks
as specified byrunAfter
usingthe
whenSkipped
field by setting it torunBranch
.However, setting
whenSkipped
inTasks
withoutWhenExpressions
or
Tasks
with resource dependencies is invalid, and will causePipeline
validation errors. This ensures consistency in executing orskipping subsequent tasks.
Further details in TEP
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task to build and release this image.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes