From a0b0328f992d474ef3ab6d9ea2e72be7d9f83c95 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Sun, 11 Oct 2026 15:38:44 -0400 Subject: [PATCH] fix(ci): a removed layout writer no longer fails other PRs' ratchet check (#27557) #27529 removed two main-process layout writers after the ratchet landed, so main's baseline went stale and every PR failed the check. Prune the baseline and report a shrunk count as a warning; only growth fails. --- config/main-layout-writer-baseline.txt | 4 ++-- config/scripts/check-layout-writer-ratchets.mjs | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/main-layout-writer-baseline.txt b/config/main-layout-writer-baseline.txt index bddc84a2216..a66fd7053bb 100644 --- a/config/main-layout-writer-baseline.txt +++ b/config/main-layout-writer-baseline.txt @@ -3,10 +3,10 @@ # This is a RATCHET: counts may only go DOWN. Layout moves to one runtime owner; do not add # writers. Prune after removing writers: pnpm check:layout-writer-ratchets --prune 1 src/main/ipc/pty/ipc/leaf-move.ts -2 src/main/ipc/pty/ipc/spawn-commit-persist.ts +1 src/main/ipc/pty/ipc/spawn-commit-persist.ts 1 src/main/ipc/pty/pane/pane-owner-replacement.ts 3 src/main/ipc/pty/pane/stable-owner.ts -2 src/main/ipc/pty/runtime/spawn-commit.ts +1 src/main/ipc/pty/runtime/spawn-commit.ts 1 src/main/ipc/renderer-shutdown-checkpoint.ts 1 src/main/ipc/runtime-environment-removal-cleanup.ts 1 src/main/ipc/runtime-environment-session-reconcile.ts diff --git a/config/scripts/check-layout-writer-ratchets.mjs b/config/scripts/check-layout-writer-ratchets.mjs index 0e8c6bf71cb..4381123e576 100644 --- a/config/scripts/check-layout-writer-ratchets.mjs +++ b/config/scripts/check-layout-writer-ratchets.mjs @@ -455,12 +455,13 @@ export function main(root = process.cwd()) { `::error file=${file}::${now} ${ratchet.label}, baseline allows ${allowed}. ${ADVICE}` ) } + // Why: a removal must not fail PRs that branched before it; only growth fails. for (const { file, now, allowed } of shrunk) { - console.error( - `::error file=${file}::${now} ${ratchet.label}, baseline still allows ${allowed}. Run: pnpm check:layout-writer-ratchets --prune` + console.warn( + `::warning file=${file}::${now} ${ratchet.label}, baseline still allows ${allowed}. Run: pnpm check:layout-writer-ratchets --prune` ) } - if (grown.length + shrunk.length > 0) { + if (grown.length > 0) { failed = true } else { console.log(`Layout-writer ratchet (${ratchet.id}) OK — ${total(current)} ${ratchet.label}.`)