From 1d77ee83b3e598b227a876e3531c6c3036a3636b Mon Sep 17 00:00:00 2001 From: Ilia Denisov Date: Mon, 13 Jul 2026 12:45:38 +0200 Subject: [PATCH] fix(ci): make the legal-page probe size-independent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /eula/ probe fetched the full ~129 KB page. While the monitoring stack boots after the rolling deploy and the CPU-capped (1 CPU / 192 MB) renderer is starved, that transfer exceeded the wget timeout for the entire 60s retry window, while the 3x-smaller /privacy/ passed — pre-rendering the pages did not help because the bottleneck is the transfer, not the render. Fetch only the (head -c 4096) and assert the page's canonical URL, which uniquely identifies the rendered legal doc reaching the edge (the landing's canonical is erudit-game.ru/); the check now transfers ~4 KB regardless of page size. --- .gitea/workflows/ci.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index aafc7b3..43242d8 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -536,17 +536,19 @@ jobs: - name: Probe the /privacy/ and /eula/ legal pages are served run: | set -u - # /privacy/ and /eula/ are static legal markdown rendered by the render sidecar (no backend - # fetch). If the @legal caddy route is missing they fall to the landing shell (also 200), so - # assert the page-specific canonical URL (the landing's is erudit-game.ru/) plus the seller - # INN — proving the rendered legal doc reached the edge, not the landing catch-all. Retry - # like the landing/gateway/backend probe: the renderer is recreated in this same deploy and - # a single-shot check can race its restart (it answers /offer/ then is briefly re-listening). + # /privacy/ and /eula/ are static legal markdown rendered by the render sidecar. If the + # @legal caddy route is missing they fall to the landing shell (also 200, canonical + # erudit-game.ru/), so assert the page-specific canonical URL — it uniquely identifies the + # rendered legal doc reaching the edge, not the landing catch-all. Read only the + # (head -c 4096; the canonical link sits in the first bytes): the check is then + # size-independent, so the large EULA page does not exceed the timeout while the monitoring + # stack is still booting post-deploy and starving the CPU-capped renderer. Retry like the + # landing/gateway/backend probe to ride out that window. for route in privacy eula; do ok= for i in $(seq 1 20); do - out="$(docker run --rm --network edge alpine:3.20 wget -q -T 10 -O - "http://scrabble/${route}/" 2>&1 || true)" - if echo "$out" | grep -qF "erudit-game.ru/${route}/" && echo "$out" | grep -qF "290210610742"; then + head_out="$(docker run --rm --network edge alpine:3.20 sh -c "wget -q -T 10 -O - http://scrabble/${route}/ 2>/dev/null | head -c 4096" || true)" + if printf '%s' "$head_out" | grep -qF "erudit-game.ru/${route}/"; then echo "ok: /${route}/ serves the rendered legal page" ok=1 break