pipeline
pipeline copied to clipboard
Move parameter validation from `taskspec` to `taskrunspec` when propagating parameters
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 https://github.com/tektoncd/pipeline/issues/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
- [x] Has Tests included if any functionality added or changed
- [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)
- [ ] 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
/kind bug
cc @chuangw6
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 |
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 |
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 |
/retest
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 |
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 | 97.0% | 97.0% | 0.1 |
| pkg/apis/pipeline/v1beta1/pipelinerun_validation.go | 100.0% | 96.7% | -3.3 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 97.7% | 97.3% | -0.4 |
| pkg/apis/pipeline/v1beta1/taskrun_validation.go | 100.0% | 99.0% | -1.0 |
| pkg/reconciler/taskrun/taskrun.go | 80.3% | 80.4% | 0.1 |
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 | 97.0% | 97.0% | 0.1 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 97.7% | 97.3% | -0.4 |
| pkg/apis/pipeline/v1beta1/taskrun_validation.go | 100.0% | 98.0% | -2.0 |
| pkg/reconciler/taskrun/taskrun.go | 80.3% | 80.4% | 0.1 |
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 | 97.0% | 97.0% | 0.1 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 97.7% | 98.1% | 0.4 |
| pkg/reconciler/taskrun/taskrun.go | 80.3% | 80.4% | 0.1 |
/retest
/retest
/retest
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 | 97.0% | 97.0% | 0.1 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 97.7% | 98.1% | 0.4 |
| pkg/reconciler/taskrun/taskrun.go | 80.3% | 80.4% | 0.1 |
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 | 97.0% | 97.0% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 97.7% | 98.1% | 0.4 |
| pkg/reconciler/taskrun/taskrun.go | 80.3% | 80.4% | 0.1 |
/retest
/kind bug
/assign
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.7% | 98.1% | 0.4 |
| pkg/reconciler/pipelinerun/pipelinerun.go | 85.8% | 85.8% | 0.0 |
| pkg/reconciler/taskrun/taskrun.go | 80.3% | 80.4% | 0.1 |
/retest
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.7% | 98.1% | 0.4 |
| pkg/reconciler/pipelinerun/pipelinerun.go | 85.8% | 85.8% | 0.0 |
| pkg/reconciler/taskrun/taskrun.go | 80.3% | 80.4% | 0.1 |
/retest
/retest
/retest
@jerop this is now ready for review. Thanks in advance 😄
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.3% | 98.1% | 0.8 |
| pkg/reconciler/pipelinerun/pipelinerun.go | 85.8% | 85.8% | 0.0 |
| pkg/reconciler/taskrun/taskrun.go | 80.6% | 80.7% | 0.1 |
@lbernick I accidentally re-requested review. Sorry about that. Please hold off until I implement your suggestions.
thanks Chitrang! Please rebase, and make sure these changes are reflected in v1 as well
Hi @lbernick, should I only update the files in V1 that are similar to those inv1beta1 or also others? I ask because I implemented some changes in files like pipeline_types.go and pipelinerun_validation.go which don't exist in v1. Should they be added there as well?
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.3% | 98.1% | 0.8 |
| pkg/reconciler/pipelinerun/pipelinerun.go | 85.8% | 85.8% | 0.0 |
| pkg/reconciler/taskrun/taskrun.go | 80.6% | 80.7% | 0.1 |
should I only update the files in
V1that are similar to those inv1beta1or also others? I ask because I implemented some changes in files likepipeline_types.go and pipelinerun_validation.gowhich don't exist inv1. Should they be added there as well?
Until we release v1 (and stop adding new features to v1beta1), we'll have to keep these two directories in sync. (This is a good reason to factor any non-api related logic out of pkg/apis/pipeline.) Any changes to v1beta1 should also be made to v1. The pipeline validation can be done in a separate PR though.