Skip to content

fix(build-info): ship VERSION in backend image, add dialog blurb + fallback (#958) - #975

Merged
vybe merged 1 commit into
devfrom
fix/958-build-info-version-and-blurb
Jun 1, 2026
Merged

fix(build-info): ship VERSION in backend image, add dialog blurb + fallback (#958)#975
vybe merged 1 commit into
devfrom
fix/958-build-info-version-and-blurb

Conversation

@dolho

@dolho dolho commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Two problems behind the "every field shows unknown" Build Info dialog:

  1. version always unknown on dev/prod. Backend reads version from /app/VERSION, but the file was only present via a docker-compose.yml bind mount (./VERSION:/app/VERSION:ro). Prod compose has no such mount and the Dockerfile never COPYed the file, so version defaulted to "unknown" everywhere except local-dev-with-bind-mount.
  2. No operator guidance when fields are missing. Even after Show Trinity version in header + git commit/branch detail in Settings #926 added the build-args pipeline, an out-of-band Docker build or a missed start.sh run produced a wall of "unknown" rows with no explanation of what Build Info is or how to populate it.

Changes

  • docker/backend/DockerfileCOPY ../../VERSION /app/VERSION so the file ships in the image. Dev's bind mount still overrides for hot edits.
  • src/frontend/src/composables/useBuildInfo.js — expose isMissing computed (true when every metadata field equals "unknown").
  • src/frontend/src/components/NavBar.vue (Build Info modal) — short blurb under the title; gray-bg fallback note ("Build metadata not available — rebuild with scripts/deploy/start.sh to populate.") shown only when isMissing.
  • src/frontend/src/views/Settings.vue (Build Info section) — same fallback note in the loading/error/data state chain. Existing blurb retained.

Related to #958

Test plan

Verified via Playwright (headless Chromium, route mock for missing state):

  • Backend rebuilt without bind mount → /app/VERSION present in image (docker run --rm --entrypoint cat trinity-backend /app/VERSION0.9.0).
  • GET /api/version returns "version": "0.9.0" instead of "unknown".
  • NavBar modal renders blurb and populated fields. Screenshot.
  • Settings → General → Build Info renders populated fields. Screenshot.
  • Route-mocked GET /api/version with all fields = "unknown" → modal shows fallback note + blurb; Settings panel shows fallback note. Screenshots.
  • isMissing correctly false when version populated but git fields unknown (intentional — partial provenance is still useful, not a "missing metadata" state).

🤖 Generated with Claude Code

…llback (#958)

The Build Info dialog showed "unknown" for every field in local dev
because the VERSION file was bind-mounted by docker-compose.yml only —
the backend Dockerfile never COPYed it. Prod compose has no such
mount, so prod also fell back to "unknown" for `version`. Bake the
file into the image directly so both surfaces work without a host
mount; dev's `./VERSION:/app/VERSION:ro` bind still overrides for hot
edits.

Add operator-facing guidance to the dialog so a "wall of unknown"
isn't its own UX bug:

- `useBuildInfo` exposes `isMissing` — true when every metadata field
  equals "unknown".
- NavBar modal: blurb under the title explaining what Build Info is
  for; a gray-bg note ("Build metadata not available — rebuild with
  scripts/deploy/start.sh to populate.") shown only when isMissing.
- Settings panel: same fallback message between the error and data
  states. The existing blurb was kept.

Related to #958

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dolho
dolho requested a review from vybe May 29, 2026 12:58

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — verified VERSION file exists at repo root (0.9.0), the COPY matches the established ../../ build-context pattern, and CI 'build' check passes (Dockerfile compiles). isMissing is correctly singleton-scoped and both consumers unwrap .value properly. Dev bind mount retained for hot edits. Validated via /validate-pr.

@vybe
vybe merged commit 3aaf633 into dev Jun 1, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants