Skip to content

fix(ci): require readyz JSON body in healthcheck, not just HTTP 200#40

Merged
ItsThompson merged 1 commit into
mainfrom
fix/healthcheck-require-json-body
Jul 18, 2026
Merged

fix(ci): require readyz JSON body in healthcheck, not just HTTP 200#40
ItsThompson merged 1 commit into
mainfrom
fix/healthcheck-require-json-body

Conversation

@ItsThompson

Copy link
Copy Markdown
Owner

Summary

Follow-up hardening to the website healthcheck workflow added in #39.

A live workflow_dispatch of healthcheck.yml against prod returned HTTP 200 and passed, even though /healthz was not yet deployed. Root cause: the shell's React Router SSR catch-all answers 200 with the SPA HTML shell for any unmatched path, so the original status-code-only probe was a false-healthy — a green run proved nothing about the backend.

Change

The probe now requires the readiness-backed JSON body ("status":"ok") in addition to HTTP 200. A 200-HTML fallback no longer counts as healthy.

Response Before After
real healthy: 200 + {"status":"ok"} ✅ pass ✅ pass
SPA fallback: 200 + HTML (prod today, pre-deploy) ✅ pass (wrong) ❌ fail (correct)
backend down: 503 + {"status":"unhealthy",...} ❌ fail ❌ fail

This also hardens against a future stale/rolled-back deploy that loses the /healthz route silently showing green.

Testing

  • actionlint (incl. shellcheck): clean.
  • Local dry-run of the strengthened success condition against all three body cases above: behaves as the table shows.

Notes

A live workflow_dispatch against prod returned HTTP 200 even though
/healthz is not yet deployed: the shell's React Router SSR catch-all
answers 200 (HTML) for the unmatched path, so a status-code-only check is
a false-healthy. Require the readiness-backed body ({"status":"ok"}) in
addition to 200 so a green run proves we actually reached /healthz and the
backend is up. A stale/rolled-back deploy that loses the route now
correctly goes red instead of silently passing.
@ItsThompson
ItsThompson enabled auto-merge July 18, 2026 17:57
@ItsThompson
ItsThompson merged commit b820566 into main Jul 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant