config: drop VERSION env override; use version.Version - #622
Open
MsfPablo wants to merge 1 commit into
Open
Conversation
The cfg.Version field in internal/registry/config duplicated the version.Version package var without adding value: VERSION only set the default, which was already "dev", and the package var is set at build time via -ldflags. Two call sites (registry_app telemetry init and the v0 health handler) were reading cfg.Version; both now use version.Version so the deployed binary reports the version it was built with. The .env.example entry is replaced with a comment pointing at the ldflags injection point — there is intentionally no env override any more. Refs agentregistry-dev#567.
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.
What
Removes the redundant
cfg.Versionfield frominternal/registry/configso the registry server reports the version it was built with instead of one overridable throughAGENT_REGISTRY_VERSIONat runtime.Why
Issue #567 —
cfg.Versiononly ever set the default ("dev"), which is whatinternal/version.Versionalready returns when no-ldflagsinjection happened. Two production paths read it:internal/registry/registry_app.go— telemetry init labelinternal/registry/api/handlers/v0/health/handlers.go— health metricsversionattributeBoth now read
version.Versiondirectly, so a deployed binary's reported version always matches what it was built with. There is intentionally no env override any more.Changes
internal/registry/config/config.go— dropVersion stringfield; leave a comment explaining the build-time injection pointinternal/registry/registry_app.go—telemetry.InitMetrics(version.Version)internal/registry/api/handlers/v0/health/handlers.go— same, plus theinternal/versionimport.env.example— replace theAGENT_REGISTRY_VERSION=devline with a comment pointing at the ldflags injectionTest plan
go build ./...cleango test ./internal/registry/config/...passesgo test ./internal/registry/...passes (telemetry, health, controllers)cfg.Versionreferences in the registry config path (CLI root config has its own unrelatedVersionfield — left alone)Notes
Versionreferences in the codebase (internal/cli/version.go,internal/mcp/registryserver/server.go,internal/registry/registry_app.go:133/137) already read fromversion.Version. This change brings the two stragglers into line.cfg.Verbose; there is no such field in this config struct (probably from an earlier refactor), so the scope is exactlycfg.Versiononly.Disclosed: this PR was authored with LLM assistance under the MsfPablo persona.