fix: order versions before applying limit - #67
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
🔇 Additional comments (3)
📝 WalkthroughWalkthroughThe ChangesRecent version selection
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change reorders versions before applying the limit; no actionable merge-blocking risk remains beyond normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant CLI as CLI Entry
participant Cmd as versions Command
participant Selector as selectRecentVersions
participant Registry as Registry Adapter
participant Output as Console Output
Note over CLI,Output: Registry Version Listing Flow (Current State)
CLI->>Cmd: Run versions command
Cmd->>Cmd: Parse args (--limit, --json)
Cmd->>Registry: fetchVersions(name)
Registry-->>Cmd: Version[] (adapter order)
Note over Cmd,Selector: Version Sorting & Limiting
Cmd->>Selector: selectRecentVersions(versions, limit)
Selector->>Selector: Sort by publishedAt (descending)
Selector->>Selector: Null dates moved to end
Selector->>Selector: Slice to limit
Selector-->>Cmd: Recent versions
alt JSON output mode
Cmd->>Output: JSON.stringify(shown)
else Table output mode
Cmd->>Output: Format table with counts
end
Output-->>CLI: Display results
Auto-approved: Fixes incorrect version selection by sorting by publishedAt before applying the limit, keeping undated versions last; the added test pins the corrected ordering.
Re-trigger cubic
Sorts registry versions by
publishedAtbefore applying--limit, so npm no longer returns the oldest releases. Versions without publication dates stay at the end in adapter order.Closes #63