Skip to content

Commit e92e82f

Browse files
authored
Merge pull request #5147 from modelcontextprotocol/v2/chore/5068-node-matrix
ci: validate the TypeScript servers on Node 22, 24 and 26 in parallel
2 parents 3de22b0 + 0f1ac4f commit e92e82f

8 files changed

Lines changed: 28 additions & 16 deletions

File tree

‎.claude/skills/local-dev/SKILL.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Driving a running server with a client is `/client-smoke`; tests are
1414

1515
## Install and build
1616

17-
Node 22 for the TypeScript servers, and `uv` for the Python ones.
17+
Node 24 (the development version; 22 is the oldest supported) for the
18+
TypeScript servers, and `uv` for the Python ones.
1819

1920
```sh
2021
npm install # at the repo root: all four TypeScript workspaces

‎.github/workflows/typescript.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,28 @@ jobs:
7070
# `validate` (format:check -> lint -> typecheck -> build -> test). What no
7171
# leg covers — the root tooling and the cross-workspace guards — is the
7272
# root-guards job above; together they are the root `npm run validate`.
73+
#
74+
# Each package is also validated on every Node line it supports (#5068):
75+
# 22, the oldest supported, through 26. The `node` axis multiplies legs,
76+
# not steps, so the versions run side by side and the job takes no longer
77+
# than its slowest leg. The other jobs here stay on one Node, 22: the oldest
78+
# supported, so an API only newer Node has cannot slip in unnoticed.
7379
validate:
7480
timeout-minutes: 15
7581
needs: [detect-packages]
7682
strategy:
7783
fail-fast: false
7884
matrix:
7985
package: ${{ fromJson(needs.detect-packages.outputs.packages) }}
80-
name: Validate ${{ matrix.package }}
86+
node: [22, 24, 26]
87+
name: Validate ${{ matrix.package }} (Node ${{ matrix.node }})
8188
runs-on: ubuntu-latest
8289
steps:
8390
- uses: actions/checkout@v6
8491

8592
- uses: actions/setup-node@v7
8693
with:
87-
node-version: 22
94+
node-version: ${{ matrix.node }}
8895
cache: npm
8996

9097
# This package plus the root: run from a workspace directory, `npm ci`

‎AGENTS.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ opening paragraph instead, as this one does. A format with no comment syntax
9696

9797
## Development setup
9898

99-
Node **22** for the TypeScript servers. Python **>= 3.10** for the Python
100-
servers, at the version each server's `.python-version` pins. Python
99+
Node **24** for the TypeScript servers, the development version; Node **22**
100+
is the oldest supported, and CI validates each TypeScript server on 22, 24 and
101+
26 in parallel legs. Python **>= 3.10** for the Python servers, at the version each server's `.python-version` pins. Python
101102
dependencies are managed with **`uv`, never `pip`**.
102103

103104
```sh

‎docs/quality-gate.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ out; everything else points here.
1919
into parallel jobs on a fresh install; the gate runs them in sequence on your
2020
checkout. So a green gate means every check CI applies has already passed on
2121
your machine. It is the strongest predictor of a green CI there is here, though
22-
not a proof: CI runs on Linux, on a fresh `npm ci`, with Node 22 and each
23-
Python server's pinned interpreter.
22+
not a proof: CI runs on Linux, on a fresh `npm ci`, with Node 22 (the oldest
23+
supported) and each Python server's pinned interpreter, and `typescript.yml`'s
24+
`validate` job runs each TypeScript server on Node 22, 24 and 26, one parallel
25+
leg per version. The gate runs on whichever Node you have; use Node 24, the
26+
development version.
2427

2528
**There are two exceptions.** The first is the Windows legs (#1149): `test-windows` in both
2629
workflows runs each server's test suite (`npm test`, `pytest`) on a
@@ -48,7 +51,7 @@ in this order, and the first failure stops the run.
4851
| 1 | `verify:install-fresh` | Every package in `node_modules` is at the version `package-lock.json` records, and every `package.json` declares what the lockfile says it does | None needed: CI installs with `npm ci` |
4952
| 2 | `verify:dco` | Every commit in `origin/v2/main..HEAD` carries a `Signed-off-by:` trailer matching its author or committer (merge and bot commits exempt) | `dco.yml` → **DCO signoff**, over the pull request's `base.sha..head.sha` |
5053
| 3 | `validate` → `validate:guards` | The root guards, listed [below](#the-root-guards) | `typescript.yml` → **Root guards** |
51-
| 4 | `validate` → each workspace's `validate` | Per TypeScript server: `format:check`, `lint` (`--max-warnings 0`), `typecheck`, `build`, `test` | `typescript.yml` → **Validate \<server\>** (one leg each) |
54+
| 4 | `validate` → each workspace's `validate` | Per TypeScript server: `format:check`, `lint` (`--max-warnings 0`), `typecheck`, `build`, `test` | `typescript.yml` → **Validate \<server\> (Node \<n\>)** (one leg per server per Node: 22, 24 and 26, in parallel) |
5255
| 5 | `coverage` | Per TypeScript server: `vitest run --coverage`, failing when any file is below 90% on lines, statements, functions or branches | `typescript.yml` → **Coverage \<server\>** (one leg each) |
5356
| 6 | `validate:py` | Per Python server: `uv sync --locked`, `ruff check`, `ruff format --check`, `pyright`, `pytest`, `uv build` | `python.yml` → **Test \<server\>** (one leg each) |
5457
| 7 | `coverage:py` | Per Python server: `uv sync --locked`, then `uv run --frozen pytest --cov --cov-report=term-missing --cov-report=json`; then **every file** in `coverage.json` must reach **90% on lines and 90% on branches** | `python.yml` → **Coverage \<server\>** (one leg each) |

‎src/everything/Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.12-alpine AS builder
1+
FROM node:24-alpine AS builder
22

33
COPY src/everything /app
44
COPY tsconfig.json /tsconfig.json
@@ -7,7 +7,7 @@ WORKDIR /app
77

88
RUN --mount=type=cache,target=/root/.npm npm install
99

10-
FROM node:22-alpine AS release
10+
FROM node:24-alpine AS release
1111

1212
WORKDIR /app
1313

‎src/filesystem/Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.12-alpine AS builder
1+
FROM node:24-alpine AS builder
22

33
WORKDIR /app
44

@@ -10,7 +10,7 @@ RUN --mount=type=cache,target=/root/.npm npm install
1010
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
1111

1212

13-
FROM node:22-alpine AS release
13+
FROM node:24-alpine AS release
1414

1515
WORKDIR /app
1616

‎src/memory/Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.12-alpine AS builder
1+
FROM node:24-alpine AS builder
22

33
COPY src/memory /app
44
COPY tsconfig.json /tsconfig.json
@@ -9,7 +9,7 @@ RUN --mount=type=cache,target=/root/.npm npm install
99

1010
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
1111

12-
FROM node:22-alpine AS release
12+
FROM node:24-alpine AS release
1313

1414
COPY --from=builder /app/dist /app/dist
1515
COPY --from=builder /app/package.json /app/package.json

‎src/sequentialthinking/Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.12-alpine AS builder
1+
FROM node:24-alpine AS builder
22

33
COPY src/sequentialthinking /app
44
COPY tsconfig.json /tsconfig.json
@@ -9,7 +9,7 @@ RUN --mount=type=cache,target=/root/.npm npm install
99

1010
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
1111

12-
FROM node:22-alpine AS release
12+
FROM node:24-alpine AS release
1313

1414
COPY --from=builder /app/dist /app/dist
1515
COPY --from=builder /app/package.json /app/package.json

0 commit comments

Comments
 (0)