feat: introduce when expressions to steps
Changes
This PR introduces the use of "when" expressions within Tekton steps, enabling conditional execution. The controller marshals the taskSpec.steps[*].when data and passes it to the entrypointer. The entrypointer evaluates these expressions to determine if a step should run. Skipped steps exit with code 0 and a 'Skipped' TerminationReason. This approach allows steps to use previous step results in their conditions, even though the controller still creates the container for skipped steps.
Note: StepAction doesn't own whenExpressions, whenExpressions should be defined under steps[*] to control the flow.
fixes: #7623
Related
- tep: https://github.com/tektoncd/community/pull/1147
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
- [x] Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
- [x] Has Tests included if any functionality added or changed
- [x] pre-commit Passed
- [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). See some examples of good release notes.
- [ ] Release notes contains the string "action required" if the change requires additional action from users switching to the new release
Release Notes
introduce when expressions to steps.
/kind feat
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
@ericzzzzzzz: The label(s) kind/feat cannot be applied, because the repository doesn't have them.
In response to this:
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
- [ ] Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
- [ ] Has Tests included if any functionality added or changed
- [ ] pre-commit Passed
- [ ] 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). See some examples of good release notes.
- [ ] Release notes contains the string "action required" if the change requires additional action from users switching to the new release
Release Notes
NONE/kind feat
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.
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 72.1% | -16.9 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 72.1% | -16.9 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 72.1% | -16.9 |
| pkg/pod/entrypoint.go | 94.1% | 93.5% | -0.5 |
/kind feature
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.6% | 1.7 |
| pkg/pod/entrypoint.go | 94.1% | 93.3% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.6% | 1.7 |
| pkg/pod/entrypoint.go | 94.1% | 93.3% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.6% | 1.7 |
| pkg/pod/entrypoint.go | 94.1% | 93.3% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.6% | 1.7 |
| pkg/pod/entrypoint.go | 94.1% | 93.3% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.6% | 1.7 |
| pkg/pod/entrypoint.go | 94.1% | 93.3% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.6% | 1.7 |
| pkg/pod/entrypoint.go | 94.1% | 93.3% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.6% | 1.7 |
| pkg/pod/entrypoint.go | 94.1% | 93.3% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.6% | 1.7 |
| pkg/pod/entrypoint.go | 94.1% | 93.3% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.6% | 1.7 |
| pkg/pod/entrypoint.go | 94.1% | 93.3% | -0.7 |
/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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.3% | 1.3 |
| pkg/pod/entrypoint.go | 94.1% | 93.4% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.3% | 1.3 |
| pkg/pod/entrypoint.go | 94.1% | 93.4% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.3% | 1.3 |
| pkg/pod/entrypoint.go | 94.1% | 93.4% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.3% | 1.3 |
| pkg/pod/entrypoint.go | 94.1% | 93.4% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.3% | 1.3 |
| pkg/pod/entrypoint.go | 94.1% | 93.4% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.1% | -0.5 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.3% | 1.3 |
| pkg/pod/entrypoint.go | 94.1% | 93.4% | -0.7 |
/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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.0% | -0.6 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.3% | 1.3 |
| pkg/pod/entrypoint.go | 94.1% | 93.4% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.0% | -0.6 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.3% | 1.3 |
| pkg/pod/entrypoint.go | 94.1% | 93.4% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.0% | -0.6 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.3% | 1.3 |
| pkg/pod/entrypoint.go | 94.1% | 93.4% | -0.7 |
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 |
|---|---|---|---|
| cmd/entrypoint/main.go | 11.6% | 11.0% | -0.6 |
| pkg/apis/pipeline/v1/task_validation.go | 98.5% | 98.5% | 0.0 |
| pkg/apis/pipeline/v1beta1/task_validation.go | 98.4% | 98.4% | 0.0 |
| pkg/container/step_replacements.go | 70.0% | 72.7% | 2.7 |
| pkg/entrypoint/entrypointer.go | 89.0% | 90.3% | 1.3 |
| pkg/pod/entrypoint.go | 94.1% | 93.4% | -0.7 |
Thanks for your work here @ericzzzzzzz /meow
@chitrangpatel: 
In response to this:
Thanks for your work here @ericzzzzzzz /meow
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.
@tektoncd/core-collaborators PTAL 🙏 It unlocks https://github.com/tektoncd/pipeline/issues/7623.