Skip to content

feat(config): add minimum release age excludes#10277

Merged
jdx merged 1 commit into
mainfrom
feat/min-release-age-excludes
Jun 9, 2026
Merged

feat(config): add minimum release age excludes#10277
jdx merged 1 commit into
mainfrom
feat/min-release-age-excludes

Conversation

@jdx

@jdx jdx commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • add minimum_release_age_excludes to skip the global minimum release age policy for matching tools/backends
  • support shorthand tools (jq), full backend IDs (npm:prettier), and backend wildcards (npm:*)
  • keep CLI --minimum-release-age and per-tool minimum_release_age precedence intact
  • document the setting and update the JSON schema

Tests

  • cargo test install_before
  • cargo test test_settings_toml_is_sorted
  • mise run test:e2e e2e/cli/test_install_before

This PR was generated by an AI coding assistant.


Note

Medium Risk
Changes fuzzy/latest version resolution for installs and upgrades when a global minimum release age is set; mistakes in exclude patterns could allow newer versions than intended for excluded tools.

Overview
Adds minimum_release_age_excludes so a global supply-chain age cutoff can skip selected tools or whole backends while everything else still honors minimum_release_age.

Resolution now goes through resolve_before_date_for_tool, which only bypasses the global setting when an exclude entry matches the tool shorthand (e.g. jq), full backend id (e.g. npm:prettier), or backend wildcard (e.g. npm:*). Per-tool minimum_release_age and --minimum-release-age are unchanged and still win over exclusions.

Documented in tips/settings, exposed in settings.toml / MISE_MINIMUM_RELEASE_AGE_EXCLUDES, and added to schema/mise.json. Covered by install_before unit tests and an e2e case where excluding jq installs a newer latest than the global cutoff would allow.

Reviewed by Cursor Bugbot for commit 30e79bd. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces a new minimum_release_age_excludes setting that allows users to exclude specific tools or backends from the global minimum_release_age filter. The feature includes schema definitions, core exclusion-matching logic, integration across resolution paths, and comprehensive documentation and testing.

Changes

Minimum Release Age Excludes

Layer / File(s) Summary
Configuration Schema and Settings
schema/mise.json, settings.toml
New minimum_release_age_excludes field defined as array of strings with environment variable mapping and comma-separated list parsing.
Tool-Aware Before-Date Resolution
src/install_before.rs
Introduces resolve_before_date_for_tool that computes effective cutoff timestamps while matching tool identifiers against exclude patterns (short name, full backend id, backend type, tool name). Refactored shared resolution logic and comprehensive test coverage.
Resolution Integration Points
src/backend/mod.rs, src/toolset/tool_request.rs, src/toolset/tool_version.rs
Three resolution sites updated to use resolve_before_date_for_tool passing the tool backend identifier for exclusion evaluation.
Documentation and End-to-End Testing
docs/tips-and-tricks.md, e2e/cli/test_install_before
User documentation with TOML example and clarification about interaction with per-tool settings. E2E test verifies excluded tools install without being filtered by global minimum age.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • jdx/mise#10276: Shares registry/cargo-msrv.toml registry metadata updates for the cargo-msrv backend entry.

Poem

🐰 A tool once filtered by the years of age,
Now springs free from time's tiresome cage,
Exclude by name, by backend's shining gleam—
The minimum release age bends to your scheme! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(config): add minimum release age excludes' accurately describes the main feature added in this pull request, which introduces a new configuration option to exclude specific tools/backends from the global minimum release age policy.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/min-release-age-excludes

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

@jdx jdx force-pushed the feat/min-release-age-excludes branch from 612d99c to 6d86509 Compare June 9, 2026 00:32
@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds minimum_release_age_excludes to let users skip the global supply-chain age gate for specific tools or backends, while keeping per-tool minimum_release_age options and the CLI --minimum-release-age flag fully in effect. The core change extracts a new resolve_before_date_for_tool path that checks the exclude list before falling back to the global setting, and updates all three call sites (backend/mod.rs, tool_request.rs, tool_version.rs).

  • Exclusion matching supports tool shorthands, full backend IDs, and backend:* wildcards; bare backend names (e.g. npm) intentionally do not match scoped tools (npm:prettier), which is verified by unit tests and documented.
  • Unit tests cover the main matching branches and both precedence layers; one test (test_effective_before_date_exclude_does_not_override_tool_option) uses a non-matching exclude entry so it doesn't actually reach the "excluded but per-tool option wins" branch.
  • The e2e test adds assert_not_empty before the assert_not_contains check, addressing the prior false-positive gap.

Confidence Score: 5/5

Safe to merge — the change only narrows when the global minimum_release_age cutoff is applied and cannot bypass per-tool or CLI-supplied cutoffs.

All three call sites are updated consistently, the precedence order (CLI flag → per-tool option → excludes → global setting) is enforced by the function's early-return structure, and the new logic is covered by seven unit tests plus an e2e test. No auth, install-path, or data-mutation logic is touched.

The one unit test that claims to verify 'exclude does not override tool option' actually exercises a non-matching exclude entry, so the exact scenario (tool IS excluded AND has its own per-tool setting) lacks an explicit test — worth a quick look before merging if strict coverage is important.

Important Files Changed

Filename Overview
src/install_before.rs Core logic for minimum_release_age_excludes — adds resolve_before_date_for_tool and is_minimum_release_age_excluded; well-structured precedence ordering; good unit test coverage with one minor gap (see comment)
src/backend/mod.rs Swaps resolve_before_date for resolve_before_date_for_tool in effective_latest_before_date; correct and minimal change
src/toolset/tool_request.rs resolve_options now passes the BackendArg through to resolve_before_date_for_tool; straightforward update
src/toolset/tool_version.rs Mirrors tool_request.rs change; correct parallel update in ToolVersion resolution path
e2e/cli/test_install_before Adds e2e test for the excludes path; assert_not_empty addresses silent-failure gap from prior review, but the unit test for tool-option-wins-over-exclude doesn't actually exercise the excluded branch (see comment)
settings.toml New minimum_release_age_excludes entry with full docs, env var, and parse_env; alphabetically sorted between minimum_release_age and netrc
docs/tips-and-tricks.md Adds documentation block explaining minimum_release_age_excludes patterns and precedence; accurate and clear
schema/mise.json Adds minimum_release_age_excludes array schema; correctly placed and typed

Fix All in Claude Code

Reviews (3): Last reviewed commit: "feat(config): add minimum release age ex..." | Re-trigger Greptile

Comment thread src/install_before.rs
Comment thread e2e/cli/test_install_before
@jdx jdx force-pushed the feat/min-release-age-excludes branch from 6d86509 to 2910ace Compare June 9, 2026 00:39

jdx commented Jun 9, 2026

Copy link
Copy Markdown
Owner Author

Addressed the review feedback:

  • Removed the bare backend tool-name match, so prettier no longer excludes npm:prettier; users should use shorthand/full IDs or backend wildcards like npm:*.
  • Added a negative unit test for that behavior.
  • Strengthened the e2e assertion with assert_not_empty before checking the old filtered version is absent.
  • Rebased onto origin/main so the unrelated registry file is no longer part of this PR.

Tests run:

  • cargo test install_before
  • cargo test test_settings_toml_is_sorted
  • mise run test:e2e e2e/cli/test_install_before

This comment was generated by an AI coding assistant.

@jdx jdx force-pushed the feat/min-release-age-excludes branch from 2910ace to 30e79bd Compare June 9, 2026 00:52
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.1 x -- echo 17.7 ± 2.5 15.7 32.2 1.00
mise x -- echo 17.9 ± 1.0 16.2 24.5 1.01 ± 0.16

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.1 env 17.1 ± 0.9 15.6 21.6 1.00
mise env 17.8 ± 1.0 16.1 23.5 1.04 ± 0.08

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.1 hook-env 17.7 ± 0.8 16.1 24.1 1.00
mise hook-env 18.3 ± 0.8 16.6 22.8 1.03 ± 0.07

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.1 ls 15.7 ± 3.1 13.0 38.8 1.00
mise ls 17.2 ± 3.1 14.0 37.5 1.09 ± 0.29

xtasks/test/perf

Command mise-2026.6.1 mise Variance
install (cached) 134ms 135ms +0%
ls (cached) 59ms 60ms -1%
bin-paths (cached) 65ms 66ms -1%
task-ls (cached) 121ms 122ms +0%

@jdx jdx merged commit 7e0b436 into main Jun 9, 2026
35 checks passed
@jdx jdx deleted the feat/min-release-age-excludes branch June 9, 2026 01:09
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.

1 participant