From a74d4bd69c7267950fcc23cd0060c78699e7712c Mon Sep 17 00:00:00 2001 From: Brian Love Date: Wed, 13 May 2026 23:55:53 -0700 Subject: [PATCH] ci: include scripts/rate-limit.ts in demo redeploy gating The Phase 3 hotfix in #316 fixed a SQL bug in scripts/rate-limit.ts but never reached production: the CI Check if demo changed step's regex only watched assemble-demo, demo-middleware, and langgraph-proxy. A rate-limit.ts change alone evaluated demo_changed=false, the deploy step was skipped, and demo.cacheplane.ai kept serving the original broken bundle. Two changes: 1. Extend the watched regex to include scripts/rate-limit.ts. 2. Touch scripts/demo-middleware.ts (a documentation comment) so THIS PR matches the existing watched paths and triggers the redeploy that picks up #316's SQL fix. Also documents the gating contract in demo-middleware.ts itself so a future engineer splitting rate-limit into multiple files knows to update the regex. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 2 +- scripts/demo-middleware.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74ea88e2..c54a7881 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -343,7 +343,7 @@ jobs: if printf '%s\n' "$changed_files" | grep -E '^examples/chat/(angular|python)/' >/dev/null; then demo_changed=true fi - if printf '%s\n' "$changed_files" | grep -E '^(vercel\.demo\.json|scripts/(assemble-demo|demo-middleware|langgraph-proxy)\.ts)$' >/dev/null; then + if printf '%s\n' "$changed_files" | grep -E '^(vercel\.demo\.json|scripts/(assemble-demo|demo-middleware|langgraph-proxy|rate-limit)\.ts)$' >/dev/null; then demo_changed=true fi if printf '%s\n' "$changed_files" | grep -E '^libs/' >/dev/null; then diff --git a/scripts/demo-middleware.ts b/scripts/demo-middleware.ts index 5a25e539..f2c59dfc 100644 --- a/scripts/demo-middleware.ts +++ b/scripts/demo-middleware.ts @@ -8,6 +8,11 @@ * The rate-limit hook is wired here (not in the shared factory) so the * cockpit-examples wrapper stays unaffected — its bundle does not pull * in @neondatabase/serverless. + * + * Note: changes to scripts/rate-limit.ts MUST trigger a redeploy of this + * function. The ci.yml `Check if demo changed` step watches + * scripts/(assemble-demo|demo-middleware|langgraph-proxy|rate-limit)\.ts. + * Keep that regex in sync if you split rate-limit into multiple files. */ import { createProxyHandler } from './langgraph-proxy'; import { checkRateLimit } from './rate-limit';