-
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
Conditions Beta: When Expressions #3135
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.
|
The following is the coverage report on the affected files.
|
Sorry @jerop have been slow on reviewing your changes. Just started playing with them. Ran a simple PipelineRun with one task with
But the way users might start using
@bobcatfish how about changing this status |
@pritidesai thanks for looking into this! currently, knative only provides I've now updated it to our own status
That gives this result in your example:
@pritidesai @bobcatfish what do you think? will add what we decide on about the status to the TEP |
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.
Looking great! The main thing I'm wondering about right now is working out what exactly we need to include in the Status
@pritidesai @jerop that's a good point about "failed". one option would be implementing this PR with the same behavior as we use for existing Conditions, and then separately deciding how we want to handle this in the future? that would mean the potential for a backwards incompatible change though. i dont want to change the behavior of our existing condition - one reason we implemented it the way we did was to satisfy knative duck typing if anything, id like to see the addition of a new condition specifically for skipped. and perhaps in that case we do not include ConditionSucceeded at all? the fact that we have a few options here makes me want to suggest that we separate that discussion from this PR if we can - i could also see making a separate TEP about it to make sure we explore the options well |
I am afraid of the backwards incompatibility playing role here specially if the current design lands in a release as is (without any updates to the status).
Yup, I am on same page, keep the condition behavior as is.
Making separate TEP make sense but again concerned about backward compatibility. One quicker way to address this would be to not include the Pipelinerun status has a count of that skipped task:
And describing PR does not list any taskruns:
But one drawback to this approach is nothing included in the
|
Maybe we can discuss in the API WG on Monday and find a way to unblock this PR at least - @imjasonh had suggested that having Succeeded:True in this case, regardless of other info we might provide (e.g. a Reason and/or an additional Condition) might be a good path forward, since Succeeded:False feels like it's at the root of the current problems with Conditions |
examples/v1beta1/pipelineruns/pipelinerun-with-when-expressions.yaml
Outdated
Show resolved
Hide resolved
The following is the coverage report on the affected files.
|
/lgtm |
/hold cancel |
Thank you for the reviews @vdemeester, @afrittoli, @pritidesai, @bobcatfish, @dibyom and @sbwsg 🙏 |
Use `WhenExpressions` instead The [API compatibility policy](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md#alpha-beta-and-ga) states that Alpha features may be dropped at any time, though users will be given at least one release worth of warning.So we're giving two releases warning on deprecation. PR: tektoncd#3135 TEP: https://github.com/tektoncd/community/blob/master/teps/0007-conditions-beta.md
Use `WhenExpressions` instead The [API compatibility policy](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md#alpha-beta-and-ga) states that Alpha features may be dropped at any time, though users will be given at least one release worth of warning.So we're giving two releases warning on deprecation. PR: tektoncd#3135 TEP: https://github.com/tektoncd/community/blob/master/teps/0007-conditions-beta.md
Use `WhenExpressions` instead The [API compatibility policy](https://github.com/tektoncd/pipeline/blob/master/api_compatibility_policy.md#alpha-beta-and-ga) states that Alpha features may be dropped at any time, though users will be given at least one release worth of warning.So we're giving two releases warning on deprecation. PR: #3135 TEP: https://github.com/tektoncd/community/blob/master/teps/0007-conditions-beta.md
@jerop has been reviewed 32 PRs in pipelines (https://github.com/tektoncd/pipeline/pulls?q=is%3Apr+reviewed-by%3Ajerop+-author%3Ajerop) and has authored 27 PRs against this repo (https://github.com/tektoncd/pipeline/pulls/jerop) including when expressions tektoncd#3135, in addition to making significant improvements to our processes (e.g. defining design principles tektoncd/community#171 and recently proposing topical areas of ownership) Thanks for all your hard work @jerop!!
@jerop has been reviewed 32 PRs in pipelines (https://github.com/tektoncd/pipeline/pulls?q=is%3Apr+reviewed-by%3Ajerop+-author%3Ajerop) and has authored 27 PRs against this repo (https://github.com/tektoncd/pipeline/pulls/jerop) including when expressions #3135, in addition to making significant improvements to our processes (e.g. defining design principles tektoncd/community#171 and recently proposing topical areas of ownership) Thanks for all your hard work @jerop!!
The fields in `WhenExpressions` were missing json annotations in tektoncd#3135 so they were PascalCase - relased in v0.16 The json annotations were added and supported both PascalCase and lowercase fields for backwards compatibility in tektoncd#3291 and tektoncd#3389 - released in v0.17 The PascalCase fields were deprecated in v0.17, with an earliest date of removal of Jan 07 2021 - https://github.com/tektoncd/pipeline/blob/v0.23.0/docs/deprecations.md This change removes the deprecated PascalCase fields in `WhenExpressions`
This change removes the deprecated PascalCase fields in `WhenExpressions` The fields in `WhenExpressions` were missing json annotations in tektoncd#3135 so they were PascalCase - released in v0.16 The json annotations were added and supported both PascalCase and lowercase fields for backwards compatibility in tektoncd#3291 and tektoncd#3389 - released in v0.17 The PascalCase fields were deprecated in v0.17, with an earliest date of removal of Jan 07 2021 - https://github.com/tektoncd/pipeline/blob/v0.23.0/docs/deprecations.md
This change removes the deprecated PascalCase fields in `WhenExpressions` The fields in `WhenExpressions` were missing json annotations in tektoncd#3135 so they were PascalCase - released in v0.16 The json annotations were added and supported both PascalCase and lowercase fields for backwards compatibility in tektoncd#3291 and tektoncd#3389 - released in v0.17 The PascalCase fields were deprecated in v0.17, with an earliest date of removal of Jan 07 2021 - https://github.com/tektoncd/pipeline/blob/v0.23.0/docs/deprecations.md
This change removes the deprecated PascalCase fields in `WhenExpressions` The fields in `WhenExpressions` were missing json annotations in tektoncd#3135 so they were PascalCase - released in v0.16 The json annotations were added and supported both PascalCase and lowercase fields for backwards compatibility in tektoncd#3291 and tektoncd#3389 - released in v0.17 The PascalCase fields were deprecated in v0.17, with an earliest date of removal of Jan 07 2021 - https://github.com/tektoncd/pipeline/blob/v0.23.0/docs/deprecations.md
This change removes the deprecated PascalCase fields in `WhenExpressions` The fields in `WhenExpressions` were missing json annotations in tektoncd#3135 so they were PascalCase - released in v0.16 The json annotations were added and supported both PascalCase and lowercase fields for backwards compatibility in tektoncd#3291 and tektoncd#3389 - released in v0.17 The PascalCase fields were deprecated in v0.17, with an earliest date of removal of Jan 07 2021 - https://github.com/tektoncd/pipeline/blob/v0.23.0/docs/deprecations.md
This change removes the deprecated PascalCase fields in `WhenExpressions` The fields in `WhenExpressions` were missing json annotations in #3135 so they were PascalCase - released in v0.16 The json annotations were added and supported both PascalCase and lowercase fields for backwards compatibility in #3291 and #3389 - released in v0.17 The PascalCase fields were deprecated in v0.17, with an earliest date of removal of Jan 07 2021 - https://github.com/tektoncd/pipeline/blob/v0.23.0/docs/deprecations.md
This change updates [TEP-0007: Conditions Beta](https://github.com/tektoncd/community/blob/main/teps/0007-conditions-beta.md): - TEP status is implemented - was implemented in tektoncd/pipeline#3135 - _skipping_ is addressed in [TEP-0059: Skipping Strategies](https://github.com/tektoncd/community/blob/main/teps/0059-skipping-strategies.md)
This change updates [TEP-0007: Conditions Beta](https://github.com/tektoncd/community/blob/main/teps/0007-conditions-beta.md): - TEP status is implemented - was implemented in tektoncd/pipeline#3135 - _skipping_ is addressed in [TEP-0059: Skipping Strategies](https://github.com/tektoncd/community/blob/main/teps/0059-skipping-strategies.md)
This change updates [TEP-0007: Conditions Beta](https://github.com/tektoncd/community/blob/main/teps/0007-conditions-beta.md): - TEP status is implemented - was implemented in tektoncd/pipeline#3135 - _skipping_ is addressed in [TEP-0059: Skipping Strategies](https://github.com/tektoncd/community/blob/main/teps/0059-skipping-strategies.md)
This change removes the deprecated PascalCase fields in `WhenExpressions` The fields in `WhenExpressions` were missing json annotations in tektoncd#3135 so they were PascalCase - released in v0.16 The json annotations were added and supported both PascalCase and lowercase fields for backwards compatibility in tektoncd#3291 and tektoncd#3389 - released in v0.17 The PascalCase fields were deprecated in v0.17, with an earliest date of removal of Jan 07 2021 - https://github.com/tektoncd/pipeline/blob/v0.23.0/docs/deprecations.md
This change removes the deprecated PascalCase fields in `WhenExpressions` The fields in `WhenExpressions` were missing json annotations in #3135 so they were PascalCase - released in v0.16 The json annotations were added and supported both PascalCase and lowercase fields for backwards compatibility in #3291 and #3389 - released in v0.17 The PascalCase fields were deprecated in v0.17, with an earliest date of removal of Jan 07 2021 - https://github.com/tektoncd/pipeline/blob/v0.23.0/docs/deprecations.md
This change updates [TEP-0007: Conditions Beta](https://github.com/tektoncd/community/blob/main/teps/0007-conditions-beta.md): - TEP status is implemented - was implemented in tektoncd/pipeline#3135 - _skipping_ is addressed in [TEP-0059: Skipping Strategies](https://github.com/tektoncd/community/blob/main/teps/0059-skipping-strategies.md)
Adding
WhenExpressions
used to efficiently specify guarded executionof
Tasks
, without spinning up new pods. We useWhenExpressions
toavoid adding an opinionated and complex expression language to the Tekton
API to ensure Tekton can be supported by as many systems as possible.
Further details about the design are in Conditions Beta TEP.
The components of
WhenExpressions
areInput
,Operator
and
Values
:Input
is the input for theGuard
checking which can be staticinputs or variables, such as
Parameters
orResults
.Operator
represents anInput
's relationship to a set ofValues
.Operators
we will use inWhenExpressions
areIn
andNotIn
.Values
is an array of string values. TheValues
array must benon-empty. It can contain static values or variables (
Parameters
orResults
).The declared
WhenExpressions
are evaluated before theTask
is run.If all the
WhenExpressions
evaluate toTrue
, theTask
is run.If any of the
WhenExpressions
evaluate toFalse
, theTask
isskipped.
Changes
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