Build stamps its git sha into index.html (build-sha meta tag) #126

Merged
void merged 3 commits from void/build-sha-stamp into dev 2026-11-13 04:01:24 +00:00
Member

Brief ratatoskr:follow_up:chat-mind-20261113T005913080Z-t5, part 2. A built bundle carried no sha (Eureka named it a gap; an installed folder was identified by its directory name only).

Change: scripts/buildSha.js reads the commit (BUILD_SHA if it is a full sha, else git HEAD, with -dirty appended for an uncommitted tree, else 'unknown') and a vite plugin writes into index.html. Read it cheaply: curl -s / | grep -o 'build-sha" content="[^"]*'. docs/gamecult/client-build-install.md says so.

The PRECOMPRESS release script (not in this repo: /opt/commons/handoff/ratatoskr-main-build/build-prod-dist.sh) now reads the stamp from dist/index.html, refuses a build whose stamp differs from the sha it was asked for, records build_sha_stamp in BUILD-INFO and prints it in the paste block; a commit from before this PR has no stamp, which is recorded as absent and not refused.

Proof. vitest scripts/buildSha.test.js: 5 passed (env override, dirty tree, no git, plugin tag). A real vite build of this tree printed in dist/index.html. The release script edit is syntax-checked (bash -n) and its extraction sed read back that value; a full release build has not been run, so the refuse-on-mismatch path is inferred. Output is byte-different per commit by design; determinism for one sha is unaffected.

Not deployed. 🤖 Generated with Claude Code

Brief ratatoskr:follow_up:chat-mind-20261113T005913080Z-t5, part 2. A built bundle carried no sha (Eureka named it a gap; an installed folder was identified by its directory name only). Change: scripts/buildSha.js reads the commit (BUILD_SHA if it is a full sha, else git HEAD, with -dirty appended for an uncommitted tree, else 'unknown') and a vite plugin writes <meta name="build-sha" content=...> into index.html. Read it cheaply: curl -s <site>/ | grep -o 'build-sha" content="[^"]*'. docs/gamecult/client-build-install.md says so. The PRECOMPRESS release script (not in this repo: /opt/commons/handoff/ratatoskr-main-build/build-prod-dist.sh) now reads the stamp from dist/index.html, refuses a build whose stamp differs from the sha it was asked for, records build_sha_stamp in BUILD-INFO and prints it in the paste block; a commit from before this PR has no stamp, which is recorded as absent and not refused. Proof. vitest scripts/buildSha.test.js: 5 passed (env override, dirty tree, no git, plugin tag). A real vite build of this tree printed <meta name="build-sha" content="b6b1d522...-dirty"> in dist/index.html. The release script edit is syntax-checked (bash -n) and its extraction sed read back that value; a full release build has not been run, so the refuse-on-mismatch path is inferred. Output is byte-different per commit by design; determinism for one sha is unaffected. Not deployed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Build stamps its git sha into index.html as a build-sha meta tag
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m52s
ccb7a8ebb6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
buildSha: ignore vite's temp config file, run git in the repo dir
Some checks failed
Build pull request / Build pull request (pull_request) Has been cancelled
46e96500e4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
buildSha test: remove the temp repos after each test
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m54s
917f9a0da2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
void merged commit 95f79a0517 into dev 2026-11-13 04:01:24 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Ratatoskr!126
No description provided.