Skip to content

fix(release): get RHEL base image version in verify-release#19905

Merged
davdhacs merged 2 commits intomasterfrom
fix-verify-release-rhel-version
Apr 9, 2026
Merged

fix(release): get RHEL base image version in verify-release#19905
davdhacs merged 2 commits intomasterfrom
fix-verify-release-rhel-version

Conversation

@davdhacs
Copy link
Copy Markdown
Contributor

@davdhacs davdhacs commented Apr 8, 2026

problem:
The verify-release script hardcoded rhacs-main-rhel9, which fails for releases 4.10 and below that use rhel8 base images.

fix:
Check if the operator image (no "rhelN" metadata is in the image name) for the release version.

Verified by running against 4.8.10, 4.9.5, and 4.10.1 — all pass the image check (example run with @tommartensen 's suggestion: https://github.com/stackrox/stackrox/actions/runs/24196594919)

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 8, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The minor version extraction assumes a plain x.y.z SemVer string and may break for pre-release or suffixed tags (e.g. 4.11.0-rc.1); consider parsing with shell parameter expansion and stripping non-digit suffixes to make this more robust.
  • It may be worth adding a small guard to ensure minor_version is numeric before using -ge (e.g. defaulting to a safe value or failing fast with a clear error) to avoid unexpected behavior if the version format changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The minor version extraction assumes a plain `x.y.z` SemVer string and may break for pre-release or suffixed tags (e.g. `4.11.0-rc.1`); consider parsing with shell parameter expansion and stripping non-digit suffixes to make this more robust.
- It may be worth adding a small guard to ensure `minor_version` is numeric before using `-ge` (e.g. defaulting to a safe value or failing fast with a clear error) to avoid unexpected behavior if the version format changes.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

📝 Walkthrough

Walkthrough

The validate_images() function in the release verification script now dynamically selects the RHEL tag variant (rhel8 or rhel9) based on the minor version component of the release patch string, replacing a hardcoded rhel9 reference.

Changes

Cohort / File(s) Summary
RHEL Version Tag Selection
.github/workflows/scripts/verify-release.sh
Modified validate_images() to parse the minor version from RELEASE_PATCH and conditionally select rhel9 tag when minor version ≥ 11, otherwise defaults to rhel8. Replaces hardcoded rhacs-main-rhel9 image reference with computed rhel_version variable.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: dynamically determining the RHEL base image version in the verify-release script instead of hardcoding it.
Description check ✅ Passed The description explains the problem and fix concretely, with validation examples, but lacks most required template sections like testing documentation, user-facing docs, and detailed validation approach.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-verify-release-rhel-version

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/scripts/verify-release.sh:
- Around line 97-100: Validate RELEASE_PATCH format before extracting
minor_version: check RELEASE_PATCH matches a semantic-like pattern (e.g. use a
regex such as ^[0-9]+\.[0-9]+\.[0-9]+$ or at least ensure it contains two dots)
and if it fails, log an error and exit non-zero instead of proceeding; then
safely compute minor_version from RELEASE_PATCH (using cut or shell parameter
expansion) and perform the numeric comparison to set rhel_version ("rhel8" or
"rhel9"). Reference variables: RELEASE_PATCH, minor_version, rhel_version.
🪄 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: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 9a50aca0-78f8-400c-b35e-5f95062b726c

📥 Commits

Reviewing files that changed from the base of the PR and between 39d15cc and da6fa38.

📒 Files selected for processing (1)
  • .github/workflows/scripts/verify-release.sh

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🚀 Build Images Ready

Images are ready for commit 602ba73. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-610-g602ba73593

The verify-release script hardcoded rhacs-main-rhel9, which fails for
releases 4.10 and below that use rhel8 base images. Instead of hardcoding
a version cutoff, read the externalRepo from the release branch's
.tekton/create-custom-snapshot.yaml which is the source of truth for
the downstream image repository name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davdhacs davdhacs force-pushed the fix-verify-release-rhel-version branch from da6fa38 to debf59c Compare April 8, 2026 21:15
@davdhacs davdhacs marked this pull request as ready for review April 8, 2026 21:30
@davdhacs davdhacs requested a review from a team as a code owner April 8, 2026 21:30
@davdhacs davdhacs requested a review from tommartensen April 8, 2026 21:30
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Parsing the GitHub API JSON response with grep/sed is brittle; consider using jq to extract externalRepo reliably and avoid breaking if the JSON formatting changes.
  • It may be worth explicitly checking the exit status of the gh api call before piping it, so that a failure to fetch .tekton/create-custom-snapshot.yaml is detected and reported clearly rather than just resulting in an empty main_repo.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Parsing the GitHub API JSON response with `grep`/`sed` is brittle; consider using `jq` to extract `externalRepo` reliably and avoid breaking if the JSON formatting changes.
- It may be worth explicitly checking the exit status of the `gh api` call before piping it, so that a failure to fetch `.tekton/create-custom-snapshot.yaml` is detected and reported clearly rather than just resulting in an empty `main_repo`.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@davdhacs davdhacs changed the title fix: determine RHEL base image version dynamically in verify-release fix(release): get RHEL base image version in verify-release Apr 8, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.61%. Comparing base (39d15cc) to head (3f82e37).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19905   +/-   ##
=======================================
  Coverage   49.60%   49.61%           
=======================================
  Files        2766     2765    -1     
  Lines      208567   208541   -26     
=======================================
+ Hits       103454   103459    +5     
+ Misses      97436    97405   -31     
  Partials     7677     7677           
Flag Coverage Δ
go-unit-tests 49.61% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@davdhacs davdhacs requested a review from janisz April 8, 2026 21:55
Co-authored-by: Tom Martensen <tmartens@redhat.com>
@davdhacs davdhacs requested a review from tommartensen April 9, 2026 15:55
@davdhacs davdhacs enabled auto-merge (squash) April 9, 2026 15:55
@davdhacs davdhacs merged commit 602ba73 into master Apr 9, 2026
121 checks passed
@davdhacs davdhacs deleted the fix-verify-release-rhel-version branch April 9, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants