Add attended script for multi-branch UBI bump PRs - #3430
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe new ChangesUBI bump pull request automation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Script
participant Git
participant Registry
participant Podman
participant GitHub
Script->>Git: validate state and fetch upstream
Script->>Registry: resolve latest UBI digest
Script->>Git: create branch and run image bump
Script->>Podman: compare RPM inventories
Script->>Git: commit and push changes
Script->>GitHub: create pull request
GitHub-->>Script: return pull request URL
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Summary by QodoAdd attended script to open UBI bump PRs across release branches
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
|
FYI I used this to generate these PRs:
Works pretty good afaict. |
|
🤖 Finished Review · ✅ Success · Started 3:13 PM UTC · Completed 3:27 PM UTC |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@hack/ubi-bump-prs.sh`:
- Around line 172-176: Update the failed-push handling around the git push in
the script to distinguish non-fast-forward failures, fetch the current remote
state before retrying, and use an explicit --force-with-lease instead of -f. Do
not offer or perform an unconditional force push; preserve the existing prompt
and branch variables while ensuring collaborators’ remote commits cannot be
silently overwritten.
- Around line 140-145: In the declined-PR branch of the interactive loop, reset
the work branch to "$UPSTREAM_REMOTE/$BRANCH" before continuing so the bump’s
tracked changes are discarded and later git checkout -B operations can proceed.
Update the logic surrounding the answer check and preserve the existing skip
messages and continue behavior.
🪄 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: 49eab71c-fba6-403c-b62d-d77c46e186ef
📒 Files selected for processing (1)
hack/ubi-bump-prs.sh
Code Review by Qodo
1.
|
ReviewFindingsMedium
Low
Previous runReviewFindingsMedium
Low
Next steps:
Previous run (2)ReviewFindingsMedium
Low
Next steps:
Previous run (3)ReviewFindingsMedium
Low
Previous run (4)ReviewFindingsMedium
Low
Labels: PR adds developer automation tooling in hack/ for UBI base image management |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
c48f604 to
a3090fb
Compare
|
🤖 Finished Review · ✅ Success · Started 1:27 PM UTC · Completed 1:44 PM UTC |
|
Moving to draft while I look at the fullsend comments. |
Pull request was converted to draft
a3090fb to
af44b7c
Compare
|
🤖 Finished Review · ✅ Success · Started 5:19 PM UTC · Completed 5:35 PM UTC |
af44b7c to
0d74c14
Compare
|
🤖 Finished Review · ✅ Success · Started 8:49 PM UTC · Completed 9:06 PM UTC |
Wraps hack/ubi-base-image-bump.sh to automate creating PRs for all active branches, including an RPM version diff in the commit and PR body. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wraps hack/go-mod-upgrade-helper.sh to automate creating PRs for all active branches, showing old/new versions and prompting before each PR. The goal is to make it easier and faster to upgrade golang deps across all active branches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0d74c14 to
09fa222
Compare
|
🤖 Finished Review · ✅ Success · Started 1:15 PM UTC · Completed 1:30 PM UTC |
Superseded by updated review
| echo | ||
| continue | ||
| fi | ||
|
|
There was a problem hiding this comment.
[low] edge-case
The sed pattern used to extract OLD_VERSION and NEW_VERSION interpolates $PKG directly into a regex without escaping. Go module paths contain dots that are regex wildcards. In practice the risk of a false match in go.mod is negligible, but it is a latent correctness issue.
Suggested fix: Escape regex metacharacters in $PKG before using it in the sed expression.
| COMMIT_MSG="chore(deps): Update ubi-minimal base image | ||
|
|
||
| Old digest: sha256:$OLD_DIGEST | ||
| New digest: sha256:$NEW_DIGEST" |
There was a problem hiding this comment.
[low] staging-idiom
Uses git add -A to stage all changes before committing. Other scripts in hack/ that commit changes explicitly name the files being staged. The clean-tree prerequisite check mitigates the risk, but aligning with repo conventions is worthwhile.
Suggested fix: Replace git add -A with the known file list: git add Dockerfile Dockerfile.dist acceptance/kubernetes/kind/acceptance.Dockerfile rpms.lock.yaml.
| echo | ||
|
|
||
| CREATED_PRS=() | ||
|
|
There was a problem hiding this comment.
[low] edge-case
LATEST_DIGEST is computed as sha256sum of the raw manifest from skopeo inspect --raw. This is consistent with ubi-base-image-bump.sh today but creates a fragile coupling — if either script changes its digest computation method, the comparison could break silently.
| HEAD_BEFORE=$(git rev-parse HEAD) | ||
| if ! hack/go-mod-upgrade-helper.sh "${HELPER_CMD_ARGS[@]}"; then | ||
| echo "go-mod-upgrade-helper.sh failed for $BRANCH, skipping." | ||
| git reset --hard "$UPSTREAM_REMOTE/$BRANCH" |
There was a problem hiding this comment.
[low] edge-case
When HELPER_ARGS is empty, ${HELPER_ARGS[@]} can fail with 'unbound variable' on Bash < 4.4 under set -o nounset. The existing go-mod-upgrade-helper.sh uses the same pattern, so this is consistent with the codebase.
Suggested fix: Use ${HELPER_ARGS[@]+"${HELPER_ARGS[@]}"} for safe expansion on older Bash versions.
Summary
hack/ubi-bump-prs.sh, an attended script that creates UBI base image bump PRs across all active release brancheshack/ubi-base-image-bump.shand adds RPM version diffing (viapodman run rpm -qa) in both the commit message and PR bodyUsage
🤖 Generated with Claude Code