From c254e7cb76169540af70d5e083f8253948aadea2 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Dec 2025 15:32:26 +0100 Subject: [PATCH] feat: dynamic version from VERSION file (v1.3.57) - Created VERSION file with current version - Health endpoints now read version from VERSION file instead of hardcoded - Fixes issue where health check showed wrong version - main.py /health and /api/v1/system/health now show correct version --- VERSION | 1 + app/system/backend/router.py | 11 ++++++++++- main.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..0aad741 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.3.57 \ No newline at end of file diff --git a/app/system/backend/router.py b/app/system/backend/router.py index 586bbad..be4b4e1 100644 --- a/app/system/backend/router.py +++ b/app/system/backend/router.py @@ -6,6 +6,15 @@ Health checks and system information from fastapi import APIRouter from app.core.config import settings from app.core.database import execute_query +from pathlib import Path + +# Read version from VERSION file +def get_version(): + try: + version_file = Path(__file__).parent.parent.parent.parent / "VERSION" + return version_file.read_text().strip() + except: + return "unknown" router = APIRouter() @@ -23,7 +32,7 @@ async def health_check(): return { "status": "healthy", "service": "BMC Hub", - "version": "1.0.0", + "version": get_version(), "database": db_status, "config": { "environment": "production" if not settings.ECONOMIC_DRY_RUN else "development", diff --git a/main.py b/main.py index c9e56ef..fae7b6f 100644 --- a/main.py +++ b/main.py @@ -131,7 +131,7 @@ async def health_check(): return { "status": "healthy", "service": "BMC Hub", - "version": "1.0.0" + "version": get_version() } if __name__ == "__main__":