Skip to content
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

Validation for Finally Task Results referenced in Pipeline Results #5000

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

vsinghai
Copy link

@vsinghai vsinghai commented Jun 17, 2022

Changes

Prior to this commit, there was no validation for Finally
Task Result's being referenced in Pipeline Result's.

This commit creates validation for that case by making
sure all the Finally Task Result's reference a task_name
within the Pipeline Result's. This commit also gathers
all the errors in Pipeline Results validation instead
of exiting on the first error. The reason is that if
multiple references exist to non-existant tasks, this
function will only return an error message about one of them,
forcing the person to fix the errors one by one.

Fixes bug #4923

/kind bug
/cc @jerop

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in
    (if there are no user facing changes, use release note "NONE")

Release Notes

Fixed a bug where Finally Task Result's are being referenced in Pipeline Result's.

@tekton-robot tekton-robot requested a review from jerop June 17, 2022 15:21
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 17, 2022
@tekton-robot
Copy link
Collaborator

Hi @vsinghai. 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.

@dibyom
Copy link
Member

dibyom commented Jun 17, 2022

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 17, 2022
@tekton-robot
Copy link
Collaborator

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/apis/pipeline/v1beta1/pipeline_validation.go 100.0% 99.1% -0.9

@vsinghai
Copy link
Author

/retest

@tekton-robot
Copy link
Collaborator

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/apis/pipeline/v1beta1/pipeline_validation.go 100.0% 99.1% -0.9

@vsinghai vsinghai force-pushed the propogate branch 2 times, most recently from 4799fd4 to 3b7c549 Compare June 17, 2022 19:45
@vsinghai
Copy link
Author

/retest

@tekton-robot
Copy link
Collaborator

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/apis/pipeline/v1beta1/pipeline_validation.go 100.0% 99.1% -0.9
pkg/reconciler/pipelinerun/pipelinerun.go 86.3% 85.8% -0.5

@tekton-robot
Copy link
Collaborator

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/apis/pipeline/v1beta1/pipeline_validation.go 100.0% 99.1% -0.9
pkg/reconciler/pipelinerun/pipelinerun.go 86.3% 85.8% -0.5

Copy link
Member

@lbernick lbernick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the commit message a bit confusing because it makes it sound like we already support finally task results in pipeline results. maybe you could clarify that the syntax "tasks.foo.results.bar" can't be used to refer to finally tasks, and that's what this commit adds validation for?

pkg/reconciler/pipelinerun/pipelinerun_test.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/pipeline_validation.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/pipeline_validation.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/pipeline_validation.go Outdated Show resolved Hide resolved
@abayer
Copy link
Contributor

abayer commented Jun 20, 2022

/retest

@tekton-robot
Copy link
Collaborator

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/apis/pipeline/v1beta1/pipeline_validation.go 100.0% 99.1% -0.9
pkg/reconciler/pipelinerun/pipelinerun.go 86.3% 85.8% -0.5

@vsinghai vsinghai force-pushed the propogate branch 2 times, most recently from ac6d11f to 9019ff6 Compare June 21, 2022 15:36
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 21, 2022
@vsinghai
Copy link
Author

/retest

@vsinghai vsinghai force-pushed the propogate branch 2 times, most recently from 1c3a835 to 11d4fc4 Compare June 21, 2022 18:15
@dibyom
Copy link
Member

dibyom commented Jun 27, 2022

/test pull-tekton-pipeline-alpha-integration-tests

@dibyom
Copy link
Member

dibyom commented Jun 27, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 27, 2022
@vsinghai
Copy link
Author

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 28, 2022
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 29, 2022
@vsinghai
Copy link
Author

vsinghai commented Jun 29, 2022

/test pull-tekton-pipeline-build-tests
/test pull-tekton-pipeline-integration-tests

@vsinghai
Copy link
Author

/test pull-tekton-pipeline-integration-tests

1 similar comment
@jerop
Copy link
Member

jerop commented Jun 29, 2022

/test pull-tekton-pipeline-integration-tests

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jerop

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 12, 2022
…Results

Prior to this commit, there was no validation for Finally
Task Results being referenced to Pipeline Results.

This commit creates validation for that case by making
sure all the Finally Task Results reference a `task_name`
within the Pipeline Results. This commit also gathers
all the errors in `Pipeline Results` validation instead
of exiting on the first error. The reason is that if
multiple references exist to non-existant tasks, this
function will only return an error message about one of them,
forcing the person to fix the errors one by one.

Fixes bug [tektoncd#4923](tektoncd#4923)

/kind bug
/cc @jerop
@lbernick
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 12, 2022
@vsinghai
Copy link
Author

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 12, 2022
@jerop
Copy link
Member

jerop commented Jul 12, 2022

@vsinghai could you please update the PR description as well (about gathering all the errors, instead of exiting)?

@vsinghai
Copy link
Author

@vsinghai could you please update the PR description as well (about gathering all the errors, instead of exiting)?

done

@jerop
Copy link
Member

jerop commented Jul 12, 2022

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants