Skip to content

Several small tweaks for rpm version check script - #212

Merged
simonbaird merged 4 commits into
conforma:mainfrom
simonbaird:rpm-check-tweaks
Jul 23, 2026
Merged

Several small tweaks for rpm version check script#212
simonbaird merged 4 commits into
conforma:mainfrom
simonbaird:rpm-check-tweaks

Conversation

@simonbaird

Copy link
Copy Markdown
Member

No description provided.

We get bogus output if it's not installed.
As far as I can tell it does not work, because rpm is not present.
Also microdnf is not present so it's not easy to add it.

Claude suggests we could copy /var/lib/rpm out of the container then
inspect it, but I'm thinking it's easier just to stop using
ubi-micro in golden container.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: d540e9bf-6a82-4f25-b31e-76013bcada25

📥 Commits

Reviewing files that changed from the base of the PR and between 5e7a2df and 44841da.

📒 Files selected for processing (1)
  • show-latest-build-versions.sh

📝 Walkthrough

Walkthrough

The scripts update release image tags, require rpmdev-vercmp before comparisons, process tags 0.7, 0.8, and latest, and map latest to build reference v08.

Changes

Release version maintenance

Layer / File(s) Summary
Image set and dependency preflight
rpm-version-checker.sh
The image list replaces ec-rhel9:0.6 with ec-rhel9:0.8, retains 0.7, and exits with an install message when rpmdev-vercmp is unavailable.
Release tag and build reference selection
show-latest-build-versions.sh
The default RH_TAGS value changes from 0.6 0.7 latest to 0.7 0.8 latest, and latest maps to v08 instead of v07.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided, so there is no meaningful description to assess. Add a brief description of the main changes and their intent.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the primary changes by describing tweaks to the rpm version check script.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@qodo-for-conforma

Copy link
Copy Markdown

PR Summary by Qodo

Tighten rpm version check scripts: fail fast, bump tags to 0.7/0.8, drop ubi-micro

🐞 Bug fix ✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Fail early when rpmdev-vercmp is missing to avoid misleading comparisons.
• Update checked image/tag lists to include 0.8 and drop 0.6/ubi-micro.
• Align “latest build versions” script defaults to 0.7/0.8.
Diagram

graph TD
  A["rpm-version-checker.sh"] --> B("rpmdev-vercmp") --> C("Compare RPM versions")
  A --> D("Image list: 0.7/0.8, ubi-minimal")
  E["show-latest-build-versions.sh"] --> F("Default RH_TAGS: 0.7 0.8 latest")
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Run comparisons inside a tooling container
  • ➕ Eliminates host dependency on rpmdevtools/rpmdev-vercmp
  • ➕ Improves reproducibility across developer machines and CI
  • ➖ Adds a container build/publish step and versioning overhead
  • ➖ More moving parts than a simple host-side precheck
2. Inspect RPM DB by extracting /var/lib/rpm from images
  • ➕ Could support minimal/micro images without rpm tooling installed
  • ➕ Decouples from rpm command availability inside the image
  • ➖ More complex implementation and edge cases across RPM DB formats
  • ➖ Harder to maintain vs. checking images that actually include rpm tooling

Recommendation: The PR’s approach (fail fast when rpmdev-vercmp is absent and stop checking ubi-micro) is the simplest, most reliable fix for bogus output. Consider the “tooling container” approach only if host dependency becomes a recurring friction point in CI or onboarding.

Files changed (2) +7 / -4

Bug fix (1) +6 / -3
rpm-version-checker.shAdd rpmdev-vercmp preflight and refresh image list (add 0.8, drop ubi-micro/0.6) +6/-3

Add rpmdev-vercmp preflight and refresh image list (add 0.8, drop ubi-micro/0.6)

• Adds an early dependency check for rpmdev-vercmp with a clear install hint and exits if missing. Updates the images-to-check list to include ec-rhel9:0.8 and removes older/unsupported targets (0.6 and ubi-micro).

rpm-version-checker.sh

Other (1) +1 / -1
show-latest-build-versions.shBump default maintained RH_TAGS to 0.7/0.8 +1/-1

Bump default maintained RH_TAGS to 0.7/0.8

• Updates the script’s default RH_TAGS argument to track maintained releases (0.7, 0.8, latest) instead of including 0.6.

show-latest-build-versions.sh

@qodo-for-conforma

qodo-for-conforma Bot commented Jul 22, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Unconditional rpmdev-vercmp check ✗ Dismissed 🐞 Bug ≡ Correctness
Description
rpm-version-checker.sh now exits if rpmdev-vercmp is missing even when no RPM version arguments are
provided, despite rpmdev-vercmp only being used inside the per-argument comparison loop. This
prevents using the script for digest/created metadata-only runs on hosts without rpmdevtools
installed.
Code

rpm-version-checker.sh[R27-30]

+if ! command -v rpmdev-vercmp &>/dev/null; then
+  printf "Error: rpmdev-vercmp not found. Install it with: sudo dnf install rpmdevtools\n"
+  exit 1
+fi
Evidence
The PR adds an unconditional rpmdev-vercmp presence check at startup, but rpmdev-vercmp is only
used inside the loop over user-provided RPM args; when no args are passed, that loop never runs and
the dependency is not required for digest/created output.

rpm-version-checker.sh[27-30]
rpm-version-checker.sh[46-72]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`rpm-version-checker.sh` now requires `rpmdev-vercmp` unconditionally, even though it’s only invoked when the script is comparing user-supplied RPM NVRs (i.e., when `$@` is non-empty). This makes a metadata-only invocation (no args) fail unnecessarily.

### Issue Context
- The script prints digest/created for each image regardless of `$@`.
- The `rpmdev-vercmp` call happens only inside the `for want in "$@"; do ...` loop.

### Fix Focus Areas
- rpm-version-checker.sh[27-30]
- rpm-version-checker.sh[46-72]

### Suggested fix
- Move the `command -v rpmdev-vercmp` check to just before the first `rpmdev-vercmp` invocation, or guard it with `if (($# > 0)); then ... fi`.
- (Optional) Print the error to stderr (`>&2`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. Hardcoded latest version ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
show-latest-build-versions.sh changes the default RH_TAGS to include 0.8, but still hardcodes
latest to ver="v07", unlike numeric tags which derive ver from the tag value. This requires
manual updates to keep the printed “Likely Konflux build ref” accurate for latest.
Code

show-latest-build-versions.sh[14]

+RH_TAGS="${1:-"0.7 0.8 latest"}"
Evidence
The PR changes the default tag set to include 0.8. The script still sets ver to v07 whenever
t==latest, and ver directly influences the Konflux image reference that gets printed, so the
mapping is a manual-maintenance point that can easily become stale.

show-latest-build-versions.sh[14-14]
show-latest-build-versions.sh[29-31]
show-latest-build-versions.sh[77-80]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The default `RH_TAGS` list was updated, but the `latest` -> `ver` mapping remains hardcoded (`v07`). Since `_show_details` uses `ver` to generate the “Likely Konflux build ref”, this mapping can become stale and misleading without an explicit update whenever `latest` changes.

### Issue Context
- Numeric tags use `ver="v${t/./}"`.
- `latest` uses a hardcoded `v07`.
- `ver` is used to form the Konflux image reference.

### Fix Focus Areas
- show-latest-build-versions.sh[14-14]
- show-latest-build-versions.sh[29-31]
- show-latest-build-versions.sh[77-80]

### Suggested fix
- Derive the `latest` `ver` from an explicit variable (e.g., `LATEST_VER=${LATEST_VER:-...}`), or
- Compute it from the highest numeric tag present in `RH_TAGS` (excluding `latest`), and use that for `latest` too, so the mapping updates automatically when the default tag list changes.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread rpm-version-checker.sh
Comment thread show-latest-build-versions.sh
cuipinghuo
cuipinghuo previously approved these changes Jul 22, 2026
Comment thread show-latest-build-versions.sh
@simonbaird
simonbaird merged commit e586d1e into conforma:main Jul 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants