From 2ee6a2fc7cd71631b09f181577aa0051e222a213 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Mon, 17 Aug 2026 16:17:24 +0100 Subject: [PATCH] ci: stop fetching an unpinned Yarn before the pinned one Everywhere we build the JS, we asked Yarn to install itself twice: yarn set version berry yarn set version The first call fetches whichever release is "berry" today and the second immediately replaces it, so every build made two downloads to end up with one Yarn, and the one that could not be reproduced tomorrow was fetched first. That first fetch broke CI outright on 17 August 2026, during a GitHub incident, when it returned an empty body and Yarn 1 died writing it out: error TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView at writeFile (node:fs:2373:5) The unpinned call is dropped everywhere it appeared: Make.bat, the macOS and pip package builds, and the four workflows. The packaging scripts keep their pinned "yarn set version ${YARN_VERSION}", which still reads packageManager from package.json, so their behaviour is unchanged beyond losing a download. The workflows go further and use Corepack, which reads packageManager itself and provisions exactly that Yarn without writing .yarnrc.yml and .yarn/releases into the repository root, where the JS project is not. The Dockerfile already installed and enabled Corepack immediately before both "set version" calls, so both were redundant there and are simply removed. CONTRIBUTING.md and README.md already tell contributors to start with "corepack enable", so this brings the automation in line with the documented setup. Note that Corepack ships with Node.js only up to (but not including) 25.0.0, so it will need installing explicitly once the runners move past it, as the Dockerfile already does. --- .github/workflows/check-javascript-style.yml | 9 +++++---- .github/workflows/run-feature-tests-epas.yml | 9 +++++---- .github/workflows/run-feature-tests-pg.yml | 9 +++++---- .github/workflows/run-javascript-tests.yml | 9 +++++---- Dockerfile | 2 -- Make.bat | 2 -- pkg/mac/build-functions.sh | 2 -- pkg/pip/build.sh | 1 - 8 files changed, 20 insertions(+), 23 deletions(-) diff --git a/.github/workflows/check-javascript-style.yml b/.github/workflows/check-javascript-style.yml index 3d2845b9e6c..974501a1114 100644 --- a/.github/workflows/check-javascript-style.yml +++ b/.github/workflows/check-javascript-style.yml @@ -19,10 +19,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Upgrade yarn - run: | - yarn set version berry - yarn set version $(node -p "require('./web/package.json').packageManager.split('@')[1]") + # Corepack reads packageManager from web/package.json and provisions + # exactly that Yarn: a single pinned download, with nothing written + # into the checkout. + - name: Enable Corepack + run: corepack enable - name: Install Node modules run: | diff --git a/.github/workflows/run-feature-tests-epas.yml b/.github/workflows/run-feature-tests-epas.yml index 058612c1955..3d0442aa8d7 100644 --- a/.github/workflows/run-feature-tests-epas.yml +++ b/.github/workflows/run-feature-tests-epas.yml @@ -141,10 +141,11 @@ jobs: } EOF - - name: Upgrade yarn - run: | - yarn set version berry - yarn set version $(node -p "require('./web/package.json').packageManager.split('@')[1]") + # Corepack reads packageManager from web/package.json and provisions + # exactly that Yarn: a single pinned download, with nothing written + # into the checkout. + - name: Enable Corepack + run: corepack enable - name: Build the JS bundle run: | diff --git a/.github/workflows/run-feature-tests-pg.yml b/.github/workflows/run-feature-tests-pg.yml index 922d68ac3e8..90900ced5d0 100644 --- a/.github/workflows/run-feature-tests-pg.yml +++ b/.github/workflows/run-feature-tests-pg.yml @@ -151,10 +151,11 @@ jobs: } EOF - - name: Upgrade yarn - run: | - yarn set version berry - yarn set version $(node -p "require('./web/package.json').packageManager.split('@')[1]") + # Corepack reads packageManager from web/package.json and provisions + # exactly that Yarn: a single pinned download, with nothing written + # into the checkout. + - name: Enable Corepack + run: corepack enable - name: Build the JS bundle run: | diff --git a/.github/workflows/run-javascript-tests.yml b/.github/workflows/run-javascript-tests.yml index d38c146c126..6648aafc42e 100644 --- a/.github/workflows/run-javascript-tests.yml +++ b/.github/workflows/run-javascript-tests.yml @@ -28,10 +28,11 @@ jobs: - uses: actions/checkout@v4 - - name: Upgrade yarn - run: | - yarn set version berry - yarn set version $(node -p "require('./web/package.json').packageManager.split('@')[1]") + # Corepack reads packageManager from web/package.json and provisions + # exactly that Yarn: a single pinned download, with nothing written + # into the checkout. + - name: Enable Corepack + run: corepack enable - name: Install Node modules run: | diff --git a/Dockerfile b/Dockerfile index e6d7ecc9223..6d0bf273a93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,8 +42,6 @@ RUN --mount=type=bind,source=.git,target=/pgadmin4/.git \ export CPPFLAGS="-DPNG_ARM_NEON_OPT=0" && \ npm install -g corepack && \ corepack enable && \ - yarn set version berry && \ - yarn set version "$(node -p "require('./package.json').packageManager.split('@')[1]")" && \ yarn install && \ yarn run bundle && \ rm -rf yarn.lock \ diff --git a/Make.bat b/Make.bat index 99285c93505..817d266f5f6 100644 --- a/Make.bat +++ b/Make.bat @@ -227,7 +227,6 @@ REM Main build sequence Ends ECHO ERROR: Could not determine Yarn version from package.json packageManager field. EXIT /B 1 ) - CALL yarn set version berry || EXIT /B 1 CALL yarn set version %YARN_VERSION% || EXIT /B 1 CALL yarn install || EXIT /B 1 CALL npm rebuild || EXIT /B 1 @@ -288,7 +287,6 @@ REM Main build sequence Ends ECHO ERROR: Could not determine Yarn version from package.json packageManager field. EXIT /B 1 ) - CALL yarn set version berry || EXIT /B 1 CALL yarn set version %YARN_VERSION% || EXIT /B 1 CALL yarn workspaces focus --production || EXIT /B 1 diff --git a/pkg/mac/build-functions.sh b/pkg/mac/build-functions.sh index 16ce1804c01..c5174e98a1b 100644 --- a/pkg/mac/build-functions.sh +++ b/pkg/mac/build-functions.sh @@ -71,7 +71,6 @@ _build_runtime() { echo "ERROR: Could not determine Yarn version from package.json packageManager field." exit 1 fi - yarn set version berry yarn set version "${YARN_VERSION}" yarn workspaces focus --production @@ -308,7 +307,6 @@ _complete_bundle() { echo "ERROR: Could not determine Yarn version from package.json packageManager field." exit 1 fi - yarn set version berry yarn set version "${YARN_VERSION}" yarn install 2>&1 diff --git a/pkg/pip/build.sh b/pkg/pip/build.sh index a5623dea08d..395b5624b6c 100755 --- a/pkg/pip/build.sh +++ b/pkg/pip/build.sh @@ -61,7 +61,6 @@ if [ -z "${YARN_VERSION}" ]; then echo "ERROR: Could not determine Yarn version from package.json packageManager field." exit 1 fi -yarn set version berry yarn set version "${YARN_VERSION}" yarn install yarn run bundle