parse_repoclosure: skip empty lines #41
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!41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "pr-skip-empty-line"
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?
Looks like we can get empty lines in the
dnf repoclosureoutputsometimes (not sure why). They break things, so we'll skip them.
Signed-off-by: Adam Williamson awilliam@redhat.com
Embarrassing admission: I do not actually understand why this causes bad results in
parse_repoclosure, but somehow it does. I suspecthandle_preexistingwinds up doing something unexpected. I should maybe robustify that a bit.58055e1b8d0c8c61e741AI Code Review
📋 MR Summary
This PR updates the
parse_repoclosurefunction to skip empty lines in thednf repoclosureoutput.dnf repoclosureoutput inrmdepcheck.py.tests/testdata/test_parse_repoclosure.txtto verify the fix.Detailed Code Review
The change correctly addresses the issue of unexpected empty lines in the
dnf repoclosureoutput by filtering them out early in the processing loop. This is a robust and straightforward approach to handling potential malformed input in a line-by-line parser. The inclusion of an empty line in the test data ensures this behavior is covered.📂 File Reviews
📄 `rmdepcheck.py` - Updated `parse_repoclosure` to ignore empty or whitespace-only lines.
✅ 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.
Oh, wait, yeah, obviously I see why it causes problems: the empty line(s) are treated as a dependency issue. It/they won't get dropped out by
handle_preexistingunless there's exactly one empty line in each raw output, I think. So in any other case we'll wind up printing something like:where each blank line is essentially "passed through" from a blank line in the raw output.