Skip to content
This repository was archived by the owner on Oct 22, 2026. It is now read-only.

fix: add changelog entries in chronological order - #279

Open
skyc1e wants to merge 1 commit into
MetaMask:mainfrom
skyc1e:fix/chronological-order
Open

skyc1e wants to merge 1 commit into
MetaMask:mainfrom
skyc1e:fix/chronological-order

Conversation

@skyc1e

@skyc1e skyc1e commented Mar 31, 2026 •

Copy link
Copy Markdown

Explanation

git rev-list returns commits newest-first. The loop in updateChangelog
called .reverse() before iterating, but addChange uses unshift
(prepend) internally. The combination of reverse + unshift produced entries
in reverse chronological order (newest first).

Removing .reverse() lets unshift naturally reverse the newest-first
input into the correct oldest-first (forward chronological) order in the
changelog.

References

Fixes MetaMask/release-tools#117

Changelog

Fixed

  • Changelog entries now appear in forward chronological order (earliest to latest)

Checklist

  • Tests added to verify chronological ordering
  • All 142 tests pass
  • Lint and type check pass

Note

Low Risk
Small change to changelog generation order plus a focused test; low blast radius limited to release note formatting.

Overview
Ensures newly discovered commits are written to the changelog in forward chronological order (earliest first) by removing the extra .reverse() before adding entries.

Adds a regression test that mocks newest-first commit input and asserts the rendered changelog lists entries in the expected oldest-to-newest order.

Written by Cursor Bugbot for commit e55fb04. This will update automatically on new commits. Configure here.

git rev-list returns commits newest-first. The iteration used
.reverse() before calling addChange (which uses unshift), causing
entries to end up in reverse chronological order. Removing .reverse()
lets unshift naturally produce the correct oldest-first ordering.

Fixes #210
@skyc1e
skyc1e requested a review from a team as a code owner March 31, 2026 10:40
@MetaMask MetaMask locked and limited conversation to collaborators Oct 22, 2026
@GuillaumeRx

Copy link
Copy Markdown
Contributor

This library has now been migrated into the release-tools monorepo. This PR has been locked and this repo will be archived shortly. Going forward, releases of this library will only include changes made in the release-tools repo.

  • Please push this branch to release-tools and open a new PR there.
  • Optionally, add a link pointing to the discussion in this PR to provide context.

This branch has not been deployed

No deployments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changes get automatically added to changelogs in reverse chronological order when it should be forward order

2 participants