Repository navigation
feat(release/auto-changelog): preserve finalized changelog history when merging previous releases - #300
Merged
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
HowardBraham
force-pushed
the
merge-previous-releases
branch
from
October 26, 2026 05:19
884e1f4 to
d0e407b
Compare
mcmire
reviewed
Oct 27, 2026
mcmire
left a comment
Contributor
There was a problem hiding this comment.
I didn't review the script itself as I don't have much context on it, but I left some minor suggestions below.
As far as the risk to other repos goes, this looks pretty safe to me. I don't believe other repos use the merge-previous-releases action (or at least, I don't recognize it).
JadeCong
pushed a commit
to CloudEngineHub/metamask-extension
that referenced
this pull request
Oct 29, 2026
…MetaMask#47463) ## **Description** This is the very last step in a chain of PRs to turn on fully-autonomous CHANGELOG generation in Extension. ## **Changelog** CHANGELOG entry: null ## **Related issues** ### Previous PRs in the chain #### release-tools/auto-changelog MetaMask/release-tools#127 MetaMask/release-tools#130 #### github-tools MetaMask/github-tools#300 MetaMask/github-tools#301 MetaMask/github-tools#303 <!--## **Manual testing steps** ## **Screenshots/Recordings** ## **Pre-merge author checklist** ## **Pre-merge reviewer checklist**--> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Workflow-only change that adds a CI secret env var and removes an action input; no runtime extension code or user-facing behavior changes. > > **Overview** > Turns on the **AI changelog proofreader** for release changelog automation by passing **`AI_ANALYZER_LITELLM_KEY`** into the `update-release-changelog` GitHub Action (same LiteLLM secret pattern as other AI workflows). > > Also **drops the explicit `previous-version-ref: 'null'`** input so previous-version resolution is handled by the updated action rather than being hard-coded in this repo. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c801241. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
darkwing
pushed a commit
to darkwing/metamask-mobile
that referenced
this pull request
Oct 29, 2026
…MetaMask#38444) ## **Description** This is the very last step in a chain of PRs to turn on fully-autonomous CHANGELOG generation in Mobile. ## **Changelog** CHANGELOG entry: null ## **Related issues** ### Previous PRs in the chain #### release-tools/auto-changelog MetaMask/release-tools#127 MetaMask/release-tools#130 #### github-tools MetaMask/github-tools#300 MetaMask/github-tools#301 MetaMask/github-tools#303 <!--## **Manual testing steps** ## **Screenshots/Recordings** ## **Pre-merge author checklist** ## **Pre-merge reviewer checklist**--> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes how release and OTA hotfix changelogs are produced in CI; misconfiguration could break changelog PRs or tags, though behavior is intended to match the removed script via github-tools v1. > > **Overview** > Mobile release changelog automation no longer runs the local **`run-update-release-changelog-mobile.sh`** wrapper or manual **github-tools** checkout, Node setup, and **`yarn`** steps. **`create-release-pr.yml`** (OTA hotfix path) and **`update-release-changelog.yml`** now call **`MetaMask/github-tools/.github/actions/update-release-changelog@v1`**, which owns branch checkout, version derivation from **`release/X.Y.Z`** / **`release/X.Y.Z-ota`**, and concurrent Runway updates on the release branch. > > This PR also threads **`AI_ANALYZER_LITELLM_KEY`** from **`auto-create-release-pr.yml`** into **`create-release-pr.yml`** as an optional reusable-workflow secret and passes it into both changelog action steps so the new AI changelog proofreader can run during autonomous **`CHANGELOG.md`** generation. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1abeae5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: howard <howard@example.com>
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 amends merge commits on
CHANGELOG.md, plus a repo-wide Node 20→22 bump that affects multiple GitHub Actions consumers of.nvmrc.Overview
Fixes lost release changelog sections when older active release branches are merged into a new
release/X.Y.Zbranch withgit merge -s ours. After each ancestry-only merge,merge-previous-release-changelog.mtscopies the source branch’s finalized## [version]block and[version]:link fromCHANGELOG.mdinto the destination in version order, thenmerge-previous-releases.shamends the merge commit whenCHANGELOG.mdchanges. Ambiguous or unsafe cases (duplicate headings, section already present, errors) warn and leave the destination unchanged so the merge does not fail.The repo requires Node ≥22.18 (
.nvmrcv22.23.4,engines,constraints.pro) so the.mtshelper runs without a build step; the merge-previous-releases action addssetup-nodefromgithub-tools/.nvmrc. Tooling adds lint/tsc coverage for.github/scripts/**/*.mts, broadensyarn testto all.github/**/*.test.{mjs,mts}, and adds integration tests that exercise the real shell script with a fakegh.Reviewed by Cursor Bugbot for commit d0e407b. Bugbot is set up for automated code reviews on this repo. Configure here.