X Tutup
Skip to content

fix(changelog): Add semver sorting to action changelogs#7569

Merged
olblak merged 3 commits intoupdatecli:mainfrom
josill:fix/semver-sorting
Jan 20, 2026
Merged

fix(changelog): Add semver sorting to action changelogs#7569
olblak merged 3 commits intoupdatecli:mainfrom
josill:fix/semver-sorting

Conversation

@josill
Copy link
Contributor

@josill josill commented Jan 18, 2026

Fix #5351

Fix version sorting in changelogs to use semantic version comparison instead of lexicographic string comparison. Versions like "v0.99.0" and "v0.100.0" are now sorted correctly. Sorting order changed to descending (newest first) to match changelog conventions.

Test

To test this pull request, you can run the following commands:

cd pkg/core/reports && go test -v

Tradeoff

Changed sorting order from ascending to descending (newest first). This is a breaking change for existing tests, but matches changelog conventions and the expected behavior shown in the issue.

Potential improvement

Consider making sort order configurable if both ascending and descending orders are needed in different contexts.

@josill josill changed the title Add semver sorting to action changelogs fix: Add semver sorting to action changelogs Jan 18, 2026
@olblak olblak added bug Something isn't working resource-changelog labels Jan 20, 2026
@olblak
Copy link
Member

olblak commented Jan 20, 2026

Consider making sort order configurable if both ascending and descending orders are needed in different contexts.

Thank you very much for the pull request. I think in the future, it would be nice to be able to override default changelog with an optional changelog section similar to what I described here, but this is totally out of the scope.
Your proposal is already a great improvement with the current situation

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes semantic version sorting in action changelogs to address issue #5351 where versions like "v0.99.0" and "v0.100.0" were sorted incorrectly using lexicographic comparison. The sorting order has been changed from ascending to descending (newest first) to match standard changelog conventions.

Changes:

  • Implemented semantic version comparison using the Masterminds/semver library
  • Changed sort order to descending (newest first) for changelog versions
  • Updated all test expectations to reflect the new descending sort order

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pkg/core/reports/action.go Added semver-based sorting logic with fallback to string comparison for non-version strings
pkg/core/reports/action_test.go Added new test case for semver sorting (v0.99.0, v0.100.0, v0.101.0) and updated existing test expectations for descending order
pkg/core/reports/actions_test.go Updated all test expectations to reflect descending changelog order

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@olblak olblak merged commit a3a5f99 into updatecli:main Jan 20, 2026
5 checks passed
@olblak olblak changed the title fix: Add semver sorting to action changelogs fix(changelog): Add semver sorting to action changelogs Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working resource-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Action changelogs are not sorted by version numbers

3 participants

X Tutup