feat(version): version x.y.z propre et cohérente partout + bump script
CI / lint (push) Failing after 21s
CI / test (push) Skipped
CI / build (push) Skipped
CI / e2e (push) Skipped
CI / security (push) Successful in 27s
Desktop Build / build-windows (push) Canceled after 0s
Desktop Build / build-linux (push) Canceled after 0s

Corrige l'incoherence d'affichage (page principale 0.0.0-dev vs a propos
v2.0.0-dev) et unifie la gestion de version sur une seule source de verite.

Backend:
- version.py: get_version() retourne toujours le tag x.y.z propre du dernier
  tag (plus de 0.0.0-dev / -N-gHASH dans l'UI). Ajout get_git_describe() et
  get_git_commit() pour le detail.
- main.py: /api/health expose git_describe + git_commit (nouveaux champs).

Frontend:
- modale A propos (populateAbout): version + commit lus depuis /api/health,
  suppression du hardcode v2.0.0-dev dans index.html.
- section config A propos (loadAbout): lit health.version, plus de state.
  APP_VERSION obsolete.
- badge header: fetch /api/health (fallback neutre '...').
- state.js: suppression de APP_VERSION (1.5.0) devenu mort; imports nettoyes.

Script:
- scripts/bump_version.sh: incrementation SemVer selon les commits
  (breaking->major, feat->minor, sinon patch), creer/pousser le tag vX.Y.Z.

Tests: 507 passed, frontend validators OK.
This commit is contained in:
2026-09-07 22:13:54 -04:00
parent 01453bce5f
commit c5b92eabe1
8 changed files with 189 additions and 40 deletions
+1 -2
View File
@@ -5,7 +5,6 @@
import * as UI from './ui.js';
import * as Utils from './utils.js';
import { initI18n, t } from './i18n.js';
import { state } from './state.js';
import { initAIFab } from './ai-fab.js';
// Wire up AI toolbar toast (avoids circular import in utils.js)
@@ -117,7 +116,7 @@ document.addEventListener("DOMContentLoaded", () => {
// Show version in header — always visible, fallback before the async fetch
const versionBadge = document.getElementById('version-badge');
if (versionBadge) {
versionBadge.textContent = window.__OBSIGATE_VERSION || state.APP_VERSION || 'dev';
versionBadge.textContent = window.__OBSIGATE_VERSION || '…';
}
fetch('/api/health')
.then(r => r.json())
+7 -3
View File
@@ -923,8 +923,7 @@ function loadAbout() {
title: t("about.section_app"),
rows: [
[t("about.name"), "ObsiGate"],
[t("about.version"), state.APP_VERSION],
[t("about.api_version"), health.version || "—"],
[t("about.version"), health.version || "—"],
[t("about.status"), health.status || "—"],
],
},
@@ -1653,7 +1652,7 @@ function initAboutModal() {
document.addEventListener('keydown', function(e) { if (e.key === 'Escape' && overlay.classList.contains('active')) overlay.classList.remove('active'); });
function populateAbout() {
// Live stats from health endpoint
// Live stats + version from health endpoint (single source of truth)
fetch('/api/health')
.then(function(r) { return r.json(); })
.then(function(d) {
@@ -1661,6 +1660,11 @@ function initAboutModal() {
var vEl = document.getElementById('about-stat-vaults');
if (fEl) fEl.textContent = d.total_files || '—';
if (vEl) vEl.textContent = d.vaults || '—';
// Clean x.y.z version (not hardcoded) + git detail
var versionEl = document.getElementById('about-version');
if (versionEl && d.version) versionEl.textContent = d.version;
var commitEl = document.getElementById('about-commit');
if (commitEl) commitEl.textContent = d.git_describe || d.git_commit || '—';
})
.catch(function() {});
-2
View File
@@ -2,8 +2,6 @@
Use state.xxx to read/write any value. ES module imports are read-only,
so we export a single mutable object instead of individual let bindings. */
export const state = {
APP_VERSION: "1.5.0",
// Core navigation
currentVault: null,
currentPath: null,