Skip to content

fix(runner): serve the health route somewhere Cloud Run does not answer first - #121

Merged
sgardoll merged 1 commit into
mainfrom
fix/runner-health-reserved-path
Oct 4, 2026
Merged

sgardoll merged 1 commit into
mainfrom
fix/runner-health-reserved-path

Conversation

@sgardoll

@sgardoll sgardoll commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

The bug

PR #120 added GET /healthz to the runner. Cloud Run's front end answers /healthz itself, so the request never reaches the container — the endpoint is dead in production no matter how well it works locally.

Verified against the live service:

$ curl .../nope        -> {"success":false,"error":"Not found.","preWrite":true}
$ curl .../healthz     -> HTTP 404, content-type: text/html, a Google error page

Our runner sets CORS headers on every response, including its 404s. The /healthz response has none of them, and content-type: text/html is not ours — proof the request was answered before the container.

This also silently broke the canary's version probe: it would have read Google's HTML error page as its answer.

The fix

  • The path is now a declared constant, /runnerHealth.
  • The canary probes that path; DEPLOYMENT.md documents why it is not /healthz.
  • A test asserts the route is not the reserved path and that it is matched through the constant rather than a literal, so reintroducing /healthz fails the suite instead of going dark silently.

Verification

423 node tests · 11 runner guard tests · dart analyze clean · 28 Dart tests. The new guard was mutation-tested: setting the constant back to /healthz fails it, restoring passes.

Found by testing against the real deployment, which is the only place a reserved-path collision shows up.


Devin Review

…er first

The route was /healthz, and Cloud Run's front end answers that path itself - the
request never reaches the container. Verified against the live service: an
unknown path returns the runner's own JSON 404 with its CORS headers, while
/healthz returns a Google HTML 404 with none of them. So the endpoint shipped in
PR #120 was dead in production however well it worked locally, and the canary's
version probe would have read Google's error page as its answer.

The path is now a declared constant, /runnerHealth, and a test asserts it is not
the reserved one and that the route is matched through the constant rather than
a literal - so putting it back fails the suite rather than silently going dark.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@sgardoll
sgardoll merged commit 9906bfb into main Oct 4, 2026
7 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