Skip to content

fix(tools): skip malformed repoquery lines in scan_rawhide_state - #179

Closed
mrbobbytables wants to merge 1 commit into
projectbluefin:mainfrom
mrbobbytables:fix/scan-rawhide-malformed-lines
Closed

mrbobbytables wants to merge 1 commit into
projectbluefin:mainfrom
mrbobbytables:fix/scan-rawhide-malformed-lines

Conversation

@mrbobbytables

Copy link
Copy Markdown
Contributor

Summary

Skip lines in repoquery stdout that do not contain four tab-separated fields in tools/scan_rawhide_state.py, print a warning to sys.stderr for any discarded lines, and select the first valid line.

When dnf repoquery emits warnings, progress output, or unexpected text without tabs, unpacking lines[0].split("\t", 3) raised ValueError: not enough values to unpack (expected 4, got 1), crashing the entire scan.

Changes

  • In tools/scan_rawhide_state.py: Iterate over non-empty lines from repoquery, checking len(parts) == 4. Discard and warn on malformed lines to sys.stderr, returning the first parsed entry. Return None if no line matches.
  • In tests/test_scan_rawhide_state.py: Add unit tests for query() when stdout mixes warning lines before valid lines, when all lines are malformed, and when lines have incomplete tab separations.

Closes #172

— hive: backend=copilot model=gemini-3.8-flash

🐝 Hive Agent: contributor | SHA: e2865e7

tools/scan_rawhide_state.py crashed when repoquery returned lines that did
not contain four tab-separated fields (such as dnf5 warning or progress
lines), raising ValueError: not enough values to unpack.

Skip lines that do not have four tab-separated fields, print a warning to
stderr for discarded lines, and return the first valid four-field entry.
Also add unit test coverage in tests/test_scan_rawhide_state.py for stdout
containing warning lines, malformed lines, and partially tabbed lines.

Closes projectbluefin#172

Assisted-by: Gemini 3.8 Flash via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>

@castrojo castrojo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Substantive review:

  • Bug fix: Hardens query() in tools/scan_rawhide_state.py against malformed/un-tabbed stdout lines from dnf repoquery (such as repository warning messages), avoiding ValueError crashes by verifying field counts and selecting the first valid entry.
  • Test Coverage: Adds unit test cases in tests/test_scan_rawhide_state.py verifying discarding of warning lines and partially tabbed lines.
  • Validation: Factory contract, validate.py, and unittest suite pass without errors.
  • Outstanding: CI rebuild matrix jobs are currently queued/running; awaiting CI completion and independent peer review (+2).

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from correctness, security, intent-alignment, style, docs-currency.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78

@hanthor

hanthor commented Sep 20, 2026

Copy link
Copy Markdown
Member

Closing to consolidate the queue on the merged #178 full-factory candidate. The branch is retained; please re-open or submit a fresh, rebased PR after that build establishes the current baseline.

@hanthor hanthor closed this Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scan_rawhide_state.py crashes on any repoquery line without tabs, and has failed nightly since at least 09-19

3 participants