Skip to content
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-0076 (array results and indexing into array) promoted to beta 🎓 #6103

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

pritidesai
Copy link
Member

@pritidesai pritidesai commented Feb 2, 2023

Changes

Pipelines 0.38 introduced two alpha features - producing array results and indexing into array param (proposed in TEP-0076). This commit is promoting these two features to beta such that these features can be used by the task authors and pipeline authors in a cluster when enable-api-fields is either set to beta or alpha.

These features are still not available in stable API i.e. these features will not work when enable-api-fields set to stable

Before we can merge this PR, I have following three PRs to update the doc and examples. Please review the outstanding PRs first. These PRs are merged now.

Fixes part of #5688.

Signed-off-by: pritidesai pdesai@us.ibm.com

/kind feature

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

TEP-0076 promoted to beta - Array results and indexing into an array is now possible with enable-api-fields set to beta.

@tekton-robot tekton-robot added kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Feb 2, 2023
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 2, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 89.5% 87.9% -1.5
pkg/reconciler/pipelinerun/resources/apply.go 97.5% 97.5% -0.0
pkg/reconciler/pipelinerun/resources/validate_params.go 96.2% 96.2% -0.0
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.3% -0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 89.5% 87.9% -1.5
pkg/reconciler/pipelinerun/resources/apply.go 97.5% 97.5% -0.0
pkg/reconciler/pipelinerun/resources/validate_params.go 96.2% 96.2% -0.0
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.3% -0.0

@jerop jerop added this to the Pipelines v0.45 milestone Feb 3, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 89.5% 87.9% -1.5
pkg/reconciler/pipelinerun/resources/apply.go 97.5% 97.5% -0.0
pkg/reconciler/pipelinerun/resources/validate_params.go 96.2% 96.2% -0.0
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.3% -0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 89.5% 87.9% -1.5
pkg/reconciler/pipelinerun/resources/apply.go 97.5% 97.5% -0.0
pkg/reconciler/pipelinerun/resources/validate_params.go 96.2% 96.2% -0.0
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.3% -0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 89.5% 94.0% 4.5
pkg/reconciler/pipelinerun/resources/apply.go 97.5% 97.5% -0.0
pkg/reconciler/pipelinerun/resources/validate_params.go 96.2% 96.2% -0.0
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.3% -0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 89.5% 94.0% 4.5
pkg/reconciler/pipelinerun/resources/apply.go 97.5% 97.5% -0.0
pkg/reconciler/pipelinerun/resources/validate_params.go 96.2% 96.2% -0.0
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.3% -0.0

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 7, 2023
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 7, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 88.6% 93.5% 4.9
pkg/reconciler/pipelinerun/resources/apply.go 97.5% 97.5% -0.0
pkg/reconciler/pipelinerun/resources/validate_params.go 96.2% 96.2% -0.0
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.3% -0.0

@JeromeJu
Copy link
Member

JeromeJu commented Feb 7, 2023

/assign @afrittoli @JeromeJu

@Yongxuanzhang
Copy link
Member

/assign

@pritidesai
Copy link
Member Author

@afrittoli @JeromeJu @Yongxuanzhang I appreciate if you can review the changes in this PR, my team is looking for this feature as part of 0.45. Thanks!

Copy link
Member

@Yongxuanzhang Yongxuanzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
Thanks! Sorry I thought we want to merge other issues fixes before this one. I think it's ok to get this merged in v0.45

I will update other PRs (like #6120) once we get this merged.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 9, 2023
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 14, 2023
@vdemeester
Copy link
Member

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 14, 2023
@vdemeester
Copy link
Member

Cc @abayer @afrittoli @jerop to remove the hold 😛 but yay 🎉

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pritidesai 🎉 - this looks mostly good to me, only a couple of minor things - it would be nice to have the docs updated, especially given the fact that we don't have v1/v1beta separate docs, so the docs should default to the latest API which is v1

Both are alpha features and can be enabled by setting `enable-api-fields` to `alpha`.
Object result is alpha feature and can be enabled by setting `enable-api-fields` to `alpha`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: shouldn't we say that "array results are a beta feature. They can be enabled in the v1 API by setting the enable-api-fields to beta

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, with v1beta1 API, for this feature to work, enable-api-fields does not have to be alpha anymore which means it can be set to either beta or stable.

@chitrangpatel how did you approach this when we promoted propagated params/workspaces features? 🤔 Or these features were not classified as beta? will appreciate any guidance. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propagated Params was moved straight to stable since stable and beta were same at the time.
Propagated workspaces is currently beta meaning that it will work if enable-api-fields is alpha or beta but not stable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, we should clarify that array results is an beta feature

@pritidesai it seems that in both v1 and v1beta1, we check that beta feature flag is enabled -- @lbernick we may need clarification in the TEP about whether the flag should be the same in both versions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propagated workspaces is currently beta meaning that it will work if enable-api-fields is alpha or beta but not stable.

Thanks @chitrangpatel for getting back. How did we document that propagated workspace is beta feature? At the same time, I am checking docs. I just want to make sure its consistent across many different features.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I just checked the PR #6030, there is no specific guidelines other than the replacing alpha with beta in the docs 🙃 I will update the docs here but it's really very confusing for folks using v1beta1 APIs.

docs/tasks.md Outdated
@@ -833,7 +833,7 @@ or [at the `Pipeline` level](./pipelines.md#emitting-results-from-a-pipeline).
#### Emitting Array `Results`

Tekton Task also supports defining a result of type `array` and `object` in addition to `string`.
Emitting a task result of type `array` is an `alpha` feature implemented based on the
Emitting a task result of type `array` is implemented based on the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto: shouldn't me mention that arrays are a beta feature?

expectedResult: true,
}, {
name: "when enable-api-fields is set to stable",
c: config.EnableStableAPIFields(ctx),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: stable is the default (and will always be), so this feels a bit redundant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup I completely agree, stable is a default. its just added to be consistent with the

/approve

Good by me!

thanks @abayer 🙏

@vdemeester can we cancel the hold? I do not think there is anything pending here now. If there is a concern of array params in a matrix and when expressions, we had examples and doc updated for both features in PR #6092 and PR #6077. @Yongxuanzhang please confirm!

Comment on lines +326 to +330
// EnableStableAPIFields enables stable features in an existing context (for use in testing)
func EnableStableAPIFields(ctx context.Context) context.Context {
return setEnableAPIFields(ctx, StableAPIFields)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this? As far as I can tell it's only used in the unit test for CheckAlphaOrBetaAPIFields - and it doesn't look like it's really needed there either as stable is the default value.

pkg/apis/pipeline/v1/result_validation.go Show resolved Hide resolved
// By default the result type is string
if tr.Type != ResultsTypeString {
// By default, the result type is string
case tr.Type != ResultsTypeString:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto: same as above, I would prefer using default here

@pritidesai
Copy link
Member Author

Thanks @pritidesai 🎉 - this looks mostly good to me, only a couple of minor things - it would be nice to have the docs updated, especially given the fact that we don't have v1/v1beta separate docs, so the docs should default to the latest API which is v1

Thank you @afrittoli, how can we resolve this?

@pritidesai
Copy link
Member Author

Cc @abayer @afrittoli @jerop to remove the hold 😛 but yay 🎉

thanks @vdemeester 🙏

@abayer @jerop anything pending to cancel the hold? 😕

@abayer
Copy link
Contributor

abayer commented Feb 14, 2023

/approve

Good by me!

Pipelines 0.38 introduced two alpha features - producing array results
and indexing into array param. This commit is promoting these two features
to beta such that these features can be used by the task authors and pipeline
authors by setting enable-api-fields to either beta or alpha.

These features are still not availalbe in stable API i.e. these features
will not work with enable-api-fields set to stable

Signed-off-by: pritidesai <pdesai@us.ibm.com>
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 14, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 88.6% 93.5% 4.9
pkg/reconciler/pipelinerun/resources/apply.go 97.5% 97.5% -0.0
pkg/reconciler/pipelinerun/resources/validate_params.go 96.2% 96.2% -0.0
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.3% -0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/feature_flags.go 88.6% 93.5% 4.9
pkg/reconciler/pipelinerun/resources/apply.go 97.5% 97.5% -0.0
pkg/reconciler/pipelinerun/resources/validate_params.go 96.2% 96.2% -0.0
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.3% -0.0

@pritidesai
Copy link
Member Author

thank you @Yongxuanzhang @afrittoli @vdemeester @abayer @JeromeJu @jerop and @chitrangpatel 🙏

I have updated this PR to document that this feature is beta feature. I am looking for lgtm unless there is anything else pending. Thanks a bunch!

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abayer, JeromeJu, jerop, vdemeester

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:
  • OWNERS [abayer,jerop,vdemeester]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Yongxuanzhang
Copy link
Member

/lgtm
Thanks!

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 14, 2023
@afrittoli
Copy link
Member

/lgtm

@afrittoli
Copy link
Member

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 15, 2023
@tekton-robot tekton-robot merged commit 9c1ecae into tektoncd:main Feb 15, 2023
@pritidesai pritidesai deleted the promote-0076-to-beta-1 branch February 15, 2023 16:21
pritidesai added a commit to pritidesai/pipeline that referenced this pull request Feb 16, 2023
This commit includes two changes to the table with beta features:
1. Alpha Release: an additional column to keep history of when the feature was
first available as alpha
2. TEP-0076: Array results was promoted to beta in PR -
tektoncd#6103

Signed-off-by: pritidesai <pdesai@us.ibm.com>
tekton-robot pushed a commit that referenced this pull request Feb 16, 2023
This commit includes two changes to the table with beta features:
1. Alpha Release: an additional column to keep history of when the feature was
first available as alpha
2. TEP-0076: Array results was promoted to beta in PR -
#6103

Signed-off-by: pritidesai <pdesai@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants