Repository navigation
feat(release/auto-changelog): preserve finalized changelog history when merging previous releases - #300
Open
HowardBraham wants to merge 1 commit into
Open
feat(release/auto-changelog): preserve finalized changelog history when merging previous releases#300HowardBraham wants to merge 1 commit into
HowardBraham wants to merge 1 commit into
Conversation
HowardBraham
force-pushed
the
merge-previous-releases
branch
from
October 24, 2026 03:54
ac9c6d1 to
884e1f4
Compare
HowardBraham
marked this pull request as ready for review
October 24, 2026 03:59
This branch has not been deployed
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.
References
Explanation
Current state
When a new
release/X.Y.Zbranch is created,merge-previous-releases.shmerges every older active release branch into it withgit merge -s ours. That records the ancestry without duplicating code, but it also keeps the destination's files. If an older release has already published its finalized changelog section (## [13.54.0]plus its[13.54.0]: …link), the new branch never gets it, and the next release's changelog is generated without it.Solution
After each
-s oursmerge, the script now runs a newmerge-previous-release-changelog.mts. It does the following:## [version]section and its link reference from the sourceCHANGELOG.mdinto the destination, in newest-first order.The script is TypeScript that Node runs directly with no build step. Native
.mtssupport needs Node 22.18 or later, so this PR also moves the repo from Node 20 to 22:.nvmrcgoes fromv20tov22.23.4.engines.nodeand theconstraints.prorule go from>=20.0.0to>=22.18.0.setup-nodestep that reads.nvmrc. Before this it ran on whatever Node the runner had.Impact of the Node bump
.nvmrcfeeds seven actions throughnode-version-file(check-changelog,draft-segment-schema-pr,flaky-test-report,playwright-test-health-report,post-merge-validation,publish-slack-release-testing-statusand the merge action), plus thepost-relay-subsidy-balanceworkflow. Their consumers move from Node 20 to 22. Actions with their own pinned Node (stable-sync,remove-rca-needed-label-sheets,setup-e2e-env) aren't affected. Reviewers should confirm that moving those actions to Node 22 is acceptable.Other changes
merge-previous-releases.test.mtsruns the real shell script against a throwaway origin and clone, with a fakegh. It covers a preserved release, an ambiguous source, and a destination that already has the release.yarn test: it now runs every*.test.{mjs,mts}file with onenode --test. This also picks upplaywright-test-health-report/lib/report-health.test.mjs, which was never wired intoyarn test..mtsfiles are added to the existingtsc(viainclude) andlint:eslintruns, plus two small ESLint overrides.lint:eslintstays two commands, because ESLint ignores dot-directories.Testing
tsc,lint:eslintandnode --testpass on Windows and on Linux (Ubuntu with Node 22.23.4, no git identity configured).consensys-test/metamask-extension-howard, a newrelease/branch merged an older active release.setup-nodeinstalled 22.23.4 and the log showedInserted finalized 999.999.999 changelog history. The section was byte-identical to the source, sat in version order, and onlyCHANGELOG.mdchanged. A branch whose destination already had the section was left byte for byte. Runs:40046194251,40046722723,40059428200.tsc, ESLint, the constraints check and the unit tests passing, not on those actions running.Note
Medium Risk
Touches release-branch merge automation and mutates CHANGELOG.md on the new RC; behavior is conservative on errors, but the Node 20→22 bump affects every action/workflow that reads this repo’s
.nvmrc.Overview
After each
git merge -s ourswhen folding older active release branches into a newrelease/*branch, changelog history is no longer dropped: a newmerge-previous-release-changelog.mtscopies the source’s finalized## [version]block and link reference intoCHANGELOG.mdin version order, then the shell script amends the merge commit when that file changes. Ambiguous or unsafe cases warn and leave the destination unchanged so release merges don’t fail on changelog edits.The repo requires Node ≥22.18 (
.nvmrc,engines, constraints) so CI can run the.mtsscript without a build step; the merge-previous-releases composite action addssetup-nodefromgithub-tools/.nvmrc. Tooling picks up the new scripts viatsconfig/eslintoverrides,yarn testruns all.github/**/*.test.{mjs,mts}, and integration tests exercise the real merge shell script with git fixtures.Reviewed by Cursor Bugbot for commit 884e1f4. Bugbot is set up for automated code reviews on this repo. Configure here.