-
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
Fix json annotations in WhenExpressions #3389
Fix json annotations in WhenExpressions #3389
Conversation
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.
thanks @jerop
/cc @vdemeester |
/test pull-tekton-pipeline-go-coverage |
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.
So I wonder if we should "just" revert (and cherry-pick real quick to do a 0.17.2) or if we should go for a cleaner fix.
The cleaner fix would be to have Input
(DeprecatedInput
field in go) and input
(Input
field in go) and have some code to convert the Input
into input
.
I am ok with both, either we get that fix for "conversion" fix in 0.17.2, or in 0.18.0 (with a revert)
@vdemeester I'm torn too and am actually really interested if you have a preference. I like that the revert will "correct" the situation to some extent without the risk of us rushing in more extensive changes (also side note i suggested this to @jerop ) - but if anyone has used when expressions with 0.17.0 or 0.17.1, i think this will be a backwards incompatible change for them. i'm not certain, but i think going from storing the fields with lowercase (0.17.0 or 0.17.1) back to uppercase (this change) would be backwards incompatible? since probably less ppl are in this situation than the other, i think it's worth it? I agree with you re. the cleaner fix, i think that's definitely the way to go, I guess it's a question of whether it's worth an interim release that "corrects" the backwards incompatible change in the meantime 🤔 🤔 🤔 |
/lgtm |
|
/hold |
b01c381
to
84734ee
Compare
split up the when expressions example to separate pipelinerun and pipeline to make it easier to test pipeline created in v0.16.3 and run with these changes: |
84734ee
to
4033ab8
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pritidesai, 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 |
4033ab8
to
570cc86
Compare
The following is the coverage report on the affected files.
|
When a pipeline with when expressions is created in v0.16.* then it is run in a pipelinerun in v0.17.0 or v0.17.1, a pipeline validation error about missing fields would be thrown -- as reported in tektoncd#3382 That happened because json annotations were added to when expressions type in v0.17.0 so that the fields would have lowercase, such as in the code completion in tekton intellij plugin as described in redhat-developer/intellij-tekton#223 Without the json annotations, the fields were stored with first letters capitalized, that is Input, Operator and Values. With the json annotations, the fields were expected to be lowercase, that is input, operator and values, causing the missing fields error in pipeline validation As such, users would have to reapply pipelines definitions created in previous versions to make them work in v0.17.0 or v0.17.1 -- to remove this requirement, we need to support both the uppercase and lowercase first letters for the annotations Fixes tektoncd#3382
570cc86
to
4f35ed1
Compare
/retest |
/test pull-tekton-pipeline-go-coverage |
@bobcatfish @vdemeester folks have started migrating their pipelines to use |
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
/hold cancel |
We fixed the json annotations and deprecated the PascalCase fields in tektoncd#3389 -- this change includes these deprecations in the table for tracking
We fixed the json annotations and deprecated the PascalCase fields in #3389 -- this change includes these deprecations in the table for tracking
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 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
Changes
When a pipeline with when expressions is created in v0.16.* then it is run in a pipelinerun in v0.17.0 or v0.17.1, a pipeline validation error about missing fields would be thrown -- as reported in #3382
That happened because json annotations were added to when expressions type in v0.17.0 so that the fields would have lowercase, such as in the code completion in tekton intellij plugin as described in redhat-developer/intellij-tekton#223
Without the json annotations, the fields were stored with first letters capitalized, that is
Input
,Operator
andValues
. With the json annotations, the fields were expected to be lowercase, that isinput
,operator
andvalues
, causing the missing fields error in pipeline validationAs such, users would have to reapply pipelines definitions created in previous versions to make them work in v0.17.0 or v0.17.1 -- to remove this requirement, we need to support both the uppercase and lowercase first letters for the annotations
Split up the when expressions example to separate pipelinerun and pipeline to make it easier to test a pipeline created in v0.16.3 and run with these changes:
Fixes #3382
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
/kind cleanup
/cc @pritidesai @bobcatfish