Skip to content

Show build information in web UI - #257

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

Show build information in web UI#257
WilliamK112 wants to merge 4 commits 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 thread internal/server/templates/layout/footer.html Outdated

@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.

WilliamK112 and others added 2 commits August 20, 2026 09:43
Shared footer templates were reading .Version and .Commit, which resolve
to package data on VersionShowData and BrowseSourceData. Point the footer
at Layout.BuildInfo and cover both pages so the proxy version stays visible.

Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the BuildInfo constructor argument while picking up access logging
and other mainline changes.

Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@WilliamK112

Copy link
Copy Markdown
Author

@andrew Footer now reads .BuildInfo.Version / .BuildInfo.Commit so package Version fields on VersionShowData and BrowseSourceData no longer shadow the proxy build. Added template coverage for both pages plus HTTP assertions on version-show and browse-source. Also merged latest main (access logging / Helm) while keeping the BuildInfo constructor argument.

go test ./internal/server is green locally.

@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.

Thanks for the update, the footer and tests now cover the shadowing case.

Two remaining items:

  • internal/server/layout.go: BuildInfo is embedded in Layout, so Version and Commit are still promoted through Layout into every page data struct. The footer now reads .BuildInfo.Version explicitly, but the promotion means any template that writes {{.Version}} or {{.Commit}} still gets page-dependent behaviour. Make it a named field (BuildInfo BuildInfo) so the fields aren't promoted at all. The template, layoutFor, and the tests already access it as .BuildInfo.…, so only the struct definition changes.
  • internal/server/server_test.go (newTestServer): the Server{} literal now has mixed alignment across cfg/db/storage/logger, buildInfo, and templates/healthCache. Please realign.

@WilliamK112

Copy link
Copy Markdown
Author

Addressed both remaining items on 02e8c3c:

  • Layout now uses the named field BuildInfo BuildInfo, so Version and Commit are no longer promoted into page data.
  • newTestServer now keeps the entire Server literal consistently aligned.

Validation: go test ./... and git diff --check both pass.

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