You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci: probe by message text, not HTTP status; check iTunes first (#45)
Two fixes addressing the May 2026 false positive where the probe latched
onto v2-12-5 because it didn't return the deprecation marker. v2-12-5
was actually returning 500 "database is unreachable" — a different kind
of broken — but the probe's predicate ("not deprecated → live") couldn't
tell the difference.
Discriminator changed from HTTP status to message text:
- "deprecated" → deprecated (1)
- "session not found" / "invalid" / "expired" → healthy (0)
- anything else → broken/transient (2)
Liftoff's tRPC layer wraps ALL errors as httpStatus 500, so HTTP status
is no signal at all. The healthy v2-13-10 host returns
"Session not found" with httpStatus 500 — bit-for-bit identical envelope
shape as the broken v2-12-5 host returning "database is unreachable".
Discovery order also changed:
1. Probe the current host. If healthy, no-op. If broken (500/transient),
warn and bail without bumping — try again tomorrow.
2. Ask the App Store via iTunes lookup what the current iOS app version
is. Host names mirror the app version (2.13.10 → v2-13-10), so the
iOS version IS the canonical answer to "what host should we use".
If iTunes lookup succeeds and the derived host is healthy, use it.
3. Fall back to a sweep with a wider candidate window: same minor
patch+1..15, minor+1 0..15, minor+2 0..5, major+1 0..2. Pick the
HIGHEST healthy version found, not the first — earlier-version hosts
can linger after a rotation, but we want the current one.
The current candidate window (patch+1..3, minor+1..3, minor+2..1, major+1)
would never have found v2-13-10 from a v2-12-3 starting point even with
the new predicate, so the sweep widening is part of the fix.
Verified locally against known states: v2-13-{9,10}=healthy,
v2-13-5=deprecated, v2-12-5=broken/transient, v2-99-99=broken.
Co-authored-by: Orca <[email protected]>
echo "::error::no healthy host found via iTunes lookup or candidate sweep"
79
140
exit 1
80
141
fi
81
142
82
-
echo "found live host: $live"
143
+
echo "live host: $live ($lver)"
83
144
84
-
# Skip if a PR for this version already exists
145
+
# Skip if the file is already on this version, or a PR for it is open.
146
+
if [ "$live" = "$current" ]; then
147
+
echo "default already matches ${lver}, no bump needed"
148
+
exit 0
149
+
fi
85
150
if gh pr list --search "auto/bump-api-host-${lver} in:head state:open" --json number --jq 'length' | grep -qv '^0$'; then
86
151
echo "PR already open for ${lver}; skipping"
87
152
exit 0
@@ -100,4 +165,4 @@ jobs:
100
165
101
166
gh pr create --base main \
102
167
--title "fix(auth): bump default API host to ${lver}" \
103
-
--body "Automated probe found \`$current\` returns \"server is deprecated\". \`$live\` is currently live. Triggered by \`.github/workflows/api-host-probe.yml\`. Verify with \`LIFTOFF_API_BASE=$live liftoff-export auth refresh\` before merging."
168
+
--body "Automated probe found \`$current\` returns \"server is deprecated\". \`$live\` is healthy (returns 4xx for an invalid-token probe, the expected response from a working backend). Triggered by \`.github/workflows/api-host-probe.yml\`. Verify with \`LIFTOFF_API_BASE=$live liftoff-export auth refresh\` before merging."
0 commit comments