Handle error conditions in CheckMissingResultReferences
Before this change, it was possible for a PipelineRun to exist which would cause the controller to crash in CheckMissingResultReferences.
Changes
Handle error conditions in CheckMissingResultReferences, fixing https://github.com/tektoncd/pipeline/issues/8083
Plus, added tests to cover the scenarios.
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
- [x] ~~Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps~~
- [x] Has Tests included if any functionality added or changed
- [x] pre-commit Passed
- [x] Follows the commit message standard
- [x] Meets the Tekton contributor standards (including functionality, content, code)
- [x] 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 - [x] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
- [x] ~~Release notes contains the string "action required" if the change requires additional action from users switching to the new release~~
Release Notes
Improved error handling for some invalid result reference scenarios.
Hi @ralphbean. Thanks for your PR.
I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
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.
/kind bug
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/reconciler/pipelinerun/resources/pipelinerunresolution.go | 96.7% | 96.5% | -0.2 |
| pkg/reconciler/pipelinerun/resources/resultrefresolution.go | 99.2% | 98.3% | -0.8 |
I'm not sure how the test coverage drop is possible. I added tests to cover the new branches.
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/reconciler/pipelinerun/resources/pipelinerunresolution.go | 96.7% | 96.5% | -0.2 |
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: vdemeester
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [vdemeester]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@afrittoli @chitrangpatel @JeromeJu ptal 🙏🏼 We'll want to cherry-pick this for LTSes as well.
/lgtm
/retest
/cherry-pick release-v0.59.x
@vdemeester: new pull request created: #8093
In response to this:
/cherry-pick release-v0.59.x
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.
/cherry-pick release-v0.56.x
/cherry-pick release-v0.53.x
/cherry-pick release-v0.50.x
@vdemeester: new pull request created: #8094
In response to this:
/cherry-pick release-v0.56.x
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.
@vdemeester: new pull request created: #8095
In response to this:
/cherry-pick release-v0.53.x
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.
@vdemeester: #8084 failed to apply on top of branch "release-v0.50.x":
Applying: Handle error conditions in CheckMissingResultReferences
Using index info to reconstruct a base tree...
M pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go
M pkg/reconciler/pipelinerun/resources/resultrefresolution_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/reconciler/pipelinerun/resources/resultrefresolution_test.go
CONFLICT (content): Merge conflict in pkg/reconciler/pipelinerun/resources/resultrefresolution_test.go
Auto-merging pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Handle error conditions in CheckMissingResultReferences
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
In response to this:
/cherry-pick release-v0.50.x
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.
/cherry-pick release-v0.61.x
@vdemeester: new pull request created: #8105
In response to this:
/cherry-pick release-v0.61.x
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.