Skip to content

Bundle the original pull request instead of its backport - #4465

Merged
Mpdreamz merged 6 commits into
mainfrom
feature/changelog-backports
Oct 15, 2026
Merged

Mpdreamz merged 6 commits into
mainfrom
feature/changelog-backports

Conversation

@Mpdreamz

Copy link
Copy Markdown
Member

When bundling a commit range, a pull request with a configured backport label is replaced by the pull request it was backported from. A Kibana 9.5.5 patch range now yields 48 entries instead of none.

Affects: Release notes, Configuration

Prompt summary: Release notes for a patch release are built from a commit range, and the range holds backports instead of the changes they copy. The bundler should trace each backport to its original pull request, so the entry, labels, and links come from where the change was authored. The behavior is opt-in per repository.

Why

A backport carries no release note and often excludes itself through create.exclude rules such as Kibana's backport rule. A patch range therefore resolves to no entries. Elasticsearch only works because the bundler infers an entry from the backport's own metadata, and links to the backport.

What

Opt-in setting

bundle.backports.labels lists exact label names. Glob characters are an error, because backport* also matches opt-out labels such as backport-skip. Without the setting, nothing changes.

Finding the original

BackportReferences reads a cherry picked from commit trailer, commit subjects, the title, and the body. GitHubBackportService resolves trailers and checks every candidate in batched GraphQL. A number counts only when it is a merged pull request on the default branch of the same repository. This drops issue numbers and links to other repositories. Reverts are never traced.

Range bundling

The range query now returns each pull request's title and labels. BackportTracer replaces labeled backports with their originals in order, merges duplicates, and keeps a backport whose original is not found. Create rules then run on the original. The run report gains a Backports section that lists traced and unresolved pull requests.

Verify

dotnet test tests/Elastic.Changelog.Tests/
dotnet test tests/Elastic.Documentation.Configuration.Tests/

Live check: release unified bundle current --products kibana with a Kibana changelog.yml that sets bundle.backports.labels: [backport] and GITHUB_TOKEN set. The run takes about 11 minutes.

Out of scope: Other changelog commands and the Kibana and Elasticsearch changelog.yml files. Each repository opts in with its own config.

🤖 Generated with Claude Code

When bundling a commit range, a pull request with a label listed in bundle.backports.labels is replaced by the pull request it was backported from. Kibana patch ranges produced no entries before, because backports carry no release note. The original is found through a cherry-pick trailer, commit subjects, the title, or the body, and only a merged pull request on the default branch counts. Repositories without the setting behave as before.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner October 14, 2026 19:10
@Mpdreamz
Mpdreamz requested a review from akira28 October 14, 2026 19:10
Review of the backport tracing found five ways it could drop a change or abort. The title no longer narrows the originals when a commit names another one. An oversized number is skipped instead of throwing. The commits and labels of a pull request are read page by page. Validation fails on any GraphQL error except NOT_FOUND.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A subject such as "Follow up on #10" mentions an earlier pull request and is not a cherry-picked change of its own, so it no longer adds #10 as an original. The validation test now injects its error into the validation query and asserts that query ran.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A backport of an already-squashed backport ends its subject with the original and the release-branch backport, for example "Second (#21) (#201)". Keeping only the last number lost #21 once validation dropped #201. The whole ending is kept now, and validation removes what is not an original.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Comment thread docs/data/release-notes/bundle.md Resolved

@theletterf theletterf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Mpdreamz and others added 2 commits October 15, 2026 09:21
The docs said reverts are never traced, which read as if they were left out of the bundle. They are only not replaced by an original; a revert keeps its own entry.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Skipping titles that start with Revert hid pull requests that belong in the release notes. A labeled pull request is now traced whatever its title. Handling reverts needs a mechanism of its own, so the title check and the title field it needed are removed.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz
Mpdreamz merged commit 864081e into main Oct 15, 2026
32 checks passed
@Mpdreamz
Mpdreamz deleted the feature/changelog-backports branch October 15, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants