Skip to content

Report server version in rossoctl version - #80

Merged
esnible merged 1 commit into
mainfrom
feat/version-reports-server-version
Aug 31, 2026
Merged

Report server version in rossoctl version#80
esnible merged 1 commit into
mainfrom
feat/version-reports-server-version

Conversation

@esnible

@esnible esnible commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

  • rossoctl version now also prints the connected server's version (via GET /auth/config), falling back to "unknown" if unreachable.
  • cortex serve's /auth/config now reports its own build version, sourced from a shared buildinfo.Version (ldflags target moved from cmd.version).

Test plan

  • go build ./..., go vet ./..., go test ./...
  • Manual: rossoctl version against live server and against unreachable server
  • Manual: cortex serve + curl /auth/config shows injected version

Assisted-by: Claude

Signed-off-by: Ed Snible

`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 mrsabath left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 version in /auth/config (AuthConfigResponse.version in rossoctl/rossoctl auth.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.

Comment thread Makefile
BINARY := rossoctl
PKG := github.com/rossoctl/rossoctl-cli
CMD_PKG := $(PKG)/cmd
BUILDINFO_PKG := $(PKG)/internal/buildinfo

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@esnible
esnible merged commit 7bda387 into main Aug 31, 2026
2 checks passed
@esnible
esnible deleted the feat/version-reports-server-version branch August 31, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants