Skip to content

Commit b3f7149

Browse files
cliffhallclaude
andcommitted
fix(ci): keep the diff workflow's file name, read changed paths NUL-delimited
- GitHub dispatches only a workflow whose file is on the default branch, and both version workflows dispatch this one by file name from v2/main, so the rename to mcp-interface-diff.yml would break their dispatch until the next milestone merge. The file stays everything-mcp-diff.yml; its display name and status context still change. - git diff --name-only and ls-files C-quote a path holding a non-ASCII character, a tab or a newline, which then matched no server directory and passed with nothing to diff. Both now use -z. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent 03a1b6b commit b3f7149

10 files changed

Lines changed: 40 additions & 20 deletions

File tree

‎.claude/skills/release/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Then, on the PR:
216216
(that fires `pull_request`; they run on `push`). If a status does not
217217
appear, dispatch its workflow by hand:
218218
`gh workflow run typescript.yml --ref changeset-release/v2/main` (or
219-
`python.yml`, `dco.yml`, `mcp-interface-diff.yml`).
219+
`python.yml`, `dco.yml`, `everything-mcp-diff.yml`).
220220
3. **Read it**: each bump matches the semver policy in `RELEASING.md`, each
221221
`CHANGELOG.md` entry says what a user of the server needs to know, the
222222
consumed changeset files are deleted, and `package-lock.json` records the
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
# they do the CI workflows (#5110), and the `dispatch-status` jobs report the
4949
# dispatched run on the PR as a commit status.
5050
#
51+
# The file keeps its `everything-` name although it diffs every server: GitHub
52+
# dispatches only a workflow whose file exists on the default branch (`main`),
53+
# and both version workflows dispatch this one by file name from `v2/main`, so
54+
# renaming it here would break their dispatch until the next milestone merge.
55+
#
5156
# See: https://github.com/modelcontextprotocol/inspector/issues/1034
5257
name: MCP Interface Diff
5358

@@ -288,7 +293,7 @@ jobs:
288293
run: |
289294
# A re-run keeps its run ID, so a newer run means this one is
290295
# superseded and the status is no longer its to set.
291-
NEWER=$(gh run list --workflow mcp-interface-diff.yml --event workflow_dispatch \
296+
NEWER=$(gh run list --workflow everything-mcp-diff.yml --event workflow_dispatch \
292297
--commit "$GITHUB_SHA" --json databaseId \
293298
--jq "[.[] | select(.databaseId > $GITHUB_RUN_ID)] | length") || NEWER=0
294299
if [ "${NEWER:-0}" -gt 0 ]; then
@@ -324,7 +329,7 @@ jobs:
324329
# nothing, whatever its jobs' results: the newer run owns the status
325330
# (#5178). A failed lookup counts as no newer run, so this run still
326331
# reports: a stale status is better than one left pending.
327-
NEWER=$(gh run list --workflow mcp-interface-diff.yml --event workflow_dispatch \
332+
NEWER=$(gh run list --workflow everything-mcp-diff.yml --event workflow_dispatch \
328333
--commit "$GITHUB_SHA" --json databaseId \
329334
--jq "[.[] | select(.databaseId > $GITHUB_RUN_ID)] | length") || NEWER=0
330335
if [ "${NEWER:-0}" -gt 0 ]; then

‎.github/workflows/prepare-python-release.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
echo "Generated by the **Prepare Python Release** workflow. Nothing is published until a maintainer publishes a GitHub Release."
113113
echo
114114
echo "> [!NOTE]"
115-
echo "> A push made with the workflow token starts no CI, so the workflow dispatched the TypeScript, Python, DCO and interface diff workflows on this branch. Their results show on this PR as the \`TypeScript (dispatched)\`, \`Python (dispatched)\`, \`DCO (dispatched)\` and \`Interface diff (dispatched)\` statuses. To run them again: \`gh workflow run python.yml --ref $BRANCH\` (and \`typescript.yml\`, \`dco.yml\`, \`mcp-interface-diff.yml\`)."
115+
echo "> A push made with the workflow token starts no CI, so the workflow dispatched the TypeScript, Python, DCO and interface diff workflows on this branch. Their results show on this PR as the \`TypeScript (dispatched)\`, \`Python (dispatched)\`, \`DCO (dispatched)\` and \`Interface diff (dispatched)\` statuses. To run them again: \`gh workflow run python.yml --ref $BRANCH\` (and \`typescript.yml\`, \`dco.yml\`, \`everything-mcp-diff.yml\`)."
116116
} > "$RUNNER_TEMP/pr-body.md"
117117
# A second run on the same day force-updates the branch, and may
118118
# stamp a different set of packages; the open PR's body is rewritten
@@ -132,6 +132,6 @@ jobs:
132132
# The push above starts no workflow (see the header), so CI is
133133
# dispatched on the branch explicitly, after a first run and a rerun
134134
# alike.
135-
for workflow in typescript.yml python.yml dco.yml mcp-interface-diff.yml; do
135+
for workflow in typescript.yml python.yml dco.yml everything-mcp-diff.yml; do
136136
gh workflow run "$workflow" --ref "$BRANCH"
137137
done

‎.github/workflows/version-packages.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@ jobs:
9191
PR: ${{ steps.changesets.outputs.pr-number }}
9292
run: |
9393
BRANCH=$(gh pr view "$PR" --json headRefName --jq .headRefName)
94-
for workflow in typescript.yml python.yml dco.yml mcp-interface-diff.yml; do
94+
for workflow in typescript.yml python.yml dco.yml everything-mcp-diff.yml; do
9595
gh workflow run "$workflow" --ref "$BRANCH"
9696
done

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ servers/
6363
│ overview of how the rules, skills, gates and sweeps fit together
6464
├── .github/workflows/ typescript.yml, python.yml (per-package CI), release.yml (publishes on a GitHub Release),
6565
│ version-packages.yml (the changesets PR), prepare-python-release.yml (the CalVer PR),
66-
│ mcp-interface-diff.yml (each changed server's interface diff on PRs),
66+
│ everything-mcp-diff.yml (each changed server's interface diff on PRs),
6767
│ main-source.yml (a PR into main must bring nothing that is not on v2/main),
6868
│ and the scheduled sweeps that file issues: dependency-refresh.yml, dependabot-alerts.yml, sdk-watch.yml
6969
├── .github/ISSUE_TEMPLATE/ Bug and feature issue forms; config.yml routes security and new servers away

‎RELEASING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ node scripts/prepare-python-release.mjs # prints one "name: old -> new" line
3939
### PRs opened by these workflows
4040

4141
> [!NOTE]
42-
> Both workflows push their PR's branch with the workflow token, and a push made with that token starts no workflow, so each one then dispatches the TypeScript, Python, DCO and MCP interface diff workflows on that branch (`workflow_dispatch` is the one event the token can start). A PR does not list dispatched checks, so each dispatched run also reports itself on the PR's head commit as a status: `TypeScript (dispatched)`, `Python (dispatched)`, `DCO (dispatched)` and `Interface diff (dispatched)`; wait for them to pass before merging. Closing and reopening the PR does not start the CI workflows: that fires `pull_request`, and those run on `push`. The token's `pull_request` events do not run DCO or the diff either: GitHub holds those runs as `action_required` (#5173), so the PR may also list them as pending or failed with no jobs; the `(dispatched)` statuses are the results. To run one again by hand: `gh workflow run typescript.yml --ref <branch>` (or `python.yml`, `dco.yml`, `mcp-interface-diff.yml`). The Version Packages PR's body is rewritten on every push to `v2/main`, so it is linked to the release issue with `addCloseIssueReferences` (which lives outside the body), carries a `Part of #N` comment as its textual record, and gets `Part of #N` as its body's first line only immediately before it is merged. The Prepare Python Release PR keeps its `Closes #N` line and is linked to the release issue with `addCloseIssueReferences` too, as every PR into `v2/main` is. The repository setting **Settings → Actions → General → Allow GitHub Actions to create and approve pull requests** must be on, or the workflows fail at the step that opens the PR.
42+
> Both workflows push their PR's branch with the workflow token, and a push made with that token starts no workflow, so each one then dispatches the TypeScript, Python, DCO and MCP interface diff workflows on that branch (`workflow_dispatch` is the one event the token can start). A PR does not list dispatched checks, so each dispatched run also reports itself on the PR's head commit as a status: `TypeScript (dispatched)`, `Python (dispatched)`, `DCO (dispatched)` and `Interface diff (dispatched)`; wait for them to pass before merging. Closing and reopening the PR does not start the CI workflows: that fires `pull_request`, and those run on `push`. The token's `pull_request` events do not run DCO or the diff either: GitHub holds those runs as `action_required` (#5173), so the PR may also list them as pending or failed with no jobs; the `(dispatched)` statuses are the results. To run one again by hand: `gh workflow run typescript.yml --ref <branch>` (or `python.yml`, `dco.yml`, `everything-mcp-diff.yml`). The Version Packages PR's body is rewritten on every push to `v2/main`, so it is linked to the release issue with `addCloseIssueReferences` (which lives outside the body), carries a `Part of #N` comment as its textual record, and gets `Part of #N` as its body's first line only immediately before it is merged. The Prepare Python Release PR keeps its `Closes #N` line and is linked to the release issue with `addCloseIssueReferences` too, as every PR into `v2/main` is. The repository setting **Settings → Actions → General → Allow GitHub Actions to create and approve pull requests** must be on, or the workflows fail at the step that opens the PR.
4343
4444
## How publishing works
4545

‎docs/quality-gate.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ out; everything else points here.
1313
| --- | --- | --- | --- |
1414
| Inner loop | `npm run validate -w src/<server>`, `npm run validate:py -- <server>` | Your machine | While iterating on one server |
1515
| Pre-push gate | `npm run local:gate` | Your machine, under a lease | Before every push |
16-
| CI | `.github/workflows/typescript.yml`, `python.yml`, `mcp-interface-diff.yml`; `dco.yml`; `main-source.yml` | GitHub, on every push and pull request (`mcp-interface-diff.yml` diffs only the servers the change touches); `dco.yml` on pull requests only; `main-source.yml` on pull requests into `main` only, and not mirrored by a gate stage, since no local push targets `main` | Before merge |
16+
| CI | `.github/workflows/typescript.yml`, `python.yml`, `everything-mcp-diff.yml`; `dco.yml`; `main-source.yml` | GitHub, on every push and pull request (`everything-mcp-diff.yml` diffs only the servers the change touches); `dco.yml` on pull requests only; `main-source.yml` on pull requests into `main` only, and not mirrored by a gate stage, since no local push targets `main` | Before merge |
1717

1818
**`npm run local:gate` runs every check CI runs.** CI splits the same checks
1919
into parallel jobs on a fresh install; the gate runs them in sequence on your
@@ -57,7 +57,7 @@ in this order, and the first failure stops the run.
5757
| 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) |
5858
| 8 | `verify:skills:cli` | `claude plugin validate` on `.claude/skills`, at the pinned CLI version | `typescript.yml` → **Root guards** |
5959
| 9 | `smoke` | Every server boots over each transport it implements and answers one tool call | `typescript.yml` → **Boot smoke** |
60-
| 10 | `interface-diff` | For each server the change touches, its MCP interface (capabilities, tools, prompts, resources, resource templates) in this checkout's build, diffed against the same server built from the base. It fails only when a diff cannot run; a changed interface is reported, not failed | `mcp-interface-diff.yml` → **Choose the servers to diff**, then **Diff \<server\>** (one leg each, and a PR comment each) |
60+
| 10 | `interface-diff` | For each server the change touches, its MCP interface (capabilities, tools, prompts, resources, resource templates) in this checkout's build, diffed against the same server built from the base. It fails only when a diff cannot run; a changed interface is reported, not failed | `everything-mcp-diff.yml` → **Choose the servers to diff**, then **Diff \<server\>** (one leg each, and a PR comment each) |
6161

6262
Notes on the stages:
6363

‎scripts/interface-diff.mjs‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// `scripts/lib/workflow-gate.test.mjs` derives that from the npm scripts a
2525
// workflow invokes. A check behind an action is invisible to it; a check
2626
// behind `npm run interface-diff` is enforced by it. CI
27-
// (`mcp-interface-diff.yml`) and the gate run this same file.
27+
// (`everything-mcp-diff.yml`) and the gate run this same file.
2828
// - The tool comes in as an exact-pinned root devDependency, so it is held
2929
// by `package-lock.json`'s integrity hash, the way every other npm
3030
// dependency here is, and no third-party action runs in CI at all.
@@ -345,7 +345,10 @@ function resolveBase(base) {
345345
* lockfile on each side (`null` where there is none).
346346
*/
347347
function changesSince(sha) {
348-
const lines = (text) => text.split("\n").filter(Boolean);
348+
// NUL-delimited, so a path holding a non-ASCII character, a tab or a
349+
// newline comes back as written rather than C-quoted (`"src/time/…`), which
350+
// would match no server's directory.
351+
const paths = (text) => text.split("\0").filter(Boolean);
349352
let baseLock = null;
350353
try {
351354
baseLock = JSON.parse(git("show", `${sha}:package-lock.json`));
@@ -355,8 +358,20 @@ function changesSince(sha) {
355358
const headFile = path.join(repoRoot, "package-lock.json");
356359
return {
357360
changedFiles: [
358-
...lines(git("diff", "--name-only", "--no-renames", sha)),
359-
...lines(git("ls-files", "--others", "--exclude-standard")),
361+
...paths(
362+
run(
363+
"git",
364+
["diff", "--name-only", "--no-renames", "-z", sha],
365+
repoRoot,
366+
),
367+
),
368+
...paths(
369+
run(
370+
"git",
371+
["ls-files", "--others", "--exclude-standard", "-z"],
372+
repoRoot,
373+
),
374+
),
360375
],
361376
baseLock,
362377
headLock: existsSync(headFile)

‎scripts/lib/interface-diff-servers.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The servers the MCP interface diff covers, how each is started for it, and
22
// which of them a change touches (#5428).
33
//
4-
// Two things live here, both shared by CI (`mcp-interface-diff.yml`) and the
4+
// Two things live here, both shared by CI (`everything-mcp-diff.yml`) and the
55
// pre-push gate through `scripts/interface-diff.mjs`, so the two always agree
66
// on what to diff:
77
//
@@ -68,7 +68,7 @@ export const TOOLING_PATHS = [
6868
"scripts/interface-diff.mjs",
6969
"scripts/lib/interface-diff-servers.mjs",
7070
"scripts/lib/win-shell-args.mjs",
71-
".github/workflows/mcp-interface-diff.yml",
71+
".github/workflows/everything-mcp-diff.yml",
7272
];
7373

7474
/** Root files every TypeScript server's build reads. */

‎scripts/version-pr-ci.test.mjs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// The Version Packages and Prepare Python Release workflows push their PR
55
// branches with the workflow token, which starts no workflow (GitHub holds a
66
// `pull_request` run as `action_required`), so they dispatch `typescript.yml`,
7-
// `python.yml`, `dco.yml` and `mcp-interface-diff.yml` on the branch instead. A dispatched run's checks are left out of the
7+
// `python.yml`, `dco.yml` and `everything-mcp-diff.yml` on the branch instead. A dispatched run's checks are left out of the
88
// status rollup a pull request reads, so each dispatched workflow also mirrors
99
// its run onto the commit as a status. Both version workflows run only from `v2/main`, so nothing
1010
// exercises this path before a release needs it; if any link here breaks,
@@ -48,7 +48,7 @@ const CI = [
4848
trigger: "pull_request",
4949
},
5050
{
51-
file: "mcp-interface-diff.yml",
51+
file: "everything-mcp-diff.yml",
5252
context: "Interface diff (dispatched)",
5353
trigger: "pull_request",
5454
},
@@ -63,7 +63,7 @@ const VERSION_WORKFLOWS = [
6363
"typescript.yml",
6464
"python.yml",
6565
"dco.yml",
66-
"mcp-interface-diff.yml",
66+
"everything-mcp-diff.yml",
6767
],
6868
},
6969
{
@@ -73,7 +73,7 @@ const VERSION_WORKFLOWS = [
7373
"typescript.yml",
7474
"python.yml",
7575
"dco.yml",
76-
"mcp-interface-diff.yml",
76+
"everything-mcp-diff.yml",
7777
],
7878
},
7979
];

0 commit comments

Comments
 (0)