Skip to content

obs: Dockerfile ldflags + smoke-buildinfo target (track 1/8)#5

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

obs: Dockerfile ldflags + smoke-buildinfo target (track 1/8)#5
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. Wires the provisioner's Docker build to inject instant.dev/common/buildinfo vars at link time:

  • Dockerfile: ARG GIT_SHA / BUILD_TIME / VERSION on the shared builder stage (so both prod and debug final targets get the same linked-in metadata), passed into go build -ldflags -X so the resulting binary stamps its own commit on every log line and /healthz response.
  • Makefile: docker-build now forwards --build-arg from make vars.
  • New make smoke-buildinfo target builds cmd/smoke-buildinfo with override values and asserts they appear at runtime — a CI regression gate for the ldflag path.

Depends on InstaNode-dev/common#2 (adds the buildinfo package).

Test plan

  • go build ./... green.
  • go test ./... green (server/interceptor/storage suites pass).
  • make smoke-buildinfo prints smoke-buildinfo: OK (GitSHA=smoke-sha BuildTime=smoke-time Version=smoke-ver).

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

…ha (track 1/8)

- Dockerfile: ARG GIT_SHA / BUILD_TIME / VERSION (prod stage only —
  the debug stage shares the same builder layer so it gets the same
  ldflags for free), passed into `go build -ldflags -X
  instant.dev/common/buildinfo.X=...`.
- Makefile: docker-build now forwards --build-arg from `make` vars.
- New `make smoke-buildinfo` target verifies the ldflag path.

Companion change in common (PR #2 adds the buildinfo package).

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