Skip to content

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

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

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

  • Dockerfile: ARG GIT_SHA / BUILD_TIME / VERSION, 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 (which default to git rev-parse --short HEAD etc).
  • 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 (no regressions).
  • 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

…rack 1/8)

- Dockerfile: ARG GIT_SHA / BUILD_TIME / VERSION, passed into
  `go build -ldflags -X instant.dev/common/buildinfo.X=...` so the
  resulting worker binary stamps its own commit on every log line
  and /healthz response.
- Makefile: docker-build now forwards --build-arg from `make` vars
  (which default to `git rev-parse --short HEAD` etc).
- New `make smoke-buildinfo` target builds cmd/smoke-buildinfo with
  override values and asserts they appear at runtime — CI regression
  gate for 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