Repository navigation
fix(import): skip factory-sourced packages in Rawhide resolver - #154
mrbobbytables wants to merge 4 commits into
Conversation
Bluefin binary packages with direct-upstream provenance (e.g. pipewire-libs-extra with branch=upstream) are built by the factory from upstream releases rather than Fedora dist-git. Skip these factory-sourced packages in tools/import_bluefin_rawhide.py so the Rawhide import resolver does not query Rawhide for missing dist-git sources or flag them as unavailable. Closes #2 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>
There was a problem hiding this comment.
Correctness review (head 868af23)
Medium — substring -n check misclassifies subpackage names (tools/import_bluefin_rawhide.py:52-55): after match_pkg = re.match(r"^%package(?:\s+-n)?\s+(\S+)", line), the code decides between the -n and prefixed forms with if "-n" in line. That is a substring test on the whole line, so any subpackage whose name contains -n — e.g. %package plugin-nautilus — is treated as if written with -n: the bare plugin-nautilus is added to the skip set instead of <main>-plugin-nautilus. Two consequences: (1) the actual factory-built binary name is not skipped and would still be queried/flagged unavailable (the very bug this PR fixes), and (2) an unrelated bare name is silently excluded from Rawhide resolution. Fix by testing the regex, e.g. use two alternated groups or re.match(r"^%package\s+-n\s+(\S+)", line) first. The tests in tests/test_import_bluefin_rawhide.py:84-92 cover only libspa-extra/subpkg, neither of which contains -n, so this case is untested.
Low — unguarded spec read (tools/import_bluefin_rawhide.py:44): spec.read_text(...) is outside the try that guards the provenance read; an unreadable .spec file crashes the whole resolver rather than being skipped like corrupt provenance is (line 35-37).
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78
Ensure subpackages containing '-n' in their name without the '-n' flag are correctly prefixed with the parent package name. Also guard spec file reading against OSError so unreadable spec files do not crash the resolver. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
|
Addressed the review feedback in
🐝 Hive Agent:
|
There was a problem hiding this comment.
Reviewed (correctness) — no blockers.
One low-severity note on test adequacy:
tests/test_import_bluefin_rawhide.py(test_unreadable_spec_is_ignored):spec.touch(mode=0o000)does not make the file unreadable when the test runs as root (common in CI containers) — root bypasses permission bits, soread_text()succeeds and the test still passes, but it no longer exercises theOSErrorbranch it claims to cover. Consider mockingPath.read_textto raiseOSError, or skipping underos.geteuid() == 0.
Also worth knowing (info, not blocking): in tools/import_bluefin_rawhide.py::factory_sources, main_name is initialized once per directory before the *.spec loop, so if a directory contains multiple specs and a later spec has %package foo before (or without) a Name: line, it inherits the previous spec's name. Unlikely in practice; over-inclusion here only widens the skip set for already factory-sourced directories.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78
…n_name per spec Mock Path.read_text in test_unreadable_spec_is_ignored to reliably exercise the OSError handling when running as root in container environments. Also reset main_name per spec file in factory_sources. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
|
Addressed the review feedback in
🐝 Hive Agent:
|
There was a problem hiding this comment.
Reviewed (correctness) — no blockers at head 767ab08.
One low-severity edge case: factory_sources parses spec files with literal regexes (tools/import_bluefin_rawhide.py:44-58), so RPM macros are not expanded. A direct-upstream spec using Name: %{pname} or %package -n %{name}-extra would yield macro-laden names that never match manifest binaries, and the package would still be queried against Rawhide and flagged unavailable. This fails safe (reverts to pre-PR behavior for that package) and the directory name plus the provenance package field are still added, so it's informational — but worth knowing if a future upstream spec leans on macros for subpackage names.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78
castrojo
left a comment
There was a problem hiding this comment.
Substantive review:
- Correctness: verified that factory_sources correctly identifies direct-upstream packages (branch: upstream) and their subpackages, preventing invalid Rawhide dist-git queries for packages maintained directly.
- Testing: unit tests in tests/test_import_bluefin_rawhide.py thoroughly cover factory_sources discovery and negative cases.
- Validation: factory contract, recipe set agreement, and all 323 unit tests pass cleanly against current main.
- Outstanding: awaiting independent human/peer approval (+2) before landing.
There was a problem hiding this comment.
docs-currency
- The hand-edited generated report is now internally inconsistent:
reports/bluefin-rawhide-resolution.jsonstill says"binary_count": 75, but it contains 74resolved_binary_to_sourceentries and 0unavailableentries. Since this PR makesmain()computebinary_countafter the factory filter (tools/import_bluefin_rawhide.py:89-91, 121), the next real run will emit 74 — the checked-in snapshot should match (setbinary_countto 74 or regenerate the report).
No findings from: security, intent-alignment, style.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
correctness
- Low:
factory_sourcesparses spec files with literal regexes (tools/import_bluefin_rawhide.py:42-59) and does not expand RPM macros, so a factory spec declaring%package -n %{name}-foowould yield the literal macro string and the real binary name would slip past the filter — recreating the exact false "unavailable" this PR fixes. No currentbranch: upstreamspec uses%package(packages/pipewire-libs-extra/pipewire-libs-extra.spec:4has onlyName:), so this is latent, not active. Worth a comment in the docstring noting the parser is macro-blind.
Verified: filter placement in main() (tools/import_bluefin_rawhide.py:89-90) is before resolution and before binary_count = len(binaries), so the hand-edited reports/bluefin-rawhide-resolution.json (75→74, unavailable: []) matches what a regeneration would produce; the three cited packages really carry branch: upstream in .hummingbird-upstream.json; new tests cover the nonexistent/rawhide-branch/corrupt/unreadable paths and assert factory sources are never passed to dnf.
No findings from: security, intent-alignment, style, docs-currency.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78
|
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. |
1 similar comment
|
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. |
Summary
Bluefin binary packages with direct-upstream provenance (e.g.
pipewire-libs-extrawith.hummingbird-upstream.jsonhavingbranch = "upstream") are built directly by this factory from upstream releases rather than imported from Fedora dist-git.Previously,
tools/import_bluefin_rawhide.pyattempted to query Fedora Rawhide forpipewire-libs-extra, failed to find a Rawhide dist-git candidate, and placed it into theunavailablelist inreports/bluefin-rawhide-resolution.json, triggering automated issue creation (#2).This change:
factory_sources(destination)intools/import_bluefin_rawhide.pyto identify packages with direct-upstream provenance (branch: upstream), including package and subpackage names defined in specs.tools/import_bluefin_rawhide.pyso they are not queried against Rawhide dist-git or flagged as unavailable.reports/bluefin-rawhide-resolution.jsonto clearpipewire-libs-extrafromunavailable.factory_sourcesand verifying factory sources are never queried against Rawhide intests/test_import_bluefin_rawhide.py..agents/skills/build-failure-triage/SKILL.mdto document that packages with direct-upstream provenance must not be triaged as missing Rawhide sources or recorded as runtime contract debt.Closes #2
— hive: backend=copilot model=gemini-3.8-flash
🐝 Hive Agent:
contributor| SHA:868af23