Report server version in rossoctl version - #80
Conversation
`rossoctl version` now fetches the server's version via GET /auth/config and prints it, falling back to "unknown" if the server is unreachable or doesn't report one. The local server (cortex serve) now reports its own build version in /auth/config, sourced from a shared buildinfo.Version ldflags target instead of cmd-local var. Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: Ed Snible <snible@us.ibm.com>
mrsabath
left a comment
There was a problem hiding this comment.
Summary
Clean, well-scoped feature: rossoctl version now also prints the connected server's version from GET /auth/config, and cortex serve reports its own build version via a shared buildinfo.Version.
I verified the version field is consistent end-to-end across three surfaces:
- CLI client model (
internal/apiclient.AuthConfig.Version) cortex serve(internal/serve.AuthConfig.Version)- the real rossoctl Python backend, which already returns
versionin/auth/config(AuthConfigResponse.versionin rossoctl/rossoctlauth.py).
So rossoctl version reports the actual backend version against a live server, not only against cortex serve, and falls back to "unknown" gracefully when the server is unreachable or omits the field. Moving version out of cmd into buildinfo is the right call to avoid an import cycle from internal/serve, and the Makefile ldflags target was updated to match.
Good test coverage: three CLI cases (reachable / server-omits-version / unreachable) plus the updated serve test asserting the new field.
Areas reviewed: Go (cmd/serve/apiclient/buildinfo), tests, Makefile, cross-repo API contract
Commits: 1, signed-off (DCO passes)
CI status: passing (DCO + test)
LGTM. One optional cosmetic nit inline.
| BINARY := rossoctl | ||
| PKG := github.com/rossoctl/rossoctl-cli | ||
| CMD_PKG := $(PKG)/cmd | ||
| BUILDINFO_PKG := $(PKG)/internal/buildinfo |
There was a problem hiding this comment.
nit (optional, non-blocking): BUILDINFO_PKG := is longer than the column BINARY/PKG/CMD_PKG were padded to, so its := no longer lines up with the three above it, and the VERSION/COMMIT/DATE block below still uses the older narrower alignment. Purely cosmetic (make doesn't care). Either widen all of them to match BUILDINFO_PKG, or drop the manual padding entirely.
Summary
rossoctl versionnow also prints the connected server's version (viaGET /auth/config), falling back to "unknown" if unreachable.cortex serve's/auth/confignow reports its own build version, sourced from a sharedbuildinfo.Version(ldflags target moved fromcmd.version).Test plan
go build ./...,go vet ./...,go test ./...rossoctl versionagainst live server and against unreachable servercortex serve+curl /auth/configshows injected versionAssisted-by: Claude
Signed-off-by: Ed Snible