Replaced the Kustomize-based Tekton PipelineRun generation pipeline with a Jinja2/Python script#4087
Conversation
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
| - name: revision | ||
| value: '{{ '{{revision}}' }}' | ||
| - name: output-image | ||
| value: {{ output_image }} |
| value: '[{"type": "rpm", "path": "."}]' | ||
| {%- if image_expires_after %} | ||
| - name: image-expires-after | ||
| value: {{ image_expires_after }} |
| pipelineRef: | ||
| params: | ||
| - name: bundle | ||
| value: {{ pipeline_bundle }} |
2031b6e to
ccffc29
Compare
joelcapitao
left a comment
There was a problem hiding this comment.
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
9c802f3 to
09518db
Compare
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)
09518db to
afdb36f
Compare
New files created:
Files removed:
Key features of the new system:
Assisted-by: Claude Opus 4.5 Vertex (Anthropic)