Skip to content

Commit cc4ad93

Browse files
committed
ci: defer ecosystem matrix until after e2e
1 parent a2603c5 commit cc4ad93

4 files changed

Lines changed: 42 additions & 31 deletions

File tree

.github/actions/changes-filter/action.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ outputs:
4444
dependency-changes:
4545
description: 'Root `package.json`, `pnpm-lock.yaml`, or `pnpm-workspace.yaml` changed.'
4646
value: ${{ github.event_name != 'pull_request' || steps.filter.outputs.deps == 'true' }}
47+
ecosystem-matrix-changes:
48+
description: 'Frontend runtime or registry census infrastructure changed.'
49+
value: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ecosystem_matrix == 'true' }}
4750

4851
runs:
4952
using: composite
@@ -71,6 +74,13 @@ runs:
7174
- 'package.json'
7275
- 'pnpm-lock.yaml'
7376
- 'pnpm-workspace.yaml'
77+
ecosystem_matrix:
78+
- 'src/**'
79+
- 'scripts/registry-census/**'
80+
- 'vitest.matrix.config.mts'
81+
- '.github/actions/changes-filter/action.yaml'
82+
- '.github/workflows/ci-ecosystem-matrix.yaml'
83+
- '.github/workflows/ci-tests-e2e.yaml'
7484
7585
- name: Filter relevant changes
7686
if: ${{ github.event_name == 'pull_request' }}

.github/workflows/ci-ecosystem-matrix.yaml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,7 @@
2525
name: 'CI: Ecosystem Matrix'
2626

2727
on:
28-
# A frontend change is the thing this advisory exists to catch, so src/** runs
29-
# it. The corpus is restored, not refetched, so a PR run is bounded by
30-
# execution rather than by the network.
31-
pull_request:
32-
paths:
33-
- 'src/**'
34-
- 'scripts/registry-census/**'
35-
- 'vitest.matrix.config.mts'
36-
- '.github/workflows/ci-ecosystem-matrix.yaml'
37-
# Refreshes the corpus and writes the baseline every PR is measured against.
38-
# Actions cache scoping means only a default-branch run can produce an entry
39-
# that other branches restore.
40-
push:
41-
branches: [main]
42-
paths:
43-
- 'src/**'
44-
- 'scripts/registry-census/**'
45-
- 'vitest.matrix.config.mts'
46-
- '.github/workflows/ci-ecosystem-matrix.yaml'
28+
workflow_call:
4729
workflow_dispatch:
4830

4931
permissions:

.github/workflows/ci-tests-e2e.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
contents: read
2121
outputs:
2222
should-run: ${{ steps.changes.outputs.should-run }}
23+
ecosystem-matrix-changes: ${{ steps.changes.outputs.ecosystem-matrix-changes }}
2324
steps:
2425
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2526
- id: changes
@@ -223,6 +224,21 @@ jobs:
223224
[[ "$SHARDED" != "success" || "$BROWSERS" != "success" || ( "$VIDEO" != "success" && "$VIDEO" != "skipped" ) ]] && echo "E2E failed" && exit 1
224225
echo "E2E passed"
225226
227+
ecosystem-matrix:
228+
name: Ecosystem matrix (after E2E)
229+
needs: [changes, e2e-status]
230+
if: >-
231+
${{
232+
needs.changes.outputs.ecosystem-matrix-changes == 'true'
233+
&& needs.e2e-status.result == 'success'
234+
&& (github.event_name == 'pull_request'
235+
|| (github.event_name == 'push'
236+
&& github.ref_name == github.event.repository.default_branch))
237+
}}
238+
permissions:
239+
contents: read
240+
uses: ./.github/workflows/ci-ecosystem-matrix.yaml
241+
226242
upload-e2e-coverage:
227243
needs: [changes, playwright-tests-chromium-sharded]
228244
if: >-

scripts/registry-census/README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,18 @@ Pure stdlib; needs `curl` and `tar` on PATH, plus `git` for `--write-pins`.
8282

8383
## In CI
8484

85-
`.github/workflows/ci-ecosystem-matrix.yaml`. An exact cache hit restores the
86-
snapshot and corpus as-is, with no registry crawl or pack refetch. On a miss,
87-
the workflow rebuilds the corpus and refuses to cache or measure it unless at
88-
least 95% of pin-resolved, structurally eligible registry targets are
89-
available. Targets the pin bump could not resolve, unsupported hosts, invalid
90-
URLs or subdirectories, and packs outside the archive/staging budget are
91-
recorded but do not consume that outage floor. The minimum count of five
92-
failed targets keeps a small local `--limit` smoke run from acting like a
93-
census.
85+
`CI: Tests E2E` calls `.github/workflows/ci-ecosystem-matrix.yaml` after the
86+
required E2E gate passes for affected PRs and pushes to the default branch.
87+
This keeps the advisory census from occupying hosted runners ahead of required
88+
browser tests. The matrix workflow can also be dispatched directly. An exact
89+
cache hit restores the snapshot and corpus as-is, with no registry crawl or
90+
pack refetch. On a miss, the workflow rebuilds the corpus and refuses to cache
91+
or measure it unless at least 95% of pin-resolved, structurally eligible
92+
registry targets are available. Targets the pin bump could not resolve,
93+
unsupported hosts, invalid URLs or subdirectories, and packs outside the
94+
archive/staging budget are recorded but do not consume that outage floor. The
95+
minimum count of five failed targets keeps a small local `--limit` smoke run
96+
from acting like a census.
9497

9598
The cache key covers the pin set plus the fetch and validation code, and
9699
Actions caches are immutable. Main normally provides the shared entry that
@@ -256,9 +259,9 @@ The advisory is red. In order:
256259
**Blast radius:** the matrix is an advisory PR check, not a required check.
257260
`ProtectMain` requires `test`, `lint-and-format`, `e2e-status` and
258261
`website-e2e`, so a red matrix informs but does not block. Promotion requires
259-
both adding `matrix-verdict` to required checks and adding a `merge_group`
260-
trigger; doing only the first leaves merge groups waiting for a check this
261-
workflow never reports.
262+
both making the called matrix verdict a required check and admitting
263+
`merge_group` events in the caller condition; doing only the first leaves merge
264+
groups waiting for a check the caller never reports.
262265

263266
## Detection proof (counter-evidence)
264267

0 commit comments

Comments
 (0)