Repository navigation
SWF(bug): Sort changelog events by time - #670
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
jatmn
left a comment
There was a problem hiding this comment.
🟢 Thanks for the contribution. I do not see any actionable issues from my review.
Merge readiness
- Approval gate: GitHub reports
mergeStateStatus: BLOCKEDwhile required CI is green (fmt/clippy, stable/beta tests, build). This looks like branch protection waiting on a human approval, not a PR-owned check failure. - Target freshness:
origin/mainmatches the recorded merge-base (65d55405); no rebase drift on this branch. - PR template hygiene (non-blocking): CodeRabbit flagged missing template sections (linked issue, kind-of-change checkbox, protocol block). Optional cleanup for maintainer workflow; not a code defect in the diff.
Sort commits and merged PRs newest first before applying the changelog limit. Commit timestamps stay numbers and merged PR timestamps stay strings.
Cause
api/changelog.rsput Git's Unix seconds into a JSON number and the PR merge time into an RFC 3339 string. The old comparator calledas_str().unwrap_or("")on both. The commit got an empty sort key, so an older merged PR could take the only slot atlimit=1.The sort now compares Unix seconds and fractional nanoseconds without changing the response. The test checks that both events and their original timestamp types are present, then asks for just the newest event.
Before
After
Node suite in
cargo test --workspace:Try it
Set
DATABASE_URLto a local PostgreSQL 16+ instance whose user can create test databases.cargo test -p twigpine-node --lib api::changelog::tests::changelog_limit_keeps_newer_commit_over_older_merged_pr -- --exactNot tested against a deployed node.
Summary by CodeRabbit