-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix parameter substitution for defaults referencing other params #9186
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
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This fixes issue tektoncd#8862 where parameter default values that reference other parameters (e.g., default: $(params.fallback-param)) were not being properly substituted when using local pipeline resolution. - Added logic to handle parameter dependency chains by resolving in multiple passes until no more substitutions are needed - Added three test cases covering all scenarios from issue tektoncd#8862 Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
12c5860 to
86ba51c
Compare
|
/retest |
1 similar comment
|
/retest |
|
/cc @twoGiants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! 😸 👍
It does work for the new test cases which were introduced but breaks for some others.
Unfortunately the current (and former) implementation has a few issues. In general I had difficulties to understand this algorithm but I figured it out after a while and re-worked it. Will open a PR in the next days and link here.
The function ApplyParameters should return an error in quite a few cases, but there is no error handling implemented. Here are the bugs I found:
- Circular dependencies not handled.
- Reverse declaration order not handled.
- Self-reference not handled.
- Referencing non existent parameter not handled.
It looks like the issues were there before.
More detail with examples follows.
P.S.: Here is my commit in a branch with the current re-work. It's a bit more code, but it's easier to grasp what happens, has error handling and the algorithm has O(n) complexity. I added a few comments with examples in the critical places. It's mostly done. The recursion depth limit will be implemented and then I open a PR.
Alright, I've opened a PR (#9271) with a re-write. It also fixes the issue @valAndre07 was having and the others I found. Check out the issue (#9270 ) I created and the PR description for more info. @valAndre07 you can check out the PR branch locally, build Tekton, deploy on your cluster and test it manually if it works as expected. Such a manual test would be much appreciated. @vdemeester I've added the three test cases from this branch and they pass and I am also manually testing it. Will write the results in my PR. I think we can close this PR. Wdyt? |
Changes
This fixes issue #8862 where parameter default values that reference
other parameters (e.g., default: $(params.fallback-param)) were not
being properly substituted when using local pipeline resolution.
multiple passes until no more substitutions are needed
Co-Authored-By: Claude noreply@anthropic.com
Signed-off-by: Vincent Demeester vdemeest@redhat.com
Fixes #8862
/kind bug
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes