Skip to content

ci(perf): dynamic cockpit-e2e matrix#535

Open
blove wants to merge 6 commits into
mainfrom
claude/cockpit-dyn-matrix
Open

ci(perf): dynamic cockpit-e2e matrix#535
blove wants to merge 6 commits into
mainfrom
claude/cockpit-dyn-matrix

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 25, 2026

Summary

Replaces the hardcoded 24-cap cockpit-e2e matrix with one derived from nx affected.

  • PR touching 1 cap → 1 matrix entry (~46 CI-min saved vs the 24-runner fan-out we have today).
  • PR touching libs/chat (fanout) → all 24 caps run via the empty-affected fallback (no regression).
  • Push to main → all 24 caps run (--full-fleet=true).

New pieces:

  • scripts/cockpit-matrix.mjs — pure selectCockpitCaps classifier + CLI wrapper that derives caps by walking cockpit/ and reading project.json files from disk (avoids ~3-5 min of sequential nx show project calls; runs in ~80ms).
  • scripts/cockpit-matrix.spec.mjs — 7 node:test unit tests, wired into the ci-scope test job (now 22 tests total).
  • .github/workflows/ci.yml — new cockpit-e2e-dispatcher job; cockpit-e2e matrix now consumes fromJson(needs.cockpit-e2e-dispatcher.outputs.caps). Summary aggregator unchanged.

This PR itself is a doc + scripts diff; nx affected on 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

  • 7 unit tests passing locally via node --test
  • 22/22 combined ci-scope.spec.mjs + cockpit-matrix.spec.mjs
  • CLI smoke-tested: --full-fleet true emits 24-entry JSON in ~80ms
  • First CI run: dispatcher job succeeds + emits valid JSON + all 24 cockpit-e2e shards run + summary green

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

🤖 Generated with Claude Code

blove and others added 5 commits May 23, 2026 21:52
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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment May 25, 2026 3:10pm

Request Review

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