From fc7be4a263135563ab328a135e1aa94db8f4e46a Mon Sep 17 00:00:00 2001 From: Jack Champagne Date: Tue, 28 Jul 2026 10:31:06 -0400 Subject: [PATCH] ci: fix amicode-release UI gate check for the unconditional layout memo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ead3274d3 ("lock down appearance settings; force v2 layout") changed settings.tsx to `newLayoutDesigns: createMemo(() => true)`. That minifies to `newLayoutDesigns:(()=>!0)`, so the gate check's grep for the old channel-gated shape `newLayoutDesigns,)` finds nothing and the step exits 1 — blocking any release cut from current mainline. Accepts the new unconditional shape, keeps the legacy channel-gated shape as a fallback, and still fails loudly on real drift. Also fixes two latent set -e bugs that made the check exit silently instead of reporting: a `grep && { ... }` AND-list, and a `VAR=$(grep|...)` assignment that aborts under pipefail when grep does not match — the latter meant the existing "gate pattern not found" message could never fire. Verified against four cases: current build (shape A on), the shipping vendored binary (legacy shape B on), a binary patched to =>!1, and a binary with the pattern removed. Correct rc and a diagnostic in each. --- .github/workflows/amicode-release.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/amicode-release.yml b/.github/workflows/amicode-release.yml index a1980b441..b89fc97d5 100644 --- a/.github/workflows/amicode-release.yml +++ b/.github/workflows/amicode-release.yml @@ -54,9 +54,26 @@ jobs: check() { local BIN="$1" test -f "$BIN" - # minified shape: `...general?.newLayoutDesigns,)` with `=!0` (on) / `=!1` (off) + # Shape A (current, since ead3274d3 "lock down appearance settings; force v2 layout"): + # settings.tsx sets `newLayoutDesigns: createMemo(() => true)` — unconditional, no + # channel dependency. Minifies to `newLayoutDesigns:(()=>!0)`. + if grep -aq 'newLayoutDesigns:[A-Za-z$_]\{1,8\}(()=>!0)' "$BIN"; then + echo "OK: gate hardcoded ON (unconditional memo) in $BIN" + return 0 + fi + # `if`, not `grep && { ... }` — under `set -e` a failing grep in an AND-list aborts + # the step with no message, which would silently pass as a green gate. + if grep -aq 'newLayoutDesigns:[A-Za-z$_]\{1,8\}(()=>!1)' "$BIN"; then + echo "FAIL: unconditional memo is OFF (=>!1) in $BIN" + exit 1 + fi + # Shape B (legacy, channel-gated): `...general?.newLayoutDesigns,)` with + # `=!0` (on) / `=!1` (off). Kept so this check still works if the setting is + # ever wired back to the channel default. local VAR - VAR=$(grep -aoh 'newLayoutDesigns,[A-Za-z$_]\{1,8\})' "$BIN" | head -1 | sed 's/newLayoutDesigns,//; s/)//') + # `|| true` — under `set -o pipefail` a no-match grep would abort the step here with + # no message, so the "pattern not found" diagnostic below could never fire. + VAR=$( { grep -aoh 'newLayoutDesigns,[A-Za-z$_]\{1,8\})' "$BIN" || true; } | head -1 | sed 's/newLayoutDesigns,//; s/)//') test -n "$VAR" || { echo "FAIL: gate pattern not found in $BIN (minifier drift? update this check)"; exit 1; } grep -aq "[^A-Za-z0-9_\$]${VAR}=!0" "$BIN" \ || { echo "FAIL: channel gate OFF (${VAR}=!1) in $BIN — built with channel latest/prod?"; exit 1; }