Update POLICY_BUNDLE_DIGEST in tekton-task bundle and catalog#217
Conversation
After acceptance tests pass and policy bundles are tagged :konflux, the tekton-catalog-release job now extracts all tasks from the tested bundle, updates the POLICY_BUNDLE_DIGEST default to the current release-policy:konflux digest, rebuilds the tekton-task bundle, and pushes both the bundle (:konflux) and task files (tekton-catalog). The tag job no longer copies the tekton-task bundle directly since tekton-catalog-release handles it with the updated digest. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR splits tekton bundle publishing into a dedicated ChangesTekton task bundle extraction and release refactoring
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
yq navigates the YAML structure properly rather than relying on fragile regex pattern matching against raw text. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/konflux-policy.yaml (1)
230-231:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftThis overlay copy leaves removed tasks and versions behind.
cp -ronly adds or overwrites. If a task or version disappears from the tested bundle, the old directory remains intekton-catalog, so the branch can drift from the bundle this job just pushed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/konflux-policy.yaml around lines 230 - 231, The overlay copy using the shell command "cp -r /tmp/catalog-tasks/tasks/* tasks/" leaves deleted tasks/versions behind; replace it with a synchronization that removes stale destinations (for example use "rsync -a --delete /tmp/catalog-tasks/tasks/ tasks/" or alternatively remove the destination directory before copying) so the destination "tasks/" exactly mirrors the extracted bundle; update the CI step that runs the "cp -r /tmp/catalog-tasks/tasks/* tasks/" command to use the rsync --delete form (or a remove-then-copy sequence) to prevent drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/konflux-policy.yaml:
- Around line 176-179: The script currently treats "no task files found" as
success; change the behavior so absence of any files matching
POLICY_BUNDLE_DIGEST is treated as a failure: after computing TASK_FILES (via
grep -rl 'POLICY_BUNDLE_DIGEST' ...), if TASK_FILES is empty then emit an
explicit error message and exit with non-zero status (e.g., exit 1) so the
workflow fails; ensure you reference the TASK_FILES variable and the
POLICY_BUNDLE_DIGEST match check in the updated conditional to make the failure
explicit.
- Around line 142-145: Replace the mutable action tag and dynamic CLI version by
pinning both the GitHub Action reference and the Tekton CLI version: change
uses: tektoncd/actions/setup-tektoncd-cli@v1 to the exact commit SHA for
tektoncd/actions/setup-tektoncd-cli, and replace version: latest with an
explicit CLI release string (for example "v0.45.0"); ensure the commit SHA and
CLI version you choose correspond to the same tested release so the action and
the installed CLI are immutable and reproducible.
In `@hack/extract-all-bundle-tasks.sh`:
- Around line 36-37: The repo-parsing currently uses REPO="${BUNDLE%@*}" then
REPO="${REPO%:*}", which incorrectly strips host ports (e.g., registry:5000)
because it removes everything after the last colon; change the logic to only
strip an image tag from the path basename so ports remain. Replace the single
`${REPO%:*}` step with logic that splits REPO into dir="${REPO%/*}" and
base="${REPO##*/}", then strip a tag from base with base="${base%%:*}" and
rebuild REPO as either "$base" (if no dir) or "$dir/$base"; keep using the same
BUNDLE/REPO variable names so the later crane blob calls target the correct
repository with port preserved.
---
Outside diff comments:
In @.github/workflows/konflux-policy.yaml:
- Around line 230-231: The overlay copy using the shell command "cp -r
/tmp/catalog-tasks/tasks/* tasks/" leaves deleted tasks/versions behind; replace
it with a synchronization that removes stale destinations (for example use
"rsync -a --delete /tmp/catalog-tasks/tasks/ tasks/" or alternatively remove the
destination directory before copying) so the destination "tasks/" exactly
mirrors the extracted bundle; update the CI step that runs the "cp -r
/tmp/catalog-tasks/tasks/* tasks/" command to use the rsync --delete form (or a
remove-then-copy sequence) to prevent drift.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: d676bebc-8f15-49f4-b1de-b96871a3bcc9
📒 Files selected for processing (2)
.github/workflows/konflux-policy.yamlhack/extract-all-bundle-tasks.sh
Silently succeeding would publish the bundle and catalog with stale digest defaults if the task YAML structure changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tekton-catalog jobs Each job can now be toggled separately via workflow_dispatch inputs: - run_tag: tag tested images as :konflux - run_tekton_task_bundle: rebuild tekton-task bundle with updated policy digest - run_tekton_catalog: sync task definitions to tekton-catalog git repo The tekton-catalog job extracts from whatever is currently in tekton-task:konflux rather than sharing artifacts with the bundle rebuild, so it works whether the bundle was just rebuilt or not. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/konflux-policy.yaml (1)
132-149: ⚡ Quick winConsider adding a workflow
concurrency:group to serialize publishing.Because
tekton-task-bundleandtekton-catalogboth push to mutable refs (quay.io/conforma/tekton-task:konfluxand thekonfluxbranch ofconforma/tekton-catalog), two concurrentworkflow_dispatchruns can race and clobber each other (e.g., one run’s bundle paired with another’s catalog commit). A workflow-level concurrency group cleanly prevents this.♻️ Suggested top-level addition
permissions: contents: read +concurrency: + group: konflux-policy + cancel-in-progress: false + jobs:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/konflux-policy.yaml around lines 132 - 149, Add a top-level workflow concurrency group to serialize publishing so the tekton-task-bundle and tekton-catalog jobs cannot run concurrently and race when pushing mutable refs (the quay.io/conforma/tekton-task:konflux image tag and the konflux branch of conforma/tekton-catalog). Modify the workflow YAML to add a top-level concurrency block that uses a stable group key (for example a fixed "konflux-publish" or one derived from the repository/branch like "konflux-publish-${{ github.ref }}") so only one workflow run that may push these refs can proceed at a time; this ensures the tekton-task-bundle and tekton-catalog jobs are effectively serialized without changing their job definitions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/konflux-policy.yaml:
- Around line 132-149: Add a top-level workflow concurrency group to serialize
publishing so the tekton-task-bundle and tekton-catalog jobs cannot run
concurrently and race when pushing mutable refs (the
quay.io/conforma/tekton-task:konflux image tag and the konflux branch of
conforma/tekton-catalog). Modify the workflow YAML to add a top-level
concurrency block that uses a stable group key (for example a fixed
"konflux-publish" or one derived from the repository/branch like
"konflux-publish-${{ github.ref }}") so only one workflow run that may push
these refs can proceed at a time; this ensures the tekton-task-bundle and
tekton-catalog jobs are effectively serialized without changing their job
definitions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: fa500bf2-fea7-4197-a497-c51311b63ce0
📒 Files selected for processing (1)
.github/workflows/konflux-policy.yaml
Both tekton-task-bundle and tekton-catalog now consume the same artifact from update-task-definitions, guaranteeing identical task definitions in the OCI bundle and the git repo. The two downstream jobs are fully independent and run in parallel. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the inline POLICY_BUNDLE_DIGEST update logic from the workflow into a standalone script that can be tested locally. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests mock crane via a CRANE_DATA fixture directory and use real jq/yq/grep on local data. Covers happy paths, idempotency, error cases, and edge cases like missing version labels. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Jira: EC-1846
Summary
tekton-catalog-releasejob now updates thePOLICY_BUNDLE_DIGESTdefault in task definitions to the currentrelease-policy:konfluxdigest:konflux, keeping the bundle and tekton-catalog in synchack/extract-all-bundle-tasks.shto extract all tasks from a bundle (not just acceptance-tested ones), socollect-keyless-paramsis includedChanges
tagjob: Filters tekton-task entries from "Tag tested images by digest" since the bundle is now rebuilt bytekton-catalog-release.tekton-catalog-releasejob:acceptance-testsandtag(toleratestagbeing skipped)crane auth login(compatible withtkn bundle push)extract-all-bundle-tasks.shrelease-policy:konfluxdigest viacrane digestand updatesPOLICY_BUNDLE_DIGESTin task definitionsquay.io/conforma/tekton-task:konfluxviatkn bundle pushconforma/tekton-catalogkonflux branch (existing behavior)Test plan
workflow_dispatchwithrun_tag: trueandrun_tekton_catalog: truequay.io/conforma/tekton-task:konfluxcontains all 3 tasks (verify-enterprise-contract,verify-conforma-konflux-ta,collect-keyless-params)POLICY_BUNDLE_DIGESTdefault in the bundle tasks matchescrane digest quay.io/conforma/release-policy:konfluxconforma/tekton-catalogkonflux branch has the same updated digestrun_tag: false+run_tekton_catalog: truestill works (uses existing:konfluxdigest)🤖 Generated with Claude Code