Skip to content

POC - Params in separate file#1644

Open
ckhordiasma wants to merge 32 commits intorhoai-3.4-ea.2from
separate-params
Open

POC - Params in separate file#1644
ckhordiasma wants to merge 32 commits intorhoai-3.4-ea.2from
separate-params

Conversation

@ckhordiasma
Copy link
Contributor

  • define params-file param, and params-init step
  • change params-init step base image

@ckhordiasma ckhordiasma marked this pull request as draft March 16, 2026 17:03
@ckhordiasma
Copy link
Contributor Author

/retest

ckhordiasma and others added 26 commits March 16, 2026 15:07
…line

Correct Tekton variable syntax for params-init task results (use
$(tasks.params-init.results.<name>) instead of $(results.params-init.<name>)
and $(tasks.params-init.<name>)) and quote variable in tee command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace duplicate yq invocation (check then read) with a single call
that captures the value and handles the missing-param case inline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…init

Move $(params.*) substitutions from inline script into env blocks so
values are not subject to shell interpretation. Consolidate parallel
arrays into a single PARAM_NAMES list with env var names derived by
convention (PARAM_<UPPER_SNAKE>).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Derive param values from env vars using bash indirection (${!ENV_NAME})
based on a naming convention (PARAM_<UPPER_SNAKE>), eliminating the
parallel PARAM_VALUES array. Result paths remain hardcoded since Tekton
validates $(results.*) references at admission time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the no-op base image directive with a multi-stage build that
compiles a simple Go program on ubi9/go-toolset and runs it on
ubi9/ubi-minimal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
yq -e treats YAML boolean false as falsy and exits with code 1, even
when the field exists. Use has("value") to check field existence
separately, then read the value without -e.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a header line, indent each param, and print values on labeled lines
instead of concatenating them via tee.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Detect the YAML value type and output compact JSON for arrays (!!seq)
and objects (!!map) to match Tekton's expected result format. Scalar
values continue to be written as plain text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add PARAM_TYPES array to distinguish string/array/object params.
Array params are serialized to JSON via jq in PARAM_VALUES. The
override loop already handles type-aware output. Downstream references
updated to use params-init results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace bash script with Python for cleaner param handling. Uses yq to
convert the YAML params file to JSON, then reads it with json.load().
Type detection for array/object results is handled natively via
isinstance() instead of yq type checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded PARAMS dict with argparse (--name, --path, --value).
All param defaults are now passed through Tekton args, avoiding inline
substitution in the script. Type is inferred from value count: multiple
values = array, single = string. Adding a new param only requires a new
args line and a taskSpec result entry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Expand comma-separated args into individual block sequence entries.
YAML block style requires each item on its own '- ' line.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use --array before --value to indicate the param is an array type,
ensuring single-element arrays are serialized as JSON arrays rather
than plain strings. Replace argparse with manual arg parsing to keep
flag grouping per param.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ckhordiasma and others added 4 commits March 17, 2026 11:45
New string params: prefetch-mode, prefetch-config-file-content,
prefetch-log-level, fetch-git-tags, clone-depth, additional-build-secret,
rhel-subscription-activation-key, path-context, dockerfile.
New array params: build-args, additional-labels.
All downstream references updated to use params-init task results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
See if Tekton allows array pipeline params with [*] in inline taskSpec
args without explicit task-level param declarations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ckhordiasma ckhordiasma marked this pull request as ready for review March 17, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant