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

fix: reference params in default values, allow chained references in stepactions #8536

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

waveywaves
Copy link
Member

@waveywaves waveywaves commented Jan 28, 2025

Changes

  • parameter defaults can now reference other parameters in chain
    • validate if the default parameter references are correct
    • ensure that no referenced parameter goes unresolved, including the chains
    • ensure that there are no circular dependencies with param referencing
    • multipass replacement from default params to ensure both referenced and non reference default values are processed
    • add tests

fixes #7935

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

/kind bug

Release Notes

fixes https://github.com/tektoncd/pipeline/issues/7935 allowing users to reference other parameters in default values

@tekton-robot
Copy link
Collaborator

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

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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. labels Jan 28, 2025
@tekton-robot tekton-robot requested review from abayer and jerop January 28, 2025 12:59
@waveywaves waveywaves force-pushed the fix/issue-7935 branch 2 times, most recently from e9a6fd9 to 6fbb28b Compare January 28, 2025 13:11
@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 97.7% -1.5

@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 97.7% -1.5

@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 97.7% -1.5

@waveywaves waveywaves force-pushed the fix/issue-7935 branch 2 times, most recently from b8a307e to 46a7adc Compare January 28, 2025 13:24
@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 98.3% -0.8

@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.0% -0.1

@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 98.3% -0.8

@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 98.3% -0.8

@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.3% 0.2

@waveywaves waveywaves marked this pull request as ready for review January 28, 2025 13:53
@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 Jan 28, 2025
@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.4% 0.2

@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.4% 0.2

@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/v1alpha1/stepaction_validation.go 98.9% 99.1% 0.1
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.4% 0.2

- parameter defaults can now reference other parameters in chain
- validate if the default parameter references are correct
- ensure that no referenced parameter goes unresolved, including the chains
- ensure that there are no circular dependencies with param referencing
- multipass replacement from default params to ensure both referenced and non reference default values are processed
- add tests
@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 28, 2025
@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/v1alpha1/stepaction_validation.go 98.9% 95.5% -3.5
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.4% 0.2

@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 95.5% -3.5
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.4% 0.2

@waveywaves waveywaves changed the title fix: reference params in default values, allow chained references fix: reference params in default values, allow chained references in stepactions Jan 28, 2025
@waveywaves
Copy link
Member Author

/retest

@waveywaves
Copy link
Member Author

/test ?

@tekton-robot
Copy link
Collaborator

@waveywaves: The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

/test ?

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.

@waveywaves
Copy link
Member Author

/test e2e

@tekton-robot
Copy link
Collaborator

@waveywaves: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

/test e2e

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.

@waveywaves
Copy link
Member Author

/retest

@waveywaves
Copy link
Member Author

/test all

@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/v1alpha1/stepaction_validation.go 98.9% 95.5% -3.5
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.4% 0.2

@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.2% 0.3
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.4% 0.2

@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/v1alpha1/stepaction_validation.go 98.9% 99.2% 0.3
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.4% 0.2

@tekton-robot
Copy link
Collaborator

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
pkg/apis/pipeline/v1alpha1/stepaction_validation.go 98.9% 99.2% 0.3
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.4% 0.2

@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/v1alpha1/stepaction_validation.go 98.9% 99.2% 0.3
pkg/reconciler/taskrun/resources/apply.go 99.1% 99.4% 0.2

@waveywaves
Copy link
Member Author

/retest

1 similar comment
@vdemeester
Copy link
Member

/retest

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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 29, 2025
@abayer
Copy link
Contributor

abayer commented Jan 30, 2025

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 30, 2025
@tekton-robot tekton-robot merged commit c6d38c9 into tektoncd:main Jan 30, 2025
18 checks passed
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Reusing Params substitution in StepActions does not always work
4 participants