ci(perf): dynamic cockpit-e2e matrix#535
Merged
Merged
Conversation
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.
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>
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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
Replaces the hardcoded 24-cap
cockpit-e2ematrix with one derived fromnx affected.--full-fleet=true).New pieces:
scripts/cockpit-matrix.mjs— pureselectCockpitCapsclassifier + CLI wrapper that derives caps by walkingcockpit/and reading project.json files from disk (avoids ~3-5 min of sequentialnx show projectcalls; runs in ~80ms).scripts/cockpit-matrix.spec.mjs— 7node:testunit tests, wired into the ci-scope test job (now 22 tests total)..github/workflows/ci.yml— newcockpit-e2e-dispatcherjob;cockpit-e2ematrix now consumesfromJson(needs.cockpit-e2e-dispatcher.outputs.caps). Summary aggregator unchanged.This PR itself is a doc + scripts diff;
nx affectedon the PR base..head will return zero cockpit caps → empty-affected fallback fires → matrix runs all 24 (so we exercise the same surface as today on this very PR).Test plan
node --testci-scope.spec.mjs+cockpit-matrix.spec.mjs--full-fleet trueemits 24-entry JSON in ~80msSpec:
docs/superpowers/specs/2026-05-23-dynamic-cockpit-e2e-matrix-design.mdPlan:
docs/superpowers/plans/2026-05-23-dynamic-cockpit-e2e-matrix.md🤖 Generated with Claude Code