Skip to content

Add a post-deployment smoke gate#33

Merged
KostasCherv merged 3 commits into
mainfrom
codex/post-deploy-smoke
Jul 14, 2026
Merged

Add a post-deployment smoke gate#33
KostasCherv merged 3 commits into
mainfrom
codex/post-deploy-smoke

Conversation

@KostasCherv

Copy link
Copy Markdown
Owner

What

  • add a portable fail-fast smoke runner for /health, /ready, unauthenticated access rejection, and end-to-end SSE delivery
  • add a one-event /health/stream SSE probe with no tenant data or model cost
  • run the smoke gate automatically after Cloud Run replacement
  • optionally validate authenticated GET /sessions when SMOKE_TEST_TOKEN is present
  • capture the previous ready revision and print an exact manual rollback command on failure
  • document local use and rollback guidance

Why

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.py
  • bash -n scripts/deploy.sh
  • git diff --check
  • graphify update .

Limitations

  • The required auth check proves anonymous requests are rejected; the positive authenticated check only runs when an operator supplies a short-lived SMOKE_TEST_TOKEN.
  • The SSE probe validates transport behavior without exercising a real research run, avoiding tenant-data setup, model spend, and deployment-time mutations.
  • Automatic rollback is intentionally omitted because gcloud run services replace currently routes traffic immediately; the prior revision is reported for an explicit operator decision.
  • Repository-wide mypy remains blocked by 37 pre-existing errors outside this change.

@KostasCherv
KostasCherv marked this pull request as ready for review July 14, 2026 07:58
@KostasCherv

Copy link
Copy Markdown
Owner Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +61 to +62
ready = request(base_url, "/ready", timeout)
require(ready.status == 200, f"/ready returned HTTP {ready.status}, expected 200")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cortex Ready Ready Preview, Comment Jul 14, 2026 8:45am

@KostasCherv
KostasCherv merged commit 12f7ec2 into main Jul 14, 2026
5 checks passed
@KostasCherv
KostasCherv deleted the codex/post-deploy-smoke branch July 14, 2026 11:02
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