Skip to content

Commit cd35730

Browse files
committed
fix: footer version stuck at 2.1.0 — single source of truth
The footer reads /api/version, which returned LUXMON_VERSION (a separate hardcoded constant frozen at 2.1.0), while bump-version.sh only updated the FastAPI(version=...) field. The two drifted, so the footer never advanced past 2.1.0. - Make LUXMON_VERSION the single source of truth; FastAPI version derives from it. - Update bump-version.sh to grep/sed LUXMON_VERSION instead of the version="..." pattern. - Footer now correctly shows the running version (2.5.2).
1 parent a30d6b3 commit cd35730

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎api/__init__.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ async def get_response(self, path: str, scope: Scope) -> Any:
4848

4949
logger = logging.getLogger("luxmon.api")
5050

51-
app = FastAPI(title="lux-mon API", version="2.5.2")
51+
# Single source of truth for the lux-mon version. The footer reads this via
52+
# /api/version, and FastAPI's version field derives from it. bump-version.sh
53+
# updates this one constant.
54+
LUXMON_VERSION = "2.5.2"
5255

53-
LUXMON_VERSION = "2.1.0"
56+
app = FastAPI(title="lux-mon API", version=LUXMON_VERSION)
5457

5558
app.add_middleware(
5659
CORSMiddleware,

‎scripts/bump-version.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ while [[ $# -gt 0 ]]; do
3737
done
3838

3939
# ── Current version (file) ─────────────────────────────────────────────────
40-
FILE_VERSION="$(grep -oE 'version="[0-9]+\.[0-9]+\.[0-9]+"' "$VERSION_FILE" | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')"
40+
FILE_VERSION="$(grep -oE 'LUXMON_VERSION = "[0-9]+\.[0-9]+\.[0-9]+"' "$VERSION_FILE" | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')"
4141
if [[ -z "$FILE_VERSION" ]]; then
4242
echo "Could not parse version from $VERSION_FILE" >&2
4343
exit 2
@@ -113,7 +113,7 @@ NEXT="${MAJOR}.${MINOR}.${PATCH}"
113113

114114
# ── Write back (optional) ───────────────────────────────────────────────────
115115
if [[ "$WRITE" -eq 1 ]]; then
116-
sed -i -E "s/version=\"[0-9]+\.[0-9]+\.[0-9]+\"/version=\"${NEXT}\"/" "$VERSION_FILE"
116+
sed -i -E "s/LUXMON_VERSION = \"[0-9]+\.[0-9]+\.[0-9]+\"/LUXMON_VERSION = \"${NEXT}\"/" "$VERSION_FILE"
117117
echo "Updated $VERSION_FILE -> ${NEXT}" >&2
118118
fi
119119

0 commit comments

Comments
 (0)