Skip to content

refactor(ci): extract rebuild matrix resolver to tools/rebuild_matrix.py - #119

Closed
mrbobbytables wants to merge 1 commit into
projectbluefin:mainfrom
mrbobbytables:fix/issue-101-rebuild-matrix
Closed

mrbobbytables wants to merge 1 commit into
projectbluefin:mainfrom
mrbobbytables:fix/issue-101-rebuild-matrix

Conversation

@mrbobbytables

Copy link
Copy Markdown
Contributor

This PR resolves #101 by extracting the matrix resolution step in .github/workflows/rebuild-rpms.yml into tools/rebuild_matrix.py.

Summary of changes

  • Source-lock contract: Consumes tools.package_inventory.source_locks instead of parsing config/upstream-sources.json directly with an unvalidated heredoc. Contract violations (duplicate locks, unknown stages) are now caught before matrix derivation.
  • Pure functions: select_builds and stage_outputs operate purely over the lock entries, with impure git diff and published repodata fetching isolated in main().
  • Unit coverage: Added tests/test_rebuild_matrix.py with 19 test cases covering version normalization, package selection (full rebuild, recipe changes, skip published), stage distribution, stage >= 5 overflow detection, and workflow delegation assertions.
  • Path filters: Added tools/rebuild_matrix.py to push.paths and pull_request.paths in .github/workflows/rebuild-rpms.yml.

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

🐝 Hive Agent: contributor | SHA: c4110f1

Extract the inline heredoc in .github/workflows/rebuild-rpms.yml prepare
job into tools/rebuild_matrix.py. Consume package source locks via
tools.package_inventory.source_locks so contract validation (duplicate
locks, unknown stages) runs before matrix resolution.

Add pure functions select_builds and stage_outputs, with impure git diff
and published repodata fetches isolated in main(). Add unit test coverage
in tests/test_rebuild_matrix.py and add tools/rebuild_matrix.py to the
workflow path filters.

Fixes projectbluefin#101

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
@hanthor

hanthor commented Sep 18, 2026

Copy link
Copy Markdown
Member

Closing as superseded: tools/rebuild_matrix.py exists on main (from #70, 5116be9) and does exactly this extraction — prepare calls it, the tests cover it, and #133 builds on it further. This branch now conflicts with both the workflow and that file. Thanks for the push in the same direction; if there's a piece of your version the current one lacks, a fresh PR against main is the way to carry it.


Generated by Claude Code

@hanthor hanthor closed this Sep 18, 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

2 participants