make update: content-digest cache buster for VITE_* changes - #12
Merged
Merged
Conversation
The previous chain — operator edits apps/web/.env → make update → docker compose build — relied on BuildKit invalidating the `pnpm build` layer when an ARG value changed. That works in theory but isn't reliable enough in practice: operators were seeing stale bundles ship after env edits, with no other way out than a manual `docker compose build --no-cache web`. Add a content-digest cache buster: - scripts/updater.sh hashes apps/web/.env + repo-root .env, exports WEB_ENV_DIGEST. - docker-compose.yml threads it as a build arg. - web.Dockerfile consumes it just before the `pnpm build` RUN. Any byte change in either env file produces a different digest → the build layer invalidates → Vite re-inlines the current VITE_* values. The pnpm-store mount cache keeps `pnpm install` fast, so the rebuild cost stays at ~30-60s.
MostafaMoradii
added a commit
that referenced
this pull request
Jun 30, 2026
…-zone times Three small README updates reflecting recent shipped behavior: 1. VITE_CONSOLE_BASE_URL / VITE_WS_URL examples now show the bare-host form first (after PR #11, the SPA normalizes both shapes to the same final URL). 2. Drop the "if the SPA still hits :8090, force --no-cache" callout — PR #12's content-digest cache buster means a make update after any apps/web/.env edit reliably picks up the new values. 3. Add a paragraph in 'What's where' noting that times render in the operator's local zone with a ±HH:MM offset suffix on the hover tooltip (the convention that landed today).
MostafaMoradii
added a commit
that referenced
this pull request
Jun 30, 2026
PR #12's cache-buster called sha256sum unconditionally, which is GNU coreutils. macOS dev laptops have shasum -a 256 instead, so the command failed under set -euo pipefail and the whole build aborted with an opaque 'building: server web' line and nothing else: ==> building: server web make: *** [update] Error 1 Probe PATH, pick whichever hasher exists, use awk for the field extract (gnu cut vs bsd cut differ in flag handling for piped input in older versions). If neither is present, log a warning and skip the cache-buster — the operator can still run with manual --no-cache on the rare boxes that have neither tool.
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.
Summary
Operators edit
apps/web/.env, runmake update, and see the SPA still shipping the old VITE_* values. The Dockerfile's ARG-based cache invalidation isn't reliable enough on its own.Fix by adding a content-digest cache buster:
scripts/updater.shhashesapps/web/.env+ repo-root.envand exportsWEB_ENV_DIGEST.docker-compose.ymlthreads it as a build arg on the web service.web.Dockerfileconsumes the ARG just before thepnpm buildRUN.Any byte change in either env file produces a different digest → BuildKit invalidates the
pnpm buildlayer reliably → Vite re-inlines the current VITE_* values.The pnpm-store
--mount=type=cachekeeps install fast, so the rebuild cost is ~30-60s — the price ofmake updatealways doing what it says.Test plan
apps/web/.env(change VITE_CONSOLE_BASE_URL or just touch the file), runmake update, confirm the build output showsweb env digest: <newhash>...and thepnpm buildlayer re-runs (no CACHED marker).make updatewithout editing reuses the layer (the digest matches → cache hit).