-
Notifications
You must be signed in to change notification settings - Fork 1.9k
don't validate skipped task results for pipeline results #6157
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
Conversation
|
Skipping CI for Draft Pull Request. |
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
|
Hi @pritidesai @jerop , could you take a look at this PR? |
kyubisation
left a comment
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.
Thank you very much for the quick fix! 😃
I'm not very familiar with the code base, but from my perspective this looks good to me. 👍
|
please fix the typo in the pr title and commit message |
b122f4d to
5847110
Compare
jerop
left a comment
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.
could it be more confusing for the pipeline result to remain as is - an unsubstituted reference to a task result? what if users assume pipeline results were produced by the pipeline, but then some are just the original references? wondering if we should just wait for tektoncd/community#954?
also @Yongxuanzhang please add to the commit message that this change is not only removing validation, but also leaving pipeline results as the original unsubstituted references to task results when the task was skipped
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
This commit skips the validation of "skipped tasks", my understanding is that if users use "when expressions" on tasks and they should be aware of some results cannot be replaced if tasks are skipped as mentioned in https://tekton.dev/docs/pipelines/pipelines/#emitting-results-from-a-pipeline |
|
The following is the coverage report on the affected files.
|
|
Please update the release notes elaborating its a fix for a regression issue, thanks! |
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
lbernick
left a comment
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 think it would be worth adding a reconciler unit test or an integration test with a full pipelinerun spec with skipped results
| customTaskResults map[string][]v1beta1.CustomRunResult) ([]v1beta1.PipelineRunResult, error) { | ||
| customTaskResults map[string][]v1beta1.CustomRunResult, | ||
| skippedTasks []v1beta1.SkippedTask, | ||
| logger *zap.SugaredLogger) ([]v1beta1.PipelineRunResult, error) { |
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.
nit: I think it would be a bit cleaner to get the logger from the context instead of passing it in as a param (more consistent with the rest of the codebase)
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 I see, thanks! Fixed!
| } { | ||
| t.Run(tc.description, func(t *testing.T) { | ||
| received, _ := ApplyTaskResultsToPipelineResults(tc.results, tc.taskResults, tc.runResults) | ||
| received, _ := ApplyTaskResultsToPipelineResults(tc.results, tc.taskResults, tc.runResults, nil, logtesting.TestLogger(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.
| received, _ := ApplyTaskResultsToPipelineResults(tc.results, tc.taskResults, tc.runResults, nil, logtesting.TestLogger(t)) | |
| received, _ := ApplyTaskResultsToPipelineResults(tc.results, tc.taskResults, tc.runResults, nil /* skippedTasks */, logtesting.TestLogger(t)) |
| skippedTasks: []v1beta1.SkippedTask{{ | ||
| Name: "skippedTask", | ||
| }}, | ||
| expectedResults: []v1beta1.PipelineRunResult{{ |
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.
What output results existed prior to this regression? Was it just a non-replaced result expression? or was there no pipeline result? (based on the linked issue it looks like the latter.) I think an absent Pipeline result might make more sense than a Pipeline result like "$(tasks.skippedTask.results.foo)".
(everything else is mostly a nit but let's verify this)
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.
Ah yes this is a great point! When I implemented this fix I didn't check the previous behaviour. I checked the previous version and there are no results if the task is skipped. We should definitely keep the previous behaviour otherwise this will be another issue
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
This commit skip the validation for skipped task results in pipeline results. This fixes tektoncd#6139. The skipped task results are not emitted by design thus we shouldn't validate if they are emitted. Pipeline results referenced to skipped task will not be emitted.
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
afrittoli
left a comment
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.
Thank you for all the updates!
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli, kyubisation The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm I think we'll need to cherry pick this to all the releases after v0.37 we currently support-- which is v0.41-v0.45 :( (Although v0.45 EOL is tomorrow) |
Changes
This commit skip the validation for skipped task results in pipeline results. This fixes #6139. The skipped task results are not emitted by design thus we shouldn't validate if they are emitted. Pipeline results referenced to skipped task will not be emitted.
/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:
functionality, content, code)
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes