From 4bd92ab592be92b6c92541e565590d71f414d6bf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 22:50:48 +0000 Subject: [PATCH 1/3] Initial plan From 70a8497022718be66daf005d0e38cddfc6942d90 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 22:52:47 +0000 Subject: [PATCH 2/3] fix: trigger create-release-pr on any push to master/alpha, not just packages/** Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --- .github/workflows/create-release-pr.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 4dbe932dd..12707ad29 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -11,9 +11,6 @@ on: branches: - master - alpha - # Only trigger for commits that touch package source files. - paths: - - 'packages/**' permissions: contents: write From 6b0f7e8aba7a311c555d7787cdabfa4da342317b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 23:46:38 +0000 Subject: [PATCH 3/3] fix: update packageManager to pnpm@9.15.9 to match lockfileVersion 9.0 Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> --- package.json | 2 +- scripts/test-release-automation.js | 45 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index db8e48205..4b52abba5 100644 --- a/package.json +++ b/package.json @@ -35,5 +35,5 @@ "playwright": "1.50.1", "semver": "^6.3.1" }, - "packageManager": "pnpm@8.15.0" + "packageManager": "pnpm@9.15.9" } diff --git a/scripts/test-release-automation.js b/scripts/test-release-automation.js index 02141bd2b..94a222022 100644 --- a/scripts/test-release-automation.js +++ b/scripts/test-release-automation.js @@ -788,6 +788,51 @@ test('alpha version bump needed: commit created for alpha release branch', () => } }); +// ---------------------------------------------------------------------------- +// Section 7 — pnpm version / lockfile compatibility +// +// Guards against the recurring breakage where a contributor regenerates +// pnpm-lock.yaml with a newer pnpm but forgets to update the "packageManager" +// field in package.json. When the two are out of sync, pnpm/action-setup@v4 +// installs the (stale) version from packageManager, which then rejects the +// lockfile with ERR_PNPM_NO_LOCKFILE and the entire workflow fails. +// +// Compatibility rule (based on pnpm changelog): +// lockfileVersion 6.x → generated by pnpm 6/7/8 (pnpm <9 cannot read v9) +// lockfileVersion 9.x → generated by pnpm 9+; pnpm 8 treats it as absent +// ---------------------------------------------------------------------------- + +section('7. pnpm version / lockfile compatibility'); + +test('packageManager in package.json is compatible with pnpm-lock.yaml lockfileVersion', () => { + const rootPkg = JSON.parse(fs.readFileSync(path.join(ROOT_DIR, 'package.json'), 'utf8')); + const packageManager = rootPkg.packageManager || ''; + + const pmMatch = packageManager.match(/^pnpm@(\d+)\./); + assert.ok( + pmMatch, + `packageManager field should be "pnpm@X.Y.Z", got: "${packageManager}"`, + ); + const pnpmMajor = parseInt(pmMatch[1], 10); + + const lockfilePath = path.join(ROOT_DIR, 'pnpm-lock.yaml'); + const lockfileContent = fs.readFileSync(lockfilePath, 'utf8'); + const lockVersionMatch = lockfileContent.match(/^lockfileVersion:\s+'?(\d+)/m); + assert.ok(lockVersionMatch, 'Could not find lockfileVersion in pnpm-lock.yaml'); + const lockfileMajor = parseInt(lockVersionMatch[1], 10); + + // lockfileVersion 9 was introduced in pnpm 9. pnpm 8 ignores it entirely + // (ERR_PNPM_NO_LOCKFILE), which is what broke create-release-pr.yml. + if (lockfileMajor >= 9) { + assert.ok( + pnpmMajor >= 9, + `pnpm-lock.yaml uses lockfileVersion ${lockVersionMatch[1]} which requires pnpm 9+, ` + + `but packageManager is "${packageManager}". ` + + `Update packageManager in package.json to match the pnpm version used to generate the lockfile.`, + ); + } +}); + // ============================================================================ // Summary // ============================================================================