Skip to content

Commit 64e7520

Browse files
committed
fix(deploy): drop yarn set version berry from setup step
The Setup Yarn2 step hard-coded `yarn set version berry` before `yarn install --immutable`. This forces the latest 4.x release and overrides whatever `packageManager` field the consumer has pinned. When a consumer is on an older yarn (e.g. 4.14.x with yarn.lock metadata `version: 9`) and `berry` resolves to 4.16.0 (which uses metadata `version: 10`), `yarn install --immutable` then refuses to write the metadata bump and the workflow fails: YN0028: │ - version: 9 YN0028: │ + version: 10 YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden. Causes a self-failure too: the self-tests on this repo use the `samplePythonProject*` fixtures which pin `yarn@4.14.1` with v9 lockfiles. The PR-test job for #55 was failing for exactly this reason — has nothing to do with the smoketest changes in the parent commits. Fix: drop the `yarn set version berry` line. Corepack already respects the `packageManager` field in package.json, so consumers keep their pin. Consumers can use any yarn 4.x (or upgrade to yarn 5 in future) without needing to wait for a workflow update. Applies to both `deploy-to-aws-uv.yml` and `deploy-to-aws.yml`.
1 parent 901f126 commit 64e7520

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/deploy-to-aws-uv.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,12 @@ jobs:
137137
- name: Setup Yarn2 package manager, install and list dependencies
138138
run: |
139139
corepack enable
140-
yarn set version berry
140+
# `yarn set version berry` was previously hard-coded here, but it
141+
# forces the latest 4.x and overrides the consumer's `packageManager`
142+
# pin. When the consumer is on a yarn whose lockfile metadata is
143+
# older than the latest, `yarn install --immutable` then refuses to
144+
# write the metadata bump and the workflow fails. Corepack already
145+
# respects the `packageManager` field in package.json.
141146
yarn install --immutable
142147
yarn info
143148

.github/workflows/deploy-to-aws.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ jobs:
141141
- name: Setup Yarn2 package manager, install and list dependencies
142142
run: |
143143
corepack enable
144-
yarn set version berry
144+
# `yarn set version berry` was previously hard-coded here, but it
145+
# forces the latest 4.x and overrides the consumer's `packageManager`
146+
# pin. When the consumer is on a yarn whose lockfile metadata is
147+
# older than the latest, `yarn install --immutable` then refuses to
148+
# write the metadata bump and the workflow fails. Corepack already
149+
# respects the `packageManager` field in package.json.
145150
yarn install --immutable
146151
yarn info
147152

0 commit comments

Comments
 (0)