Repository navigation
fix(runner): serve the health route somewhere Cloud Run does not answer first - #121
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
PR #120 added
GET /healthzto the runner. Cloud Run's front end answers/healthzitself, 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:
Our runner sets CORS headers on every response, including its 404s. The
/healthzresponse has none of them, andcontent-type: text/htmlis 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
/runnerHealth.DEPLOYMENT.mddocuments why it is not/healthz./healthzfails the suite instead of going dark silently.Verification
423 node tests · 11 runner guard tests ·
dart analyzeclean · 28 Dart tests. The new guard was mutation-tested: setting the constant back to/healthzfails it, restoring passes.Found by testing against the real deployment, which is the only place a reserved-path collision shows up.