feat(version): automate version computation from git tags #292

Merged
chris merged 3 commits from feature/auto-version-computation into main 2026-06-10 15:34:10 +02:00
Owner

Summary

Pipeline-computed version replaces manual version files. No more version drift or manual bumps.

Changes

  • New: scripts/ci/compute-version.sh — computes MAJOR.MINOR.{commit_count} from git tags
  • Updated: scripts/ci/detect-scopes.sh — removed version extraction (path detection only)
  • Updated: .forgejo/workflows/build-deploy.yml — version step, outputs from compute-version.sh
  • Updated: apps/web/vite.config.ts — defines VITE_APP_VERSION from MEMORIES_APP_VERSION
  • Updated: apps/web/src/lib/appVersion.ts — reads from import.meta.env
  • Updated: apps/web/Dockerfile — passes MEMORIES_APP_VERSION ARG to Vite build
  • Zeroed: apps/web/package.json → 0.0.0, application.yml → dev, tools/cli/package.json → 0.0.0

Version flow

  1. CI compute-version.sh reads git tags → 0.61.5
  2. Injected as MEMORIES_APP_VERSION env var in build/deploy jobs
  3. Frontend: Vite define injects at build time
  4. API: application.yml reads from env var

Local dev

  • Shows dev (no tag fallback)
  • Or 0.0.{commit_count} if tags exist locally

Post-merge

Tag v0.61 on main to anchor first computed version.

## Summary Pipeline-computed version replaces manual version files. No more version drift or manual bumps. ### Changes - **New**: `scripts/ci/compute-version.sh` — computes `MAJOR.MINOR.{commit_count}` from git tags - **Updated**: `scripts/ci/detect-scopes.sh` — removed version extraction (path detection only) - **Updated**: `.forgejo/workflows/build-deploy.yml` — version step, outputs from compute-version.sh - **Updated**: `apps/web/vite.config.ts` — defines `VITE_APP_VERSION` from `MEMORIES_APP_VERSION` - **Updated**: `apps/web/src/lib/appVersion.ts` — reads from `import.meta.env` - **Updated**: `apps/web/Dockerfile` — passes `MEMORIES_APP_VERSION` ARG to Vite build - **Zeroed**: `apps/web/package.json` → `0.0.0`, `application.yml` → `dev`, `tools/cli/package.json` → `0.0.0` ### Version flow 1. CI `compute-version.sh` reads git tags → `0.61.5` 2. Injected as `MEMORIES_APP_VERSION` env var in build/deploy jobs 3. Frontend: Vite `define` injects at build time 4. API: `application.yml` reads from env var ### Local dev - Shows `dev` (no tag fallback) - Or `0.0.{commit_count}` if tags exist locally ### Post-merge Tag `v0.61` on main to anchor first computed version.
feat(version): automate version computation from git tags
Some checks failed
Build and Deploy / Detect changed services and test scopes (push) Failing after 3s
Build and Deploy / Run full test suite (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Has been skipped
Build and Deploy / Run main smoke checks (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
f492df3e66
- Add scripts/ci/compute-version.sh: MAJOR.MINOR.{commit_count} from tags
- Remove version extraction from detect-scopes.sh (path detection only)
- Update build-deploy.yml: version step, outputs from compute-version.sh
- Vite define injects MEMORIES_APP_VERSION as VITE_APP_VERSION
- appVersion.ts reads from import.meta.env instead of package.json
- Dockerfile passes MEMORIES_APP_VERSION ARG to Vite build
- Zero out version placeholders: 0.0.0 / dev in all source files
fix(deploy): pass MEMORIES_APP_VERSION as build arg to web service
Some checks failed
Build and Deploy / Detect changed services and test scopes (push) Failing after 3s
Build and Deploy / Run full test suite (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Has been skipped
Build and Deploy / Run main smoke checks (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
1c4e92c79e
Docker Compose does not forward environment variables as Docker build
args unless explicitly declared. The web Dockerfile declares
ARG MEMORIES_APP_VERSION=dev but compose never passed it, so the web
image always got version 'dev'.

Also fix double-dash in image_tag when GITHUB_REF is empty (local dev):
only append branch suffix when a valid branch name exists.
docs(version): mark spec 015 complete, update versioning workflow
Some checks failed
Build and Deploy / Detect changed services and test scopes (push) Failing after 2s
Build and Deploy / Run full test suite (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Has been skipped
Build and Deploy / Run main smoke checks (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
d3a250cc86
- Update tasks.md: all 8 tasks checked off as complete
- Update spec.md: status from Draft to Approved
- Update agent-workflow.md: replace manual version bump section with
  automated version computation flow (spec 015)
chris merged commit 53e11bb0ee into main 2026-06-10 15:34:10 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!292
No description provided.