Motivation
The wasm visor's version line shows its compile-time version — currently (devel) for a locally-built blob (or a stale ldflags stamp like v1.3.80). For a compiled bundle that's much less useful than the source commit it was built from. Show the git commit, labelled "bundle" (e.g. Serverless visor · bundle 4a813c0), so you can tell exactly what code the served/embedded wasm contains — distinct from the running visor's release version.
Why it's not automatic today
pkg/buildinfo/buildinfo.go readDebugBuildInfo() only parses the commit out of bi.Main.Version (via commitRegex). That works for go-install pseudo-versions (v1.3.85-0-g<commit>) but NOT for a local (devel) build. It never reads bi.Settings for vcs.revision, which is where a plain go build in a git repo stamps the commit (in the .go.buildinfo section; survives -ldflags=-s -w).
Plan
- buildinfo (verifiable): in
readDebugBuildInfo, when no commit came from Main.Version, fall back to bi.Settings → vcs.revision (+ vcs.modified → +dirty, vcs.time → date). Populate Info.Commit. Confirm the wasm build isn't -buildvcs=false (Makefile embed-wasm-visor / wasm-visor-go target).
- surface:
buildinfo.Get() already returns {Version, Commit, Date}; the wasm overview/about (cmd/wasm-visor, pkg/wasmhv/core.go) already carries BuildInfo — just make sure Commit is non-empty.
- UI (Angular, CI-built): in
app-mode.service.ts (the 'Serverless visor · …' line), render bundle <commit[:7]> when the mode is serverless/wasm, in place of the meaningless config version. Keep any real release version separate if present.
Small, but touches build-flag verification + Go + Angular, so worth doing as one focused change.
Motivation
The wasm visor's version line shows its compile-time version — currently
(devel)for a locally-built blob (or a stale ldflags stamp likev1.3.80). For a compiled bundle that's much less useful than the source commit it was built from. Show the git commit, labelled "bundle" (e.g.Serverless visor · bundle 4a813c0), so you can tell exactly what code the served/embedded wasm contains — distinct from the running visor's release version.Why it's not automatic today
pkg/buildinfo/buildinfo.go readDebugBuildInfo()only parses the commit out ofbi.Main.Version(via commitRegex). That works for go-install pseudo-versions (v1.3.85-0-g<commit>) but NOT for a local(devel)build. It never readsbi.Settingsforvcs.revision, which is where a plaingo buildin a git repo stamps the commit (in the.go.buildinfosection; survives-ldflags=-s -w).Plan
readDebugBuildInfo, when no commit came fromMain.Version, fall back tobi.Settings→vcs.revision(+vcs.modified→+dirty,vcs.time→ date). PopulateInfo.Commit. Confirm the wasm build isn't-buildvcs=false(Makefileembed-wasm-visor/ wasm-visor-go target).buildinfo.Get()already returns{Version, Commit, Date}; the wasm overview/about (cmd/wasm-visor, pkg/wasmhv/core.go) already carries BuildInfo — just make sure Commit is non-empty.app-mode.service.ts(the 'Serverless visor · …' line), renderbundle <commit[:7]>when the mode is serverless/wasm, in place of the meaningless config version. Keep any real release version separate if present.Small, but touches build-flag verification + Go + Angular, so worth doing as one focused change.