CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix(deploy): INCIDENT 2026-08-19 — script died silently after reset without DEPLOY_EVENT_TOKEN; in-container /api probes need X-Forwarded-For; EXIT trap restores HEAD #5505

Merged⚡ AI-generatedXSccantynz wants to mergefix/deploy-script-2026-08-19mainopened 13d ago
ccantynzcommented 13d ago

Deploys of 027a403 and 9c12757 never landed. Journal: "HEAD is now at …" then exit 1, no message. deploy_event() read the token with a grep pipeline; the box .env has no DEPLOY_EVENT_TOKEN, grep exited 1, and under set -euo pipefail that killed the script right after git reset --hard — HEAD advanced, old container kept running, next tick saw "nothing new" forever. Also from the journal: the served-SHA gate couldn't read /api/version inside the container because /api/* sits behind the rate limiter, which returns 400 without X-Forwarded-For.

Fixes: tolerant token read; X-Forwarded-For: 127.0.0.1 on every in-container /api call; an EXIT trap restores HEAD to the previous sha and logs loudly on any unexpected death, so a crash can never strand a deploy again. Harness gains a stateful git shim and tests for all three (23 pass).

After merge I will recover the box by hand (HEAD is currently stranded at 9c12757 with a138741 running).

🤖 Generated with Claude Code

ccantynzAI Reviewcommented 13d ago

AI Triage

(no summary)

Priority: medium Risk area: mixed

Suggested labels: (no label suggestions) Suggested reviewers: (no reviewer suggestions)

Suggestions only — nothing has been applied. The PR author stays in control.

gluecron[bot]🤖 botAI Reviewcommented 13d ago

AI review unavailable

The platform's AI balance is exhausted, so AI generation is temporarily unavailable. Nothing was lost. You can queue this as a repair for the internal agent from the repository's Health page, or try again once the balance is restored. The PR is otherwise unchanged.

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts