Skip to content

obs: buildinfo package for compile-time GitSHA/BuildTime/Version (track 1/8)#2

Merged
mastermanas805 merged 1 commit into
masterfrom
obs/buildinfo-fresh
May 12, 2026
Merged

obs: buildinfo package for compile-time GitSHA/BuildTime/Version (track 1/8)#2
mastermanas805 merged 1 commit into
masterfrom
obs/buildinfo-fresh

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

Track 1 of 8 in the observability rollout. Adds instant.dev/common/buildinfo:

  • Three package vars (GitSHA, BuildTime, Version) defaulting to sentinel strings.
  • Real values are wired in at link time via go build -ldflags -X.
  • Each service's Dockerfile passes --build-arg GIT_SHA=... into the ldflag so /healthz and slog log lines stamp the exact commit the running pod was built from.

Companion PRs in api, worker, provisioner repos update the Dockerfiles and Makefiles to invoke the ldflag injection. CLAUDE.md updated at the InstaNode root to document the new docker build commands.

Test plan

  • go test ./buildinfo/... — 2 tests pass (defaults + reachability).
  • Manual smoke: go build -ldflags "-X instant.dev/common/buildinfo.GitSHA=test123" ./... then run binary, confirm buildinfo.GitSHA == "test123". Verified via the make smoke-buildinfo target in api/worker/provisioner.
  • Full common/ test suite green — no regressions in crypto, plans, resourcetype.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

New `instant.dev/common/buildinfo` exposes three package vars
(`GitSHA`, `BuildTime`, `Version`) defaulting to sentinel strings.
Real values are wired in at link time via `go build -ldflags -X` —
the Dockerfile in each service passes `--build-arg GIT_SHA=...`
into the ldflag so /healthz and slog log lines stamp the exact
commit the running pod was built from.

This is track 1 of 8 in the observability rollout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant