Build-time param defaults in in tkn-bundle#3490
Conversation
Review Summary by QodoAdd build-time parameter defaults support to tkn-bundle tasks
WalkthroughsDescription• Add PARAM_DEFAULTS parameter to customize task parameter defaults at build time • Implement parameter default value substitution in tkn-bundle tasks • Update documentation across multiple README files • Add comprehensive test coverage for param defaults functionality Diagramflowchart LR
A["PARAM_DEFAULTS input"] -->|"space-separated PARAM=VALUE"| B["Parse entries"]
B -->|"extract name and value"| C["Update task YAML files"]
C -->|"yq modify .spec.params"| D["Set default values in bundle"]
D -->|"push to registry"| E["Bundle with custom defaults"]
File Changes1. task/tkn-bundle/0.2/tkn-bundle.yaml
|
Code Review by Qodo
Context used✅ Tickets:
EC-1790 1. yq params not null-safe
|
3dfe5ac to
5631cdb
Compare
5631cdb to
673ba12
Compare
|
Last push because I forgot to run |
673ba12 to
9db4b3e
Compare
|
And that push was just a rebase on fresh upstream/main. |
9db4b3e to
686db14
Compare
|
Added a version bump and a changelog entry as suggested by the CI. |
The high level goal is to be able to update one single artifact (the tekton task bundle for Conforma) and have it specify a pinned and therefore stable Conforma cli and Conforma policy bundle. The cli pinning is done already. The policy pinning is WIP. We're introducing a param called POLICY_BUNDLE_DIGEST in this PR. Actually in that PR as it is now we are pinning the digest in the source code, but the idea is that we'd prefer to pin it to whatever the current policy bundle is at the time of build (since we'll run some CI to ensure the cli and policy bundle work well together). This change in the tkn-bundle task means we could pass in the exact digest that was used in the CI, so we get a stable pinned policy bundle, but avoid the chore of needing to regularly update the hard-coded digest in the definition to make sure the policy bundle doesn't get old and stale. |
It's a long story, but we want to reduce the number of moving parts related to updating Conforma in Red Hat Konflux. Being able to pin the policy bundle when building the Conforma tasks means we can reduce breakages related to old incompatible versions of the cli being used with the latest policy bundle. See also the related PR at conforma/cli#3268 Ref: https://redhat.atlassian.net/browse/EC-1790 Co-authored-by: Claude Code <noreply@anthropic.com>
686db14 to
c783026
Compare
|
Last revision included some commentary improvements, and a very minor change to the log output. Also I rebased on the latest main branch. |
What would be the trigger to build and release a new task bundle? Typically, the trigger for Konflux builds is a code change. A Renovate PR that updates the policy bundle seems like the obvious trigger. How would versioning work? The task will re-release with the same version number but will reference a different version of the policy over time? |
We build a task bundle on every merge. Actually it's done in our Konflux on-push pipeline, see here.
It's a good question. Currently all the tasks are "0.1". We actually don't bump the version. Perhaps we'll change that, but I see it as out of scope for EC-1790. |
Ack, I see now how it makes sense for your particular setup. Though modifying the task definition dynamically at build time still doesn't feel like something that should become an accepted pattern. Would you be able to achieve what you need using the I imagine you will need to execute some custom code in the pipeline to find the bundle digest anyway, so would it work to just edit the YAML in-place using custom code as well? |
Yeah, the motivation is quite similar actually. For STEP_IMAGE the goal was to use a fresh and pinned task runner image conveniently without needing to hard code the digest anywhere. The PARAM_DEFAULTS is similar in that we want to use it to pin a policy bundle without needing to hard code its digest, (and hence require some manual update toil, or some complicated automation to update it when necessary). FWIW, one argument against merging this is that we might be the only team that makes use of it, however I think there may be other use cases for setting a param default at build time. |
|
We realized that the release service pipelines are using git resolvers, so adjusting the value in the tekton bundle doesn't make any difference for them. A hard coded digest in git is the only thing that does works for them. Until we can move release service pipelines to bundle resolvers, let's put this on hold. |
It's a long story, but we want to reduce the number of moving parts related to updating Conforma in Red Hat Konflux. Being able to pin the policy bundle when building the Conforma tasks means we can reduce breakages related to old incompatible versions of the cli being used with the latest policy bundle.
See also the related PR at conforma/cli#3268
Ref: https://redhat.atlassian.net/browse/EC-1790