Skip to content

feat: in-app version/build stamp (version + commit) (#74)#81

Merged
BorisTyshkevich merged 2 commits into
mainfrom
feat/version-build-stamp
Jun 29, 2026
Merged

feat: in-app version/build stamp (version + commit) (#74)#81
BorisTyshkevich merged 2 commits into
mainfrom
feat/version-build-stamp

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

Closes #74.

What

Bakes v<version> (<short-commit>) into the build and surfaces it as a small line in the user-menu footer (under the signed-in email / Log out), so a bug report can be tied to an exact build of the self-contained dist/sql.html copied onto clusters.

  • build/build.mjsbuildStamp() reads the version (from $ASB_VERSION when set, else package.json) + git rev-parse --short HEAD, injected via the existing __ASB_BUILD__ token-replace seam. Graceful fallbacks: v<version> when not a git checkout; appends -dirty when the working tree differs from HEAD.
  • build/bundle.sh — passes the resolved release version through (ASB_VERSION) so the bundle's VERSION file and the in-HTML stamp stay in lockstep (release.yml calls bundle.sh ${GITHUB_REF_NAME#v}).
  • src/main.js — passes the placeholder through the createApp(env) seam.
  • src/ui/app.jsbuild: env.build || 'dev'; renders the .um-build line in openUserMenu().
  • src/styles.css — muted/mono .um-build rule matching the menu footer.
  • Tests stub build and assert the line renders; CHANGELOG entry under [Unreleased].

Acceptance (#74)

  • dist/sql.html carries the version + commit, shown in the UI (user menu).
  • Build works offline / when not a git checkout (verified with a failing git on PATH → v0.1.4).
  • Touched src/ stays at the per-file coverage gate (npm test: 1023 passed, gate green).

Verification

  • npm test green; npm run build stamps v0.1.4 (<commit>); no-git and -dirty paths verified.
  • Deployed to the otel demo cluster and confirmed live in the user menu (v0.1.4 (cd90a84)), with served bytes SHA-matching the local build.

🤖 Generated with Claude Code

BorisTyshkevich and others added 2 commits June 29, 2026 12:42
The app version lived only in package.json — not baked into the build nor
shown in the UI — so a bug report couldn't be tied to an exact build of the
self-contained dist/sql.html copied onto clusters.

- build/build.mjs: bake `v<version> (<short-commit>)` into the bundle via a
  __ASB_BUILD__ token replace (same seam as the styles/script splices); read
  version from package.json + `git rev-parse --short HEAD`, with a graceful
  `v<version>` fallback when there's no git checkout.
- src/main.js: pass the placeholder through the createApp(env) seam.
- src/ui/app.js: expose `app.build` (env.build || 'dev'); render a small
  `.um-build` line in the user-menu footer.
- src/styles.css: muted/mono `.um-build` rule matching the menu footer.
- tests: stub `build` in fake-app and assert the user-menu line renders.
- CHANGELOG: note under [Unreleased].

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PgV4UResR7braUkAq7VaCr
…trees

Code-review follow-ups on the build-stamp change:

- build.mjs honors $ASB_VERSION over package.json, and bundle.sh passes the
  resolved release version (release.yml calls `bundle.sh ${GITHUB_REF_NAME#v}`).
  Previously the bundle's VERSION file used the tag while sql.html's stamp
  re-read package.json — a `bundle.sh <tag>` with an unbumped package.json would
  ship two divergent versions in one artifact.
- Append `-dirty` (via `git status --porcelain`) when the working tree differs
  from HEAD, so a hand-built artifact (e.g. a manual `kubectl cp dist/sql.html`)
  isn't mistaken for the clean commit it sits on.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PgV4UResR7braUkAq7VaCr
@BorisTyshkevich BorisTyshkevich merged commit f05e758 into main Jun 29, 2026
6 checks passed
@BorisTyshkevich BorisTyshkevich deleted the feat/version-build-stamp branch June 29, 2026 10:50
@BorisTyshkevich BorisTyshkevich mentioned this pull request Jun 29, 2026
23 tasks
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.

Surface an in-app version/build stamp (version + commit) for support

1 participant