Skip to content

fix(docker): npm config + fail-loud build validation (follow-up to #31) - #32

Merged
songkuan-zheng merged 1 commit into
ship/v1.83.10from
fix/docker-build-ui-refinements
May 29, 2026
Merged

fix(docker): npm config + fail-loud build validation (follow-up to #31)#32
songkuan-zheng merged 1 commit into
ship/v1.83.10from
fix/docker-build-ui-refinements

Conversation

@songkuan-zheng

Copy link
Copy Markdown
Collaborator

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 .npmrc line min-release-age=3d (npm 11+ supply-chain hardening) as a fatal config error. Override just for the docker RUN so npm ci works.
  • set -eux + semicolons replace the && \ chain. The trailing || true on npm cache clean was swallowing failures earlier in the chain — the image looked clean but _experimental/out/ could be missing or empty.
  • test -f out/index.html asserts 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.yml would fail at the npm ci step 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

  • Built locally with docker buildx — image succeeds, _experimental/out/index.html exists
  • Container started, served UI at :4011, bundle grep confirms D2 strings (auth_permission_denied:"TOAST", auth_session_expired:"REDIRECT_LOGIN", etc.)
  • Browser e2e: cookie+sessionStorage cleared → redirected to /ui/login?redirect_to=... per D2 contract

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/.
@songkuan-zheng
songkuan-zheng merged commit ba80a14 into ship/v1.83.10 May 29, 2026
@songkuan-zheng
songkuan-zheng deleted the fix/docker-build-ui-refinements branch May 29, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant