Skip to content

Commit 57fd195

Browse files
committed
ci(dogfood): the three Dogfood Regression Gate shards run on merge_group
Only merge_group leaves the dogfood job's event deny-list; pull_request keeps the fast set, and dogfood-verify, temporal-conformance and ui-published-artifacts stay full-battery only. THE TWO SPEEDS and every comment that restated the old split now say what runs where. The two gates that read job if: spellings learn the queue-and-full clause (pull_request excluded alone): check-expected-skips no longer calls such a job "full battery only", and dispatch-gates keeps the dogfood path population and tells the dev the PR skips the shards and the merge-queue build runs them first. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2ebbZkr2QAEG1x7UC8
1 parent 6701c08 commit 57fd195

10 files changed

Lines changed: 197 additions & 73 deletions

‎.github/workflows/ci.yml‎

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,26 +114,41 @@ concurrency:
114114
cancel-in-progress: true
115115

116116
# ── THE TWO SPEEDS (#22998) ──────────────────────────────────────────────────
117-
# A `pull_request` or `merge_group` run carries the FAST SET: `Build Core`,
118-
# `Test Core` (affected-only) and `Build Docs`. `main`'s 4-hourly `schedule` run,
119-
# its `push` runs and an on-demand `workflow_dispatch` carry the FULL BATTERY:
120-
# the fast set plus the four jobs below that spell
117+
# A `pull_request` run carries the FAST SET: `Build Core`, `Test Core`
118+
# (affected-only) and `Build Docs`. A `merge_group` run carries the fast set
119+
# plus the three `dogfood` shards (#30461, ruling record 6663883327, letter B),
120+
# whose job alone spells
121+
#
122+
# github.event_name != 'pull_request'
123+
#
124+
# in its `if:`, so a dogfood red shows on the queue build of the entry that
125+
# carries it, before the merge rather than on `main`'s push run after it.
126+
# `main`'s 4-hourly `schedule` run, its `push` runs and an on-demand
127+
# `workflow_dispatch` carry the FULL BATTERY: all of that plus the three jobs
128+
# below that spell
121129
#
122130
# github.event_name != 'pull_request' && github.event_name != 'merge_group'
123131
#
124-
# in their `if:` — `temporal-conformance`, `dogfood` (three shards),
125-
# `dogfood-verify` and `ui-published-artifacts`. Nothing is deleted: the jobs
126-
# moved off the per-PR path, the last one never had one (#26717). A red in one of them is a main-red for the owning lane, and the
127-
# publish lane reads the full battery before its approval (release.yml's
128-
# `full-battery` job, `scripts/ci/scheduled-full-run.mjs --release-gate`).
132+
# in their `if:` — `temporal-conformance`, `dogfood-verify` and
133+
# `ui-published-artifacts`. Nothing is deleted: the jobs moved off the per-PR
134+
# path, the last one never had one (#26717). A red in one of them is a main-red
135+
# for the owning lane, and the publish lane reads the full battery before its
136+
# approval (release.yml's `full-battery` job,
137+
# `scripts/ci/scheduled-full-run.mjs --release-gate`). ⛔ No affected-only
138+
# dogfood filter on the queue: the shards run on every entry, through the
139+
# `core` output, which is 'true' on `merge_group` (letter C was not ruled).
140+
# The queue enforces only the ruleset's required set, and `Dogfood Regression
141+
# Gate` is outside it since #22998 (check:required-contexts' tombstone); this
142+
# file does not decide whether it rejoins.
129143
#
130-
# Spelled as a DENY-list of the two per-PR events on purpose — the filter
144+
# Spelled as a DENY-list of the per-PR events on purpose — the filter
131145
# contract's half 1 below, applied to events: a trigger added to `on:` later
132146
# RUNS these jobs, and the failure direction of a wrong guess is a slower PR,
133147
# never a full battery that silently stopped running. `dogfood-gate` keeps
134-
# `if: always()` (check:shard-attestation pins it): with both legs skipped it
135-
# counts zero expected attestations and concludes success, exactly as on a
136-
# filter-skipped diff.
148+
# `if: always()` (check:shard-attestation pins it): with both legs skipped (a
149+
# pull request) it counts zero expected attestations and concludes success,
150+
# exactly as on a filter-skipped diff; on a queue build it counts the three
151+
# shards' credentials and `dogfood-verify`'s skip as zero expected.
137152

138153
jobs:
139154
filter:
@@ -158,8 +173,9 @@ jobs:
158173
# 'true'` did.
159174
docs: ${{ github.event_name != 'merge_group' && steps.changes.outputs.docs || 'true' }}
160175
# Read by `test-plan`, `test` (ORed with `crosspkg`) and `build-core`,
161-
# and on push / schedule by `dogfood`, `dogfood-verify` and
162-
# `temporal-conformance` — see the `core` filter below and each job's `if:`.
176+
# on merge_group / push / schedule by `dogfood`, and on push / schedule
177+
# by `dogfood-verify` and `temporal-conformance` — see the `core` filter
178+
# below and each job's `if:`.
163179
core: ${{ github.event_name != 'merge_group' && steps.changes.outputs.core || 'true' }}
164180
# Gates the `test` job ONLY, ORed with `core` — see the `crosspkg`
165181
# filter below and the `test` job's `if:` (#9829, #10015).
@@ -2390,9 +2406,11 @@ jobs:
23902406
# below — the shard count can change without touching it.
23912407
name: Dogfood Regression Gate (${{ matrix.shard }}/3)
23922408
needs: filter
2393-
# See THE FILTER CONTRACT on the filter job's outputs (#4928). Full battery
2394-
# only: see THE TWO SPEEDS above `jobs:` (#22998).
2395-
if: ${{ !cancelled() && needs.filter.outputs.core != 'false' && github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
2409+
# See THE FILTER CONTRACT on the filter job's outputs (#4928). The queue
2410+
# build and the full battery, never a pull request: see THE TWO SPEEDS
2411+
# above `jobs:` (#22998; `merge_group` left this deny-list by #30461,
2412+
# ruling record 6663883327). `dogfood-verify` below keeps both events.
2413+
if: ${{ !cancelled() && needs.filter.outputs.core != 'false' && github.event_name != 'pull_request' }}
23962414
runs-on: ubuntu-latest
23972415
# Backstop only — the stall guard on the test step is the primary detector
23982416
# for a #4250-style hang (see Test Core). 30 min is ~6× a shard (~5 min;
@@ -2704,11 +2722,13 @@ jobs:
27042722
overwrite: true
27052723

27062724
dogfood-gate:
2707-
# Stable check name for a SHARDED job (#3622 follow-up). Since #22998 its
2708-
# legs run in the full battery only (THE TWO SPEEDS above `jobs:`) and the
2709-
# context leaves the required set; on a PR or queue build both legs skip
2710-
# and this gate counts zero expected attestations. The history below is
2711-
# why the name and the `if: always()` stay.
2725+
# Stable check name for a SHARDED job (#3622 follow-up). Since #22998 the
2726+
# context is outside the required set (THE TWO SPEEDS above `jobs:`). On a
2727+
# PR both legs skip and this gate counts zero expected attestations; on a
2728+
# queue build (since #30461) the three dogfood shards run and are counted,
2729+
# while `dogfood-verify` skips and is judged with zero expected; the full
2730+
# battery runs and counts both. The history below is why the name and the
2731+
# `if: always()` stay.
27122732
#
27132733
# Branch protection required the context "Dogfood Regression Gate". Once
27142734
# the job became a 2-way matrix its checks publish as "Dogfood Regression

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,8 +1496,9 @@ jobs:
14961496
# ══════════════════════════════════════════════════════════════════════════
14971497
full-battery:
14981498
name: Full battery green at the version commit
1499-
# A PR or queue build carries ci.yml's FAST SET since #22998; the dogfood
1500-
# and temporal legs run only on main's push, 4-hourly schedule and
1499+
# A PR or queue build carries ci.yml's FAST SET since #22998 (a queue
1500+
# build adds the three dogfood shards since #30461); `dogfood-verify` and
1501+
# the temporal leg run only on main's push, 4-hourly schedule and
15011502
# dispatch runs. So "tested before a release" is read HERE, as a gate: the
15021503
# newest completed `schedule` or `push` runs of `CI` and `Lint & Type
15031504
# Check` whose head is the version commit or a first-parent ancestor of it

‎.github/workflows/upgrade-harness-optin.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
# its data" — a check each of the line's PRs passes BEFORE it merges. The
99
# harness that answers R2 is a dogfood test,
1010
# `packages/qa/dogfood/test/upgrade-18x-harness.dogfood.test.ts`, and the
11-
# dogfood jobs in `ci.yml` run only on `main`'s full battery (THE TWO SPEEDS,
12-
# #22998): they skip `pull_request` and `merge_group`. So without this workflow
13-
# the line's PRs get their first R2 answer after the merge.
11+
# dogfood shards in `ci.yml` skip `pull_request` (THE TWO SPEEDS, #22998; they
12+
# run on `merge_group` since #30461). So without this workflow the line's PRs
13+
# get their first R2 answer in the merge queue, after the PR is enqueued.
1414
#
1515
# This workflow adds the missing TRIGGER for that ONE file, and nothing else.
1616
# The test, its fixture and its assertions stay where they are, and the full

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ Even inside your own worktree, operate defensively:
510510
`Build & E2E UI` and `Live E2E UI`; a check outside those ten is advisory
511511
([why that matters](docs/agents/multi-agent-discipline.md#advisory-checks-ride-through)). A required context is
512512
matched by check-run name, so a rename detaches its gate silently — treat those ten names as contract.
513-
**Two speeds** — PR and queue runs carry the fast set; `main`'s scheduled and push runs carry the full
514-
battery ([detail](docs/agents/multi-agent-discipline.md#two-speeds-which-runs-carry-which-battery)).
513+
**Two speeds** — PR runs carry the fast set, queue runs add the dogfood shards; `main`'s scheduled and push
514+
runs carry the full battery ([detail](docs/agents/multi-agent-discipline.md#two-speeds-which-runs-carry-which-battery)).
515515
**Main-red:** a full-battery red is its lane's first work — triage files it under
516516
the main-red convention, the lane's next PR fixes it, and ⛔ no lane PR arms the queue meanwhile.
517517

‎docs/agents/multi-agent-discipline.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ A check outside those ten is advisory and rides through, and an advisory red
133133
**Two speeds** (ruling record 6120820653): PR and queue runs carry the fast set, 10 minutes of
134134
wall per queue entry; `main`'s scheduled (4-hourly) and push runs carry the full battery — dogfood, e2e,
135135
`Temporal Conformance (live PG + MySQL)` — read by the publish lane before
136-
any approval.
136+
any approval. Queue runs also carry the three `Dogfood Regression Gate` shards (ruling record
137+
6663883327), so a dogfood red shows on the queue build before the merge; `Dogfood Verify CLI`,
138+
Temporal Conformance and `UI Published Artifacts` stay full-battery only. The `Dogfood Regression
139+
Gate` context is outside the required set, so the queue does not hold an entry on it.
137140

138141
## Re-arm awareness
139142

‎scripts/check-required-contexts.mjs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@ const UNATTRIBUTED_BATTERY = '(no battery open)';
385385
* Gate` tombstone above gives: neither name is dead — both jobs still publish
386386
* these check-runs on every full-battery run, and the instruction files name
387387
* them correctly as full-battery jobs.
388+
* Since #30461 (ruling record 6663883327, letter B) the three dogfood shards
389+
* also run on `merge_group`, so a queue build publishes `Dogfood Regression
390+
* Gate` over their credentials; the context stays out of this registry and
391+
* of the ruleset until a ruling puts it back, which that ruling did not do.
388392
*/
389393
export const REQUIRED_CONTEXTS = [
390394
{

‎scripts/ci/scheduled-full-run.mjs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,9 @@ export function renderBody({
798798
// ---------------------------------------------------------------------------
799799
//
800800
// A PR or queue build carries the FAST SET since #22998 (ci.yml's THE TWO
801-
// SPEEDS); the dogfood and temporal legs run only on `main`'s
802-
// push, 4-hourly schedule and dispatch runs. "Tested before a release" is
801+
// SPEEDS; a queue build adds the three dogfood shards since #30461);
802+
// `dogfood-verify` and the temporal leg run only on `main`'s push, 4-hourly
803+
// schedule and dispatch runs. "Tested before a release" is
803804
// therefore a statement about those runs, and this half makes it a gate:
804805
// release.yml's `full-battery` job, which `publish` needs, so a refusal here
805806
// means no deployment is queued at the `release` environment at all.

‎scripts/pm/check-expected-skips.mjs‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,14 @@ function gatedReason(workflow, wf, gate, matrix) {
539539
}
540540
if (t.kind === 'pr-event') {
541541
const where = [t.events.includes('pull_request') && 'every PR head', t.events.includes('merge_group') && 'every queue build'].filter(Boolean).join(' and ');
542-
return `full battery only: its \`if:\` excludes ${tick(t.events)}, so it skips on ${where} and is answered by main's push and scheduled runs`;
542+
// "Full battery only" is said only when BOTH per-PR events are excluded:
543+
// since #30461 ci.yml's `dogfood` shards exclude `pull_request` alone and
544+
// run on every queue build, so the queue build answers them first.
545+
if (PR_EVENTS.every((e) => t.events.includes(e))) {
546+
return `full battery only: its \`if:\` excludes ${tick(t.events)}, so it skips on ${where} and is answered by main's push and scheduled runs`;
547+
}
548+
const answered = t.events.includes('pull_request') ? "the merge-queue build and main's push and scheduled runs" : "every PR head and main's push and scheduled runs";
549+
return `its \`if:\` excludes ${tick(t.events)} alone, so it skips on ${where} and is answered by ${answered}`;
543550
}
544551
if (t.kind === 'event-action') {
545552
return `its \`if:\` excludes the ${tick(t.actions)} pull_request event(s); each such event is its own run on the same head, beside the run that concluded`;
@@ -1284,6 +1291,8 @@ function fixtureRun(name, conclusion, suite = 1, extra = {}) {
12841291
const FILTER_WIDENED = (o) => `\${{ github.event_name != 'merge_group' && steps.changes.outputs.${o} || 'true' }}`;
12851292
const CORE_IF = "${{ !cancelled() && needs.filter.outputs.core != 'false' }}";
12861293
const FULL_BATTERY_IF = "${{ !cancelled() && needs.filter.outputs.core != 'false' && github.event_name != 'pull_request' && github.event_name != 'merge_group' }}";
1294+
// ci.yml's `dogfood` shards since #30461: the queue build runs them, a PR head skips them.
1295+
const QUEUE_AND_FULL_IF = "${{ !cancelled() && needs.filter.outputs.core != 'false' && github.event_name != 'pull_request' }}";
12871296
const EVENT_ACTION_IF = "github.event.action != 'labeled' && github.event.action != 'unlabeled' && github.event.action != 'edited'";
12881297
const optInIf = (label) => `contains(github.event.pull_request.labels.*.name, '${label}') && (github.event.action != 'labeled' || github.event.label.name == '${label}')`;
12891298
const FIXTURE_TREE = Object.freeze({
@@ -1307,7 +1316,7 @@ const FIXTURE_TREE = Object.freeze({
13071316
},
13081317
'test-gate': { name: 'Test Core', needs: ['test', 'filter'], if: 'always()' },
13091318
'temporal-conformance': { name: 'Temporal Conformance (live PG + MySQL)', needs: 'filter', if: FULL_BATTERY_IF },
1310-
dogfood: { name: 'Dogfood Regression Gate (${{ matrix.shard }}/3)', needs: 'filter', if: FULL_BATTERY_IF, strategy: { matrix: { shard: [1, 2, 3] } } },
1319+
dogfood: { name: 'Dogfood Regression Gate (${{ matrix.shard }}/3)', needs: 'filter', if: QUEUE_AND_FULL_IF, strategy: { matrix: { shard: [1, 2, 3] } } },
13111320
'dogfood-verify': { name: 'Dogfood Verify CLI', needs: 'filter', if: FULL_BATTERY_IF },
13121321
'dogfood-gate': { name: 'Dogfood Regression Gate', needs: ['dogfood', 'dogfood-verify', 'filter'], if: 'always()' },
13131322
'build-core': { name: 'Build Core', needs: 'filter', if: CORE_IF },
@@ -1531,6 +1540,7 @@ export function selfTest() {
15311540
t('jobGate: …nor always(), an absent if:, a non-string, or two ${{ }} blocks', [jg('always()'), jg(undefined), jg(true), jg("${{ needs.filter.outputs.a != 'false' }} && ${{ needs.filter.outputs.b != 'false' }}")].every((x) => x === null), true);
15321541
t('jobGate: …nor an if: whose parentheses do not balance', jg("!cancelled() && (needs.filter.outputs.core != 'false'"), null);
15331542
t('spelling: a gate renders in one short line', gateTermsSpelling(jg(FULL_BATTERY_IF).terms), 'filter core + pr-event pull_request|merge_group');
1543+
t('jobGate: the queue-and-full shape (#30461) is one pr-event term excluding pull_request alone', JSON.stringify(jg(QUEUE_AND_FULL_IF)?.terms.find((x) => x.kind === 'pr-event')?.events), JSON.stringify(['pull_request']));
15341544

15351545
// ---- the derivation, on the frozen fixture tree ----------------------------
15361546
const fx = fixtureRoster();
@@ -1556,6 +1566,9 @@ export function selfTest() {
15561566
t("reason: a queue-widened output says the merge-queue build runs it", fxRow('Build Core')?.reason.includes("merge-queue build widens it to 'true'"), true);
15571567
t("reason: a ui output says the queue reads its own diff", fxRow('Build UI Deps')?.reason.includes("against the queue's base"), true);
15581568
t('reason: a full-battery job says so', fxRow('Dogfood Verify CLI')?.reason.includes('full battery only'), true);
1569+
const queueRow = fxRow('Dogfood Regression Gate (${{ matrix.shard }}/3)');
1570+
t('reason: a job excluding pull_request alone is NOT called full battery only (#30461)', queueRow?.reason.includes('full battery only'), false);
1571+
t('reason: …it says only PR heads skip it and the merge-queue build answers it', queueRow?.reason.includes('skips on every PR head and is answered by the merge-queue build') && !queueRow?.reason.includes('every queue build'), true);
15591572
t('reason: an opt-out label names its label', fxRow('Check Changeset')?.reason.includes('`skip-changeset` label skips it'), true);
15601573
t('reason: a matrix job names its raw template', fxRow('Test Core (${{ matrix.shard }}/6)')?.reason.includes('raw `name:` template'), true);
15611574
t('reason: unread conjuncts are counted, never hidden', fxRow('Build UI Deps')?.reason.includes('1 further condition(s)'), true);

0 commit comments

Comments
 (0)