Skip to content

wasm visor: show bundle commit (labelled "bundle") instead of the (devel)/config version #3432

Description

@0pcom

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

  1. buildinfo (verifiable): in readDebugBuildInfo, when no commit came from Main.Version, fall back to bi.Settingsvcs.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).
  2. 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.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions