Skip to content

Commit bbba2c4

Browse files
committed
Merge remote-tracking branch 'origin/v2/main' into v2/docs/5164-version-packages-link
Signed-off-by: cliffhall <[email protected]> # Conflicts: # RELEASING.md
2 parents 4a51981 + 7447bf5 commit bbba2c4

7 files changed

Lines changed: 305 additions & 47 deletions

File tree

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

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,18 @@ Then, on the PR:
205205
gh pr comment "$PR" --repo modelcontextprotocol/servers --body "Part of #$N"
206206
```
207207
2. **Wait for its CI to pass.** The workflow token's push starts no workflow,
208-
so the Version Packages workflow dispatches the TypeScript and Python
209-
workflows on `changeset-release/v2/main` after each update. A PR does not
210-
list dispatched checks, so the result shows as two commit statuses,
211-
`TypeScript (dispatched)` and `Python (dispatched)`. Closing and reopening
212-
the PR does not start them (that fires `pull_request`; they run on `push`).
213-
If neither status appears, run them by hand:
214-
`gh workflow run typescript.yml --ref changeset-release/v2/main` (and
215-
`python.yml`).
208+
so the Version Packages workflow dispatches the TypeScript, Python, DCO and
209+
Everything diff workflows on `changeset-release/v2/main` after each update.
210+
A PR does not list dispatched checks, so the result shows as four commit
211+
statuses: `TypeScript (dispatched)`, `Python (dispatched)`,
212+
`DCO (dispatched)` and `Everything diff (dispatched)`. The PR may also
213+
list `DCO signoff` and the diff as pending or failed with no jobs: GitHub
214+
holds the token's `pull_request` runs (#5173), so read the statuses
215+
instead. Closing and reopening the PR does not start the CI workflows
216+
(that fires `pull_request`; they run on `push`). If a status does not
217+
appear, dispatch its workflow by hand:
218+
`gh workflow run typescript.yml --ref changeset-release/v2/main` (or
219+
`python.yml`, `dco.yml`, `everything-mcp-diff.yml`).
216220
3. **Read it**: each bump matches the semver policy in `RELEASING.md`, each
217221
`CHANGELOG.md` entry says what a user of the server needs to know, the
218222
consumed changeset files are deleted, and `package-lock.json` records the
@@ -251,8 +255,9 @@ gh workflow run prepare-python-release.yml --repo modelcontextprotocol/servers \
251255

252256
It opens a PR that starts with `Closes #N`, on a branch named
253257
`v2/chore/<N>-python-calver-<date>`, labeled `v2`, and dispatches the
254-
TypeScript and Python workflows on that branch, as the Version Packages
255-
workflow does. Wait for its two `(dispatched)` statuses to pass, check that each stamped package really
258+
TypeScript, Python and DCO workflows on that branch, as the Version Packages
259+
workflow does (not the Everything diff, whose paths it never touches). Wait
260+
for its three `(dispatched)` statuses to pass, check that each stamped package really
256261
changed, and a maintainer merges it.
257262
No PR means no Python server has a shipped change since its last stamp.
258263

‎.github/workflows/dco.yml‎

Lines changed: 96 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,30 @@ name: DCO
1212
# are skipped: the only one is a milestone merge, whose commits were each
1313
# checked on their way into `v2/main`, and whose range reaches back past the
1414
# adoption of the rule.
15+
#
16+
# The version PRs that automation opens (Version Packages, Prepare Python
17+
# Release) are pushed and opened with the workflow token, whose events start no
18+
# run here: GitHub holds each one as `action_required`, or fails it with no
19+
# jobs (#5173). Their workflows dispatch this one on the PR's branch instead,
20+
# as they do the CI workflows (#5110). A dispatched run has no PR, so it checks
21+
# the default range, `origin/v2/main..<branch tip>`, which is what both version
22+
# PRs add, and the `dispatch-status` jobs below report it on the PR as a
23+
# commit status.
1524
on:
1625
pull_request:
1726
types: [opened, synchronize, reopened, edited]
1827
branches-ignore: [main]
28+
workflow_dispatch:
1929

20-
# Read-only, and handed no secret, so this job holds no credential and stays
21-
# outside the SHA-pin rule (`verify:action-pins`).
30+
# Read-only, and handed no secret but `GITHUB_TOKEN`, so no job here holds a
31+
# credential and each stays outside the SHA-pin rule (`verify:action-pins`).
2232
permissions:
2333
contents: read
2434

35+
# A dispatched run has no PR number, so it is grouped by its branch: a shared
36+
# empty group would let one version PR's run cancel the other's.
2537
concurrency:
26-
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
38+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2739
cancel-in-progress: true
2840

2941
jobs:
@@ -34,7 +46,7 @@ jobs:
3446
steps:
3547
- uses: actions/checkout@v6
3648
with:
37-
ref: ${{ github.event.pull_request.head.sha }}
49+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
3850
# The whole history, so both ends of the range and their merge base
3951
# are present.
4052
fetch-depth: 0
@@ -44,9 +56,86 @@ jobs:
4456
with:
4557
node-version: 24
4658

47-
# Node built-ins and git only, so no `npm ci`.
59+
# Node built-ins and git only, so no `npm ci`. A dispatched run checks
60+
# the script's default base (see the header).
4861
- name: Check every commit is signed off
4962
env:
50-
BASE_SHA: ${{ github.event.pull_request.base.sha }}
51-
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
63+
BASE_SHA: ${{ github.event.pull_request.base.sha || 'origin/v2/main' }}
64+
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
5265
run: npm run verify:dco -- --base "$BASE_SHA" --head "$HEAD_SHA"
66+
67+
# A dispatched run's checks are left out of the status rollup a pull request
68+
# reads, so on a dispatch these two jobs mirror the run onto the commit as a
69+
# status, as in typescript.yml (whose comments hold the reasoning): pending
70+
# at the start, then the result. A `pull_request` run skips both. Unlike
71+
# typescript.yml's (#5223), the pending job also stays silent when a newer
72+
# dispatched run exists, so a late or re-run older run cannot reset the
73+
# newer run's result to pending, which its own result job would then leave.
74+
dispatch-status-pending:
75+
name: Report the dispatched run as pending
76+
if: github.event_name == 'workflow_dispatch'
77+
timeout-minutes: 5
78+
runs-on: ubuntu-latest
79+
permissions:
80+
statuses: write
81+
# To look for a newer dispatched run of this workflow on the commit.
82+
actions: read
83+
steps:
84+
- name: Set the commit status to pending
85+
env:
86+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
GH_REPO: ${{ github.repository }}
88+
run: |
89+
# A re-run keeps its run ID, so a newer run means this one is
90+
# superseded and the status is no longer its to set.
91+
NEWER=$(gh run list --workflow dco.yml --event workflow_dispatch \
92+
--commit "$GITHUB_SHA" --json databaseId \
93+
--jq "[.[] | select(.databaseId > $GITHUB_RUN_ID)] | length") || NEWER=0
94+
if [ "${NEWER:-0}" -gt 0 ]; then
95+
echo "Superseded by a newer dispatched run, which reports instead"
96+
exit 0
97+
fi
98+
gh api "repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \
99+
-f state=pending -f context="DCO (dispatched)" \
100+
-f description="Dispatched run in progress" \
101+
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
102+
103+
dispatch-status:
104+
name: Report the dispatched run's result
105+
if: github.event_name == 'workflow_dispatch' && always()
106+
needs: [dispatch-status-pending, dco]
107+
timeout-minutes: 5
108+
runs-on: ubuntu-latest
109+
permissions:
110+
statuses: write
111+
# To look for a newer dispatched run of this workflow on the commit.
112+
actions: read
113+
steps:
114+
- name: Set the commit status to the run's result
115+
env:
116+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
GH_REPO: ${{ github.repository }}
118+
NEEDS: ${{ toJSON(needs) }}
119+
run: |
120+
# A run superseded by a newer dispatch on the same commit posts
121+
# nothing, whatever its jobs' results: the newer run owns the status
122+
# (#5178). A failed lookup counts as no newer run, so this run still
123+
# reports: a stale status is better than one left pending.
124+
NEWER=$(gh run list --workflow dco.yml --event workflow_dispatch \
125+
--commit "$GITHUB_SHA" --json databaseId \
126+
--jq "[.[] | select(.databaseId > $GITHUB_RUN_ID)] | length") || NEWER=0
127+
if [ "${NEWER:-0}" -gt 0 ]; then
128+
echo "Superseded by a newer dispatched run, which reports instead"
129+
exit 0
130+
fi
131+
if jq -e 'all(.[]; .result == "success" or .result == "skipped")' <<<"$NEEDS" >/dev/null; then
132+
STATE=success DESCRIPTION="Every commit is signed off"
133+
elif jq -e 'any(.[]; .result == "failure")' <<<"$NEEDS" >/dev/null; then
134+
STATE=failure DESCRIPTION="A commit is not signed off; open the run for details"
135+
else
136+
STATE=error DESCRIPTION="The run was cancelled; dispatch it again"
137+
fi
138+
gh api "repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \
139+
-f state="$STATE" -f context="DCO (dispatched)" \
140+
-f description="$DESCRIPTION" \
141+
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"

‎.github/workflows/everything-mcp-diff.yml‎

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
# reviewer. A diff that cannot run (a base that does not build, a server that
2727
# cannot be probed) does.
2828
#
29+
# The Version Packages PR is pushed and opened with the workflow token, whose
30+
# events start no `pull_request` run here: GitHub holds each one as
31+
# `action_required`, or fails it with no jobs (#5173). So the Version Packages
32+
# workflow dispatches this one on the PR's branch, as it does the CI workflows
33+
# (#5110), and the `dispatch-status` jobs report the dispatched run on the PR
34+
# as a commit status. The Prepare Python Release PR touches none of the paths
35+
# below, so it is not dispatched there.
36+
#
2937
# See: https://github.com/modelcontextprotocol/inspector/issues/1034
3038
name: Everything Server MCP Diff
3139

@@ -192,6 +200,84 @@ jobs:
192200
path: mcp-diff-report/
193201
if-no-files-found: ignore
194202

203+
# A dispatched run's checks are left out of the status rollup a pull request
204+
# reads, so on a dispatch these two jobs mirror the run onto the commit as a
205+
# status, as in typescript.yml (whose comments hold the reasoning): pending
206+
# at the start, then the result. Every other event skips both. Unlike
207+
# typescript.yml's (#5223), the pending job also stays silent when a newer
208+
# dispatched run exists, so a late or re-run older run cannot reset the
209+
# newer run's result to pending, which its own result job would then leave.
210+
dispatch-status-pending:
211+
name: Report the dispatched run as pending
212+
if: github.event_name == 'workflow_dispatch'
213+
timeout-minutes: 5
214+
runs-on: ubuntu-latest
215+
permissions:
216+
statuses: write
217+
# To look for a newer dispatched run of this workflow on the commit.
218+
actions: read
219+
steps:
220+
- name: Set the commit status to pending
221+
env:
222+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
223+
GH_REPO: ${{ github.repository }}
224+
run: |
225+
# A re-run keeps its run ID, so a newer run means this one is
226+
# superseded and the status is no longer its to set.
227+
NEWER=$(gh run list --workflow everything-mcp-diff.yml --event workflow_dispatch \
228+
--commit "$GITHUB_SHA" --json databaseId \
229+
--jq "[.[] | select(.databaseId > $GITHUB_RUN_ID)] | length") || NEWER=0
230+
if [ "${NEWER:-0}" -gt 0 ]; then
231+
echo "Superseded by a newer dispatched run, which reports instead"
232+
exit 0
233+
fi
234+
gh api "repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \
235+
-f state=pending -f context="Everything diff (dispatched)" \
236+
-f description="Dispatched run in progress" \
237+
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
238+
239+
# `comment` runs only on `pull_request`, so on a dispatch it is skipped,
240+
# which counts as passed; the report is in the run's summary and artifact.
241+
dispatch-status:
242+
name: Report the dispatched run's result
243+
if: github.event_name == 'workflow_dispatch' && always()
244+
needs: [dispatch-status-pending, diff, comment]
245+
timeout-minutes: 5
246+
runs-on: ubuntu-latest
247+
permissions:
248+
statuses: write
249+
# To look for a newer dispatched run of this workflow on the commit.
250+
actions: read
251+
steps:
252+
- name: Set the commit status to the run's result
253+
env:
254+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
255+
GH_REPO: ${{ github.repository }}
256+
NEEDS: ${{ toJSON(needs) }}
257+
run: |
258+
# A run superseded by a newer dispatch on the same commit posts
259+
# nothing, whatever its jobs' results: the newer run owns the status
260+
# (#5178). A failed lookup counts as no newer run, so this run still
261+
# reports: a stale status is better than one left pending.
262+
NEWER=$(gh run list --workflow everything-mcp-diff.yml --event workflow_dispatch \
263+
--commit "$GITHUB_SHA" --json databaseId \
264+
--jq "[.[] | select(.databaseId > $GITHUB_RUN_ID)] | length") || NEWER=0
265+
if [ "${NEWER:-0}" -gt 0 ]; then
266+
echo "Superseded by a newer dispatched run, which reports instead"
267+
exit 0
268+
fi
269+
if jq -e 'all(.[]; .result == "success" or .result == "skipped")' <<<"$NEEDS" >/dev/null; then
270+
STATE=success DESCRIPTION="The diff ran; the report is in the run's summary"
271+
elif jq -e 'any(.[]; .result == "failure")' <<<"$NEEDS" >/dev/null; then
272+
STATE=failure DESCRIPTION="The diff could not run; open the run for details"
273+
else
274+
STATE=error DESCRIPTION="The run was cancelled; dispatch it again"
275+
fi
276+
gh api "repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \
277+
-f state="$STATE" -f context="Everything diff (dispatched)" \
278+
-f description="$DESCRIPTION" \
279+
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
280+
195281
# Post (or update) a sticky PR comment so reviewers can see the diff without
196282
# navigating to the Actions tab. One comment per PR, found again by its
197283
# marker and edited on each push. This job checks nothing out and runs none

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
# token starts no workflow, so the PR would get no TypeScript or Python CI
1919
# (#5110); a close and reopen fires only `pull_request`, which those workflows
2020
# do not run on. So it dispatches both on the branch once the PR is open:
21-
# `workflow_dispatch` is the one event the workflow token can start.
21+
# `workflow_dispatch` is the one event the workflow token can start. DCO, a
22+
# `pull_request` workflow, gets no run from that token's events either (GitHub
23+
# holds it as `action_required`, #5173), so it is dispatched the same way. The
24+
# Everything diff is not: this PR touches none of the paths it runs on.
2225

2326
name: Prepare Python Release
2427

@@ -38,7 +41,7 @@ jobs:
3841
permissions:
3942
contents: write
4043
pull-requests: write
41-
# To dispatch the TypeScript and Python workflows on the PR's branch.
44+
# To dispatch the CI and DCO workflows on the PR's branch.
4245
actions: write
4346
steps:
4447
# The ref this was dispatched on becomes the PR's base, and every PR
@@ -108,7 +111,7 @@ jobs:
108111
echo "Generated by the **Prepare Python Release** workflow. Nothing is published until a maintainer publishes a GitHub Release."
109112
echo
110113
echo "> [!NOTE]"
111-
echo "> A push made with the workflow token starts no CI, so the workflow dispatched the TypeScript and Python workflows on this branch. Their results show on this PR as the \`TypeScript (dispatched)\` and \`Python (dispatched)\` statuses. To run them again: \`gh workflow run python.yml --ref $BRANCH\` (and \`typescript.yml\`)."
114+
echo "> A push made with the workflow token starts no CI, so the workflow dispatched the TypeScript, Python and DCO workflows on this branch. Their results show on this PR as the \`TypeScript (dispatched)\`, \`Python (dispatched)\` and \`DCO (dispatched)\` statuses. To run them again: \`gh workflow run python.yml --ref $BRANCH\` (and \`typescript.yml\`, \`dco.yml\`)."
112115
} > "$RUNNER_TEMP/pr-body.md"
113116
# A second run on the same day force-updates the branch, and may
114117
# stamp a different set of packages; the open PR's body is rewritten
@@ -128,6 +131,6 @@ jobs:
128131
# The push above starts no workflow (see the header), so CI is
129132
# dispatched on the branch explicitly, after a first run and a rerun
130133
# alike.
131-
for workflow in typescript.yml python.yml; do
134+
for workflow in typescript.yml python.yml dco.yml; do
132135
gh workflow run "$workflow" --ref "$BRANCH"
133136
done

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
# Python CI (#5110). Closing and reopening it does not help either: that fires
2020
# `pull_request`, and those workflows run on `push`. So after each update this
2121
# workflow dispatches both on the PR's branch; `workflow_dispatch` is the one
22-
# event the workflow token can start.
22+
# event the workflow token can start. The `pull_request` workflows, DCO and the
23+
# Everything diff, get no run from that token's events either (GitHub holds
24+
# them as `action_required`, #5173), so they are dispatched the same way.
2325
#
2426
# This workflow only ever opens a PR. It gives the action no publish script, so
2527
# it never publishes, tags or creates a Release; that is `release.yml`, on a
@@ -41,7 +43,7 @@ jobs:
4143
permissions:
4244
contents: write
4345
pull-requests: write
44-
# To dispatch the TypeScript and Python workflows on the PR's branch.
46+
# To dispatch the CI, DCO and Everything diff workflows on the PR's branch.
4547
actions: write
4648
steps:
4749
- uses: actions/checkout@v6
@@ -89,6 +91,6 @@ jobs:
8991
PR: ${{ steps.changesets.outputs.pr-number }}
9092
run: |
9193
BRANCH=$(gh pr view "$PR" --json headRefName --jq .headRefName)
92-
for workflow in typescript.yml python.yml; do
94+
for workflow in typescript.yml python.yml dco.yml everything-mcp-diff.yml; do
9395
gh workflow run "$workflow" --ref "$BRANCH"
9496
done

0 commit comments

Comments
 (0)