Add a post-deployment smoke gate#33
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f4d55573f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ready = request(base_url, "/ready", timeout) | ||
| require(ready.status == 200, f"/ready returned HTTP {ready.status}, expected 200") |
There was a problem hiding this comment.
Add a /ready route before gating deployments
In this commit, git grep '"/ready"' only finds the smoke script/tests and no FastAPI route; the app exposes /health and /health/stream but not /ready, so every scripts/deploy.sh run will receive a 404 here and exit after replacing the Cloud Run service. Either add the /ready endpoint or stop requiring it before making this smoke check a deploy gate.
Useful? React with 👍 / 👎.
# Conflicts: # src/api/endpoints.py # tests/test_api.py
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # src/api/endpoints.py
What
/health,/ready, unauthenticated access rejection, and end-to-end SSE delivery/health/streamSSE probe with no tenant data or model costGET /sessionswhenSMOKE_TEST_TOKENis presentWhy
A successful Cloud Run replacement does not prove the application is live, ready, enforcing authentication, or preserving SSE through the serving path. These checks make deployment fail visibly when those production contracts regress.
Impact
Deployments now exit nonzero when required smoke checks fail. No automatic rollback occurs; operators receive a copy-pasteable command targeting the previously ready revision. The probe is read-only, bounded by short per-request timeouts, and never logs bearer tokens.
Checks
uv run pytest -q tests/test_post_deploy_smoke.py tests/test_api.py -k 'post_deploy_smoke or health'(5 passed)uv run ruff check scripts/post_deploy_smoke.py src/api/endpoints.py tests/test_api.py tests/test_post_deploy_smoke.pybash -n scripts/deploy.shgit diff --checkgraphify update .Limitations
SMOKE_TEST_TOKEN.gcloud run services replacecurrently routes traffic immediately; the prior revision is reported for an explicit operator decision.