CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix(ci): a deploy that was overtaken is not a deploy that failed #5606

MergedXSccantynz wants to mergefix/verify-deploy-supersededmainopened 1d ago
1 changed file+27−1
Modified.gluecron/workflows/deploy.yml+27−1View fileUnifiedSplit
3535 echo "deploy verified: production serves $SHA (after ~$((i * 10))s)"
3636 exit 0
3737 fi
38 # SUPERSEDED IS NOT FAILED. Added 2026-08-31 after this job went
39 # red for a deploy that had worked perfectly: two merges landed 44
40 # seconds apart, the second deploy overtook the first, and this
41 # loop spent six minutes waiting for a sha production had already
42 # moved PAST. The commit was live the whole time - inside the one
43 # being served.
44 #
45 # A red build for a condition that is not a failure is worse than
46 # no check: it is what teaches people to ignore a red deploy. And
47 # it fires on every rapid merge sequence, which is exactly when
48 # someone is watching.
49 #
50 # If production serves a DESCENDANT of this commit, this commit
51 # shipped. `--is-ancestor` answers precisely that. A failed fetch
52 # is not fatal - we fall through and keep polling, which is the
53 # behaviour this job had before.
54 if [ -n "$LIVE" ]; then
55 git fetch --quiet origin 2>/dev/null || true
56 if git cat-file -e "${LIVE}^{commit}" 2>/dev/null && git merge-base --is-ancestor "$SHA" "$LIVE" 2>/dev/null; then
57 echo "deploy verified: production serves $LIVE, which CONTAINS $SHA"
58 echo "(superseded by a newer deploy - this commit shipped)"
59 exit 0
60 fi
61 fi
3862 echo "attempt $i/36 — production serves ${LIVE:-unknown}, waiting..."
3963 sleep 10
4064 done
41 echo "DEPLOY NOT VERIFIED after 6 minutes — the gluecron-update timer may be stuck."
65 echo "DEPLOY NOT VERIFIED after 6 minutes."
66 echo "Production serves ${LIVE:-unknown}, which is neither $SHA nor a descendant of it."
67 echo "The gluecron-update timer may be stuck."
4268 echo "On the host: systemctl list-timers 'gluecron-*' && journalctl -u gluecron-update"
4369 exit 1
4470
4571
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts