From 3de4d5732e26e06e825986e58ec271d0f0ff4007 Mon Sep 17 00:00:00 2001
From: Citali
Date: Wed, 11 Feb 2026 19:01:53 +0100
Subject: [PATCH] feat(versioning): show runtime version and git hash in app
footers
---
.env.example | 2 ++
TODO.md | 19 ++++++++++++-----
apps/admin/src/components/admin-shell.tsx | 7 +++++++
apps/admin/src/lib/build-info.ts | 21 +++++++++++++++++++
.../web/src/components/public-site-footer.tsx | 6 ++++++
apps/web/src/lib/build-info.ts | 21 +++++++++++++++++++
6 files changed, 71 insertions(+), 5 deletions(-)
create mode 100644 apps/admin/src/lib/build-info.ts
create mode 100644 apps/web/src/lib/build-info.ts
diff --git a/.env.example b/.env.example
index 4674258..8f4e725 100644
--- a/.env.example
+++ b/.env.example
@@ -10,5 +10,7 @@ CMS_SUPPORT_EMAIL="support@cms.local"
CMS_SUPPORT_PASSWORD="change-me-support-password"
CMS_SUPPORT_NAME="Technical Support"
CMS_SUPPORT_LOGIN_KEY="support-access-change-me"
+NEXT_PUBLIC_APP_VERSION="0.1.0-dev"
+NEXT_PUBLIC_GIT_SHA="local"
# Optional dev bypass role for admin middleware. Leave empty to require auth login.
# CMS_DEV_ROLE="admin"
diff --git a/TODO.md b/TODO.md
index 65be19c..a999fba 100644
--- a/TODO.md
+++ b/TODO.md
@@ -85,12 +85,12 @@ This file is the single source of truth for roadmap and delivery progress.
- [x] [P2] Bun-based Dockerfiles for public and admin apps
- [x] [P2] Staging and production docker-compose templates
- [x] [P1] Registry credentials and image push strategy
-- [x] [P1] Staging deployment automation against real host
-- [x] [P1] Production promotion and rollback procedure
+- [~] [P1] Staging deployment automation against real host
+- [~] [P1] Production promotion and rollback procedure
### Git Flow And Branching
-- [x] [P1] Protect `main` and `staging` branches in Gitea
+- [~] [P1] Protect `main` and `staging` branches in Gitea
- [x] [P1] Define PR gates: lint + typecheck + unit + e2e list minimum
- [x] [P1] Enforce one todo item per branch naming convention
- [x] [P2] Add PR template requiring linked TODO step
@@ -101,10 +101,19 @@ This file is the single source of truth for roadmap and delivery progress.
- [x] [P1] Source of truth for version (`package.json` root) and release tagging rules (`vX.Y.Z`)
- [x] [P1] Build metadata policy for git hash (`+sha.`) in app runtime footer
- [x] [P1] App footer implementation plan for version + commit hash (admin + web)
-- [x] [P2] Automated version injection in CI (stamping build from tag + commit hash)
-- [x] [P2] Validation tests for displayed version/hash consistency per deployment
+- [~] [P2] Automated version injection in CI (stamping build from tag + commit hash)
+- [ ] [P2] Validation tests for displayed version/hash consistency per deployment
- [x] [P1] Release tagging and changelog publication policy in CI
+### MVP0 Close-Out Checklist
+
+- [ ] [P1] Verify and document protected branch rules in Gitea (`main`, `staging`)
+- [ ] [P1] Run first staging deployment against a real host with deploy workflow and document result
+- [ ] [P1] Replace release workflow placeholders with real release-notes and rollback execution steps
+- [x] [P1] Expose runtime version + short git hash in admin and public app footer
+- [ ] [P2] Add CI build stamping for version/hash values consumed by app footers
+- [ ] [P2] Add automated tests validating displayed version/hash format and consistency
+
## MVP 1: Core CMS Business Features
### Admin App (Primary Focus)
diff --git a/apps/admin/src/components/admin-shell.tsx b/apps/admin/src/components/admin-shell.tsx
index 0457d7d..73711d9 100644
--- a/apps/admin/src/components/admin-shell.tsx
+++ b/apps/admin/src/components/admin-shell.tsx
@@ -4,6 +4,7 @@ import type { ReactNode } from "react"
import { LogoutButton } from "@/app/logout-button"
import { AdminLocaleSwitcher } from "@/components/admin-locale-switcher"
+import { getBuildInfo } from "@/lib/build-info"
type AdminShellProps = {
role: Role
@@ -57,6 +58,8 @@ export function AdminShell({
actions,
children,
}: AdminShellProps) {
+ const buildInfo = getBuildInfo()
+
return (