feat(toolchain): list installed toolchains in release order - #206
Conversation
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
|
Warning Review limit reached
Next review available in: 53 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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)
Summary by CodeRabbit
WalkthroughThe change defines release-order terminology and replaces direct toolchain ordering with channel-, date-, cached-index-, and numeric-version-based sorting. Cached index failures use numeric fallback ordering. ChangesRelease ordering
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 |
| fn parse(version: &str) -> Self { | ||
| // ignore the `+build` metadata suffix (e.g. `0.10.6+80dc50f24`) | ||
| let core = version.split('+').next().unwrap_or(version); | ||
| let parts = core | ||
| .split('.') | ||
| .map(|p| p.parse::<u64>().unwrap_or(0)) | ||
| .collect(); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Normalize the optional v prefix before parsing numeric components.
CONTEXT.md defines v1.0.0 as a valid toolchain spec. NumericVersion::parse("v1.0.0") parses the first component as 0. As a result, v1.0.0 and v2.0.0 can compare equal during numeric fallback sorting.
Strip one leading v before splitting the version. Add fallback-order tests for v0.x, v1.x, and v2.x.
There was a problem hiding this comment.
There was a problem hiding this comment.
@chawyehsu, thank you. Pull request #206 does not yet include that change.
NumericVersion::parse still does not remove a leading v before parsing. Please incorporate the fix from #200 into this pull request, or close this review thread after the change reaches this branch.
You are interacting with an AI system.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #206 +/- ##
==========================================
+ Coverage 87.11% 88.56% +1.44%
==========================================
Files 25 25
Lines 1677 1697 +20
==========================================
+ Hits 1461 1503 +42
+ Misses 216 194 -22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
There was a problem hiding this comment.
Pull request overview
This PR changes how moonup list (and other callers of installed_toolchains()) order installed toolchains so they’re displayed in release order rather than lexicographic/alphabetical name order.
Changes:
- Replace
ToolchainSpec’s custom ordering with an explicit “release order” sort key used when listing installed toolchains. - Order versioned installs by channel and release chronology (nightly builds by date; stable/latest releases by cached
channel-latest.jsonordering, with numeric fallback). - Document the “release order” term in
CONTEXT.mdand add an integration test for stale latest-cache fallback behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/integration/atomic.rs | Adds coverage ensuring stale channel-latest.json does not mis-order installed numeric versions. |
| src/toolchain/mod.rs | Implements release-order sorting for installed toolchains, including cached-index positioning and numeric fallback. |
| CONTEXT.md | Defines “Release order” to standardize terminology in the repo. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
before:
after