You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a backported change up with the pull request it came from
The Backports section explains what `-x` buys — that the changelog
reaches the pull request the change was written and reviewed in — but
not what the entry ends up looking like, so the annotation naming the
backport was rediscovered while preparing 4.1.3, and got it wrong first.
`gem:changelog` now prints the form rather than leaving it to be
remembered. It already had both halves: `changelog_origins` resolves the
`-x` trailer to where the change was written, and the `fallbacks` path
already looked the cherry-pick's own pull request up, calling it in
passing "at least the backport that brought it here". Both ends are now
asked for together — one query rather than two, since the second was
only ever a retry — and the cherry-pick's becomes the entry's second
link instead of being discarded.
A backport also stops appearing beside the entries it carried. Its merge
commit is in the history too and has no `-x` trailer to resolve, so it
read as an ordinary commit of its own pull request: dispatching this on
the 4.1.3 cycle listed #3076 as a change of its own, above the entry it
annotates. A backport is how a change arrived rather than a change, so
the ones that annotate something are dropped from the list.
On the development line there are no origins, so entries keep the single
link they have today. A backport carrying several changes at once falls
out of the same handling: each entry names its own origin and shares the
one backport link, which is what 4.0.3 should have looked like.
docs/release.md loses the procedure it carried for assembling the
changelog by hand, which existed because the task could not run from a
Claude Code on the web session. `changelog.yml` runs it on a runner now,
so the section says to dispatch that instead — and the traps it
documented, all of them about hand-rolling the match, go with it. What
replaces them is the one thing the workflow adds: the ref picks the copy
of the task as well as the history, so a release branch needs the file
on it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QAgPhpLrU9Z4bENCR9RUub
Sorting them into sections needs the changed files, which `gem:changelog:json` would have supplied:
284
-
`pull_request_read` with `get_files` per pull request, or `get` for the body.
285
-
286
-
Four things about that matching, the first of which is a trap:
287
-
288
-
-**Do not read the numbers from `Merge pull request #N` commit subjects.** It looks like it works
289
-
on this repository, and it silently loses pull requests. Applying the path filter the task uses
290
-
(`git log --full-history --simplify-merges -- . ':(exclude)rust'`) drops the merge commits while
291
-
keeping the commits they merged, so on the 4.1.2 cycle five of the eight numbers disappeared with
292
-
them. A squashed or rebased pull request never writes that subject at all. Matching `head.sha`
293
-
has neither failure mode.
294
-
-`head.sha` is in the history because this repository merges pull requests with merge commits. A
295
-
squashed or rebased one would need its `merge_commit_sha`, which the listing does not carry.
296
-
- The listing reports `merged: false` for pull requests that are merged — the field is not
297
-
populated by that endpoint. Read `merged_at` instead.
298
-
- On a release branch the commits are cherry-picks, so resolve the `(cherry picked from commit
299
-
<sha>)` trailer first and match the recorded origin, as `changelog_origins` does. Matching the
300
-
cherry-pick itself attributes every backport to the pull request that carried it.
301
-
302
-
Pull requests confined to `rust/` are left out too, which the task does by filtering the commits in
303
-
step 2 with `-- . ':(exclude)rust'`. Leave step 2 unfiltered here and drop those pull requests by
304
-
their `get_files` instead. The filter decides which commits are listed, and a pull request is found
305
-
by one specific commit — its head — so a pull request whose last commit happens to touch only
306
-
`rust/` would lose that head and disappear even though the rest of it belongs in the changelog.
307
-
Matching against every commit and filtering afterwards cannot go wrong that way.
274
+
| Input | Value |
275
+
| --- | --- |
276
+
| The ref selector | The branch the changelog is for: `aaa-X.Y.x` for a patch release, `master` otherwise |
277
+
|`version`| Where the changelog starts, when that should not follow `RBS::VERSION`. It names the release before the one being written, so `4.1.2` produces the 4.1.3 changelog |
278
+
|`format`|`list` for the template, `json` for the pull request details the sections are sorted from |
279
+
280
+
The ref is not incidental the way it is for `release-gems.yml`: it picks the history being
281
+
described *and* the copy of the task that describes it. So a release branch needs `changelog.yml`
282
+
on it, the same way it needs the release tasks — dispatching on a ref without the file fails with
283
+
`Workflow does not have 'workflow_dispatch' trigger`, since the trigger is read from the ref.
0 commit comments