Skip to content

test(packit): cover package_chunks and the packit_workflow CLI - #152

Closed
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-packit-workflow-chunks
Closed

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-packit-workflow-chunks

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds coverage for the two untested halves of tools/packit_workflow.py. Touches exactly one file: tests/test_packit_workflow.py.

package_chunks() and main() had zero assertions (37 stmts, 20 miss, 46%). .github/workflows/packit-srpm-pilot.yml:58,67 runs packit_workflow.py packages and ... chunks and feeds the output into matrix.chunk, so package_chunks is the only thing standing between 345 packages and GitHub's 256-job matrix cap — and a matrix past that cap expands to zero jobs without failing the run. That is a green build that built no package.

New cases:

  • package_chunks keeps a sub-cap list whole, splits at the first package past the cap, and never emits a chunk larger than the cap
  • chunking is lossless and order-preserving — the decoded chunks rejoin to the input
  • an empty package list yields no matrix entries, not one empty job
  • size of 0 or -1 raises ValueError
  • packages / chunks / result are driven through a subprocess, as packit-srpm-pilot.yml drives them, asserting the JSON shapes fromJson() consumes (including that each chunks entry itself parses as a package list)
  • --status maybe and a missing subcommand both exit non-zero

The cap assertion is anchored to GitHub's documented limit (GITHUB_MATRIX_CAP = 256), not to MATRIX_CHUNK. Asserting against the constant would follow it wherever it moved; anchoring makes raising MATRIX_CHUNK past the platform ceiling a failure in its own right.

main() is exercised by subprocess, matching tests/test_validate.py and tests/test_check_workflow_quoting.py. In-process coverage therefore still reports those lines unhit — that is a property of the measurement, not of the tests.

Verification

$ just test
331 passed, 29 subtests passed        (was 316)

Mutation check — each of these turns the suite red:

mutation caught by
MATRIX_CHUNK = 500 test_the_default_chunk_size_stays_under_the_github_cap
names[start : start + size + 1] test_chunks_honours_an_explicit_size
if size < -99: test_a_non_positive_chunk_size_is_rejected

No production code is touched.

Related Issue

Closes #151


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.78

package_chunks and main() had no assertions, so nothing protected the
256-job matrix cap that packit-srpm-pilot.yml depends on. A matrix past
that cap expands to zero jobs without failing the run, which is a green
build that built no package at all.

The cap is anchored to GitHub's documented limit rather than to
MATRIX_CHUNK, so raising the constant past the platform ceiling is itself
a failure. main() is driven through a subprocess, matching the other
script gates in tests/, because the workflow consumes stdout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Deferring this PR's red publish / Validate Hummingbird-only consumer transaction to the shared incident #153 — the failure is repository-wide, not PR-local.

Evidence (run https://github.com/projectbluefin/utah-packages/actions/runs/35395821077, job 105863707946) is the same broken factory soname closure tracked in #153:

nothing provides libnfs.so.16()(64bit) needed by gvfs-nfs-1.61.91-1.hum1.bfin.x86_64 from factory
nothing provides libabsl_*.so.2601.0.0()(64bit) needed by ibus-mozc-2.29.5111.102-21.hum1.bfin.x86_64 from factory

Identical output on main and on sibling PRs #139, #141 and #143. This PR adds only test files under tests/ and changes no recipe, source lock, or build input, so nothing in its diff can affect the consumer transaction.

No per-PR re-runs; this stays deferred until #153 closes or the baseline goes green.

🐝 Hive Agent: quality | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: unknown

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.78

@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:

  • Test Coverage: Adds comprehensive coverage for package_chunks and command-line execution of tools/packit_workflow.py, ensuring matrix chunks stay within GitHub's 256-job platform limits.
  • Subprocess validation: Commands are tested via subprocess to accurately verify json output consumed by GitHub Actions.
  • Validation: Factory contract, validate.py, and unittest suite pass cleanly against current main.
  • Outstanding: PR carries the hold label and requires maintainer review to remove hold before merge.

@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.

1 similar comment
@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Work is intentionally paused.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] coverage-gap: packit_workflow.package_chunks and main() CLI are untested — the 256-job matrix cap guard has zero assertions

2 participants