fix: scope rpm-sequoia workaround to RHEL 10+ and handle repo errors - #617
Merged
Merged
Conversation
The ensure_rpm_usable_before_tests fixture was causing test Errors on RHEL 9.x (where rpm-sequoia doesn't exist) and on RHEL 10 when RHUI repos return 404. Now skips on non-RHEL-10 and handles 404/403/not registered/not installed errors gracefully. Verified on a live RHEL 9.8 Azure VM: 0 Errors (was 29).
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="test_suite/conftest.py" line_range="204" />
<code_context>
print("\n[!] OCI instance: skipping RHUI RPM workaround.")
return
+ if not host.system_info.release.startswith("10"):
+ print(f"\n[!] RHEL {host.system_info.release}: rpm-sequoia not applicable, skipping workaround.")
+ return
</code_context>
<issue_to_address>
**nitpick (bug_risk):** The `startswith("10")` check is not an RHEL 10+ check: it skips RHEL 11 and later releases, while it still runs the workaround on any non-RHEL distribution whose release begins with `10` (for example, CentOS Stream 10). The fixture therefore does not match the documented scope.
**Triggers:** When a RHEL 11+ host or a non-RHEL 10 host runs the test suite.
**Suggested fix:** Parse the release major version and require `host.system_info.distribution == "rhel"` with `version.parse(host.system_info.release).major >= 10`.
```suggestion
if host.system_info.distribution != "rhel" or version.parse(host.system_info.release).major < 10:
```
</issue_to_address>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ensure_rpm_usable_before_testsfixture was causing 29 test Errors on RHEL 9.x and 26 test Errors on RHEL 10.2 in Jenkins CIV runsyum -y update rpm-sequoia openssl-libson all RHEL versions, butrpm-sequoiaonly exists on RHEL 10. On RHEL 9, the command fails because RHUI repos return 404, and the error handling only caught403andnot registeredpatterns404andnot installederrors gracefully in addition to the existing403/not registeredhandlingTest plan
rhel-ha-azure-9.8-20260908.3.x86_64.vhd) and ran the full CIV test suitecodeready-builder-for-rhel-9-x86_64-eus-rhui-rpmsreturning 404, missing RHUI cert, GPG key mismatch, etc.)