FilaOps Versioning¶
How version numbers are managed, where they live, and what to update when cutting a release.
Sources of Truth¶
There are three sources of truth for the current version. All three must agree. There is also a last-resort hardcoded fallback, which should never be reached in practice.
| File | Used By | Format |
|---|---|---|
backend/VERSION | Backend VersionManager (fallback) | Plain text, e.g. 3.0.1 |
package.json (root) | Root project metadata | "version": "3.0.1" |
frontend/package.json | Frontend (imported at Vite build time) | "version": "3.0.1" |
How Version Is Resolved¶
Backend (backend/app/core/version.py)¶
The VersionManager.get_current_version() method resolves the version in this order:
- Git tag (
git describe --tags --abbrev=0) - works in dev and non-Docker deployments where.git/is present. FILAOPS_VERSIONenv var - set by the DockerfileARG/ENV, or by docker-compose. This is the primary mechanism in Docker deployments.backend/VERSIONfile - read at module import time. This is the fallback when git and env vars are unavailable.- Hardcoded
"3.0.1"- last-resort constant. Should never be reached if the VERSION file exists.
Frontend (frontend/src/utils/version.js)¶
getCurrentVersionSync()returns the version frompackage.json, imported at build time via Vite's JSON import support. No network call required.getCurrentVersion()(async) tries the backend API (/api/v1/system/version) first, then falls back to thepackage.jsonvalue.
Docker (backend/Dockerfile)¶
The Dockerfile declares:
This default should be updated on release, but the VERSION file acts as a safety net if it's missed.
Bumping the Version¶
When releasing a new version:
- Update
backend/VERSIONto the new version - Update
package.json(root)"version"field - Update
frontend/package.json"version"field - Update
backend/DockerfileARG FILAOPS_VERSION=default - Commit, tag (
git tag vX.Y.Z), push with tags (git push --tags)
Steps 1-4 are the files. Step 5 creates the git tag that Docker-less deployments and the GitHub release checker both rely on.
Common Pitfalls¶
| Problem | Cause | Fix |
|---|---|---|
| UI shows wrong version | package.json not updated, or browser cache | Update frontend/package.json, hard-refresh |
| Backend API returns wrong version | No git tags in Docker, FILAOPS_VERSION env not set, VERSION file stale | Update backend/VERSION and Dockerfile ARG |
| "Update available" when already current | Frontend version comparison used a stale fallback | Fixed - now reads package.json at build time |
| Update checker never detects updates | getCurrentVersion() was called without await | Fixed in useVersionCheck.js |