Add EL-specific interface, refactor (#37) #40
No reviewers
Labels
No labels
ai-review-please
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
quality/rmdepcheck!40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "eln-wrapper"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After much discussion with @yselkowitz, this should be the best
option for ELN testing, I hope.
ELN (like other ELs) has multiple variants with repositories.
There is a mapping in Pungi config of relationships between the
variants. Each variant is expected to be repoclosure-complete,
possibly in itself, possibly with reference to some or all of
the other variants. Each variant contains only a subset of the
packages in the buildroot.
We have been asked to make it so that, given an arbitrary set of
"packages under test" for a given EL, the packages it contains
from each variant should be tested separately against that
variant, so we fail if replacing the packages in the variant with
the matching packages from the set under test would cause new
repoclosure issues in that variant, or the packages under test
for that variant have installability issues when tested against
the variant and any others it "depends" on.
Packages from the set under test that are not in any variant
should be ignored, as repoclosure of and installability within
the buildroot is not currently desired to be tested.
This wrapper script takes as inputs a compose that we should test
against, and a filesystem path containing the packages to be
tested. The compose is usually expected to be the latest compose
of the EL under test. Using the metadata, we discover all variants
in the compose that have repositories (except Buildroot, which is
ignored). We then list out the binary packages by name in each
variant repository.
We then split the set of packages-under-test into several temporary
variant repositories: each package is placed in the repo for all
variants of which the identically-named package in the compose is a
part, if any.
We then get and parse a copy of the variant mapping from the
Pungi config. Then, for each "populated" variant (that is, a
variant for which the packages-under-test set contains at least
one package), we run rmdepcheck, with the compose repos for the
variant plus any variants it "depends" on as the baserepos, the
local temporary variant repository as the newrepo, and the local
temp repos for all "depended-on" variants as addrepos. All
rmdepcheck output is passed through.
We track the return codes of each rmdepcheck run and return the
sum of each unique return code.
In the second commit, we refactor the project into a package containing a large
sharedmodule and two independent front-end scripts,rdc-reposandrdc-compose. It can theoretically be installed, but typically you'd just run it out of the checkout with the handy top-level launchers of the same name. This reduces code duplication between the scripts and allowsrdc-composeto run faster. We also add tests forrdc-compose, and fix a bug I found while writing the tests.This isn't totally ready yet but I wanted to put it up for anyone interested to take a look. CC @lecris
AI Code Review
📋 MR Summary
Adds
rdc-el-wrapper, a script to handle Enterprise Linux specific logic for runningrmdepcheckagainst multiple variants with dependencies.rdc-el-wrapper.pyscript.rmdepcheck.pyagainst populated variant repositories.Detailed Code Review
The implementation correctly identifies the complex workflow required for EL variant testing but lacks critical safety checks and error handling. Missing checks for external dependencies (
createrepo), fragile string slicing for configuration extraction, and missing HTTP response validations will cause the script to fail unexpectedly on errors. Additionally, using hard links between arbitrary paths can fail with cross-device link errors.📂 File Reviews
📄 `rdc-el-wrapper.py` - Implements the wrapper logic for finding compose variants, splitting packages, and invoking rmdepcheck.
os.linkcan fail withOSError: [Errno 18] Invalid cross-device linkif the input directory and/var/tmpare on different file systems.createrepois executed viasubprocess.runwithout verifying if the utility is installed or if the command succeeds.createrepoalongsidednfand enforce success on the subprocess call..json()or.textprocessing will fail cryptically..raise_for_status()on the responses before processing.get_val()relies on exact substrings (variant_as_lookaside =). If the remote configuration formatting changes slightly (e.g., missing spaces),override.index()throws aValueError.url_checksays 'If it's an existing local path, convert to file:// URI', but the code only checks forhttporhttpsand raises an error otherwise.✅ Summary
os.linkvulnerability to cross-device file system errors.createrepois installed and enforce command success.ValueError.url_check.createrepoif it fails.tempfile.TemporaryDirectoryinstances which execute on import.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
oh, also, I intend to roll this out on openQA staging so we can A/B it against other approaches.
e7aa59ba63d36b358f0dd36b358f0d3d727a1be7AI Code Review
📋 MR Summary
Adds an opinionated wrapper script (
rdc-el-wrapper) for runningrmdepcheckon Enterprise Linux by handling multi-variant compositions.rdc-el-wrapper.pyto orchestratermdepcheckacross different EL variants.Detailed Code Review
The implementation correctly aligns with the stated design requirements, specifically keeping the separation of variants and ignoring the Buildroot. However, there are two important logic issues to address. First, the script silently ignores errors when invoking
dnf repoquerybecausecheck=Falseis used, which can mask network or configuration errors and result in missing packages. Second, if there are no depended-on variants, an empty string is passed to the--addreposargument ofrmdepcheck.py, which may lead to argument parsing errors or invalid repository errors.📂 File Reviews
📄 `rdc-el-wrapper.py` - Main wrapper script that prepares and invokes rmdepcheck across isolated variant repositories.
dnf repoqueryusescheck=Falseand does not check the return code. If the network request fails or DNF errors out,stdoutwill be empty, and the script will silently assume there are no packages for that variant.addargis empty (when a variant has no dependencies), the script still passes--addreposfollowed by an empty string tormdepcheck.py. Depending on howrmdepcheck.pyparses arguments, this could cause the script to treatbaseargas the value for--addreposor fail trying to parse an empty repo.--addreposand its argument to the list ifaddargis not empty.✅ Summary
dnf repoquerysubprocess to avoid silent data loss.--addreposargument tormdepcheck.pyonly when there are actually addrepos to include.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
3d727a1be73106853291AI Code Review
📋 MR Summary
Adds an opinionated wrapper script (
rdc-el-wrapper) for runningrmdepcheckspecifically for Enterprise Linux multi-variant repository structures. It parses Pungi configurations to establish variant dependencies and dynamically creates variant-specific temporary test repositories.rdc-el-wrapper.pyscript to automate ELN variant testing.override.confand compose metadata.Detailed Code Review
The script successfully implements the requested logic for identifying ELN variants, splitting packages, and executing
rmdepcheckwith correct base/addrepo mappings. The algorithmic approach to the Pungi lookaside relationships matches the architectural requirements. However, the parsing of the remote Pungi configuration is fragile and could crash the script if the upstream configuration formatting changes even slightly (e.g., spacing changes). Additionally, modifying a global mutable state (DNFARGS) in themainfunction is an anti-pattern, though benign in a single-execution script. Some error handling improvements could prevent ungraceful tracebacks on network or subprocess failures.📂 File Reviews
📄 `rdc-el-wrapper.py` - Implements the core wrapper logic including compose metadata parsing, package splitting, and subprocess orchestration.
variant_as_lookasideis highly fragile. Searching for a strict string match and the first]character will break if upstream adds spaces around=or if formatting involves comments.DNFARGSlist inside themain()function is a bad practice. It works here becausemain()is only called once, but it makes the code harder to test or reuse._file.rsplit("-", 2)[0], if a non-RPM or malformed file is in the directory with fewer than two dashes, this can return unexpected results.✅ Summary
variant_as_lookasideparsing logic more robust using regex to avoid crashes on minor upstream configuration formatting changes.DNFARGS) inmain().🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
Fine, robustified the val parser. I am fine with the assumption that anything ending .rpm is an RPM and subject to rsplit logic. I am fine with mutating DNFARGS; we already protect against duplicating the arg, this prevents passing it all over the damn place. I am fine with things crashing with useful tracebacks rather than obfuscated error messages, I like data.
One thing I noticed with this is we get duplicated errors when we fail:
We...um. We can actually deal with that by resurrecting the "non-checked repos" idea, I think. When checking CRB, have AppStream as a modified but non-checked base repo...
I'll look at that tomorrow I think.
31068532916b1d337d976b1d337d9744f1bdb0ecDuplicated errors are fixed now, I brought back non-checked repos. But I now want to refactor this, I think...so we maybe have a shared module and two CLI scripts...
943d87467f4285d1515aAI Code Review
📋 MR Summary
Refactors
rmdepcheckinto a reusable module and introducesrdc-el-wrapperto support Enterprise Linux (ELN) testing. It adds the ability to use "non-checked base repos" to simulate dependencies across different compose variants.rdcelwrap.pyandrmdepcheck.py).rdc-el-wrapperto split "packages under test" into variant-specific temporary repositories based on compose mappings.--ncbaserepos(non-checked base repos) to allow repositories to be modified and available to the dependency solver, but excluded from repoclosure checks.Detailed Code Review
The refactoring successfully modularizes the tool and accurately accommodates the Pungi/ELN variant mapping logic without introducing cyclic redundancies. The changes follow the previous discussions, explicitly respecting the accepted return code aggregation and the non-checked base repository paradigm.
While the code avoids exhaustive error trapping by design (as requested), there is one minor logic gap in the variant dependency lookups where
Buildroot(or a dropped variant) might cause an unhandledKeyError. Filtering this lookup ensures standard Pungi configurations don't crash the script unexpectedly.📂 File Reviews
📄 `src/rmdepcheck/rdcelwrap.py` - Implements the ELN testing wrapper logic for splitting and mapping variant repositories.
Buildroot) is indepvarsbut was excluded fromvrs(which actively ignoresBuildroot), this list comprehension will raise aKeyErrorand crash the script.vrs.✅ Summary
KeyErrorinrdcelwrap.pycaused by depending on variants (likeBuildroot) that are deliberately excluded from thevrsdictionary.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
4285d1515a5aade1d2fd5aade1d2fdf5a53f7f09Progress: added tests for rdcelwrapper, now at 90% coverage, just need to cover the last bits tomorrow. Writing the tests also caused me to discover a bug - we were only checking variants we had new packages for, but actually, we need to check variants we have new packages for and any other variants that may depend on those.
I'll add the remaining test coverage and maybe split the commit a bit tomorrow, then merge, hopefully.
f5a53f7f09deb8273277deb827327757f086fe8eAI Code Review
📋 MR Summary
Refactors the project into a shared module with two CLI scripts, adds a new wrapper
rdc-el-wrapperfor ELN testing, and improves test coverage.src/rmdepcheck/shared.py.src/rmdepcheck/rdcelwrap.pyfor Enterprise Linux variant testing.Detailed Code Review
The refactoring successfully separates the concerns of the standard
rmdepcheckand the opinionatedrdc-el-wrapperby utilizing a shared module. The test coverage is a great addition, and the logic aligns with the described requirements for variant mapping.Overall, the implementation appears robust. The usage of
ast.literal_evalfor configuration parsing is a secure choice, avoiding arbitrary code execution risks. The argument parser correctly delegates to shared utility functions to validate URLs.📂 File Reviews
📄 `src/rmdepcheck/rdcelwrap.py` - Implements the opinionated wrapper for ELN.
args.compose, double slashes might be produced if the user provides a URL with a trailing slash.args.composebefore building URLs.✅ Summary
rdcelwrap.pyto prevent malformed requests.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
Add rdc-el-wrapper, an opinionated wrapper for ELN testing (#37)to Add EL-specific interface, refactor (#37)57f086fe8e4cfe070ed04cfe070ed01be91cf954quality/os-autoinst-distri-fedora#552 and https://github.com/fedora-ci/rmdepcheck-pipeline/pull/23 adapt the pipelines to this change, but I've put in a compatibility
rmdepcheck.pysymlink for now so they'll keep working even if we merge this.AI Code Review
📋 MR Summary
This PR implements a major refactor of
rmdepcheck, splitting the monolithic script into a modular architecture with two distinct CLIs (rdc-reposandrdc-compose). It introduces asharedmodule, adds the concept of non-checked base repositories, safely parses Pungi configurations to simulate Pungi variant dependencies for ELN compose testing, and expands test coverage significantly.rmdepcheck.pyscript intosrc/rmdepcheck/withshared.py,repos.py, andcompose.pymodules.rdc-composeCLI which fetches and parses ELN compose metadata (composeinfo.json) and Pungi configuration overrides.DNFARGSby isolating runtime arguments and passing them functionally.ast.literal_evalfor parsing configurations securely), and resolves a known bug regarding downstream variant checking. Test coverage validates the behavioral preservation.Detailed Code Review
The architectural transition from a single script to a well-structured Python package is cleanly executed. Separating the CLI boundaries (
repos.pyfor standard repo-level checks andcompose.pyfor Enterprise Linux variant-aware checks) alongside a shared functional core removes duplicate code and creates a clearer contract fordnfexecution arguments.The logic used to evaluate Pungi config relationships safely relies on regex matching and
ast.literal_eval(), avoiding dangerous standardeval()calls. Additionally, the move away from mutating globalDNFARGSin favor of passing constructed argument lists solves testing pollution and state leakage risks across concurrent invocations.Robust error handling is maintained for HTTP sessions in
rdc-composevia urllib3 Retries. No critical security, performance, or logic issues were found during this review.✅ Summary
🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
1be91cf954f036b42298