From 45ee345030ec421f2c331ab4e1a1ac48f507a2dc Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 16 Nov 2026 10:46:26 +0800 Subject: [PATCH] Stable release cut no longer waits on the Windows nightly (GST-2815) (#4400) * Stable release cut no longer waits on the Windows nightly (GST-2815) The nightly Windows free suite is documented as never gating, but the daily cut refused any commit carrying its red or unfinished check runs, so stable stayed behind v1.99.5.0 while shard 4 kept timing out. The cut now sets that workflow's check runs aside by workflow path, like its own job. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Type the expected green verdict in the nightly test as a literal Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- .../stable-cut-ignores-windows-nightly.md | 1 + crew/scripts/release-cut.ts | 13 ++++--- crew/test/release-cut.test.ts | 34 ++++++++++++++++++- docs/releases.md | 5 ++- docs/support-tiers.md | 2 +- 5 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 changelog.d/stable-cut-ignores-windows-nightly.md diff --git a/changelog.d/stable-cut-ignores-windows-nightly.md b/changelog.d/stable-cut-ignores-windows-nightly.md new file mode 100644 index 000000000..e932e4ee0 --- /dev/null +++ b/changelog.d/stable-cut-ignores-windows-nightly.md @@ -0,0 +1 @@ +- **The stable release no longer waits on the nightly Windows tests (GST-2815).** The nightly Windows free suite never blocks a pull request, but the daily stable cut still treated its red or unfinished results as a reason to skip a commit, so stable stopped moving while one Windows shard kept timing out. The cut now sets that workflow's check runs aside, matched by workflow file, the same way it ignores its own job. Every other check, the required `free-tests` check and the release-gate evidence still block exactly as before. diff --git a/crew/scripts/release-cut.ts b/crew/scripts/release-cut.ts index 167b7b3fa..b3942387c 100755 --- a/crew/scripts/release-cut.ts +++ b/crew/scripts/release-cut.ts @@ -23,6 +23,8 @@ * workflow produced itself (CUT_WORKFLOW: the jobs of a workflow run whose path * is that file; a job's id is its check run's id) are set aside, running or * finished: a cut lands its own job on main's head, the commit it may cut. + * Check runs from NEVER_GATING_WORKFLOWS (the nightly Windows free suite, which + * docs/support-tiers.md says never blocks) are set aside the same way. * Matching by job, not check suite, keeps check runs other workflows create * through the API, which GitHub files under any github-actions suite on the * commit. When the workflow runs cannot be read, nothing is set aside. @@ -77,6 +79,8 @@ export const REQUIRED_CHECK = 'free-tests'; export const BACKSTOP_CHECK = 'main-backstop'; export const NOTES_REF = 'refs/notes/gstack-trains'; export const CUT_WORKFLOW = '.github/workflows/weekly-release.yml'; +/** Workflows documented as never gating (docs/support-tiers.md): their check runs are set aside like the cut's own, matched the same way. */ +export const NEVER_GATING_WORKFLOWS: readonly string[] = ['.github/workflows/windows-free-tests.yml']; const NOTES_LOCAL = 'refs/notes/gstack-trains-release'; const RED = new Set(['failure', 'timed_out', 'cancelled', 'action_required', 'startup_failure', 'stale']); export const WINDOW_DAYS = 7; @@ -127,12 +131,13 @@ export function gateVerdict(gh: Gh, repo: string, sha: string, o: GateOptions = if (runs.some(c => c.status !== 'completed' || RED.has(c.conclusion ?? ''))) { const wf = parseJson(gh(['api', '--paginate', '--slurp', `repos/${repo}/actions/runs?head_sha=${sha}&per_page=100`])); const wfRuns = (Array.isArray(wf) ? wf : wf ? [wf] : []) as Array<{ workflow_runs?: Array<{ id?: number; path?: string }> }>; - const own = new Set(); - for (const w of wfRuns.flatMap(p => p.workflow_runs ?? []).filter(w => w.path === CUT_WORKFLOW && typeof w.id === 'number')) { + const asideWorkflows = new Set([CUT_WORKFLOW, ...NEVER_GATING_WORKFLOWS]); + const aside = new Set(); + for (const w of wfRuns.flatMap(p => p.workflow_runs ?? []).filter(w => asideWorkflows.has(w.path ?? '') && typeof w.id === 'number')) { const jobs = parseJson(gh(['api', '--paginate', '--slurp', `repos/${repo}/actions/runs/${w.id}/jobs?filter=all&per_page=100`])); - for (const p of (Array.isArray(jobs) ? jobs : jobs ? [jobs] : []) as Array<{ jobs?: Array<{ id?: number }> }>) for (const j of p.jobs ?? []) if (typeof j.id === 'number') own.add(j.id); + for (const p of (Array.isArray(jobs) ? jobs : jobs ? [jobs] : []) as Array<{ jobs?: Array<{ id?: number }> }>) for (const j of p.jobs ?? []) if (typeof j.id === 'number') aside.add(j.id); } - runs = runs.filter(c => !(typeof c.id === 'number' && own.has(c.id))); + runs = runs.filter(c => !(typeof c.id === 'number' && aside.has(c.id))); } let via = backstop; for (const name of [required, backstop]) { diff --git a/crew/test/release-cut.test.ts b/crew/test/release-cut.test.ts index 7abf14709..a8c1a6830 100644 --- a/crew/test/release-cut.test.ts +++ b/crew/test/release-cut.test.ts @@ -13,7 +13,7 @@ import * as path from 'node:path'; import { bunIsolationArgs } from '../../lib/bun-isolation'; import { gitFixtureTemplate, rebindGitDir } from '../../test/helpers/git-fixture-template'; import { - BACKSTOP_CHECK, CUT_WORKFLOW, FLOOR_HOURS, NOTES_CAP, NOTES_REF, REQUIRED_CHECK, SCHEDULED_GRACE_HOURS, changelogEntries, compareVersions, cutRelease, describePlan, floorStatus, + BACKSTOP_CHECK, CUT_WORKFLOW, FLOOR_HOURS, NEVER_GATING_WORKFLOWS, NOTES_CAP, NOTES_REF, REQUIRED_CHECK, SCHEDULED_GRACE_HOURS, changelogEntries, compareVersions, cutRelease, describePlan, floorStatus, gateVerdict, gitIn, planRelease, readTrainNotes, releaseNotes, sanitizeReason, stableMovedAt, verifyRegression, verifySecurity, type Gh, type Git, type TrainEvidence, } from '../scripts/release-cut'; @@ -346,6 +346,38 @@ describe('release-cut: the cut sets aside its own check runs (GST-2463)', () => .toEqual({ green: false, why: 'red check runs: Cut the release', pending: false }); }); + // Value: protects=check runs from the never-gating Windows nightly (timed out, cancelled, failed or still running) never keep a gated commit out of the + // cut, while a red required check, a red or running check run from any other workflow, a same-named job outside the nightly and a missing gate still + // refuse; fails_when=the nightly's shard 4 timeout holds stable (0326b144 behind a GREEN release gate, 6 nights), or the exclusion is keyed on the check + // name and swallows another workflow's red run; why_new=only the cut's own workflow was set aside; seam=gh is faked with the check-runs, actions/runs + // and jobs payload shapes; no_claim=a live workflow run + test('gateVerdict: the never-gating Windows nightly\'s red or running check runs are set aside; every other not-green signal still refuses (GST-2815)', () => { + const evidence = gatedBy(sha, '43668645294'); + const nightly = { id: 9100, path: '.github/workflows/windows-free-tests.yml', jobs: [71004, 71007] }; + expect(NEVER_GATING_WORKFLOWS).toContain(nightly.path); + const api = workflowRuns(sha, [ownWorkflow, nightly, { id: 555, path: '.github/workflows/evals.yml', jobs: [70555] }]); + const shard = (status: string, conclusion: string | null, id = 71004) => ({ id, name: 'windows-free-shard (4)', status, conclusion }) as CheckRun; + const aggregate = { id: 71007, name: 'windows-free-tests', status: 'completed', conclusion: 'failure' } as CheckRun; + const gated = { green: true, via: 'release gate run 43668645294' } as const; + for (const red of [shard('completed', 'timed_out'), shard('completed', 'cancelled'), shard('completed', 'failure')]) { + expect(gateVerdict(ghFor([...unbacked, red, aggregate], api), 'o/r', sha, { evidence })).toEqual(gated); + } + expect(gateVerdict(ghFor([...unbacked, shard('in_progress', null), { ...aggregate, status: 'queued', conclusion: null }], api), 'o/r', sha, { evidence })).toEqual(gated); + expect(gateVerdict(ghFor([...GREEN, shard('completed', 'timed_out')], api), 'o/r', sha)).toEqual({ green: true, via: BACKSTOP_CHECK }); + expect(gateVerdict(ghFor([{ name: REQUIRED_CHECK, status: 'completed', conclusion: 'failure' }, shard('completed', 'timed_out')], api), 'o/r', sha, { evidence })) + .toEqual({ green: false, why: REQUIRED_CHECK + ' concluded failure', pending: false }); + expect(gateVerdict(ghFor([...unbacked, shard('completed', 'timed_out'), { id: 70555, name: 'quality', status: 'completed', conclusion: 'failure' } as CheckRun], api), 'o/r', sha, { evidence })) + .toEqual({ green: false, why: 'red check runs: quality', pending: false }); + expect(gateVerdict(ghFor([...unbacked, shard('completed', 'timed_out', 80004)], api), 'o/r', sha, { evidence })) + .toEqual({ green: false, why: 'red check runs: windows-free-shard (4)', pending: false }); + expect(gateVerdict(ghFor([...unbacked, shard('in_progress', null), { name: 'slices-report', status: 'queued', conclusion: null }], api), 'o/r', sha, { evidence })) + .toEqual({ green: false, why: 'check runs still going: slices-report', pending: true }); + expect(gateVerdict(ghFor([...unbacked, shard('completed', 'timed_out')], api), 'o/r', sha)) + .toEqual({ green: false, why: 'no ' + BACKSTOP_CHECK + ' check run', pending: false }); + expect(gateVerdict(ghFor([...unbacked, shard('completed', 'timed_out')], {}), 'o/r', sha, { evidence })) + .toEqual({ green: false, why: 'red check runs: windows-free-shard (4)', pending: false }); + }); + const note = (f: ReturnType, record: unknown, on: string) => { git(f.seed, 'notes', '--ref=' + NOTES_REF, 'add', '-f', '-m', JSON.stringify(record), on); git(f.seed, 'push', '-q', '-f', 'origin', NOTES_REF); diff --git a/docs/releases.md b/docs/releases.md index 43506b18b..c6bca9728 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -50,7 +50,10 @@ days or 200 first-parent commits. The cut's own job lands a check run on main's head, the very commit it may cut, so check runs from this workflow's own runs (its file path, `.github/workflows/weekly-release.yml`, matched by the job ids of those workflow runs) are set aside whether running or -failed; every other check run counts as above. The lookup needs the +failed. Check runs from the nightly Windows free suite +(`.github/workflows/windows-free-tests.yml`), which +[never blocks](support-tiers.md#windows-ci), are set aside the same way; +every other check run counts as above. The lookup needs the workflow's `actions: read` permission; when it cannot read those runs, nothing is set aside. The workflow runs no tests and no paid evals of its own; it only reads what the trains, the backstop and the release gate diff --git a/docs/support-tiers.md b/docs/support-tiers.md index 15b6d4614..fc00729bc 100644 --- a/docs/support-tiers.md +++ b/docs/support-tiers.md @@ -24,7 +24,7 @@ That is the whole promise. Other skills, optional parts such as `/cso`'s native ## Windows CI - `windows-smoke` is the required Windows check on pull requests. -- The six-shard Windows free suite (the `Windows Free Tests` workflow, `windows-free-tests`) runs nightly on main, or when someone starts it by hand, and never blocks a pull request. +- The six-shard Windows free suite (the `Windows Free Tests` workflow, `windows-free-tests`) runs nightly on main, or when someone starts it by hand, and never blocks a pull request. The stable release cut ignores its results too, so a red or unfinished nightly never holds a release. - A red nightly run gets a fix only when it shows an install, startup or core-workflow break. - Windows checks run by path (ship-90-90 plan D, approved 2026-11-03): `Windows Scoped Tests` runs a pull request's changed Windows-safe test files on one Windows job only when it touches path, file-name or process code (a red run blocks that pull request, like any failed check), and `Windows Setup E2E` runs only when install files change (a version-only `package.json` change doesn't count).