[object Object]

← back to Designer Wallcoverings

Fix theme-push scripts: resolve LIVE theme dynamically (role==main), not stale hardcoded ids

cd7a11f6dd3444a9f5d14c0a549664a7212f6ae8 · 2026-06-23 07:38:59 -0700 · Steve Abrams

Root cause of the broken-collection-page incident: scripts hardcoded LIVE_ID=143739584563
('NewWall Template [Dev]') as live. That theme is now UNPUBLISHED; the real published
theme is 142250278963 'Steves Version 5.0'. So 'live' fixes landed on a dev theme while
the live store stayed broken, and one script (push-native-infinite) wrote straight to the
live theme believing it was dev.

- push-collection-fixes.sh / push-size-qty-layout.sh: recompute live_id from role==main; ALLOW_LIVE guard now protects whatever is actually published.
- theme-moq/push-section-to-live.py: live_theme_id() resolves role==main dynamically.
- push-native-infinite-to-steves-v5.sh: ids were inverted; now resolves role==main and ALLOW_LIVE-gates writes to the published theme.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit cd7a11f6dd3444a9f5d14c0a549664a7212f6ae8
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jun 23 07:38:59 2026 -0700

    Fix theme-push scripts: resolve LIVE theme dynamically (role==main), not stale hardcoded ids
    
    Root cause of the broken-collection-page incident: scripts hardcoded LIVE_ID=143739584563
    ('NewWall Template [Dev]') as live. That theme is now UNPUBLISHED; the real published
    theme is 142250278963 'Steves Version 5.0'. So 'live' fixes landed on a dev theme while
    the live store stayed broken, and one script (push-native-infinite) wrote straight to the
    live theme believing it was dev.
    
    - push-collection-fixes.sh / push-size-qty-layout.sh: recompute live_id from role==main; ALLOW_LIVE guard now protects whatever is actually published.
    - theme-moq/push-section-to-live.py: live_theme_id() resolves role==main dynamically.
    - push-native-infinite-to-steves-v5.sh: ids were inverted; now resolves role==main and ALLOW_LIVE-gates writes to the published theme.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 .../push-native-infinite-to-steves-v5.sh           | 27 +++++++++++++++-------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/shopify/theme-infinite-scroll-142250278963/push-native-infinite-to-steves-v5.sh b/shopify/theme-infinite-scroll-142250278963/push-native-infinite-to-steves-v5.sh
index beaeb344..696633f4 100755
--- a/shopify/theme-infinite-scroll-142250278963/push-native-infinite-to-steves-v5.sh
+++ b/shopify/theme-infinite-scroll-142250278963/push-native-infinite-to-steves-v5.sh
@@ -1,26 +1,37 @@
 #!/usr/bin/env bash
-# Stage native-Liquid infinite scroll onto the UNPUBLISHED dev theme
-# "Steves Version 5.0" (142250278963) on designer-laboratory-sandbox.
+# Stage native-Liquid infinite scroll onto theme "Steves Version 5.0" (142250278963).
+#
+# ⚠️ HEADS UP: as of 2026-06-23, 142250278963 "Steves Version 5.0" is the PUBLISHED
+# (role=main) LIVE theme — it is NO LONGER an unpublished dev theme. Earlier versions
+# of this script had the ids backwards (it "protected" 143739584563, which is now the
+# unpublished dev theme). Writing here hits the live store, so this is now ALLOW_LIVE-gated.
 #
 # Converts the theme's three native {% paginate %} numbered-pager grids
 # (collection-list / blog / blog-masonry) to append-on-scroll infinite scroll.
 # Leaves the Boost AI Search & Discovery surfaces (collection/search PRODUCT
 # grids) untouched — those already infinite-scroll via Boost's global setting
-# + assets/boost-sd-custom.js. NEVER touches the live theme 143739584563.
+# + assets/boost-sd-custom.js.
 #
 # Each asset is backed up (GET before PUT) and verified (GET after PUT).
 # Idempotent: re-running only re-PUTs assets whose live value differs.
 #
-#   THEME_TOKEN=shpat_xxx bash push-native-infinite-to-steves-v5.sh
+#   THEME_TOKEN=shpat_xxx bash push-native-infinite-to-steves-v5.sh                 # blocks if target is live
+#   THEME_TOKEN=shpat_xxx ALLOW_LIVE=1 bash push-native-infinite-to-steves-v5.sh    # LIVE (Steve-gated)
 set -euo pipefail
 cd "$(dirname "$0")"
 STORE="designer-laboratory-sandbox.myshopify.com"; API="2024-10"
-TGT_THEME=142250278963          # Steves Version 5.0 (unpublished dev)
-LIVE_THEME=143739584563         # NewWall Template — NEVER write to this
+TGT_THEME="${TARGET_THEME:-142250278963}"   # default Steves Version 5.0 (currently LIVE)
 TOK="${THEME_TOKEN:?set THEME_TOKEN}"
 
-# Hard guard: refuse to ever target the live theme id.
-if [ "$TGT_THEME" = "$LIVE_THEME" ]; then echo "REFUSING: target == live theme"; exit 2; fi
+# Resolve the PUBLISHED (role=main) theme dynamically — that is what "live" means.
+LIVE_THEME="$(curl -sS -H "X-Shopify-Access-Token: $TOK" "https://$STORE/admin/api/$API/themes.json" \
+  | python3 -c 'import sys,json; print(next((str(t["id"]) for t in json.load(sys.stdin)["themes"] if t["role"]=="main"),""))')"
+echo "target=$TGT_THEME  live(role=main)=$LIVE_THEME"
+
+# Hard guard: writing the published/live theme requires ALLOW_LIVE=1 (Steve-gated).
+if [ "$TGT_THEME" = "$LIVE_THEME" ] && [ "${ALLOW_LIVE:-0}" != "1" ]; then
+  echo "REFUSING: target ($TGT_THEME) is the LIVE published theme. Re-run with ALLOW_LIVE=1 to proceed."; exit 2
+fi
 
 python3 - "$STORE" "$API" "$TOK" "$TGT_THEME" <<'PY'
 import sys,json,os,urllib.request,urllib.parse,datetime,time

← d3069393 Deploy collection toolbar to live theme: sort dropdown + gri  ·  back to Designer Wallcoverings  ·  Fix filter pill sizing: uniform min-height and min-width for a744a13f →