Skip to content

fix(docker): decouple pnpm bootstrap from the package registry - #1603

Merged
Cedric Vidal (cedricvidal) merged 12 commits into
mainfrom
cedricvidal-decouple-pnpm-bootstrap
Nov 5, 2026
Merged

Cedric Vidal (cedricvidal) merged 12 commits into
mainfrom
cedricvidal-decouple-pnpm-bootstrap

Conversation

@cedricvidal

@cedricvidal Cedric Vidal (cedricvidal) commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Ordinary npm package proxies were being assigned to both NPM_CONFIG_REGISTRY and COREPACK_NPM_REGISTRY. That treated packument/package endpoints as though they also implemented Corepack's metadata protocol, producing malformed or unsupported per-version URLs. When Corepack failed, the pinned npm fallback reused the same endpoint, coupling both bootstrap paths to one failure domain.

This layer:

  • centralizes pinned pnpm 10.29.1 bootstrap behavior in scripts/bootstrap-pnpm.sh and uses it consistently across every Node Docker image;
  • keeps NPM_CONFIG_REGISTRY for ordinary npm/pnpm package resolution, while COREPACK_NPM_REGISTRY is unset by default and used only when explicitly configured with a Corepack-compatible endpoint;
  • clears COREPACK_NPM_REGISTRY for the pinned npm fallback, so an incompatible Corepack metadata endpoint cannot trap the fallback;
  • normalizes trailing slashes, rejects credential-bearing/query/fragment URLs, and logs only sanitized endpoint origins rather than secret-bearing URLs;
  • preserves authenticated/private package registry support through standard npm authentication configuration without baking credentials into image history or build output; and
  • leaves every pnpm install invocation unwrapped, preserving pnpm's built-in package-fetch retries and actionable exhausted-retry diagnostics.

Stack context: this is layer 3 of the native-stack series. The draft PR targets cedricvidal-harden-agent-registration (#1602), currently at be95df38c8325b05124f386695952d46a7aeedf8. This PR's head is 9406483ab1acc86d0a5386ab2d424348d6291bd9.

Demos

N/A — Docker build configuration only.

Before

N/A

After

N/A

Testing

  • PASS — pnpm exec vitest run scripts/bootstrap-pnpm.test.ts scripts/docker-compose.test.ts --reporter=default (2 files, 8 tests). Covers public defaults, an ordinary package proxy that is not a Corepack registry, trailing-slash normalization, explicit Corepack override, npm fallback independence, secret-safe rejection/diagnostics, all Node Dockerfiles using the shared contract, and no pnpm retry-policy overrides.
  • PASS — sh -n scripts/bootstrap-pnpm.sh scripts/dev-compose.sh.
  • PASS — NPM_CONFIG_REGISTRY=https://packages.example.test/npm/ COREPACK_NPM_REGISTRY=https://corepack.example.test/ docker compose --profile copilot config --format json, with assertions that both api and coder-acp-copilot receive the distinct build arguments.
  • PASS — docker build --target deps -f apps/portal/Dockerfile --build-arg NPM_CONFIG_REGISTRY=https://packagefeedproxy.microsoft.io/npm/ .. In the restricted development network, Corepack's default public fetch failed, then the pinned npm fallback installed pnpm through the ordinary Microsoft package proxy and the normal pnpm install completed successfully. This directly exercises the separated failure domains.
  • EXPECTED NETWORK LIMITATION — the same representative build with NPM_CONFIG_REGISTRY=https://registry.npmjs.org/ could not establish a TLS connection to the public registry from this environment; both Corepack and npm reported network failures. The proxy-backed build above provides the representative networked image validation.
  • PASS — pnpm headers:check after synchronizing the updated lower layer (966/966 in-scope files).
  • PASS — git diff --check origin/cedricvidal-harden-agent-registration...HEAD.
  • PASS — final-base CI run 41752955751: License Headers, Third-party NOTICE, Unit Tests (Node 22), Integration Tests (Copilot ACP, Claude Code ACP, and queue recovery), Lint Code, Build Applications, Windows Worker Build, CLI Bundle Integration Tests, gitleaks, CLA, and CI Summary all succeeded. Gateway and LLM Evals were skipped by change detection.

Documentation and compatibility

Updated .env.example and ENV_VARIABLES.md with the supported one-command package-registry override, explicit Corepack-compatible override semantics, credential-safe URL requirements, fallback isolation, and preserved pnpm retry behavior.

No dependency manifests, runtime APIs, Portal/CLI behavior, database schemas, or production deployment contracts changed. Existing private package proxy selection remains supported through NPM_CONFIG_REGISTRY; COREPACK_NPM_REGISTRY is now an explicit opt-in for compatible metadata endpoints. No migration or upgrade step is required unless an environment intentionally needs a custom Corepack registry, in which case it must export COREPACK_NPM_REGISTRY separately.

Checklist

  • N/A — Portal features did not change; no CLI parity work required.
  • N/A — Portal components did not change; no Storybook updates required.
  • N/A — No database changes or migrations.
  • N/A — No dependencies or lockfile changes; NOTICE regeneration is not required.
  • N/A — No user-visible behavior requiring a before video.
  • N/A — No user-visible behavior requiring an after video.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the pinned yq image and BusyBox wget for bounded, non-root agent registration without runtime package installation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added type: documentation Documentation additions, corrections, and improvements. area: worker Coding agent worker runtime, task execution, and lifecycle. area: cicd Build, test, release, and deployment pipelines. area: infrastructure Cloud resources, hosting, networking, and shared infrastructure. language: javascript Work involving JavaScript code, tooling, or dependencies. area: judge Evaluation engine, scoring, and criteria execution. area: portal Scope web portal, pages, and user-facing components. area: post-processing ATIF generation and the run-output post-processing pipeline. area: reporting Generation and delivery of benchmark reports. topic: security Security protections, vulnerabilities, and risk reduction. topic: testing Test coverage, test infrastructure, and validation quality. area: scheduler labels Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #445

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3245 3245 0 0 0 0 0 1m1s

🎉 All tests passed!

Github Test Reporter

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ack-issue' into cedricvidal-harden-agent-registration
…-decouple-pnpm-bootstrap

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #453

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3245 3245 0 0 0 0 0 1m32s

🎉 All tests passed!

Github Test Reporter

Cedric Vidal (cedricvidal) added a commit that referenced this pull request Nov 4, 2026
Revert 5d78953 and 48487f8 so this branch contains only the optional native dependency layer above PR #1603.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #459

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3245 3245 0 0 0 0 0 1m2s

🎉 All tests passed!

Github Test Reporter

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ack-issue' into cedricvidal-harden-agent-registration
…-decouple-pnpm-bootstrap

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

# Conflicts:
#	scripts/docker-compose.test.ts
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #478

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3245 3245 0 0 0 0 0 1m32s

🎉 All tests passed!

Github Test Reporter

@cedricvidal
Cedric Vidal (cedricvidal) marked this pull request as ready for review November 5, 2026 00:37
Base automatically changed from cedricvidal-harden-agent-registration to main November 5, 2026 00:38
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

# Conflicts:
#	scripts/docker-compose.test.ts
@cedricvidal
Cedric Vidal (cedricvidal) merged commit e509e41 into main Nov 5, 2026
17 checks passed
Cedric Vidal (cedricvidal) added a commit that referenced this pull request Nov 5, 2026
* fix(dev): verify published stack endpoints

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(docker): make optional native dependency fallback explicit

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(dev): defer readiness checks until containers exist

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* revert(dev): remove endpoint readiness layer

Revert 5d78953 and 48487f8 so this branch contains only the optional native dependency layer above PR #1603.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test(docker): guard optional native allowlist entries independently

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Test Results (Node.js 22)

test: Run #495

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
3245 3245 0 0 0 0 0 1m28s

🎉 All tests passed!

Github Test Reporter

Cedric Vidal (cedricvidal) added a commit that referenced this pull request Nov 5, 2026
* fix(compose): remove the gateway development CPU quota

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(compose): harden agent registration

Use the pinned yq image and BusyBox wget for bounded, non-root agent registration without runtime package installation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(docker): decouple pnpm bootstrap from the package registry

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(dev): verify published stack endpoints

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(docker): make optional native dependency fallback explicit

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(portal): avoid runtime Git metadata lookup

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* docs: document container storage prerequisites

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(dev): defer readiness checks until containers exist

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(website): add missing license headers

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* revert(dev): remove endpoint readiness layer

Revert 5d78953 and 48487f8 so this branch contains only the optional native dependency layer above PR #1603.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(portal): disable Git lookup in Compose development

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(portal): validate build time format

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test(compose): skip render check without Docker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(docker): preserve worker runtime package registry

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* docs: clarify runtime storage capacity checks

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test(docker): guard optional native allowlist entries independently

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(portal): avoid runtime Git metadata lookup

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(portal): disable Git lookup in Compose development

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(portal): validate build time format

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cicd Build, test, release, and deployment pipelines. area: infrastructure Cloud resources, hosting, networking, and shared infrastructure. area: judge Evaluation engine, scoring, and criteria execution. area: portal Scope web portal, pages, and user-facing components. area: post-processing ATIF generation and the run-output post-processing pipeline. area: reporting Generation and delivery of benchmark reports. area: scheduler area: worker Coding agent worker runtime, task execution, and lifecycle. language: javascript Work involving JavaScript code, tooling, or dependencies. topic: security Security protections, vulnerabilities, and risk reduction. topic: testing Test coverage, test infrastructure, and validation quality. type: documentation Documentation additions, corrections, and improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants