Skip to content

[WIP] Add --before flag for date-based version filtering#7300

Merged
jdx merged 3 commits intoinstall-before-featurefrom
copilot/sub-pr-7298
Dec 14, 2025
Merged

[WIP] Add --before flag for date-based version filtering#7300
jdx merged 3 commits intoinstall-before-featurefrom
copilot/sub-pr-7298

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 14, 2025

Summary

Add the ability to filter tool versions by release date, similar to npm's --before flag. This enables reproducible builds and supply-chain security by ensuring only versions released before a certain date are considered.

Progress

  • Add --before CLI flag to install/upgrade/use commands
  • Add install_before setting and MISE_INSTALL_BEFORE env var
  • Implement date parsing (absolute and relative)
  • Implement version filtering with timestamps
  • Update backends to provide timestamps
  • Add documentation and tests
  • Fix non-existent install_before_mode references
  • Fix upgrade dry-run to respect before-date filter
    • Add latest_version_with_opts to ToolVersion
    • Update OutdatedInfo::resolve to accept ResolveOptions
    • Update Toolset::list_outdated_versions to accept ResolveOptions
    • Update upgrade.rs to pass ResolveOptions with before_date
    • Update outdated.rs to pass default ResolveOptions
    • Update rust.rs plugin to pass default ResolveOptions
    • Test and verify the fix works
    • Add clarifying comments from code review

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Note

Propagates ResolveOptions (incl. before_date) through latest-version resolution and outdated/upgrade flows so date-based filtering applies during checks and upgrades.

  • Core resolution:
    • Add ResolveOptions support to Toolset::list_outdated_versions, OutdatedInfo::resolve, and ToolVersion::latest_version_with_opts (preserves before_date).
    • Use backend latest_version_with_opts when bumping to honor before_date.
  • CLI:
    • upgrade: build ResolveOptions with before_date (from --before/settings), latest_versions=true, use_locked_version=false; pass to outdated listing and install InstallOptions.
    • outdated: pass ResolveOptions::default() to outdated listing.
  • Plugin:
    • Rust plugin outdated_info now calls OutdatedInfo::resolve with default ResolveOptions.
  • API additions:
    • New ToolVersion::latest_version_with_opts and updated call sites to apply date-based filtering.

Written by Cursor Bugbot for commit ad374ed. This will update automatically on new commits. Configure here.

Copilot AI and others added 2 commits December 14, 2025 23:25
Pass ResolveOptions with before_date to list_outdated_versions so the
dry-run output matches what would actually be installed. Previously,
dry-run showed the unfiltered latest version while the actual upgrade
would apply the before-date filter.

Co-authored-by: jdx <216188+jdx@users.noreply.github.com>
Add comments explaining why only before_date is preserved from base_opts
and clarifying the parameter differences between Backend and ToolVersion
methods.

Co-authored-by: jdx <216188+jdx@users.noreply.github.com>
@jdx jdx marked this pull request as ready for review December 14, 2025 23:35
@jdx jdx merged commit c5c03ef into install-before-feature Dec 14, 2025
3 checks passed
@jdx jdx deleted the copilot/sub-pr-7298 branch December 14, 2025 23:35
Copilot AI requested a review from jdx December 14, 2025 23:35
Comment thread src/plugins/core/rust.rs
if regex!(r"(\d+)\.(\d+)\.(\d+)").is_match(&tv.version) {
let oi = OutdatedInfo::resolve(config, tv.clone(), bump).await?;
let oi = OutdatedInfo::resolve(config, tv.clone(), bump, &ResolveOptions::default())
.await?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Rust plugin ignores before_date causing duplicate entries

The Rust plugin's outdated_info method calls OutdatedInfo::resolve with ResolveOptions::default(), ignoring the before_date filter. In list_outdated_versions, both t.outdated_info() and OutdatedInfo::resolve() results are added to the outdated list. For Rust with semver versions, this creates duplicate entries - one ignoring before_date and one respecting it - leading to incorrect output when users specify --before.

Additional Locations (1)

Fix in Cursor Fix in Web

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