Repository navigation
fix(release/auto-changelog): exclude PRs already cherry-picked onto the baseline release - #307
Merged
Merged
Conversation
HowardBraham
force-pushed
the
changelog-duplicate-fix
branch
from
November 5, 2026 00:24
c89009a to
7383645
Compare
HowardBraham
marked this pull request as ready for review
November 5, 2026 00:26
…he baseline release Also restores the executable bit on update-release-changelog.sh, which #303 dropped.
HowardBraham
force-pushed
the
changelog-duplicate-fix
branch
from
November 5, 2026 00:47
7383645 to
e28cd86
Compare
sleepytanya
approved these changes
Nov 5, 2026
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.
Description
Current state. When a release branch is cut while an older release is still in flight, the release-changelog updater can list a PR that already shipped in the older release.
The newer branch merges the older one with
-s ours, so the Runway cherry-pick commit is in the generator's range. The original PR is in range too, because it merged tomainbefore the newer cut. The generator only compares PR numbers against the changelog text, so if the older release's changelog is stale or was hand-edited under the cherry-pick's number, the original is generated again.This happened in the 13.56.0 and 8.19.0 cuts: Extension listed #47395 in both 13.55.0 and 13.56.0, and Mobile listed 14 PRs in both 8.18.0 and 8.19.0 (plus #37860, which belongs in 8.18.0).
Solution. When the baseline is not the target branch, the updater now:
accepted ... cherry-pick=truediagnostics and keeps the cherry-pick commits that are reachable from the baseline ref (git merge-base --is-ancestor; a Git failure logs a warning and counts as not reachable, so the PR stays listed);It also restores the executable bit on
.github/scripts/update-release-changelog.sh, which #303 changed from100755to100644. Callers that exec the shim directly, such as Mobile's oldrelease/8.18.0wrapper, fail with exit 126 without it.Limits:
## [version]section, not only the first. Reruns while the changelog PR is open keep reviewed entries, as above. Once the target has its own section, the updater preserves it and the rule no longer applies, so duplicates already in a merged section are not stripped.Testing
Unit tests cover the helpers, the exclusion function (shared entries, reviewed PRs, PRs the section never listed),
removeReleaseEntries, the warning wording, and the realgit merge-basecall against a temporary repository. Thebaseline.kind !== 'target'check inmain()is covered only by the fork runs below.Fork runs on real pre-cut commits, with the updater workflow adapted only to use
PR_TOKENand a hardcoded upstream URL. They ran on the first version of this change, before the review fixes above:consensys-test/metamask-mobile-howard,release/8.18.0ate553422d7,release/8.19.0at3fb2c3da5). With v1.22.0 the generated [8.19.0] section lists all 15 PRs (run 41933261975). With this change none are listed, and no other PR number differs (run 41934216310).consensys-test/metamask-extension-howard,release/13.55.0at3c4ab5e5e2,release/13.56.0ate03bdce708). With v1.22.0 [13.56.0] lists #47395 (run 41936435434). With this change it does not, and the log and PR body warn that the 13.55.0 changelog does not list it (run 41939257564).Related
See #303.
Note
Medium Risk
Changes release changelog output for overlapping release branches; mistaken reachability or alias handling could omit entries, though Git errors conservatively keep PRs listed and warnings flag gaps in older changelog sections.
Overview
When a newer release branch is cut while an older one is still active, update-release-changelog could list the same PR twice because cherry-pick commits sit in the generator range even though they already shipped on the baseline branch.
After auto-changelog runs, the updater now parses cherry-pick=true diagnostics, finds cherry-picks whose commits are ancestors of the baseline ref via
git merge-base --is-ancestor, and strips matching entries from the draft section using newremoveReleaseEntries(only when every PR on an entry is excluded; reviewer-approved lines are preserved). Excluded PRs that never appear anywhere else in the changelog trigger a console warning and an advisory quote on the changelog PR body. This path runs only while the baseline is not the target release itself.Unit tests cover entry removal, exclusion edge cases, reachability (including Git failures), and PR presentation wording.
Reviewed by Cursor Bugbot for commit e28cd86. Bugbot is set up for automated code reviews on this repo. Configure here.