HERMES-GIELIE/static
nesquena-hermes 38e215e8f8
fix: dynamic version badge — read from git tag, never hardcoded (#790)
* fix: dynamic version badge — read from git tag, never hardcoded

The settings panel showed v0.50.87 and the HTTP Server: header said
HermesWebUI/0.50.38 — both hardcoded strings that drift further behind
with every release because there was no mechanism to keep them in sync.

Changes:
- api/updates.py: add _run_git() (moved before _detect_webui_version),
  _detect_webui_version(), and WEBUI_VERSION module constant resolved
  once at import time via 'git describe --tags --always --dirty'.
  Fallback chain: git → api/_version.py → 'unknown'.
- api/routes.py: inject webui_version into GET /api/settings response
  so the frontend can read it without a separate API call.
- static/panels.js: loadSettingsPanel() populates .settings-version-badge
  from settings.webui_version — one line after the existing api() call.
- static/index.html: replace stale hardcoded 'v0.50.87' with '—'
  placeholder; JS overwrites it as soon as the settings panel opens.
- server.py: replace hardcoded 'HermesWebUI/0.50.38' server_version with
  'HermesWebUI/' + WEBUI_VERSION.lstrip('v') — stays in sync automatically.
- Dockerfile: add ARG HERMES_VERSION=unknown and write api/_version.py
  so Docker images (where .git is excluded) still show the correct tag.
- .github/workflows/release.yml: pass build-args: HERMES_VERSION=${{ github.ref_name }}
  to the Docker build step on tag pushes.
- .gitignore: exclude api/_version.py (generated by Docker/CI, never committed).

No manual 'update the version badge' step is required going forward.
Tagging is sufficient — the badge and HTTP header update automatically.

Tests: 18 new tests in tests/test_version_badge.py covering the full
resolution chain, /api/settings injection, HTML placeholder, JS wiring,
and server.py import. 1596 tests pass total.

* fix: address review feedback on PR #790

- api/updates.py: replace exec() with regex parse for api/_version.py
  (no supply-chain risk from build artifact; exec unnecessary for one assignment)
- api/updates.py: cap git describe timeout at 3s (was 10s — import-time
  stall on NFS/.git would block server startup unnecessarily)
- server.py: lstrip('v') → removeprefix('v') (lstrip strips chars not prefix)
- server.py: emit bare 'HermesWebUI' when version is 'unknown' rather than
  'HermesWebUI/unknown' (log aggregators expect semver-ish suffix or none)
- CHANGELOG.md: add v0.50.124 entry for this user-visible change
- tests: rename exec-error test to reflect regex behaviour; add tests for
  removeprefix usage and unknown-version header guard (1598 tests total)

---------

Co-authored-by: nesquena-hermes <hermes@nesquena.com>
2026-04-20 20:36:53 -07:00
..
boot.js feat: remove bubble_layout setting end-to-end (#777) 2026-04-20 22:34:45 +00:00
commands.js fix(ui): streamline slash sub-argument autocomplete (#771) 2026-04-20 22:04:28 +00:00
favicon-32.png fix: add favicon (SVG + PNG + ICO), fix static MIME types (#613) 2026-04-16 20:11:02 -07:00
favicon.ico fix: add favicon (SVG + PNG + ICO), fix static MIME types (#613) 2026-04-16 20:11:02 -07:00
favicon.svg fix: add favicon (SVG + PNG + ICO), fix static MIME types (#613) 2026-04-16 20:11:02 -07:00
i18n.js feat: remove bubble_layout setting end-to-end (#777) 2026-04-20 22:34:45 +00:00
icons.js feat: composer-centric UI refresh + Hermes Control Center (v0.50.0, closes #242) 2026-04-12 11:55:40 -07:00
index.html fix: dynamic version badge — read from git tag, never hardcoded (#790) 2026-04-20 20:36:53 -07:00
login.js feat: support subpath mount via reverse proxy — v0.50.67 (PR #588 by @vcavichini) 2026-04-16 11:20:08 -07:00
messages.js fix(streaming): quota error detection, error persistence, stream_end session_id fix (#767) 2026-04-20 22:48:19 +00:00
onboarding.js fix(config): use Hermes config.yaml as single source of default model (#773) 2026-04-20 22:12:01 +00:00
panels.js fix: dynamic version badge — read from git tag, never hardcoded (#790) 2026-04-20 20:36:53 -07:00
sessions.js fix(ui): persist session queue to sessionStorage across page refresh (#768) 2026-04-20 23:04:09 +00:00
style.css fix(ui): hide duplicate close button in workspace header at mobile width (#783) 2026-04-21 00:58:02 +00:00
ui.js fix(ui): persist session queue to sessionStorage across page refresh (#768) 2026-04-20 23:04:09 +00:00
workspace.js feat: support subpath mount via reverse proxy — v0.50.67 (PR #588 by @vcavichini) 2026-04-16 11:20:08 -07:00