🥅 ci: Run Playwright After Merges to Dev and Guard Specs Under Test Selection (#18049)

* 🥅 ci: Run Playwright After Every Merge to Dev

The mock e2e suite ran on pull requests, nightly on main and on demand, so
when a spec broke on dev no run on dev could go red: the vote workflow that
runs the suite after merges cannot fail by design.

Add a push trigger for dev with the pull request path filter. A push runs
the pull request profile with no lane narrowed (10 memory shards, 2 Redis
transport shards, both MCP lanes and MCP Apps), and the gate job reports it.

Pushes take their own concurrency group that never cancels: the run in
progress finishes, and GitHub keeps one pending run per group, so merges
that land meanwhile collapse into one run of the newest commit. Pull
request, nightly and manual runs keep their per-ref cancelling group.

The matrix test now evaluates the workflow's own expressions per event
rather than matching their text.

* 🔭 ci: Always Run Source-Scanning Guard Specs Under Test Selection

Codegraph test selection narrows a pull request run to the test files an
import graph reaches. A spec that reads source with fs has no import edge
to what it reads: toolCapabilityGates.spec.js scans four source trees, was
not selected when #17864 changed one of the files it counts, and failed on
dev afterwards.

List every such spec, with the paths it reads, in .github/guard-specs.json.
Both selectors now add a workspace's guards to a FILES decision and turn a
NONE into a guards-only run when the change touches a path one of them
reads, renames a file, or edits the list. A list that cannot be read runs
the workspace FULL. FULL decisions and every earlier fail-open path are
unchanged.

The rule keys off the decision, not the event. A selection with no file
left in the checkout gets no guards, so the test job still runs FULL on a
stale selection instead of running only the guards.

guard-specs.test.mjs fails when a spec in a gated workspace reads the
repository through fs without being listed, when a listed path is missing,
and when a workflow would not run for a path one of its guards reads. That
last check adds the five backend and one frontend paths the triggers
lacked. The test also runs both real select steps against canned codegraph
responses.
This commit is contained in:
Danny Avila 2026-11-11 10:30:09 -05:00 • committed by GitHub
parent 1469f5ad75
commit 97f7fcdbac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 1229 additions and 23 deletions

View file

@ -1,9 +1,10 @@
# Codegraph e2e VOTES — observe-only, post-merge, time-boxed.
#
# Playwright never runs on pushes to dev, so evidence for the e2e skip election would
# otherwise wait on rare organic PR spec failures. This workflow runs the FULL mock suite after
# merges: each run is one graduation trial for every spec it executes, and doubles as the
# post-merge safety net the jest workflows already have via their dev-push triggers.
# Evidence for the e2e skip election would otherwise wait on rare organic PR spec failures, so
# this workflow runs the FULL mock suite after merges: each run is one graduation trial for
# every spec it executes. It is not the post-merge safety net: its test step cannot fail (see
# below), so a regression on dev leaves it green. The run that goes red is playwright-mock.yml's
# own dev-push trigger.
#
# By default every merge votes (the push trigger). Each run costs about 154 job-minutes on ten
# runners, so with repo variable CODEGRAPH_E2E_VOTE_MIN_HOURS set to N > 0 a push run votes