Skip to content

feat(toolchain): list installed toolchains in release order - #206

Merged
chawyehsu merged 4 commits into
mainfrom
push-yoyknpmyrrup
Aug 10, 2026
Merged

feat(toolchain): list installed toolchains in release order#206
chawyehsu merged 4 commits into
mainfrom
push-yoyknpmyrrup

Conversation

@chawyehsu

@chawyehsu chawyehsu commented Aug 10, 2026

Copy link
Copy Markdown
Owner

before:

Installed toolchains:
  0.10.3+16975d007
  0.10.6+80dc50f24
  0.6.22
  0.6.24+012953835
  0.6.29+9037370fc
  0.9.2+bbe2b338f
  0.9.3+08f337e2c
  latest (0.10.6+80dc50f24)
  nightly-2026-08-08
  nightly (2026-07-28)

after

Installed toolchains:
  nightly-2026-08-08
  0.6.22
  0.6.24+012953835
  0.6.29+9037370fc
  0.9.2+bbe2b338f
  0.9.3+08f337e2c
  0.10.3+16975d007
  0.10.6+80dc50f24
  nightly (2026-07-28)
  latest (0.10.6+80dc50f24)

Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@chawyehsu, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2924f972-9a5c-4f0e-9445-66ee558af45d

📥 Commits

Reviewing files that changed from the base of the PR and between 885b200 and e9aa7f4.

📒 Files selected for processing (1)
  • src/toolchain/mod.rs

Summary by CodeRabbit

  • New Features

    • Toolchains are now displayed in release order: versioned toolchains by channel and release date, followed by bleeding, nightly, and latest.
    • Latest releases use cached channel information when available, with numeric version ordering as a fallback.
    • Nightly toolchains are ordered by release date.
    • Ordering remains reliable when cached release information is unavailable or outdated.
  • Documentation

    • Added documentation defining the toolchain release-ordering rules.

Walkthrough

The 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.

Changes

Release ordering

Layer / File(s) Summary
Release order helpers
CONTEXT.md, src/toolchain/mod.rs
Defines ordering for bleeding, nightly, and latest, including nightly dates, cached latest positions, numeric versions, and build-metadata removal.
Sorting and cached index integration
src/toolchain/mod.rs, tests/integration/atomic.rs
Sorts installed toolchains with release-order keys. Loads channel-latest.json when available and uses numeric fallback ordering when loading or parsing fails. The integration test covers a stale cache that omits an installed version.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ae59510-3ab4-4a04-83db-80b101c0585b

📥 Commits

Reviewing files that changed from the base of the PR and between 97c6c4f and af2468e.

📒 Files selected for processing (2)
  • CONTEXT.md
  • src/toolchain/mod.rs

Comment thread src/toolchain/mod.rs Outdated
Comment thread src/toolchain/mod.rs
Comment on lines +209 to +215
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();

@coderabbitai coderabbitai Bot Aug 10, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.75510% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.56%. Comparing base (97c6c4f) to head (885b200).

Files with missing lines Patch % Lines
src/toolchain/mod.rs 87.75% 6 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json ordering, with numeric fallback).
  • Document the “release order” term in CONTEXT.md and 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.

Comment thread src/toolchain/mod.rs Outdated
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
@chawyehsu
chawyehsu merged commit b490f16 into main Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants