fix(version): read CI_COMMIT_TAG as source of truth, package.json as fallback

Previously: vite read package.json.version only, requiring manual bump
before each tag pipeline (manual sync ломалось — MR !44 пример костыля).

Now: vite reads CI_COMMIT_TAG (passed via Dockerfile ARG GIT_TAG from
.gitlab-ci.yml .docker_base) → strips 'v' prefix → exposes как __APP_TAG__.
'none' sentinel filtered → empty string → fallback к package.json.

VersionBadge priority chain:
  1. serverTag (что прод RUNS, через /api/v1/version)
  2. clientTag (что build'илось на tag pipeline)
  3. v${clientVersion} (package.json fallback floor для local / branch)

Dockerfile: add ARG GIT_TAG=none, ENV CI_COMMIT_TAG=$GIT_TAG (mirrors
существующий pattern с GIT_COMMIT → CI_COMMIT_SHORT_SHA).

Revert package.json 1.3.1 → 1.2.0 (manual bump из MR !44). Версия теперь
follows tag, не наоборот.
This commit is contained in:
Zimin A.N.
2026-05-11 14:19:50 +03:00
parent 71432e9ae7
commit e62633d903
6 changed files with 55 additions and 17 deletions
@@ -20,6 +20,9 @@ export function useAppVersion() {
const clientCommit = __APP_COMMIT__
const clientVersion = __APP_VERSION__
// Empty string when build wasn't на tag pipeline. VersionBadge / UpdateBanner
// решают priority: serverTag → clientTag → fallback v${clientVersion}.
const clientTag = __APP_TAG__
const clientBuiltAt = __APP_BUILT_AT__
const knownClient = clientCommit !== 'unknown' && clientCommit !== ''
@@ -29,6 +32,7 @@ export function useAppVersion() {
return {
clientVersion,
clientTag,
clientCommit,
clientBuiltAt,
serverVersion: server?.version,