Matrix collapse

Skip until Graph (or many deploy environments) makes the GitHub Actions UI noisy. Auto is already on; you do not set this to get started.

Matrix collapse folds look-alike jobs into one GitHub Actions job with strategy.matrix, so the UI shows one expandable node instead of a busy graph.

Default is Auto. Modes:

ModeBehavior
Auto (default)Collapse when legs are safe (simple matrix or matrix.include); otherwise expand without failing generate
OffOne job per Graph module / Aggregate-or-Layer target
StrictCollapse only when legs are independent and isomorphic; else generate fails
CoarseMay drop Graph needs between modules of the same capability (GHA cannot do per-leg needs); still errors if templates diverge

Cascade: Capability.withMatrixCollapse wins over zipxMatrixCollapse plan map, else Auto.

Actions graph

A small monorepo: Aggregate test, then Graph image / docker / deploy for api, web, and batch. Toggle Strict with the api→batch edge on to see the generate gate; Auto keeps the expanded jobs instead; switch to Coarse to collapse anyway (needs dropped).

actionsGraphLab
toy monorepo · docker modules api · web · batch (Graph image + docker + deploy after Aggregate test)
MatrixCollapse:
Auto expands when same-capability needs would be dropped; generate stays green (unlike Strict).
Verify
test
Aggregate
Publish · image
image
matrix.module · api · web · batch
Publish · docker
docker api
1 module
docker web
1 module
docker batch
needs: docker api · Auto keeps expanded
Deploy
deploy api
1 module
deploy web
1 module
deploy batch
1 module
Blue = matrix job · amber = Coarse dropped needs · red = Strict generate gate. This mirrors the Actions workflow graph: fewer nodes when collapse is allowed.

API

zipxMatrixCollapse := Map(
  Capability.DockerName -> MatrixCollapse.Strict,
)

zipxCapabilities += Capability.custom(...).withMatrixCollapse(MatrixCollapse.Strict)
zipxCapabilities += Capability.dockerGraph.withMatrixCollapse(MatrixCollapse.Off) // veto Auto

Adopting collapse renames required checks: image api becomes image (api). Use capability Off during cutover; dual emission is not supported.