chore: upgrade to Yarn 4 - #80
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Detected new or modified files in |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Code Review Summary Issues Found 🟡 Important — Areas Reviewed
Questions for Author
|
| yarn install --frozen-lockfile | ||
| fi | ||
| fi | ||
| yarn install --immutable |
There was a problem hiding this comment.
🟡 Removing Yarn-version detection may break Yarn 1 caller repos.
This composite action is consumed by other repos through danger.yml (uses: ./.tooling/.github/actions/setup-and-install with install-from-caller: true), where the install runs against the caller's workspace — not duchamp's. The old logic deliberately branched on the caller's packageManager/yarn --version and used --frozen-lockfile for Yarn 1 and --no-immutable for Berry.
--immutable is a Yarn Berry–only flag; Yarn 1 (yarn@1.x) doesn't support it. With corepack enabled, a caller repo still on packageManager: yarn@1.x will invoke Yarn Classic with --immutable, which at best ignores the flag (losing the immutability guarantee) and at worst errors out. The same applies to the cache path change above (~/.yarn/berry/cache is Berry's global cache; Yarn 1 uses ~/.cache/yarn).
If all consumer repos are already on Yarn Berry, this is fine and the simplification is good — but that's an assumption worth confirming, since it's a breaking change for shared tooling. Could you confirm no consumer repo still uses Yarn 1?
There was a problem hiding this comment.
Checked all duchamp consumers by:
- Finding all repos that reference duchamp
gh search code 'artsy/duchamp' --owner artsy --extension yml
- Checking the Yarn version in each repo's package.json.
for repo in eigen force gravity energy doppler volt metaphysics fresnel palette positron artsy.github.io; do
result=$(gh api repos/artsy/$repo/contents/package.json --jq '.content' 2>/dev/null | base64 -d 2>/dev/null | grep '"packageManager"' | head -1)
echo "$repo: ${result:-no packageManager field}"
done
The only repo using install-from-caller: true is metaphysics, which is already on Yarn 4.17.0, so no breakage there.
https://github.com/search?q=org%3Aartsy+install-from-caller&type=code
The three repos still on Yarn 1 (fresnel, palette, positron) all use danger-yarn.yml, but that workflow doesn't pass install-from-caller, so it defaults to false, meaning it installs from .tooling (duchamp's own Yarn 4 deps), never touching the caller's lockfile.
Upgrades this repo from Yarn 1 (classic) to Yarn 4 (Berry). This is the proper fix for the CI failures introduced in #76 — every attempt to invoke Yarn 1 in a Corepack-enabled environment routed back to the globally installed Yarn 4, making compatibility workarounds unworkable.
Changes:
package.json: updatedpackageManagertoyarn@4.17.0yarn.lock: regenerated in Berry format.yarnrc.yml: new Yarn 4 config file (nodeLinker: node-modules,enableGlobalCache: true).gitignore: ignore.yarn/install-state.gzsetup-and-installaction: removed all Yarn version detection and workaround code — now justyarn install --immutableclaude-review.yml: updated--frozen-lockfileto--immutable🤖 Generated with Claude Code