fix(changelog): Add semver sorting to action changelogs#7569
fix(changelog): Add semver sorting to action changelogs#7569olblak merged 3 commits intoupdatecli:mainfrom
Conversation
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. |
There was a problem hiding this comment.
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.
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:
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.