Skip to content

Commit c9aa5b8

Browse files
cliffhallclaude
andcommitted
docs: link the Version Packages PR to its release issue, not only by comment
The Version Packages PR is linked with addCloseIssueReferences as soon as it is found, carries Part of #N as its body's first line immediately before merging, and keeps the Part of #N comment as the durable record. Closes #5164 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
1 parent 8e643e1 commit c9aa5b8

3 files changed

Lines changed: 41 additions & 9 deletions

File tree

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

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,18 @@ ordinary PR first.
192192

193193
Then, on the PR:
194194

195-
1. **Tie it to the release issue with a comment**, `Part of #N`. The action
196-
rewrites the PR's body on every push to `v2/main`, so a `Closes` line there
197-
would not survive; this is the exception `AGENTS.md` names.
195+
1. **Link it to the release issue, and leave a comment.** The action rewrites
196+
the PR's body on every push to `v2/main`, so a `Closes` line there would
197+
not survive; this is the exception `AGENTS.md` names. The link lives
198+
outside the body, so make it now, with the `addCloseIssueReferences`
199+
mutation from `/pr-flow` (step 6), and read it back. On `v2/main` it closes
200+
nothing at merge. Then comment `Part of #N`, the textual record that every
201+
rewrite leaves alone:
202+
203+
```sh
204+
PR=<VERSION_PACKAGES_PR>
205+
gh pr comment "$PR" --repo modelcontextprotocol/servers --body "Part of #$N"
206+
```
198207
2. **Wait for its CI to pass.** The workflow token's push starts no workflow,
199208
so the Version Packages workflow dispatches the TypeScript and Python
200209
workflows on `changeset-release/v2/main` after each update. A PR does not
@@ -208,7 +217,25 @@ Then, on the PR:
208217
`CHANGELOG.md` entry says what a user of the server needs to know, the
209218
consumed changeset files are deleted, and `package-lock.json` records the
210219
new versions.
211-
4. A maintainer merges it.
220+
4. **Put `Part of #N` as the body's first line, immediately before the
221+
merge**, once nothing else will land on `v2/main` first: any push there
222+
regenerates the body and drops the line.
223+
224+
```sh
225+
BODY=$(mktemp)
226+
{ echo "Part of #$N"; echo
227+
gh pr view "$PR" --repo modelcontextprotocol/servers --json body --jq .body
228+
} > "$BODY"
229+
gh pr edit "$PR" --repo modelcontextprotocol/servers --body-file "$BODY"
230+
```
231+
232+
5. A maintainer merges it, **first checking the line is still the body's
233+
first**. If a push regenerated the body in between, repeat step 4:
234+
235+
```sh
236+
gh pr view "$PR" --repo modelcontextprotocol/servers \
237+
--json body --jq '.body | split("\n")[0]' # must print: Part of #N
238+
```
212239

213240
### 2c. The Python version stamps: "Prepare Python Release"
214241

‎AGENTS.md‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,16 @@ holds for a maintainer's own one-line fix as much as for a feature.
386386
workflow takes the release issue's number, writes `Closes #N` as the
387387
body's first line, names the branch `v2/chore/<N>-python-calver-<date>`
388388
and labels it `v2`.
389-
- The changesets **"Version Packages"** PR cannot carry a `Closes` line: the
389+
- The changesets **"Version Packages"** PR cannot keep a `Closes` line: the
390390
action rewrites its body on every push to `v2/main`, and its branch is the
391391
action's own (`changeset-release/v2/main`). The workflow labels it `v2`.
392-
Tie it to the release issue with a **comment** (`Part of #N`), which an
393-
update does not overwrite.
392+
It is still **linked** to the release issue like every other PR: with
393+
`addCloseIssueReferences` as soon as it is found, since the link lives
394+
outside the body and survives the rewrites (on `v2/main` it closes
395+
nothing at merge). Its body's first line becomes **`Part of #N`
396+
immediately before merging**, after the last regeneration, and is checked
397+
to still be there at merge. A `Part of #N` **comment** stays as the
398+
durable textual record, since an update does not overwrite it.
394399

395400
No other PR is exempt.
396401

‎RELEASING.md‎

Lines changed: 2 additions & 2 deletions
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 and Python 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)` and `Python (dispatched)`; wait for both to pass before merging. Closing and reopening the PR does not start them: that fires `pull_request`, and those workflows run on `push`. To run them again by hand: `gh workflow run typescript.yml --ref <branch>` (and `python.yml`). The Version Packages PR's body is rewritten on every push to `v2/main`, so it is tied to the release issue by a comment (`Part of #N`) instead of a body line. 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 and Python 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)` and `Python (dispatched)`; wait for both to pass before merging. Closing and reopening the PR does not start them: that fires `pull_request`, and those workflows run on `push`. To run them again by hand: `gh workflow run typescript.yml --ref <branch>` (and `python.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 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

@@ -77,7 +77,7 @@ A release ships one **milestone**. The step-by-step procedure, with its commands
7777
1. **A release issue**, `Release vX.Y.Z`, is filed for the milestone. Every PR below references it, and it stays open until the Release is published.
7878
2. **Preparation PRs land on `v2/main`**, each starting with `Closes #<release issue>`:
7979
- the **audit** (`npm audit`, and `pip-audit` over each Python server's locked requirements): the report goes on the release issue, and any fix it forces is its own commit in a PR;
80-
- the **Version Packages** PR (TypeScript), which references the release issue in a comment instead, because the changesets action rewrites its body;
80+
- the **Version Packages** PR (TypeScript), which is linked to the release issue with `addCloseIssueReferences` and a `Part of #N` comment, and gets `Part of #N` as its body's first line just before merging, because the changesets action rewrites its body on every push;
8181
- the **Prepare Python Release** PR (Python).
8282

8383
A milestone that touches both languages and needs an audit fix has all three. They are merged before the next step starts.

0 commit comments

Comments
 (0)