feat(cli): add minimum release age flag to lock and ls-remote#9269
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a --before flag to the mise lock and mise ls-remote commands, allowing users to filter tool versions based on their release date. The changes include updates to the CLI argument parsing, logic for resolving toolsets with date constraints, and new E2E tests to verify the functionality. Feedback suggests making the before field public in the Lock struct for consistency and optimizing the lock command to use the cached toolset when no date filter is applied to avoid unnecessary overhead.
Greptile SummaryThis PR extends the existing
Confidence Score: 5/5Safe to merge; the changes are well-tested end-to-end and additive, with no impact on existing behaviour when the new flag is absent. The core logic is consistent with the existing No files require special attention. Important Files Changed
Reviews (24): Last reviewed commit: "[autofix.ci] apply automated fixes" | Re-trigger Greptile |
e032d2c to
f2d83b4
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
e4a5f4e to
1135f6d
Compare
|
Blocking: I need to make the scope of |
d3204af to
26852af
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
b5a684b to
2c6bfaf
Compare
### 🚀 Features - **(cli)** add minimum release age flag to lock and ls-remote by @risu729 in [#9269](#9269) - **(config)** add run field for hooks by @risu729 in [#9718](#9718) - **(github)** add native oauth token source by @jdx in [#9654](#9654) - **(oci)** scope build to project config by default by @jdx in [#9766](#9766) - add support for prefixed latest version queries in outdated checks by @roele in [#9767](#9767) ### 🐛 Bug Fixes - **(activate)** guard bash chpwd hook under nounset by @risu729 in [#9716](#9716) - **(backend)** date-check latest stable fast path by @risu729 in [#9650](#9650) - **(config)** parse core tool options consistently by @risu729 in [#9742](#9742) - **(exec)** propagate __MISE_DIFF so nested mise recovers pristine PATH by @jdx in [#9765](#9765) - **(forgejo)** include prereleases when opted in by @risu729 in [#9717](#9717) - **(github)** avoid caching empty release assets by @risu729 in [#9616](#9616) - **(java)** resolve lockfile URLs from metadata by @risu729 in [#9719](#9719) - **(lock)** cache unavailable github attestations by @risu729 in [#9741](#9741) - **(pipx)** preserve options when reinstalling tools by @risu729 in [#9663](#9663) - **(python)** skip redundant lockfile provenance verification by @risu729 in [#9739](#9739) - **(vfox)** run pre_uninstall hook by @risu729 in [#9662](#9662) ### 🚜 Refactor - **(schema)** extract tool options definition by @risu729 in [#9649](#9649) ### ⚡ Performance - **(aqua)** bake rkyv aqua package blobs by @risu729 in [#9535](#9535) ### 📦️ Dependency Updates - lock file maintenance by @renovate[bot] in [#9773](#9773) ### 📦 Registry - add vector ([github:vectordotdev/vector](https://github.com/vectordotdev/vector)) by @kquinsland in [#9761](#9761) - add oc and openshift-install (http backend) by @konono in [#9669](#9669) ### New Contributors - @konono made their first contribution in [#9669](#9669) - @kquinsland made their first contribution in [#9761](#9761)
…version resolution The built-in 24h minimum_release_age default (#10279) set a before_date on every resolution, which disabled the installed-version fast paths for all non-prefer-offline commands (mise which, mise use, ...). Every invocation then fetched remote version lists for the entire toolset, turning ~75ms shell-startup calls into ~2.5s each (reported as ~65s shell startups in discussion #10308). The built-in default now only gates which versions remote resolution may pick — its actual purpose of delaying new installs. Explicit cutoffs (the --minimum-release-age flag, a per-tool minimum_release_age option, or the minimum_release_age setting) keep their date-aware resolution semantics from #9269, since opting in was a deliberate choice there. - install_before: cutoff resolution reports a BeforeDateSource (Provided/Explicit/Default) alongside the timestamp - ResolveOptions: new before_date_from_default flag, set via a shared apply_before_date_for_tool helper; the should_filter_installed_versions gates in resolve_version/resolve_prefix require an explicit cutoff - e2e: test_which_no_remote_fetch pins the regression (fails on unfixed code); test_hook_env_no_remote_fetch guards the prefer-offline paths so hook-env can never start fetching remote versions Fixes #10308 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Adds
--beforesupport to two more commands that need date-aware version discovery:mise ls-remote --before <date>filters remote version listings by release timestamp.mise lock --before <date>resolves fuzzy/latest tool requests against versions released before the cutoff before writing or previewing lockfile entries.install_before, and global[settings] install_before, with the CLI flag taking precedence.This is intended to support potential mise integration work in Renovate, where tooling may need to list and lock versions using a release-date cutoff.
Implementation Notes
ls-remotestill fetches the normal cached full remote version metadata and applies the effective date filter after reading it. That keeps the cache independent of the requested cutoff and avoids caching a filtered result for one cutoff that could incorrectly affect a later query with a different cutoff.lockbuilds the toolset with aResolveOptions.before_dateoverride when the flag is present, while preserving the existing per-tool and globalinstall_beforefallback behavior when it is not.Tests
mise run test:e2e e2e/cli/test_ls_remote e2e/cli/test_lockcargo fmt --check