fix(api): use numeric version sorting for artifact versions - #83
fix(api): use numeric version sorting for artifact versions#83prathamesh04 wants to merge 1 commit into
Conversation
The previous implementation used lexicographic sorting for version URLs, which produces incorrect results for semver-style version IDs: Lexicographic: ['2.9.0', '2.10.0', '2.1.0'] -> '2.9.0' (wrong) Numeric: ['2.10.0', '2.9.0', '2.1.0'] -> '2.10.0' (correct) This fix extracts the version segment from each URL and parses it as a numeric tuple for proper semantic version comparison. Falls back to lexicographic comparison for non-standard formats. Fixes dbpedia#70
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
cc @Integer-Ctrl @DhanashreePetare @JJ-Author This PR fixes the version sorting bug (Issue #70). The previous implementation used lexicographic sorting which gives wrong results for semver-style versions (e.g., 2.9.0 > 2.10.0). This fix uses numeric tuple comparison for proper semantic version ordering. |
|
Hey @Integer-Ctrl @DhanashreePetare @JJ-Author — I've added a testing video demonstrating the numeric version sorting fix. The fix correctly handles semver-style versions (e.g., 2.10.0 > 2.9.0) and falls back to lexicographic for date-based formats. All unit tests pass. Would appreciate a review when you get a chance. Thanks! |
|
Hi @Integer-Ctrl @DhanashreePetare — gentle bump on this one. It fixes the semver version-sorting bug (Issue #70): lexicographic sorting mis-orders versions like 2.10.0 vs 2.9.0, and this uses numeric component comparison instead. I'm preparing my GSoC 2027 application with DBpedia and would appreciate a review when you have a moment. Thanks! |
Description
The previous implementation used lexicographic sorting for version URLs, which produces incorrect results for semver-style version IDs.
Problem
Lexicographic sorting:
Numeric sorting:
Changes
Testing
Fixes #70