From 408ffa9decfd14b301fadd052a9cea33adfe7d6f Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Wed, 7 Oct 2026 21:31:09 +0000 Subject: [PATCH] Site deploy checks: no-cache headers on every read and a 150 s window (22:27 BST: the litepaper served the previous deployment for over 90 s after /api/live had moved, a false DEPLOY RED) Co-Authored-By: Claude Fable 5.1 --- tools/site-deploy-from-mirror.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/site-deploy-from-mirror.sh b/tools/site-deploy-from-mirror.sh index 53bdf5e12..1c7b0d2b1 100755 --- a/tools/site-deploy-from-mirror.sh +++ b/tools/site-deploy-from-mirror.sh @@ -21,13 +21,14 @@ MINERS_MIN_ROWS="${MINERS_MIN_ROWS:-30}" SITE="${SITE_URL:-https://igneum.network}" post_checks() { # one pass: prints the first mismatch as "field: detail" and returns 1, or returns 0 silently local j n idx m rows - j=$(curl -fsS --max-time 20 "$SITE/api/live?x=$RANDOM" 2>/dev/null) || { echo "api/live: not reachable"; return 1; } + local nc=(-H 'Cache-Control: no-cache' -H 'Pragma: no-cache') + j=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/api/live?x=$RANDOM" 2>/dev/null) || { echo "api/live: not reachable"; return 1; } n=$(printf '%s' "$j" | python3 -c 'import sys,json; print(json.load(sys.stdin)["state"]["network"])' 2>/dev/null || echo "?") [ "$n" = "$LIVE_NETWORK" ] || { echo "api/live network: $n (want $LIVE_NETWORK)"; return 1; } - idx=$(curl -fsS --max-time 20 "$SITE/?x=$RANDOM" 2>/dev/null) || { echo "index: not reachable"; return 1; } + idx=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/?x=$RANDOM" 2>/dev/null) || { echo "index: not reachable"; return 1; } for m in "${INDEX_STRINGS[@]}"; do printf '%s' "$idx" | /usr/bin/grep -qF -- "$m" || { echo "index string missing: \"$m\""; return 1; }; done - curl -fsS --max-time 20 "$SITE$LEGAL_PAGE?x=$RANDOM" 2>/dev/null | /usr/bin/grep -qiF -- "$LEGAL_STRING" || { echo "legal string missing on $LEGAL_PAGE: \"$LEGAL_STRING\""; return 1; } - rows=$(curl -fsS --max-time 20 "$SITE/miners?x=$RANDOM" 2>/dev/null | /usr/bin/grep -c '/dev/null | /usr/bin/grep -qiF -- "$LEGAL_STRING" || { echo "legal string missing on $LEGAL_PAGE: \"$LEGAL_STRING\""; return 1; } + rows=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/miners?x=$RANDOM" 2>/dev/null | /usr/bin/grep -c '&1 ) || { echo "$OUT" | tail -5 >&2; exit 1; } URL=$(echo "$OUT" | grep -oE 'https://[a-z0-9.-]*vercel\.app' | tail -1) # the post-deploy checks, retried while the edge still serves the previous deployment (up to 90 s) -verdict=""; for i in $(seq 1 18); do verdict=$(post_checks 2>&1) && break; sleep 5; done +verdict=""; for i in $(seq 1 30); do verdict=$(post_checks 2>&1) && break; sleep 5; done # up to 150 s: the edge serves the previous deployment per path for a while (22:27 BST: the litepaper lagged the API by over 90 s) case "$verdict" in ok:*) echo "post-deploy checks $verdict" ;; *) echo "DEPLOY RED $verdict (commit $SHORT at the edge $URL, $(TZ=Europe/London date +%H:%M) BST)" >&2; exit 1 ;; esac echo "SITE DEPLOYED commit $SHORT at $(TZ=UTC date +%H:%M:%SZ) UTC ($(TZ=Europe/London date +%H:%M) BST): $URL -> https://igneum.network" echo "$OUT" | grep -iE "Production:|Aliased|error" | head -3