fix: pin Yarn version from packageManager field in build scripts#10156
Conversation
Replace hardcoded 'yarn set version 4' in build-functions.sh with a dynamic lookup from each workspace's package.json packageManager field. Also syncs runtime yarn version to 4.15.0 to match web/package.json. Fixes CI build failures caused by Yarn 4.x fetching a newer patch that produces different builtin compat hashes, breaking --immutable lockfile validation.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe runtime now declares Yarn 4.15.0. Linux build steps and JavaScript-related CI workflows derive Yarn versions from package metadata instead of using hard-coded versions. ChangesYarn version alignment
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pkg/linux/build-functions.sh (1)
260-261: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAlign the remaining web test workflow with the declared Yarn version.
.github/workflows/run-javascript-tests.ymlstill runsyarn set version 4before installingweb, so CI can test with a different Yarn version than this packaging path. If version alignment is intended across build and test flows, derive the version fromweb/package.jsonthere as well.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/linux/build-functions.sh` around lines 260 - 261, Update the web test workflow’s Yarn setup to derive the version from web/package.json’s packageManager field, matching the existing YARN_VERSION logic in the packaging path, instead of hardcoding Yarn 4 before installing web.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/linux/build-functions.sh`:
- Around line 212-213: Validate YARN_VERSION immediately after extracting it in
the build flow around the packageManager parsing command, ensuring the
packageManager field exists, identifies Yarn, and yields a non-empty valid
version before calling yarn set version. Fail fast with an appropriate error
when validation fails, and apply the same validation to the corresponding second
occurrence.
---
Nitpick comments:
In `@pkg/linux/build-functions.sh`:
- Around line 260-261: Update the web test workflow’s Yarn setup to derive the
version from web/package.json’s packageManager field, matching the existing
YARN_VERSION logic in the packaging path, instead of hardcoding Yarn 4 before
installing web.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b8d3cfc5-57ee-4aea-92f8-33e3cea82aad
📒 Files selected for processing (2)
pkg/linux/build-functions.shruntime/package.json
Summary
yarn set version 4inpkg/linux/build-functions.shwith a dynamic lookup from each workspace'spackageManagerfield inpackage.jsonruntime/package.jsonYarn version to4.15.0to matchweb/package.jsonRoot Cause
CI DEB build (#1708) failed with
YN0028—yarn installran with--immutablebut the lockfile would have been modified. The build script ranyarn set version 4which fetched the latest Yarn 4.x release; that newer Yarn recomputes builtin compat patch hashes differently from the version used to generate the committed lockfile.Fix
Both the web and runtime build blocks now use the version declared in their respective
package.json. The build script never needs updating when Yarn is bumped — the single source of truth ispackageManager.Test plan
yarn installpassesbuild-functions.sh)Summary by CodeRabbit
Chores
CI