-
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-0075] Validate object keys, PipelineRunSpec -> PipelineSpec #4883
[TEP-0075] Validate object keys, PipelineRunSpec -> PipelineSpec #4883
Conversation
The following is the coverage report on the affected files.
|
174a1e4
to
fad4020
Compare
The following is the coverage report on the affected files.
|
/assign @ywluogg |
@chuangw6: 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. |
/assign @ywluogg |
I feel like this is a bug since I can get notification from Yongxuan's assignment but not from yours |
Link this to #4723 |
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.
Nice!
fad4020
to
c78367c
Compare
The following is the coverage report on the affected files.
|
/test pull-tekton-pipeline-integration-tests |
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 @chuangw6 Could you add a release note?
c78367c
to
2253bae
Compare
The following is the coverage report on the affected files.
|
2253bae
to
b87432d
Compare
The following is the coverage report on the affected files.
|
b87432d
to
13065e2
Compare
The following is the coverage report on the affected files.
|
permanentError: true, | ||
wantEvents: []string{ | ||
"Normal Started", | ||
"Warning Failed PipelineRun foo/pipeline-missing-object-param-keys parameters is missing some object keys", |
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 error message would be more helpful if it returned which keys were missing and for which parameters
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! Changed the verifier helper function to return a map (key: param, val: missing keys) so when the users see the err message from pipelinerun status, they will see which keys were missing and for which parameters.
But for the wantEvent in testing, if I also put the returned err message here, it gives weird error and fails test though the expected and got event reported from the following message are exactly same. I guess this is why other wantEvent cuts off the second half message too.
logger.go:130: 2022-06-15T11:43:08.897-0700 ERROR TestReconcile_InvalidPipelineRuns/invalid-pipeline-missing-object-keys pipelinerun/reconciler.go:294Returned an error {"targetMethod": "ReconcileKind", "error": "1 error occurred:\n\t* PipelineRun missing object keys for parameters: map[some-param:[key2]]\n\n"}
pipelinerun_test.go:1316: error in test pipeline-missing-object-param-keys: expected event "Warning Failed PipelineRun foo/pipeline-missing-object-param-keys parameters is missing object keys required by Pipeline foo/a-pipeline-with-object-params's parameters: PipelineRun missing object keys for parameters: map[some-param:[key2]]" but got "Warning Failed PipelineRun foo/pipeline-missing-object-param-keys parameters is missing object keys required by Pipeline foo/a-pipeline-with-object-params's parameters: PipelineRun missing object keys for parameters: map[some-param:[key2]]" instead
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.
That's really weird-- can you try it out on the cluster and see what error message is returned to the user?
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.
sure. Just added. We'll see an error reporting that.
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 is the error I refer to when we also add the rest of the error message to the expected wantEvent
.
So I guess we need to remove the rest part to pass the unit test @lbernick
(But in the error returned when users miss some keys, we can see the full message without a problem with the information about which keys were missing and for which parameters.)
13065e2
to
02629ca
Compare
The following is the coverage report on the affected files.
|
permanentError: true, | ||
wantEvents: []string{ | ||
"Normal Started", | ||
"Warning Failed PipelineRun foo/pipeline-missing-object-param-keys parameters is missing some object keys", |
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.
That's really weird-- can you try it out on the cluster and see what error message is returned to the user?
02629ca
to
db63243
Compare
/lgtm |
The following is the coverage report on the affected files.
|
/test tekton-pipeline-unit-tests /test pull-tekton-pipeline-alpha-integration-tests |
Add validation that checks if object param value from PipelineRunSpec misses some keys required for that object param declared in PipelineSpec.
0c8ac5f
to
9b2f96d
Compare
/retest |
The following is the coverage report on the affected files.
|
/kind misc |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom, vdemeester, 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 |
/lgtm |
@ywluogg: changing LGTM is restricted to collaborators 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. |
/lgtm |
Changes
Add validation that checks if object param value from
PipelineRunSpec
misses some keys required for that object param declared in
PipelineSpec
.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