Skip to content

feat(coverage): gate generated workflow kinds on executing coverage - #546

Merged
joshua-temple merged 2 commits into
mainfrom
feat/coverage-registry-gate
Jul 10, 2026
Merged

joshua-temple merged 2 commits into
mainfrom
feat/coverage-registry-gate

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

Nothing enforced that a newly generated workflow kind ships with executing coverage. A new emitted workflow could land with only generation-only assertions, or none, and CI would stay green. This operationalizes the "suites move with code" standard for the highest-risk axis: the set of workflow kinds the generator emits.

Fix

Adds a coverage registry and a gate test:

  • internal/coverage/registry.yaml (embedded): a positive map of each generated workflow kind to the executing coverage that exercises it (e2e scenarios and/or fleet lanes).
  • internal/coverage/registry.go: workflowKindFromLiteral derives the kind set by AST-parsing the generator's own .github/workflows/<name>.yaml output-path literals in internal/generate (the same literals verify trusts), including templated forms (cascade-foo-%s.yaml resolves to stem cascade-foo), and rejects any phantom kind.
  • internal/coverage/coverage_test.go: derives the kind set from source (never from the registry), fails if any kind lacks an executing-coverage entry, if a registry entry references a scenario/lane that does not exist, or if the registry lists a kind the generator no longer emits.

A new generated workflow kind now fails CI until its registry entry points at an executing scenario or fleet lane.

Verification

go build ./..., go test ./... (2693 pass), golangci-lint run ./... all clean; go test ./internal/coverage/ green including a test proving a templated-only kind is captured with no phantom kind. Red-proof: injecting a fake generated kind turns the gate red with a clear message. CONTRIBUTING documents the convention.

Add internal/coverage: a registry mapping every workflow kind the
generator emits to the e2e scenarios, harness tests, and fleet lanes
that run it, plus a test that derives the emitted-kind set from the
generator source and fails when an emitted kind has no registry entry
or a referenced scenario or lane does not exist.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
…denominator

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit 268d314 into main Jul 10, 2026
20 checks passed
@joshua-temple
joshua-temple deleted the feat/coverage-registry-gate branch July 10, 2026 00:09
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.

1 participant