feat: bake git tag, hash, and build date into binary #30

Merged
nrupard merged 1 commit from feat/build-version-metadata into main 2026-05-07 20:46:11 +02:00
Owner

Adds a build.rs that captures the git tag (git describe --tags --always --dirty), the 12-char short commit hash, and the build timestamp at compile time, exposes them as compile-time env vars, and surfaces them through GET /api/version, GET /health, and the startup tracing banner.

  • New build.rs resolves values from GIT_TAG/GIT_HASH/BUILD_DATE env vars first, then falls back to git, with a final "unknown" fallback so out-of-tree builds still compile.
  • Extends VersionResponse and HealthResponse with git_tag, git_hash, and build_date so operators can identify the exact build a running instance was produced from.
  • Production Dockerfile (oci-build/Dockerfile) accepts the three values as build args; the Forgejo workflow computes them per build and forwards them via docker buildx --build-arg.
  • Dev Dockerfile installs git and the dev compose mounts ./build.rs and ./.git so cargo-watch sees real values during local development.
  • compose.dev.yml and the just dev recipe forward the same metadata so per-developer Traefik instances also report accurate values.
  • Frontend footer version tooltip now exposes git_tag, git_hash, and build_date for quick inspection.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
Signed-off-by: nrupard natrsmith11@gmail.com

Adds a build.rs that captures the git tag (git describe --tags --always --dirty), the 12-char short commit hash, and the build timestamp at compile time, exposes them as compile-time env vars, and surfaces them through GET /api/version, GET /health, and the startup tracing banner. - New build.rs resolves values from GIT_TAG/GIT_HASH/BUILD_DATE env vars first, then falls back to git, with a final "unknown" fallback so out-of-tree builds still compile. - Extends VersionResponse and HealthResponse with git_tag, git_hash, and build_date so operators can identify the exact build a running instance was produced from. - Production Dockerfile (oci-build/Dockerfile) accepts the three values as build args; the Forgejo workflow computes them per build and forwards them via docker buildx --build-arg. - Dev Dockerfile installs git and the dev compose mounts ./build.rs and ./.git so cargo-watch sees real values during local development. - compose.dev.yml and the just dev recipe forward the same metadata so per-developer Traefik instances also report accurate values. - Frontend footer version tooltip now exposes git_tag, git_hash, and build_date for quick inspection. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: nrupard <natrsmith11@gmail.com>
feat: bake git tag, hash, and build date into binary
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
7bc53c46ee
Adds a build.rs that captures the git tag (git describe --tags --always --dirty), the 12-char short commit hash, and the build timestamp at compile time, exposes them as compile-time env vars, and surfaces them through GET /api/version, GET /health, and the startup tracing banner.

- New build.rs resolves values from GIT_TAG/GIT_HASH/BUILD_DATE env vars first, then falls back to git, with a final "unknown" fallback so out-of-tree builds still compile.
- Extends VersionResponse and HealthResponse with git_tag, git_hash, and build_date so operators can identify the exact build a running instance was produced from.
- Production Dockerfile (oci-build/Dockerfile) accepts the three values as build args; the Forgejo workflow computes them per build and forwards them via docker buildx --build-arg.
- Dev Dockerfile installs git and the dev compose mounts ./build.rs and ./.git so cargo-watch sees real values during local development.
- compose.dev.yml and the just dev recipe forward the same metadata so per-developer Traefik instances also report accurate values.
- Frontend footer version tooltip now exposes git_tag, git_hash, and build_date for quick inspection.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: nrupard <natrsmith11@gmail.com>
nrupard deleted branch feat/build-version-metadata 2026-05-07 20:46:11 +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
a8n-tools/rus!30
No description provided.