fix(backend): allow unresolved latest opt-in#9401
Conversation
0f02dd4 to
9c9c938
Compare
There was a problem hiding this comment.
Code Review
This pull request improves Go module version resolution by implementing a fallback to fetch "@latest" metadata for modules without tagged versions and refactors the pipx backend to default to a "latest" version when no GitHub releases are found. It also updates the runtime symlink migration to version 2, which includes logic to skip temporary "latest" labels and refreshes the installation state after migration. I have no feedback to provide.
Greptile SummaryThis PR fixes Confidence Score: 5/5Safe to merge; the age-gate logic is correctly preserved and the new fallback is tightly scoped to the empty-list case. No P0 or P1 issues found. The two prior-review concerns (GitHub URL opt-in scope, before_date regression) are handled correctly by the unfiltered No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["resolve_version: v == latest"] --> B{latest_installed_version?}
B -->|Some| DONE1[return installed version]
B -->|None| C{is_offline?}
C -->|Yes| ERR[no_versions_found error]
C -->|No| D["latest_version with before_date"]
D -->|Some| DONE2[return resolved version]
D -->|None| E["list_remote_versions — unfiltered by date"]
E --> F{list is empty?}
F -->|No| ERR
F -->|Yes| G{unresolved_latest_version?}
G -->|None| ERR
G -->|Some v| DONE3[return unresolved selector]
Reviews (6): Last reviewed commit: "fix(backend): allow unresolved latest op..." | Re-trigger Greptile |
9c9c938 to
addf3e8
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit addf3e8. Configure here.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.22 x -- echo |
17.5 ± 0.4 | 16.6 | 19.3 | 1.00 |
mise x -- echo |
17.6 ± 0.3 | 16.8 | 18.8 | 1.01 ± 0.03 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.22 env |
17.5 ± 0.5 | 16.5 | 19.3 | 1.00 |
mise env |
17.9 ± 0.5 | 16.9 | 21.0 | 1.02 ± 0.04 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.22 hook-env |
17.9 ± 0.6 | 16.8 | 24.5 | 1.00 |
mise hook-env |
18.3 ± 0.4 | 17.0 | 21.0 | 1.02 ± 0.04 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.22 ls |
18.5 ± 0.5 | 17.4 | 20.2 | 1.00 |
mise ls |
19.1 ± 0.6 | 17.9 | 27.8 | 1.03 ± 0.04 |
xtasks/test/perf
| Command | mise-2026.4.22 | mise | Variance |
|---|---|---|---|
| install (cached) | 121ms | 126ms | -3% |
| ls (cached) | 67ms | 68ms | -1% |
| bin-paths (cached) | 67ms | 67ms | +0% |
| task-ls (cached) | 709ms | 704ms | +0% |
addf3e8 to
0624feb
Compare
b17aabf to
933eb4f
Compare
933eb4f to
483868d
Compare
### 🚀 Features - **(backend)** add global libc preference by @jdx in [#9404](#9404) - opt-in to pre-release versions for github and aqua backends by @jakedgy in [#9329](#9329) ### 🐛 Bug Fixes - **(backend)** allow unresolved latest opt-in by @jdx in [#9401](#9401) - **(install)** stop rewriting healthy runtime symlinks by @jdx in [#9410](#9410) - **(node)** route musl tarball URLs to unofficial-builds by @jdx in [#9409](#9409) - **(prune)** skip remote version resolution for tracked configs by @jdx in [#9406](#9406) - **(schema)** allow array values in tool additionalProperties by @JP-Ellis in [#9400](#9400) ### 📦️ Dependency Updates - bump communique to 1.1.2 by @jdx in [#9402](#9402) ### 📦 Registry - use aqua for rumdl by @scop in [#9397](#9397) ### Chore - **(ci)** improve pr-closer workflow by @jdx in [#9403](#9403) - **(release)** stop appending sponsor blurb when communique succeeds by @jdx in [#9395](#9395) ### New Contributors - @JP-Ellis made their first contribution in [#9400](#9400)
…ends (#9548) ## Summary Backends that opt into installing an unresolved `latest` selector (today only `pipx` for git-backed requests) legitimately return an empty remote version list when their source has no discoverable versions — e.g. a GitHub repo with no releases (only tags). The hard-error path was already addressed in #9401 by falling back to the unresolved selector. What's still left is noise: every command that touches such a tool emits 3–12 repeated `mise WARN No versions found for …` warnings. The repetition comes from #9444 (don't cache empty version lists) — every separate call site that asks for remote versions in the same process re-fetches and re-warns. Underlying GitHub API calls are still deduplicated by `RELEASE_CACHE`, so this is purely log noise, not extra HTTP traffic. This change suppresses the warning when the backend opts into `unresolved_latest_version()`. For those backends an empty list is the expected steady state, not an error worth flagging. Other backends still warn as before, so the warning continues to catch real problems (typo'd repos, configs pointing at the wrong place). Refs #9381. ## Reproduction \`\`\`toml # ~/.config/mise/conf.d/tools.toml [tools] "pipx:a13xp0p0v/kernel-hardening-checker" = "latest" \`\`\` `a13xp0p0v/kernel-hardening-checker` has 0 GitHub releases (14 tags). Before this PR: \`\`\` $ mise current mise WARN No versions found for pipx:a13xp0p0v/kernel-hardening-checker mise WARN No versions found for pipx:a13xp0p0v/kernel-hardening-checker mise WARN No versions found for pipx:a13xp0p0v/kernel-hardening-checker pipx:a13xp0p0v/kernel-hardening-checker latest \`\`\` After: \`\`\` $ mise current pipx:a13xp0p0v/kernel-hardening-checker latest \`\`\` `mise ls`, `mise outdated`, and `mise install` are similarly quiet now. ## Test plan - [x] Manual repro with the discussion's tool — all warnings gone for `mise ls`, `mise current`, `mise outdated`, `mise install` - [x] `mise run lint` - [x] `cargo build` 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: only changes warning emission logic when a backend opts into `unresolved_latest_version()`, with no effect on version fetching or installation behavior. > > **Overview** > Suppresses repeated `No versions found` warnings when `list_remote_versions_with_info` returns an empty list for backends that support installing an unresolved `latest` selector (via `unresolved_latest_version()`). Other backends still warn on empty remote version lists as before. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 9ca20e5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->

Summary
Fixes
latestresolution for backends that can install an unresolved selector when their remote version list is empty.minimum_release_agecannot be evaluated when a backend has no version candidates, but falling back to literallatestfor every empty-list backend is unsafe: some backends require concrete versions and must continue failing rather than creating literallatest/installs. This change keeps the fallback in the central resolver but makes it opt-in throughBackend::unresolved_latest_version().The resolver now only falls back when the backend’s unfiltered remote version list is empty and the backend explicitly provides an unresolved selector. If versions exist but are all filtered out by
minimum_release_age, mise still reports no matching version, preserving the age gate.pipxopts in only for git-backed requests, wherelatestis an installable selector. Its remote version listing remains honest: GitHub repos with no releases return[]fromls-remoteinstead of reportinglatestas a release. Tests also assert GitHub release timestamps are preserved for date filtering.Validation
cargo fmt --checkcargo test backend::pipx::testscargo buildmise run test:e2e e2e/backend/test_fuzzy_versions_do_not_install_literal_dirspipx:a13xp0p0v/kernel-hardening-checker@latestresolves tolatestwithoutminimum_release_agepipx:a13xp0p0v/kernel-hardening-checker@latestwithminimum_release_age = "7d"resolves tolatestpipx:psf/black@latestwithminimum_release_age = "1970-01-01"still reports no matching version instead of falling back to HEADls-remote pipx:a13xp0p0v/kernel-hardening-checker --jsonreturns[]cargo check --all-featuresThis PR description was generated by an AI coding assistant.
Note
Medium Risk
Changes central
@latestresolution behavior by allowing an unresolved selector fallback for opted-in backends when remote version listing is empty, which could affect install outcomes forlatestrequests. Scope is limited via explicit backend opt-in and only triggers in non-offline mode with no remote versions returned.Overview
Fixes
@latestresolution for backends that can install an unresolved selector when no remote versions are discoverable.Adds a new
Backend::unresolved_latest_version()opt-in hook and updatesToolVersion::resolve_versionto fall back to that value only when the backend’s unfiltered remote version list is empty (and only when not offline), preserving failure behavior when versions exist but don’t match date/age filters.Updates
pipxto opt in for git-based requests by returninglatestas an installable unresolved selector, while making its remote version listing for non-GitHub git sources return an empty list (instead of a syntheticlatestversion), and adds tests for GitHub release->version mapping and timestamp preservation.Reviewed by Cursor Bugbot for commit 483868d. Bugbot is set up for automated code reviews on this repo. Configure here.