fix(xtask): stop changelog gen over-capturing in-title #N cross-references#5924
Merged
Conversation
…log gen extract_pr_numbers grepped every #N on a oneline subject, so in-title cross-references (issue refs like 'fixes #5740', prior-PR refs like 'post-#5053', and 'part N of M' markers like '(#2)') were treated as their own PRs and fed to 'gh pr view', pulling unrelated ancient or unmerged PRs into the generated release notes. A squash merge always appends the PR reference as the trailing (#N) of the subject, so parse only the last match per line. Split the parsing into a pure parse_pr_numbers helper with unit coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
xtaskchangelog generator pulling unrelated, ancient, or unmerged PRs into release notes.extract_pr_numbersrangit log --oneline <range>and grepped the whole output with#(\d+), collecting every match.A GitHub squash merge carries the merge-PR reference as the trailing
(#N)of the subject; any earlier#Nis an in-title cross-reference — an issue (fixes #5740), a prior PR (post-#5053), or a "part N of M" marker ((#2)) — not the PR that introduced the commit.Those got captured and fed to
gh pr view, which resolved to whatever ancient/unmerged PR owned the low number.Observed while regenerating the
v2026.5.30-beta.15changelog overv2026.5.28-beta.14..HEAD:#2,#6,#10, and#5053were spuriously resolved (#2/#6are unmerged dependabot PRs,#10is not a PR), surfacing as bogus entries and bogus contributor credit.Change
#Nper subject line — the squash-merge PR number.extract_pr_numbersinto a pureparse_pr_numbers(&str)helper so it is unit-testable without a git fixture.Verification
cargo test -p xtask changelog::tests::— 6/6 pass (trailing-ref capture, in-title cross-reference rejection, merge-commit subjects, no-ref lines, dedup/sort, empty input).cargo clippy -p xtask --all-targets -- -D warnings— clean.cargo fmt -p xtask -- --check— clean.Closes #5923