fix(docker): npm config + fail-loud build validation (follow-up to #31) - #32
Merged
Merged
Conversation
PR #31 shipped the UI rebuild step but missed three refinements discovered during live e2e: (a) the builder image's older npm rejects the project's .npmrc `min-release-age=3d` (npm 11+ supply-chain hardening) as a fatal config error, so override it to 0 just for the docker RUN; (b) switch from `&& \` chain to `set -eux; ...; \` so a failed step actually aborts the build instead of being swallowed by the trailing `|| true`; (c) add `test -f out/index.html` validations after both the build and the copy so a silent-success build can't ship a broken image. Also adds `.gstack/` to .gitignore (gstack working dir — never useful to commit) and a trailing newline cleanup. Without (a), CI's release-docker workflow fails at `npm ci`. Without (b)+(c), failures are invisible and the image ships with a stale _experimental/out/.
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
Follow-up to #31. The docker UI rebuild step that PR shipped was discovered to be silently broken during live e2e testing of the D1+D2 stack. Three fixes here:
NPM_CONFIG_MIN_RELEASE_AGE=0— the builder image's older npm treats the project's.npmrclinemin-release-age=3d(npm 11+ supply-chain hardening) as a fatal config error. Override just for the docker RUN sonpm ciworks.set -eux+ semicolons replace the&& \chain. The trailing|| trueonnpm cache cleanwas swallowing failures earlier in the chain — the image looked clean but_experimental/out/could be missing or empty.test -f out/index.htmlasserts after both the build and the copy. Catches silent failures at the layer they occur instead of at runtime.Also adds
.gstack/to.gitignore(gstack working dir) and fixes the trailing-newline-missing on the file.Why this matters
Without these,
release-docker.ymlwould fail at thenpm cistep on the next tag push. Verified during e2e that with these refinements the image builds clean and the served bundle contains the latest UI source (D1+D2 auth taxonomy strings present in_next/static/chunks/312bf65c9acb9b11.js).Test plan
docker buildx— image succeeds,_experimental/out/index.htmlexists:4011, bundle grep confirms D2 strings (auth_permission_denied:"TOAST",auth_session_expired:"REDIRECT_LOGIN", etc.)/ui/login?redirect_to=...per D2 contract