Skip to content

Commit 0f4d7f0

Browse files
committed
ci(test-tiers): per-PR gate for a package adopting a tier file without reading the switch
scripts/nightly-tiers.mjs moved the e2e and live tiers off the per-PR and merge-queue runs onto a nightly, gated by OS_TEST_TIERS. A package that adopts its first *.e2e.test.* or *.live.test.* file without reading that switch runs the file in the merge queue and its whole suite under the nightly, both silently; --check makes that loud only on the nightly, one night late, and its refusal then blocks the whole tier run for one package's omission. check-tier-file-adoption.mjs is the per-PR half. It is the STATIC route: --check boots vitest twice per tier-owning package to measure what it collects, which is the right instrument for a nightly and the wrong one for every PR. This shares --check's own tier-file predicate and package walk (tierPackages) and spawns nothing. The detector walks the vitest config's local import closure rather than grepping for the variable: on the one package that owns tier files today, the name appears 9 times raw and 0 times with comments masked -- every occurrence is prose, and the real read is an import edge. Both wrong detectors are pinned as controls. Zero tier files is a green that PRINTS THE ZERO: a gate reporting clean by never looking is indistinguishable from one that looked, unless the count is on the screen. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU
1 parent d03c3c9 commit 0f4d7f0

3 files changed

Lines changed: 720 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,6 +3676,27 @@ jobs:
36763676
- name: Live-server database isolation
36773677
run: pnpm check:live-db-isolation
36783678

3679+
# Nightly-tier file adoption (#16494). `scripts/nightly-tiers.mjs` moved
3680+
# the `e2e` and `live` tiers off the per-PR and merge-queue runs onto a
3681+
# nightly, gated by OS_TEST_TIERS — and a package that adopts its first
3682+
# `*.e2e.test.*` or `*.live.test.*` file WITHOUT reading that switch runs
3683+
# the file in the merge queue (nothing excludes it) and its WHOLE suite
3684+
# under the nightly (nothing narrows it), both silently. That drift was
3685+
# already loud on the NIGHTLY: `nightly-tiers.mjs --check` refuses to run
3686+
# past such a package — but the refusal blocks the whole tier run for one
3687+
# package's omission, one nightly after the PR that introduced it landed.
3688+
# This is the per-PR half, and it is deliberately the STATIC one: --check
3689+
# boots vitest twice per tier-owning package to measure what it collects,
3690+
# which is the right instrument for a nightly and the wrong one for every
3691+
# PR. This gate spawns nothing and shares --check's own tier-file
3692+
# predicate and package walk, so the two cannot disagree about which
3693+
# files are tier files. It is a SPELLING gate (the config routes through
3694+
# the one reader), never a claim the partition is right — its header
3695+
# carries that boundary and the measurement behind the detector.
3696+
# Reads ~80 manifests and a handful of configs; sub-second.
3697+
- name: Nightly-tier file adoption
3698+
run: pnpm check:tier-file-adoption
3699+
36793700
# LAYER C of the gate above (#10379). That gate verifies two of the three
36803701
# layers a cross-package declaration has: it finds the escaping tests
36813702
# itself, and `--verify` makes turbo.json hash every declared glob so the

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
"check:required-contexts": "node scripts/check-required-contexts.mjs --self-test && node scripts/check-required-contexts.mjs",
148148
"check:cross-package-test-inputs": "node scripts/check-cross-package-test-inputs.mjs --self-test && node scripts/check-cross-package-test-inputs.mjs",
149149
"check:live-db-isolation": "node scripts/check-live-db-isolation.mjs --self-test && node scripts/check-live-db-isolation.mjs",
150+
"check:tier-file-adoption": "node scripts/check-tier-file-adoption.mjs --self-test && node scripts/check-tier-file-adoption.mjs",
150151
"check:examples-live-imports": "node scripts/check-examples-live-imports.mjs --self-test && node scripts/check-examples-live-imports.mjs",
151152
"examples:live-imports": "node scripts/check-examples-live-imports.mjs --list",
152153
"check:test-source-alias": "node scripts/check-test-source-alias.mjs --self-test && node scripts/check-test-source-alias.mjs",

0 commit comments

Comments
 (0)