Skip to content

Show build information in web UI - #257

Open
WilliamK112 wants to merge 1 commit into
git-pkgs:mainfrom
WilliamK112:agent/show-build-info-in-ui
Open

Show build information in web UI#257
WilliamK112 wants to merge 1 commit into
git-pkgs:mainfrom
WilliamK112:agent/show-build-info-in-ui

Conversation

@WilliamK112

Copy link
Copy Markdown

Summary

  • pass the existing linker-injected version and commit into the server as explicit build information
  • expose build information through the shared UI layout and render it below the repository link in the footer
  • add handler and constructor coverage for the build-information data path

Why

The CLI already reports the running version and commit, but the web UI had no access to those values. Operators therefore could not identify the deployed build from the dashboard. This keeps main.Version and main.Commit as the single source of truth while making the same information available on every rendered UI page.

Validation

  • go test ./internal/server
  • go test ./...
  • go test -race ./...
  • go vet ./...
  • go tool golangci-lint run ./... (0 issues)
  • built with -X main.Version=1.2.3 -X main.Commit=abc123; both proxy --version and a live /ui/ response contained proxy 1.2.3 (abc123)
  • git diff --check

Closes #256

Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>
@WilliamK112
WilliamK112 marked this pull request as ready for review August 14, 2026 19:53
@andrew
andrew requested a lite review from Copilot August 14, 2026 20:18

Copilot AI 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.

Pull request overview

This PR threads linker-injected build metadata (version + commit) from cmd/proxy into the internal server, exposes it via the shared UI Layout, and renders it in the footer so operators can see the deployed build from any UI page.

Changes:

  • Add a BuildInfo struct and carry it through server.New(...) into Server and Layout.
  • Render build info in the shared footer template.
  • Extend server tests to cover the build-info data path and footer rendering.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/server/templates/layout/footer.html Adds build/version text to the UI footer.
internal/server/server.go Stores BuildInfo on Server and plumbs it into layout data.
internal/server/server_test.go Updates test server setup and asserts build info appears in rendered UI and constructor.
internal/server/layout.go Introduces BuildInfo and includes it in Layout.
cmd/proxy/main.go Passes linker-injected Version/Commit into server.New(...).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +15 to +19
{{if .Version}}
<p class="text-xs text-gray-500 dark:text-gray-500 mt-2">
proxy {{.Version}}{{if .Commit}} ({{.Commit}}){{end}}
</p>
{{end}}

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The shared footer reads .Version and .Commit directly. On pages whose data structs define Version, including VersionShowData and BrowseSourceData, that page field shadows Layout.BuildInfo.Version, so the footer displays package data as the proxy build version. Please reference .BuildInfo.Version and .BuildInfo.Commit explicitly and add coverage for a page with its own Version field.

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.

Add version information to the ui

3 participants