From 85c4b42edf76fd5f21b2ad77fcab4cc7cd3dd9d7 Mon Sep 17 00:00:00 2001 From: george larson Date: Sat, 29 Aug 2026 13:42:59 +0000 Subject: [PATCH] chore(ci): standardise every workflow on Node 24 via .nvmrc Every setup-node step hardcoded its own Node literal across six workflow files, so each bump meant six synchronised edits and the CI job matrix ran twice, once on 22.12 and once on 24.x. All of them now read a single .nvmrc containing 24, and the test job's two-entry matrix is removed rather than reduced to one element. The next bump is one file. The suite already passes on Node 24.20.0: 18 suites, 309 tests. The 22.12 floor was also fiction in practice, since 63 packages in package-lock.json declare engines.node above it (the eslint set wants ^20.19.0 || ^22.13.0 || >=24, @hey-api/* wants >=22.18.0). npm-publish.yml keeps its explicit npm upgrade. The bundled npm is not reliably new enough for trusted publishing: Node 24.0.0 shipped npm 11.3.0, under the 11.5.1 floor, and .nvmrc floats across the 24.x line. Its comment said "Node 22 bundles npm 10.x" and is updated to say why the step still earns its place. --- .../workflows/agent-server-sdk-main-audit.yml | 4 ++-- .github/workflows/ci.yml | 24 ++++++++----------- .github/workflows/endpoint-audit.yml | 4 ++-- .github/workflows/integration-tests.yml | 8 +++---- .github/workflows/npm-publish.yml | 12 ++++++---- .github/workflows/publish-github-packages.yml | 2 +- .nvmrc | 1 + CONTRIBUTING.md | 2 +- 8 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/agent-server-sdk-main-audit.yml b/.github/workflows/agent-server-sdk-main-audit.yml index e61c452..02888f6 100644 --- a/.github/workflows/agent-server-sdk-main-audit.yml +++ b/.github/workflows/agent-server-sdk-main-audit.yml @@ -64,10 +64,10 @@ jobs: --output "$RUNNER_TEMP/sdk-main-openapi.json" ) - - name: Use Node.js 22.12 + - name: Use Node.js uses: actions/setup-node@v6 with: - node-version: 22.12 + node-version-file: .nvmrc cache: 'npm' - name: Install client dependencies diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d4645c..19a6d1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Use Node.js 22.12 + - name: Use Node.js uses: actions/setup-node@v6 with: - node-version: 22.12 + node-version-file: .nvmrc cache: 'npm' - name: Install dependencies @@ -36,10 +36,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Use Node.js 22.12 + - name: Use Node.js uses: actions/setup-node@v6 with: - node-version: 22.12 + node-version-file: .nvmrc cache: 'npm' - name: Install dependencies @@ -54,18 +54,14 @@ jobs: test: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [22.12, 24.x] - steps: - name: Checkout code uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js uses: actions/setup-node@v6 with: - node-version: ${{ matrix.node-version }} + node-version-file: .nvmrc cache: 'npm' - name: Install dependencies @@ -91,10 +87,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Use Node.js 22.x + - name: Use Node.js uses: actions/setup-node@v6 with: - node-version: 22.x + node-version-file: .nvmrc cache: 'npm' - name: Install dependencies @@ -117,10 +113,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Use Node.js 22.x + - name: Use Node.js uses: actions/setup-node@v6 with: - node-version: 22.x + node-version-file: .nvmrc cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/endpoint-audit.yml b/.github/workflows/endpoint-audit.yml index 19ad66d..6d0fc6d 100644 --- a/.github/workflows/endpoint-audit.yml +++ b/.github/workflows/endpoint-audit.yml @@ -23,10 +23,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Use Node.js 22.x + - name: Use Node.js uses: actions/setup-node@v6 with: - node-version: 22.x + node-version-file: .nvmrc cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 5abcb8b..44abf71 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -26,10 +26,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Use Node.js 22.x + - name: Use Node.js uses: actions/setup-node@v6 with: - node-version: 22.x + node-version-file: .nvmrc cache: 'npm' - name: Install dependencies @@ -156,10 +156,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Use Node.js 22.x + - name: Use Node.js uses: actions/setup-node@v6 with: - node-version: 22.x + node-version-file: .nvmrc cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 3deda7e..41892fc 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -38,18 +38,20 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - # Trusted publishing requires Node 22.14.0+ and npm 11.5.1+ + # Trusted publishing requires npm 11.5.1+ # See: https://docs.npmjs.com/trusted-publishers/ - name: Set up Node.js for npm trusted publishing uses: actions/setup-node@v6 with: - node-version: '22' + node-version-file: .nvmrc cache: npm registry-url: https://registry.npmjs.org - # Node 22 bundles npm 10.x, but trusted publishing (OIDC) needs npm - # 11.5.1+. setup-node does not upgrade the bundled npm, so do it - # explicitly — without this the version guard below always fails. + # The bundled npm is not reliably new enough: Node 24.0.0 shipped npm + # 11.3.0, below the 11.5.1 that trusted publishing (OIDC) needs, and + # .nvmrc floats across the 24.x line. setup-node does not upgrade the + # bundled npm, so do it explicitly. Without this the version guard + # below fails on any runner that resolves to an early enough 24.x. - name: Upgrade npm for trusted publishing run: npm install -g npm@latest diff --git a/.github/workflows/publish-github-packages.yml b/.github/workflows/publish-github-packages.yml index 3697291..2b61de8 100644 --- a/.github/workflows/publish-github-packages.yml +++ b/.github/workflows/publish-github-packages.yml @@ -33,7 +33,7 @@ jobs: - name: Setup Node.js for GitHub Packages uses: actions/setup-node@v6 with: - node-version: 22.x + node-version-file: .nvmrc cache: 'npm' registry-url: 'https://npm.pkg.github.com' scope: '@openhands' diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..a45fd52 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e5571c1..030385c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ OpenHands Agent Server. ### Prerequisites -- Node.js 22.12+ +- Node.js 24+ - npm 10+ ### Install dependencies