feat: in-app version/build stamp (version + commit) (#74)#81
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-containeddist/sql.htmlcopied onto clusters.build/build.mjs—buildStamp()reads the version (from$ASB_VERSIONwhen set, elsepackage.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-dirtywhen the working tree differs from HEAD.build/bundle.sh— passes the resolved release version through (ASB_VERSION) so the bundle'sVERSIONfile and the in-HTML stamp stay in lockstep (release.ymlcallsbundle.sh ${GITHUB_REF_NAME#v}).src/main.js— passes the placeholder through thecreateApp(env)seam.src/ui/app.js—build: env.build || 'dev'; renders the.um-buildline inopenUserMenu().src/styles.css— muted/mono.um-buildrule matching the menu footer.buildand assert the line renders; CHANGELOG entry under[Unreleased].Acceptance (#74)
dist/sql.htmlcarries the version + commit, shown in the UI (user menu).giton PATH →v0.1.4).src/stays at the per-file coverage gate (npm test: 1023 passed, gate green).Verification
npm testgreen;npm run buildstampsv0.1.4 (<commit>); no-git and-dirtypaths verified.v0.1.4 (cd90a84)), with served bytes SHA-matching the local build.🤖 Generated with Claude Code