feat(health): expose app version in GET /health (#717) #719

Merged
bot-reviewer merged 1 commit from feat/717-health-version into main 2026-05-30 12:15:06 +00:00
Collaborator

Summary

  • GET /health now returns version alongside status and environment, sourced from app.version (the FastAPI instance attribute, "0.1.0", mirrors pyproject.toml).
  • Observability: health-check now shows the deployed app version.

Implementation

Per the issue spec exactly — reuse the module-scope app instance; no new settings field, no runtime pyproject parsing, no new imports/deps. Return-type dict[str, str] preserved (all three values are str).

Test plan

  • ruff check backend/app/main.py → clean
  • app = FastAPI(..., version="0.1.0", ...) confirmed at main.py:78app.version == "0.1.0"
  • Post-deploy (QA): curl -s localhost:8000/health{"status":"ok","environment":"<env>","version":"0.1.0"}

Refs #717

## Summary - `GET /health` now returns `version` alongside `status` and `environment`, sourced from `app.version` (the FastAPI instance attribute, `"0.1.0"`, mirrors `pyproject.toml`). - Observability: health-check now shows the deployed app version. ## Implementation Per the issue spec exactly — reuse the module-scope `app` instance; no new `settings` field, no runtime `pyproject` parsing, no new imports/deps. Return-type `dict[str, str]` preserved (all three values are `str`). ## Test plan - [x] `ruff check backend/app/main.py` → clean - [x] `app = FastAPI(..., version="0.1.0", ...)` confirmed at `main.py:78` → `app.version == "0.1.0"` - [ ] Post-deploy (QA): `curl -s localhost:8000/health` → `{"status":"ok","environment":"<env>","version":"0.1.0"}` Refs #717
bot-backend added 1 commit 2026-05-30 12:13:24 +00:00
Surface the deployed app version (app.version, = pyproject 0.1.0) in the
health response for observability. Reuses the FastAPI instance attribute —
no new settings field, no runtime pyproject parsing.

Refs #717
bot-reviewer approved these changes 2026-05-30 12:14:57 +00:00
bot-reviewer left a comment
Collaborator

APPROVE — matches issue #717 spec verbatim.

  • app = FastAPI(title="GenDesign API", version="0.1.0", lifespan=lifespan) (main.py:78) → app.version is str "0.1.0" → no AttributeError, -> dict[str, str] annotation holds.
  • Version sourced from app.version (not a hardcoded handler literal), no new settings field, no runtime pyproject parsing, no new imports — exactly per spec's "Не делать" list.
  • /health is a public no-auth path (RBAC middleware skips it); exposing 0.1.0 is standard observability, no info-leak concern.
  • DoD binary checks satisfied: 3 keys (status/environment/version), return type preserved.

No regressions. Merging.

<!-- gendesign-review-bot: sha=d07d10f verdict=approve --> ✅ APPROVE — matches issue #717 spec verbatim. - `app = FastAPI(title="GenDesign API", version="0.1.0", lifespan=lifespan)` (main.py:78) → `app.version` is `str "0.1.0"` → no AttributeError, `-> dict[str, str]` annotation holds. - Version sourced from `app.version` (not a hardcoded handler literal), no new `settings` field, no runtime pyproject parsing, no new imports — exactly per spec's "Не делать" list. - `/health` is a public no-auth path (RBAC middleware skips it); exposing `0.1.0` is standard observability, no info-leak concern. - DoD binary checks satisfied: 3 keys (`status`/`environment`/`version`), return type preserved. No regressions. Merging.
bot-reviewer merged commit 406ea8365a into main 2026-05-30 12:15:06 +00:00
bot-reviewer deleted branch feat/717-health-version 2026-05-30 12:15:07 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#719
No description provided.