Skip to content

[worker] Install package managers with Corepack - #4212

Draft
AbbanMustafa wants to merge 1 commit into
mainfrom
mustafa/fix-corepack-manager-install
Draft

[worker] Install package managers with Corepack#4212
AbbanMustafa wants to merge 1 commit into
mainfrom
mustafa/fix-corepack-manager-install

Conversation

@AbbanMustafa

Copy link
Copy Markdown
Contributor

Why

Builds that install a custom Node.js version with Corepack enabled can fail during INSTALL_CUSTOM_TOOLS. corepack enable creates pnpm and Yarn shims, then the worker attempts to overwrite them with npm -g install, which exits with EEXIST.

This affected 251 builds across 138 accounts in the visible hot-log window: Datadog failure cluster.

How

Use Corepack to prepare and activate the requested pnpm and Yarn versions when Corepack is enabled. Keep the existing npm global installation path for builds that do not enable Corepack.

Test Plan

  • Added a regression test verifying custom Node.js + Corepack uses corepack prepare for pnpm and Yarn without invoking the conflicting npm installs; the control test verifies Corepack-disabled builds still use npm.
  • Ran all 57 worker unit tests, worker typechecking, linting, and formatting checks.

@github-actions

Copy link
Copy Markdown

❌ It looks like a changelog entry is missing for this PR. Add it manually to CHANGELOG.md.
⏩ If this PR doesn't require a changelog entry, such as if it's an internal change that doesn't affect the user experience, you can add the "no changelog" label to the PR.

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.53%. Comparing base (2f320ae) to head (bd48592).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4212      +/-   ##
==========================================
+ Coverage   63.52%   63.53%   +0.01%     
==========================================
  Files        1028     1028              
  Lines       46929    46934       +5     
  Branches     9849     9851       +2     
==========================================
+ Hits        29807    29814       +7     
+ Misses      17020    17018       -2     
  Partials      102      102              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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