Build stamps its git sha into index.html (build-sha meta tag) #126
Loading…
Reference in a new issue
No description provided.
Delete branch "void/build-sha-stamp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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