test(cockpit-e2e-wiring): scope:* tag drift-guard (PR 3/3)#509
Merged
Conversation
PR 3 of 3 for the ci-scope thin-shim migration. PR 1 (#503) added scope:* tags to every CI-participating project; PR 2 (#507) rewrote ci-scope.mjs to read them via `nx show projects --affected --json`. This drift-guard asserts every cockpit cap project (angular + python under cockpit/<product>/<topic>/) declares the expected tags: - scope:cockpit-e2e + scope:cockpit-examples on every cap project. - scope:cockpit-smoke on python caps that have a smoke target. Closes the silent-failure mode: future contributors adding a new cap can't forget the tags — the test names which project + which tag is missing. Excludes cockpit/ag-ui/* (no python sibling; different tag rules). See spec: docs/superpowers/specs/2026-05-21-ci-scope-thin-shim-design.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
added a commit
that referenced
this pull request
May 25, 2026
The cockpit-e2e-wiring drift-guard test (PR #509) walked each cap and asserted ci.yml contained literal references to the cap's project name AND a `working-directory:` or `python:` entry for its python sibling. The hardcoded 24-cap matrix satisfied both checks. With the dispatcher pattern (this PR), neither literal appears in ci.yml — the matrix is templated as `cap: ${{ fromJson(needs.cockpit-e2e-dispatcher.outputs.caps) }}` and the dispatcher's emitted JSON covers every cap by definition. The test now short-circuits to "satisfied" when it detects the `fromJson(needs.cockpit-e2e-dispatcher.outputs.caps)` token in the workflow. Non-dispatcher workflows (e.g. future per-cap jobs) still get the original literal-reference checks. 79/79 cockpit unit tests passing locally.
blove
added a commit
that referenced
this pull request
May 25, 2026
* docs(spec): dynamic cockpit-e2e matrix design
* docs(plan): dynamic cockpit-e2e matrix implementation plan
* feat(ci): pure selectCockpitCaps classifier for dynamic matrix
Returns affected cockpit caps when fullFleet=false, or all caps when
fullFleet=true. Preserves the order of the allCockpitCaps argument.
CLI wrapper that runs nx queries + writes $GITHUB_OUTPUT lands in
the next commit. Spec at
docs/superpowers/specs/2026-05-23-dynamic-cockpit-e2e-matrix-design.md.
7/7 unit tests passing via node --test.
* feat(ci): CLI wrapper for cockpit-matrix script
Derives cockpit caps by walking cockpit/ directly and reading
project.json files from disk — ~100x faster than per-project nx CLI
calls (avoids the 32-cap sequential 'nx show project --json' tax
that would have made the dispatcher job take 3-5 min instead of
seconds).
Each cap is paired with its python sibling path via the directory
convention (cockpit/<topic>/<cap>/{angular,python}).
CLI args: --base, --head, --full-fleet. Writes 'caps=<json>' to
\$GITHUB_OUTPUT (or stdout for local debugging).
Empty-affected fallback: when --full-fleet is false but nx affected
didn't attribute any cockpit cap (lib fanout case), emits all caps.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* ci(perf): dynamic cockpit-e2e matrix via dispatcher job
Replaces the hardcoded 24-cap matrix with one emitted by a new
cockpit-e2e-dispatcher job. The dispatcher runs scripts/cockpit-matrix.mjs
which derives caps from nx affected + project-graph metadata.
- PR touching 1 cap angular dir → 1 matrix entry (~46 CI-min saved vs
today's 24-runner fan-out).
- PR touching libs/chat (fanout) → all 24 caps run via the
empty-affected fallback in cockpit-matrix.mjs.
- Push to main → all 24 caps run (--full-fleet=true).
Also wires scripts/cockpit-matrix.spec.mjs into the ci-scope test job so
the 7 new unit tests gate PRs.
The cockpit-e2e-summary job is unchanged — needs.cockpit-e2e.result
correctly aggregates matrix outcomes.
Spec: docs/superpowers/specs/2026-05-23-dynamic-cockpit-e2e-matrix-design.md
Plan: docs/superpowers/plans/2026-05-23-dynamic-cockpit-e2e-matrix.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(cockpit): drift-guard recognizes dispatcher matrix pattern
The cockpit-e2e-wiring drift-guard test (PR #509) walked each cap and
asserted ci.yml contained literal references to the cap's project
name AND a `working-directory:` or `python:` entry for its python
sibling. The hardcoded 24-cap matrix satisfied both checks.
With the dispatcher pattern (this PR), neither literal appears in
ci.yml — the matrix is templated as
`cap: ${{ fromJson(needs.cockpit-e2e-dispatcher.outputs.caps) }}`
and the dispatcher's emitted JSON covers every cap by definition.
The test now short-circuits to "satisfied" when it detects the
`fromJson(needs.cockpit-e2e-dispatcher.outputs.caps)` token in the
workflow. Non-dispatcher workflows (e.g. future per-cap jobs) still
get the original literal-reference checks.
79/79 cockpit unit tests passing locally.
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 3 of 3 for the ci-scope thin-shim migration. Adds a third `it()` block to `apps/cockpit/cockpit-e2e-wiring.spec.ts` asserting that every cockpit cap project declares the `scope:*` tags the shim relies on.
What it guards against
Without this, a future contributor adding a new cap could silently forget the tags — their CI would underfire and we'd only catch it when something breaks downstream.
Closes the migration arc
Test plan
🤖 Generated with Claude Code