Skip to content

Replaced the Kustomize-based Tekton PipelineRun generation pipeline with a Jinja2/Python script#4087

Merged
HuijingHei merged 2 commits intocoreos:testing-develfrom
HuijingHei:tekton-jinjia2
Apr 3, 2026
Merged

Replaced the Kustomize-based Tekton PipelineRun generation pipeline with a Jinja2/Python script#4087
HuijingHei merged 2 commits intocoreos:testing-develfrom
HuijingHei:tekton-jinjia2

Conversation

@HuijingHei
Copy link
Copy Markdown
Member

New files created:

  • .tekton/templates/pipelinerun.yaml.j2 - Jinja2 template for generating PipelineRun YAML
  • .tekton/templates/streams.yaml - Configuration file defining all streams and their settings
  • ci/generate-tekton-pipelinerun.py - Python script that generates the PipelineRun files
    Files removed:
  • ci/generate-tekton-pipelinerun - Old bash script that required the kustomize binary
  • .tekton/base/ directory - All Kustomize base templates
  • kustomization.yaml files - Throughout the .tekton/ directory Files modified:
  • .tekton/README.md - Updated documentation with new workflow

Key features of the new system:

  1. No runtime dependency on kustomize binary
  2. Centralized configuration - All stream settings in streams.yaml
  3. --check mode - For CI verification that generated files are up to date
  4. Stream-specific customizations supported:
    • has_overrides - Whether to generate the on-pull-request-overrides pipeline
    • hermetic - Build isolation setting (default: true, false for branched)
    • on_push_cel_expression - Custom CEL expression (used by rawhide)

Assisted-by: Claude Opus 4.5 Vertex (Anthropic)

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the Kustomize-based Tekton PipelineRun generation with a Python script and Jinja2 templates. The new approach uses a centralized configuration file (streams.yaml) and a base template (pipelinerun.yaml.j2) to generate resources for various Fedora CoreOS streams. Review feedback suggests improving the Python script's portability by explicitly defining file encodings and enhancing the YAML template's reliability by quoting variable values to prevent parsing errors.

{%- endif %}
build.appstudio.redhat.com/target_branch: '{{ '{{target_branch}}' }}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: {{ cel_expression }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The CEL expression should be quoted to ensure it is correctly parsed as a string in YAML, especially since it contains characters like & and == which can be misinterpreted in certain contexts.

    pipelinesascode.tekton.dev/on-cel-expression: '{{ cel_expression }}'

- name: revision
value: '{{ '{{revision}}' }}'
- name: output-image
value: {{ output_image }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The output image URL should be quoted as it contains colons and potentially other characters that can be misinterpreted by YAML parsers if not explicitly treated as a string.

    value: "{{ output_image }}"

value: '[{"type": "rpm", "path": "."}]'
{%- if image_expires_after %}
- name: image-expires-after
value: {{ image_expires_after }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Quoting the value ensures it is treated as a string by Tekton, which is the expected type for most pipeline parameters.

    value: "{{ image_expires_after }}"

pipelineRef:
params:
- name: bundle
value: {{ pipeline_bundle }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The pipeline bundle reference should be quoted to prevent any potential YAML parsing issues with the digest (@sha256:...) or URL characters.

      value: "{{ pipeline_bundle }}"

@HuijingHei HuijingHei force-pushed the tekton-jinjia2 branch 2 times, most recently from 2031b6e to ccffc29 Compare March 31, 2026 09:13
@HuijingHei HuijingHei marked this pull request as ready for review April 2, 2026 06:33
joelcapitao
joelcapitao previously approved these changes Apr 3, 2026
Copy link
Copy Markdown
Member

@joelcapitao joelcapitao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's neat ! Thank you for working on this.
I would have splitted the PR into 2 commits 1. the new changes and 2. the removal of all the files that are not needed anymore. That would ease the review process.
The CI jobs already validates that the final generated YAML files are strictly identical.

Also, as a follow-up patch, could you update the Konflux doc accordingly please ? c.f https://github.com/coreos/fedora-coreos-pipeline/blob/main/docs/KONFLUX.md#templating-approach

@HuijingHei HuijingHei force-pushed the tekton-jinjia2 branch 2 times, most recently from 9c802f3 to 09518db Compare April 3, 2026 10:22
New files created:
- .tekton/templates/pipelinerun.yaml.j2 - Jinja2 template for
generating PipelineRun YAML
- .tekton/templates/streams.yaml - Configuration file defining
all streams and their settings
- ci/generate-tekton-pipelinerun.py - Python script that generates
the PipelineRun files

Files modified:
- .tekton/README.md - Updated documentation with new workflow

Assisted-by: Claude Opus 4.5 Vertex (Anthropic)
@HuijingHei HuijingHei merged commit fc6a8b7 into coreos:testing-devel Apr 3, 2026
12 checks passed
@HuijingHei HuijingHei deleted the tekton-jinjia2 branch April 3, 2026 13:36
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.

2 participants