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

param validation - execution status variable #3691

Merged
merged 1 commit into from
Jan 19, 2021

Conversation

pritidesai
Copy link
Member

@pritidesai pritidesai commented Jan 13, 2021

Changes

Adding param validation while accessing execution status along with any other param or extra string. Updated pipelines documenting the limitation.

Also, avoiding task results validation as it follows very similar pattern with $(tasks.taskname.results.status) where
"status" being the result of some task.

Closes #3681
Closes #3692

/kind misc

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/misc Categorizes issue or PR as a miscellaneuous one. labels Jan 13, 2021
@tekton-robot tekton-robot requested review from jerop and a user January 13, 2021 22:29
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 13, 2021
@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 99.6% 99.6% 0.0
pkg/substitution/substitution.go 48.1% 43.8% -4.3

@ghost
Copy link

ghost commented Jan 15, 2021

Might be worth adding a unit test to check that variables of form $(tasks.foo.results.status) are considered valid, to cover the case presented in #3692

@pritidesai pritidesai force-pushed the status-var-validation branch from b5853ab to aa6b775 Compare January 15, 2021 17:19
@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 99.6% 99.6% 0.0
pkg/substitution/substitution.go 48.1% 43.8% -4.3

@pritidesai
Copy link
Member Author

$(tasks.foo.results.status)

Thanks @sbwsg I have added such unit test.

@afrittoli, this PR will needs cherry picking into 0.20 🙏

@pritidesai pritidesai added this to the Pipelines v0.20 milestone Jan 15, 2021
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbwsg

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 Jan 15, 2021
@pritidesai pritidesai added the needs-cherry-pick Indicates a PR needs to be cherry-pick to a release branch label Jan 15, 2021
@GregDritschler
Copy link
Contributor

looks good to me

Adding param validation while accessing execution status along with
any other param or extra string. Also, avoiding task results validation as
it follows very similar pattern with $(tasks.taskname.results.status) where
"status" is a result of some task.
@pritidesai pritidesai force-pushed the status-var-validation branch from aa6b775 to 6bf700a Compare January 16, 2021 17:41
@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_types.go 72.4% 74.2% 1.8
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.6% 99.6% 0.0
pkg/substitution/substitution.go 48.1% 43.8% -4.3

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2021
@tekton-robot tekton-robot merged commit 2ec2b86 into tektoncd:master Jan 19, 2021
@pritidesai pritidesai deleted the status-var-validation branch January 19, 2021 18:59
@pritidesai pritidesai removed the needs-cherry-pick Indicates a PR needs to be cherry-pick to a release branch label Jan 19, 2021
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/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
5 participants