fix(docker): bake pnpm into image to avoid runtime corepack downloads (GRO-1909) #101
Reference in New Issue
Block a user
Delete Branch "fix/GRO-1909-migrate-corepack-offline"
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?
Summary
corepack prepare --activatetocorepack install -gto bake pnpm into/usr/local/bin/pnpminstead of relying on corepack shims that re-validate against npmjs.org at runtimeCOREPACK_ENABLE_DOWNLOAD_PROMPT=0andCOREPACK_ENABLE_STRICT=0to suppress interactive prompts and strict version checks that also trigger network accessRUN mkdir -p /home/node/.cache/node/corepackfrom builder stageRoot cause
corepack prepare --activateplaces shims that re-verify pnpm againstregistry.npmjs.orgon every invocation. The prod migrate container failed withEAI_AGAINwhen DNS failed to resolve npmjs.org.Test plan
docker build --target migrate -t migrate-test .succeeds with--no-cache🤖 Generated with Claude Code
Review: Changes Requested
Code changes are technically correct and CI passes (lint, test, docker build all green). One required acceptance criterion is unmet.
Required before merge
Missing blackholed runtime verification evidence — the acceptance criteria specifies:
The PR body still has this item unchecked with no output shown. Please run the test from the issue spec and paste the result in the PR description:
The run is expected to fail on a DB connection error, but it must NOT show any EAI_AGAIN or corepack download attempt. Paste the terminal output in the PR description.
Minor (non-blocking)
The
resetstage (FROM builder AS reset) already inherits pnpm frombasevia the build chain, so theRUN corepack enable && corepack install -g pnpm@9.15.4in that stage is a redundant extra layer. Consider removing it.Flea Flicker: Cannot run blackholed test in this environment
Docker is not available in the current agent environment (confirmed: docker, podman, buildah all absent). I am unable to execute the required acceptance criterion:
What I can confirm from code review:
basestage now usescorepack install -g pnpm@9.15.4(bakes binary to/usr/local/bin/pnpm)COREPACK_ENABLE_DOWNLOAD_PROMPT=0andCOREPACK_ENABLE_STRICT=0are set in bothbaseandrunnerstagesmkdir -p /home/node/.cache/node/corepackline has been removed frombuilderresetstage has redundantRUN corepack enable && corepack install -g pnpm@9.15.4+ env vars (Lint Roller flagged as non-blocking)Recommendation: Either (a) run the blackholed test locally and paste output, or (b) rely on the CI Docker build push as a proxy for correctness, since the code changes are identical to what was previously reviewed and CI-green.
Resume: true — continuation of GRO-1916 acceptance criterion completion
64891bd260to53677b1420Flea Flicker: CI smoke test added (GRO-1939)
Updated
.gitea/workflows/ci.ymlon branchfix/GRO-1909-migrate-corepack-offlineto add the blackhole smoke step after the Migrate image build:Commit:
f007ecaNote: CI was already merged into dev (run #2090). The smoke step will run on the next push to dev.