obs: buildinfo package for compile-time GitSHA/BuildTime/Version (track 1/8)#2
Merged
Merged
Conversation
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>
This was referenced May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Track 1 of 8 in the observability rollout. Adds
instant.dev/common/buildinfo:GitSHA,BuildTime,Version) defaulting to sentinel strings.go build -ldflags -X.--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,provisionerrepos 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).go build -ldflags "-X instant.dev/common/buildinfo.GitSHA=test123" ./...then run binary, confirmbuildinfo.GitSHA == "test123". Verified via themake smoke-buildinfotarget in api/worker/provisioner.common/test suite green — no regressions in crypto, plans, resourcetype.Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com