ci: warm both root and signin paths without following redirects
CI / Architecture Guardrails (push) Successful in 4m52s
CI / Assistant Split Regression (push) Successful in 4m18s
CI / Typecheck (push) Successful in 5m53s
CI / Unit Tests (push) Failing after 1m57s
CI / Lint (push) Successful in 3m30s
CI / Build (push) Successful in 11m3s
CI / E2E Tests (push) Failing after 8m46s
CI / Fresh-Linux Docker Deploy (push) Failing after 10m30s
CI / Release Images (push) Has been skipped

Previous warm-up used curl -L, which followed the 307 from / to a
Location target the runner could not reach (the curl output was
'307000' — root redirected, follow-up connection refused). That
meant the warm-up never exited early on a ready server, and smoke
test #2 still hit an uncompiled root occasionally.

Replace with two independent warm-ups (/ expecting 307, /auth/signin
expecting 200) that compile each route without following the
redirect.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-13 03:19:56 +02:00
parent 2ca101100f
commit 5dfa1e2aab
+19 -11
View File
@@ -480,22 +480,30 @@ jobs:
echo "$BODY"
echo "$BODY" | grep '"status":"ok"'
- name: Warm up root path (Next.js dev compile)
- name: Warm up root and signin paths (Next.js dev compile)
# Dockerfile.dev runs `pnpm dev`, so Next.js compiles pages on the
# first request. The middleware+root combo on a cold server can
# take >10s to JIT-compile and sometimes OOM-kills a worker on the
# QNAP runner, causing the "unauthenticated root redirects" smoke
# test to hit ERR_CONNECTION_REFUSED. Warm the route here so the
# smoke run only exercises a ready server.
# test to hit ERR_CONNECTION_REFUSED. Warm both routes before the
# smoke run: root (must return 307 redirect) and /auth/signin
# (must return 200). Do NOT use -L; the Location target can point
# to a hostname that is unreachable from the runner namespace, and
# we only need the route compiled, not the redirect followed.
run: |
for i in $(seq 1 12); do
CODE=$(curl -s -o /dev/null -w "%{http_code}" -L --max-time 30 http://app:3100/ || echo "000")
echo "Warm-up $i: HTTP $CODE"
# Follow-redirect lands on /auth/signin which returns 200.
if [ "$CODE" = "200" ]; then exit 0; fi
sleep 5
done
echo "Warm-up did not reach 200; continuing anyway"
warm() {
local path="$1"
local expect="$2"
for i in $(seq 1 24); do
CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 30 "http://app:3100${path}" || echo "000")
echo "Warm-up ${path} $i: HTTP $CODE"
if [ "$CODE" = "$expect" ]; then return 0; fi
sleep 5
done
echo "Warm-up ${path} did not reach $expect; continuing anyway"
}
warm / 307
warm /auth/signin 200
- name: Seed admin user
# setup-admin.mjs imports @prisma/client and @node-rs/argon2, both of