-
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
[TEP-0076] Add indexing into array for pipeline params reference #4855
[TEP-0076] Add indexing into array for pipeline params reference #4855
Conversation
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
bfb2f90
to
c17a358
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
@Yongxuanzhang: GitHub didn't allow me to assign the following users: ywluogg. Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
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. |
/test pull-tekton-pipeline-build-tests |
/assign ywluogg |
@@ -222,6 +222,180 @@ var ( | |||
}, | |||
} | |||
|
|||
simpleTaskSpecArrayIndexing = &v1beta1.TaskSpec{ |
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.
Are you planning to add those invalid indexing cases in this PR? Something like $(params['FOO'][2])
$(params['FOO'][-1])
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.
I was hesitant to add the validation because I thought it is tricky.
Right now for these out of bound cases there will be no errors, and they will be treated like string.
I will think about how to add them in this PR.
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.
SG! If you don't plan to add it in this PR, you can add a TODO and do it later, but we definitely need those tests for coverage and guards.
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.
how hard would it be to add this validation? I think silently failing without errors can be confusing for users
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.
It's bit complicated, let me see if there's an easy solution
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.
Can we keep the validation in another PR? The release deadline is close
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.
I agree with Dibyo, I wouldn't want to hold off on adding validation just to get the feature out the door. Can you explain more about what the challenge is here?
c17a358
to
7da92fa
Compare
The following is the coverage report on the affected files.
|
7da92fa
to
36d5a6e
Compare
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.
Except for the current open comments, others LGTM
36d5a6e
to
b5775fd
Compare
The following is the coverage report on the affected files.
|
b5775fd
to
6115e03
Compare
The following is the coverage report on the affected files.
|
Link this to #4723 |
4d183f2
to
2e10695
Compare
The following is the coverage report on the affected files.
|
} | ||
} | ||
|
||
func TestValidateParamArrayIndex_invalid(t *testing.T) { |
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.
@lbernick is this the test case?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lbernick, ywluogg 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.
|
The following is the coverage report on the affected files.
|
2526da1
to
6366031
Compare
The following is the coverage report on the affected files.
|
/retest |
6366031
to
b4ac6b4
Compare
The following is the coverage report on the affected files.
|
/retest |
b4ac6b4
to
3a5b98e
Compare
The following is the coverage report on the affected files.
|
This commit provides the indexing into array for params and gated by alpha feature flag. Before this commit we can only refer to the whole array param, with this feature we can refer to array's element such as $(params.param-name[0]).
3a5b98e
to
f5b5b79
Compare
The following is the coverage report on the affected files.
|
Thanks @Yongxuanzhang |
Changes
This commit provides the indexing into array for params for pipeline level reference and gated by
alpha feature flag. Before this commit we can only refer to the whole
array param, with this feature we can refer to array's element such as
$(params.param-name[i]).
/kind feature
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
(if there are no user facing changes, use release note "NONE")
Release Notes