tektoncd / pipeline

A cloud-native Pipeline resource.
https://tekton.dev
Apache License 2.0
8.35k stars 1.76k forks source link

Handle error conditions in CheckMissingResultReferences #8084

Open ralphbean opened 5 days ago

ralphbean commented 5 days ago

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:

Release Notes

Improved error handling for some invalid result reference scenarios.
linux-foundation-easycla[bot] commented 5 days ago

CLA Signed


The committers listed above are authorized under a signed CLA.

tekton-robot commented 5 days ago

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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
ralphbean commented 5 days ago

/kind bug

tekton-robot commented 5 days ago

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
ralphbean commented 5 days ago

I'm not sure how the test coverage drop is possible. I added tests to cover the new branches.

tekton-robot commented 2 days ago

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
tekton-robot commented 2 days ago

[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

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/tektoncd/pipeline/blob/main/OWNERS)~~ [vdemeester] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
vdemeester commented 1 day ago

@afrittoli @chitrangpatel @JeromeJu ptal 🙏🏼 We'll want to cherry-pick this for LTSes as well.

chitrangpatel commented 38 minutes ago

/lgtm

vdemeester commented 27 minutes ago

/retest