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: stepaction param default value referencing other param #8513

Closed
wants to merge 1 commit into from

Conversation

waveywaves
Copy link
Member

@waveywaves waveywaves commented Jan 22, 2025

Changes

  • multipass default value substitution: one for non referenced default values, another one for parameter references in default values
  • add validation to ensure parameters referenced in default values are defined before use
  • substitute default values of parameters with referenced parameter values if necessary
  • update replacementsFromStepResults to only process step result references
  • add comments which highlight order of hydration of parameters
  • add example for parameter references in default values of step action parameters

fixes #7935

/kind bug

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

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 22, 2025
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign yongxuanzhang after the PR has been reviewed.
You can assign the PR to them by writing /assign @yongxuanzhang in a comment when ready.

The full list of commands accepted by this bot can be found 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

@waveywaves
Copy link
Member Author

/test check-pr-has-kind-label

@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 check-pr-has-kind-label

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

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 22, 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% 99.1% 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

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 22, 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% 91.2% -7.9

@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% 91.2% -7.9

@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% 91.2% -7.9

- multipass default value substitution: one for non referenced default values,
another one for parameter references in default values
- add validation to ensure parameters referenced in default values are defined
  before use
- substitute default values of parameters with referenced parameter values if necessary
- update replacementsFromStepResults to only process step result references
- add comments which highlight order of hydration of parameters
- add tests for replacementsFromStepResults, validateDefaultParameterReferences
- add example for parameter references in default values of step action parameters

Signed-off-by: Vibhav Bobade <[email protected]>
@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% 91.2% -7.9

@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% 91.2% -7.9

@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% 91.2% -7.9

@waveywaves
Copy link
Member Author

I had added two tests, had to remove them because I made a lot of changes to the main code after, I will add those tests back again soon. Any reviews would still be appreciated.

@waveywaves waveywaves marked this pull request as draft January 23, 2025 06:42
@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 Jan 23, 2025
@waveywaves
Copy link
Member Author

turning this into a draft PR, found some bugs while testing

@waveywaves
Copy link
Member Author

waveywaves commented Jan 23, 2025

closing this PR, it can be broken down into smaller PRs

@waveywaves waveywaves closed this Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. 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
Status: Done
Development

Successfully merging this pull request may close these issues.

Reusing Params substitution in StepActions does not always work
2 participants