Support operating on source repos (#10) #12
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
pr2jira
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!12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "support-src-repos"
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?
So I happened to find another reason to work on #10 - it's useful
for figuring out the consequences of dropping a package:
quality/tickets#880 (comment)
The good news is, this turns out to be easy. We only need a small
change to the repository modification code to handle source repos,
where the package entries don't specifiy a sourcerpm - we just
take the package name. We identify this case by looking at the
package arch; if it's "src" we just take the name, if it's
anything else we use the existing approach.
With this change, you can just include the appropriate source
repository as a base repository, and otherwise use rmdepcheck
just the same. e.g. this command tests what happens if you drop
the python-pytest-xprocess package from F44:
./rmdepcheck.py --removes https://dl.fedoraproject.org/pub/fedora/linux/development/44/Everything/x86_64/os/,https://dl.fedoraproject.org/pub/fedora/linux/development/44/Everything/source/tree/ python-pytest-xprocess
You can see it works because there are results for .src packages
from the source repo; these are build dependencies. If you run the
same command without the source repo you get a smaller set of
results covering only the runtime dependencies.
Signed-off-by: Adam Williamson awilliam@redhat.com
AI Code Review
📋 MR Summary
Adds support for source repositories by parsing package names directly from the 'name' attribute when the architecture is 'src'.
Detailed Code Review
The implementation correctly identifies source repositories and successfully adjusts how the source package name is parsed. However, a null-check regression was introduced in the
elsebranch for non-source packages. Ifsrpmevaluates toNone, calling.rsplit()on it will throw an AttributeError, crashing the script.📂 File Reviews
📄 `rmdepcheck.py` - Updates primary XML parsing logic to conditionally extract package names based on package architecture.
srpmbefore calling.rsplit(). The original code safely checkedif srpm and srpm.rsplit..., but the updated code assumessrpmwill always be a valid string, which will cause an AttributeError ifsrpmisNone.srpmis None.✅ Summary
srpminrmdepcheck.pyto prevent AttributeError exceptions.🤖 AI Code Review | Generated with ai-code-review
Platform: Forgejo | AI Provider: gemini | Model: gemini-3-pro-preview
e38e57c7ef79f816ad0eYou're quite right. Fixed.
AI Code Review
📋 MR Summary
Adds support for analyzing source repositories by modifying how source packages are identified.
.src.rpmfiles.arch == "src") to identify source packages and extracts their name instead of relying onsourcerpm.arch == "src"is an established convention in RPM metadata.Detailed Code Review
The implementation aligns well with the stated intent of resolving issue #10 by properly identifying
.src.rpmfiles within mixed or dedicated source repositories. The logic uses the agreed-upon heuristic of checking for thesrcarchitecture to fall back to the package name directly when thesourcerpmentry might be empty. No critical logic flaws, security vulnerabilities, or performance regressions are identified. The change smoothly integrates with the existing structure. Consider adding minor checks ifmfindresults are everNonebefore calling.textto avoid potentialAttributeErroron malformed repository XML, though this may be handled implicitly by existingmfindfunctionality or upstream validation.📂 File Reviews
📄 `rmdepcheck.py` - Modified primary XML parsing to correctly resolve the source package name when the package architecture is 'src'.
mfindreturnsNonefor missing elements in malformed XML, calling.textdirectly on the return value will raise anAttributeError.mfindguarantees returning an element or handlesNonetransparently.✅ Summary
mfindcalls handleNonevalues gracefully to preventAttributeErroron malformed repository metadata.🤖 AI Code Review | Generated with ai-code-review
Platform: Forgejo | AI Provider: gemini | Model: gemini-3-pro-preview
79f816ad0eb26936900dEnsure mfind calls handle None values gracefully to prevent AttributeError on malformed repository metadata.Well, it doesn't exactly handle them "gracefully", it raises an exception if it hits None. But this is intentional, I want an exception to happen in that case.
b26936900dc212769e1bc212769e1bcd1d5aa100cd1d5aa100a116bc02ffAI Code Review
📋 MR Summary
This MR adds support for parsing source repositories by identifying
.srcpackages and extracting their names directly instead of relying on thesourcerpmattribute.replace_primaryinrmdepcheck.pyto branch package processing based on the package architecture (arch == "src").test_rmdepcheck.pyto validate both binary and source repository metadata structures.Detailed Code Review
The implementation correctly aligns with the stated goal of supporting source repositories to identify build dependencies. The logic efficiently distinguishes between binary and source packages by reading the
archtag and extracts the appropriate identifier for exclusion checks. The accompanying parameterization of the test suite comprehensively covers the new workflow without complicating the test codebase.Since the author has previously confirmed that hard failures (e.g.,
AttributeErrorfrom missing metadata tags) are the intended behavior for malformed repositories, the lack of explicitNonechecks on themfindreturn values is considered correct for this project's context.✅ Summary
🤖 AI Code Review | Generated with ai-code-review
Platform: Forgejo | AI Provider: gemini | Model: gemini-3-pro-preview