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

Move parameter validation from taskspec to taskrunspec when propagating parameters #5143

Conversation

chitrangpatel
Copy link
Contributor

@chitrangpatel chitrangpatel commented Jul 14, 2022

Prior to this, propagating parameters only skipped webhook validation
for params defined in script. As a result, when users tried to propagate
params to other fields like args or command, etc. an webhook
validation was raised. This PR address issue #5141.
This PR addresses validations in taskspec and taskrunspec. The changes for validations in pipelinespec and pipelinerunspec will be added in a follow up PR.

Changes

Submitter Checklist

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

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • 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
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Move parameter validation from `taskspec` to `taskrunspec` when propagating parameters

@tekton-robot tekton-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 14, 2022
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 14, 2022
@chitrangpatel
Copy link
Contributor Author

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 14, 2022
@chitrangpatel
Copy link
Contributor Author

cc @chuangw6

@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/task_validation.go 97.6% 97.6% 0.0

@chitrangpatel chitrangpatel marked this pull request as draft July 15, 2022 13:45
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 15, 2022
@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch from d987b78 to 8cb7c26 Compare July 15, 2022 19:28
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 15, 2022
@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch from 8cb7c26 to 6bd7552 Compare July 15, 2022 19:49
@chitrangpatel chitrangpatel marked this pull request as ready for review July 15, 2022 19:49
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 15, 2022
@chitrangpatel chitrangpatel changed the title Skip validation when propagating parameters Move validation from taskspec to taskrunspec when propagating parameters Jul 15, 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/pipelinerun_validation.go 100.0% 81.7% -18.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 100.0% 92.9% -7.1

@chitrangpatel chitrangpatel changed the title Move validation from taskspec to taskrunspec when propagating parameters Move parameter validation from taskspec to taskrunspec when propagating parameters Jul 15, 2022
@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch 2 times, most recently from b1b87e2 to b82a2ab Compare July 15, 2022 20:02
@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/pipelinerun_validation.go 100.0% 95.0% -5.0
pkg/apis/pipeline/v1beta1/taskrun_validation.go 100.0% 98.0% -2.0

@chitrangpatel
Copy link
Contributor Author

/retest

@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch from b82a2ab to c9ed2eb Compare July 15, 2022 20:15
@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/pipelinerun_validation.go 100.0% 96.7% -3.3
pkg/apis/pipeline/v1beta1/taskrun_validation.go 100.0% 99.0% -1.0

@chitrangpatel chitrangpatel marked this pull request as draft July 16, 2022 14:23
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 2, 2022
@jerop
Copy link
Member

jerop commented Aug 2, 2022

/retest

pkg/apis/pipeline/v1/task_validation.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/taskrun_validation.go Outdated Show resolved Hide resolved
pkg/reconciler/taskrun/taskrun.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/task_validation_test.go Outdated Show resolved Hide resolved
@JeromeJu
Copy link
Member

JeromeJu commented Aug 3, 2022

After discussion with @JeromeJu, I think I will break this PR into handling task validations and pipeline validations separately so that v1 and v1beta1 can be kept in sync. For now, I will only open a PR for task validations. Once #5219 is merged, I will sync my changes to the pipeline validations and open a PR for it.

Thanks Chitrang!

@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch from 745925f to 412259e Compare August 3, 2022 17:27
@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/v1/task_validation.go 97.1% 98.0% 0.8
pkg/apis/pipeline/v1beta1/task_validation.go 97.3% 98.1% 0.8
pkg/reconciler/taskrun/taskrun.go 80.6% 80.7% 0.1

@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch from 412259e to 658de84 Compare August 3, 2022 18:05
@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/v1/task_validation.go 97.1% 98.0% 0.8
pkg/apis/pipeline/v1beta1/task_validation.go 97.3% 98.1% 0.8
pkg/reconciler/taskrun/taskrun.go 80.6% 80.7% 0.1

@JeromeJu JeromeJu mentioned this pull request Aug 3, 2022
5 tasks
@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch from 658de84 to 04f8ed4 Compare August 8, 2022 20:58
@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/v1/task_validation.go 97.1% 98.0% 0.8
pkg/apis/pipeline/v1beta1/task_validation.go 97.3% 98.1% 0.8
pkg/reconciler/taskrun/taskrun.go 80.6% 80.7% 0.1

@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch from 04f8ed4 to 3e446f0 Compare August 8, 2022 21:18
@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/v1/task_validation.go 97.1% 98.0% 0.8
pkg/apis/pipeline/v1beta1/task_validation.go 97.3% 98.1% 0.8
pkg/reconciler/taskrun/taskrun.go 80.6% 80.7% 0.1

@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch from 3e446f0 to befdb86 Compare August 9, 2022 13:56
@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/v1/task_validation.go 97.1% 98.0% 0.8
pkg/apis/pipeline/v1beta1/task_validation.go 97.3% 98.1% 0.8
pkg/reconciler/taskrun/taskrun.go 80.6% 80.7% 0.1

@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch from befdb86 to 4c3bebd Compare August 9, 2022 14:17
@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/v1/task_validation.go 97.1% 98.0% 0.8
pkg/apis/pipeline/v1beta1/task_validation.go 97.3% 98.1% 0.8
pkg/reconciler/taskrun/taskrun.go 80.6% 80.7% 0.1

…ameters

Prior to this, propagating parameters only skipped webhook validation
for params defined in script. As a result, when users tried to propagate
params to other fields like `args` or `command`, etc. an webhook
validation was raised. This PR address this issue.
@chitrangpatel chitrangpatel force-pushed the Bugfix-5141-propagating-params-for-args branch from 4c3bebd to fd9f6c3 Compare August 11, 2022 19:33
@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/v1/task_validation.go 97.1% 98.0% 0.8
pkg/apis/pipeline/v1beta1/task_validation.go 97.3% 98.1% 0.8
pkg/reconciler/taskrun/taskrun.go 80.3% 80.3% 0.1

@lbernick
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 11, 2022
@jerop
Copy link
Member

jerop commented Aug 11, 2022

TestPipelineRunTimeout again 🙃

/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. 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