-
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
check beta feature flag for v1 TaskSpec's ValidateParamArrayIndex #6613
Conversation
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
@@ -612,8 +612,7 @@ func isParamRefs(s string) bool { | |||
// - `trParams` are params from taskrun. | |||
// - `taskSpec` contains params declarations. | |||
func (ts *TaskSpec) ValidateParamArrayIndex(ctx context.Context, params Params) error { | |||
cfg := config.FromContextOrDefaults(ctx) | |||
if cfg.FeatureFlags.EnableAPIFields != config.AlphaAPIFields { | |||
if !config.CheckAlphaOrBetaAPIFields(ctx) { |
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.
This should be removed, since setting "stable" for v1beta1 also enables beta features
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.
Oh 🤯
how about v1? Should we remove it from v1?
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.
In v1 we do check for beta API fields, so it makes sense to keep in v1
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!
/approve cancel |
I think we should consider whether this function should return an error, instead of nil, if a task is using a feature where "enable-api-fields" is set to the wrong value. This is basically saying that if a task is using array param indexing and the index is out of bounds, this won't return an error if "enable-api-fields" is beta. |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Can we set "enable-api-fields" to random value? I think this function can validate it pipeline/pkg/apis/config/feature_flags.go Lines 201 to 213 in 09d422c
Did you mean v1 or v1beta1 task? |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
@Yongxuanzhang based on @jerop's feedback on #6617 let's merge your PR first. I think you should remove the reconciler checks for alpha/beta flags, since with this change it would be possible to create a v1beta1 task with array indexing but then have it not work correctly in the reconciler. Please also pull in the tests TestPipelineWithBetaFields and TestTaskWithBetaFields from #6617. We'll also need a release note indicating the bug fix of not requiring the "beta" feature flag for array indexing in beta tasks/pipelines. |
@Yongxuanzhang can you also add array indexing to the list of beta features? |
I think array indexing is already in the list(it's part of tep-76), what's missing is the tep-75 object param and results maybe I can open another small pr to update it? |
This commit closes tektoncd#6607. V1 TaskSpec's member function ValidateParamArrayIndex checks alpha feature flag, but array indexing is promoted to beta feature and we should check beta flag instead. And for v1beta1 the beta is on by default so we don't check the beta flag. This commit fixes this issue and also update doc. Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerop, lbernick 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 |
/test pull-tekton-pipeline-build-tests |
Changes
This commit closes #6607. TaskSpec's member function ValidateParamArrayIndex checks alpha feature flag, but array indexing is promoted to beta feature and we should check beta flag instead. This commit fixes this issue and update doc to explicitly include array indexing as beta feature.
/kind bug
Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes