Skip to content

fix: add changelog entries in chronological order#279

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

fix: add changelog entries in chronological order#279
skyc1e wants to merge 1 commit into
MetaMask:mainfrom
skyc1e:fix/chronological-order

Conversation

@skyc1e
Copy link
Copy Markdown

@skyc1e skyc1e commented Mar 31, 2026

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 #210

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 MetaMask#210
@skyc1e skyc1e requested a review from a team as a code owner March 31, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

1 participant