TheYuchen commited on
Commit
42d80aa
·
1 Parent(s): 09ac4f2

Health + OpenAPI report the real APP_VERSION

Browse files

/api/health carried a hardcoded 0.1.0 while every run stamps
app_version from app/_version.py — the liveness probe disagreed with
the provenance stamp about which build was serving. health.py and the
FastAPI metadata now import APP_VERSION from the single source of
truth. No test pinned the old value; unit lane 86 green.

backend/app/main.py CHANGED
@@ -18,6 +18,7 @@ from fastapi.middleware.cors import CORSMiddleware
18
  from fastapi.responses import FileResponse, JSONResponse
19
  from fastapi.staticfiles import StaticFiles
20
 
 
21
  from app.config import FRONTEND_DIST, get_settings
22
  from app.routes import auth as auth_route
23
  from app.routes import backends as backends_route
@@ -46,7 +47,7 @@ async def lifespan(app: FastAPI):
46
  app = FastAPI(
47
  title="QuDA Studio",
48
  description="Interactive pipeline over QuCAD / QuBound / CompressVQC / Qshot.",
49
- version="0.1.0",
50
  lifespan=lifespan,
51
  )
52
 
 
18
  from fastapi.responses import FileResponse, JSONResponse
19
  from fastapi.staticfiles import StaticFiles
20
 
21
+ from app._version import APP_VERSION
22
  from app.config import FRONTEND_DIST, get_settings
23
  from app.routes import auth as auth_route
24
  from app.routes import backends as backends_route
 
47
  app = FastAPI(
48
  title="QuDA Studio",
49
  description="Interactive pipeline over QuCAD / QuBound / CompressVQC / Qshot.",
50
+ version=APP_VERSION,
51
  lifespan=lifespan,
52
  )
53
 
backend/app/routes/health.py CHANGED
@@ -4,6 +4,7 @@ from __future__ import annotations
4
 
5
  from fastapi import APIRouter
6
 
 
7
  from app.config import get_settings
8
  from app.schemas import HealthResponse
9
 
@@ -18,8 +19,6 @@ def _safe_version(mod_name: str) -> str:
18
  return getattr(mod, "__version__", "unknown")
19
 
20
 
21
- APP_VERSION = "0.1.0"
22
-
23
 
24
  @router.get("/health", response_model=HealthResponse)
25
  def health() -> HealthResponse:
 
4
 
5
  from fastapi import APIRouter
6
 
7
+ from app._version import APP_VERSION
8
  from app.config import get_settings
9
  from app.schemas import HealthResponse
10
 
 
19
  return getattr(mod, "__version__", "unknown")
20
 
21
 
 
 
22
 
23
  @router.get("/health", response_model=HealthResponse)
24
  def health() -> HealthResponse: