fix(version): /api/health lit la version depuis le fichier VERSION — fin de la constante 7.74.3 périmée (7.80.2)
This commit is contained in:
@@ -1,5 +1,15 @@
|
|||||||
# Changelog - FlowDeck
|
# Changelog - FlowDeck
|
||||||
|
|
||||||
|
## v7.80.2 (2026-10-22) — /api/health : version lue depuis le fichier VERSION
|
||||||
|
|
||||||
|
- La version de l'app FastAPI était une constante codée en dur
|
||||||
|
dans `app/main.py` (restée à **7.74.3**) : `/api/health`
|
||||||
|
affichait donc une version périmée alors que l'app déployée
|
||||||
|
était en 7.80.1 (signalé par Bruno). Elle est maintenant lue
|
||||||
|
depuis le fichier `VERSION` à la racine (source unique, même
|
||||||
|
repli `/app/VERSION` que le tableau de bord) — elle ne pourra
|
||||||
|
plus dériver.
|
||||||
|
|
||||||
## v7.80.1 (2026-10-22) — Panneau Spark : bouton « Console ↗ »
|
## v7.80.1 (2026-10-22) — Panneau Spark : bouton « Console ↗ »
|
||||||
|
|
||||||
- **Bouton « Console ↗ »** dans la barre des discussions du
|
- **Bouton « Console ↗ »** dans la barre des discussions du
|
||||||
|
|||||||
+25
-1
@@ -190,9 +190,33 @@ async def lifespan(_app: FastAPI):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def _lire_version() -> str:
|
||||||
|
"""Version de l'app depuis le fichier VERSION (source unique).
|
||||||
|
|
||||||
|
Avant : une constante codée en dur dans FastAPI(...) — restée à
|
||||||
|
7.74.3 alors que l'app était en 7.80.1, donc /api/health mentait.
|
||||||
|
Même logique de repli que dashboard._common._get_app_version.
|
||||||
|
"""
|
||||||
|
import os
|
||||||
|
|
||||||
|
for chemin in (
|
||||||
|
os.path.join(os.path.dirname(__file__), "..", "VERSION"),
|
||||||
|
"/app/VERSION",
|
||||||
|
):
|
||||||
|
try:
|
||||||
|
if os.path.exists(chemin):
|
||||||
|
with open(chemin) as f:
|
||||||
|
v = f.read().strip()
|
||||||
|
if v:
|
||||||
|
return v
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return "0.0.0"
|
||||||
|
|
||||||
|
|
||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="FlowDeck",
|
title="FlowDeck",
|
||||||
version="7.74.3",
|
version=_lire_version(),
|
||||||
docs_url="/docs",
|
docs_url="/docs",
|
||||||
redoc_url="/redoc",
|
redoc_url="/redoc",
|
||||||
lifespan=lifespan,
|
lifespan=lifespan,
|
||||||
|
|||||||
Reference in New Issue
Block a user