Repository navigation
feat(build): binaries report their own build ID as their version; --version on every component (#1378, #1429) - #1465
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The build-ID parser is bounded and comprehensively tested, while each affected component has coverage for early version exit and telemetry-version consistency.
0 open findings
What changed in this PR
Replaces commit-stamped component versions with content-derived GNU build IDs and adds --version support across seven shipped binaries.
Changes:
- Adds a stdlib-only ELF build-ID reader and version formatter.
- Removes
STABLE_GIT_VERSIONlinkage and exposes build metadata through component CLIs. - Adds tests and operator documentation for the new version semantics.
| File | Description |
|---|---|
common/buildinfo/buildinfo.go |
Implements build-ID parsing and version output. |
common/buildinfo/buildinfo_test.go |
Tests ELF parsing and formatting. |
common/buildinfo/BUILD.bazel |
Defines the new package and tests. |
agent/internal/cmd/root.go |
Uses build ID and adds agent version output. |
agent/internal/cmd/version_test.go |
Tests agent version behavior. |
agent/internal/cmd/BUILD.bazel |
Adds buildinfo dependencies and test. |
agent/cmd/agent/BUILD.bazel |
Removes commit-based version stamping. |
agent/cmd/mesh-dns/main.go |
Adds mesh-dns build-ID version output. |
agent/cmd/mesh-dns/version_test.go |
Tests mesh-dns version behavior. |
agent/cmd/mesh-dns/BUILD.bazel |
Updates dependencies, tests, and stamping. |
agent/cmd/proxy-supervisor/main.go |
Sources supervisor version from its build ID. |
agent/cmd/proxy-supervisor/BUILD.bazel |
Removes stamping and adds buildinfo. |
agent/internal/supervisorcmd/supervisor.go |
Adds supervisor --version handling. |
agent/internal/supervisorcmd/version_test.go |
Tests supervisor version behavior. |
agent/internal/supervisorcmd/BUILD.bazel |
Registers buildinfo and version tests. |
agent/cmd/uds-csi/main.go |
Adds build-ID version reporting. |
agent/cmd/uds-csi/version_test.go |
Tests CSI version handling. |
agent/cmd/uds-csi/BUILD.bazel |
Updates dependencies, tests, and stamping. |
controller/internal/cmd/root.go |
Uses build ID and adds version output. |
controller/internal/cmd/version_test.go |
Tests controller version behavior. |
controller/internal/cmd/BUILD.bazel |
Adds buildinfo dependencies and test. |
controller/cmd/controller/BUILD.bazel |
Removes commit-based version stamping. |
prober/internal/cmd/root.go |
Uses build ID and adds version output. |
prober/internal/cmd/root_test.go |
Tests prober version behavior. |
prober/internal/cmd/BUILD.bazel |
Adds command tests and buildinfo dependency. |
prober/cmd/prober/BUILD.bazel |
Removes commit-based version stamping. |
registrar/internal/cmd/root.go |
Uses build ID and adds version output. |
registrar/internal/cmd/version_test.go |
Tests registrar version behavior. |
registrar/internal/cmd/BUILD.bazel |
Adds buildinfo dependencies and test. |
registrar/cmd/registrar/BUILD.bazel |
Removes commit-based version stamping. |
bazel/buildid/buildid.go |
Documents the build ID’s expanded role. |
bazel/buildid/defs.bzl |
Updates build-ID rule documentation. |
Makefile |
Clarifies remaining stamped metadata. |
charts/README.md |
Distinguishes chart and binary versions. |
docs/runbook.md |
Documents querying and tracing binary builds. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bpalermo
force-pushed
the
upgrade/1378-binary-build-id
branch
from
October 8, 2026 20:59
ebbd73a to
04b4f60
Compare
13 tasks
bpalermo
force-pushed
the
upgrade/1378-binary-build-id
branch
from
October 8, 2026 21:57
04b4f60 to
e94cc5d
Compare
…ersion on every component (#1378, #1429) Seven binaries linked the commit in as `Version` (`x_defs` with `{STABLE_GIT_VERSION}`), so under `--stamp` each of them, and every image layer built from them, changed with every commit, including a docs-only one. `Version` is now the binary's own GNU build ID, the content-derived note `//bazel/buildid` writes, read from the running executable by the new stdlib-only `//common/buildinfo`. The `x_defs` are gone from agent, mesh-dns, proxy-supervisor, uds-csi, controller, prober and registrar. The value still flows to the same places: OTel `service.version` and the CSI plugin's `vendor_version`. Those seven components also answer `--version` (#1429): build ID, main package and Go toolchain. The stdlib-only probe binaries and the CNI plugin stay flagless. The note is parsed by hand, not with `debug/elf`: measured on the proxy supervisor, `debug/elf` adds 167 KB and the hand parser 37 KB over main. It reads note sections first and note segments second, because Go's own linker leaves `.note.gnu.build-id` out of the PT_NOTE segment in a static binary. Under `--stamp`, at two commits that differ in one file nothing depends on, the seven binaries are now byte-identical (they all differed before). Image digests still differ until the image metadata stops carrying the commit, which is the next change in this stack. Part of #1378 Closes #1429 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…ints both architectures (#1378, #1429) Review of the build-ID change: - `cni-install` has a cobra command line and was left without `--version`, while the runbook said every component with a command line has it. It now answers like the other seven. The runbook lists the eight binaries that do and the five that do not (the four probe binaries and the CNI plugin), with the reason for each. - A build ID belongs to one architecture's binary, and `make check-build-id` built only the host's. It now builds `--platforms=@rules_go//go/toolchain:linux_<arch>` for amd64 and arm64 and prints both lists. Checked against an image: the mesh-dns binary extracted from the arm64 layer of the built index reads `e24fbf71…` with `readelf -n` (machine AArch64), the ID the arm64 list prints; the amd64 layer reads `f40e658d…`, the ID the amd64 list prints. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
force-pushed
the
upgrade/1378-binary-build-id
branch
from
October 8, 2026 22:50
e94cc5d to
1400f8a
Compare
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.


Bottom of a three-PR stack for #1378 (every merge to main gives every image a new digest, so every deploy rolls every workload). This one removes the first of the two causes; the next removes the second; the third adds the CI check.
Part of #1378
Closes #1429
What
Seven binaries (agent, mesh-dns, proxy-supervisor, uds-csi, controller, prober, registrar) linked the commit in as
Version, throughx_defswith{STABLE_GIT_VERSION}. Under--stampeach of them, and the image layer built from it, changed with every commit, including a docs-only one.Versionis now the binary's own GNU build ID: the content-derived note//bazel/buildidalready writes into every shipped binary, read from the running executable by a new stdlib-only package,//common/buildinfo. The sevenx_defsare gone.--version(observability: no component has a --version flag #1429): build ID, main package, Go toolchain. They exit before starting anything. The stdlib-only probe binaries and the CNI plugin stay flagless.charts/README.mdno longer says the chart'sappVersionmatches a version embedded in the binaries; the runbook gets "Which build is this binary".What reads
Version, and what an operator losesRead in the code, every use:
service.version(all seven)git describeof the commitvendor_versionand itsstartinglog lineNothing else reads it. No dashboard or alert in this repository refers to
service.version.What is lost:
service.versionno longer names a commit, so telemetry alone does not say which commit a pod runs. What replaces it:service.versionrun byte-identical binaries; a value that changes across a deploy means that component's code changed.dev-<sha>tag and the per-commit chart, which pins every image by digest.make check-build-idat a candidate commit.Evidence
Measured on a developer machine, real workspace status,
--stamp:--versionon the shipped binaries prints the IDreadelf -nprints, for mesh-dns, proxy-supervisor, uds-csi and prober (four different IDs). A binary outside an image prints the constant ID rules_go links into every binary (498919af…); the runbook says so.deps_testand size ceiling (mesh-dns, proxy-supervisor, uds-csi, cni, the four probe binaries), the chart tests and//bazel/buildid. The Go tests touched also pass under--config=race.make format-checkand the lint build withfail_on_violationover the touched packages are clean; gazelle makes no change.Not verified
debug/elf(37 KB against 167 KB on the proxy supervisor) come from the earlier work on this branch; I did not re-measure them. The size ceilings pass either way.service.version.Merge order
This PR is safe to merge on its own at any time: it changes no digest behaviour by itself (10 of 10 still change). The order question belongs to the next PR and is answered there.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr