Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add support for prefixed latest version queries in outdated checks#9767

Merged
jdx merged 1 commit into
jdx:mainfrom
roele:issues/outdated-prefix
May 10, 2026
Merged

feat: add support for prefixed latest version queries in outdated checks#9767
jdx merged 1 commit into
jdx:mainfrom
roele:issues/outdated-prefix

Conversation

@roele

@roele roele commented May 10, 2026

Copy link
Copy Markdown
Contributor

The prefix handling in outdated currently only uses the prefix for querying, which leads to wrong latest version shown. You likely want the latest requested version shown for example temurin-17.0.0+35 -> temurin-17.0.19+10 instead of temurin-26.0.1+8.

  ❯ mise outdated java --inactive
name  requested                 current                   latest           source
java  temurin-17.0.0+35         temurin-17.0.0+35         temurin-26.0.1+8 unknown

  ❯ mise outdated java --inactive
name  requested                 current                   latest           source
java  temurin-17.0.0+35         temurin-17.0.0+35         temurin-17.0.19+10 unknown

Copilot AI review requested due to automatic review settings May 10, 2026 14:21

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the mise outdated command to better handle tool versions with prefixes, such as specific Java distributions. It introduces the prefixed_latest_query utility to extract the major version segment from a prefixed version string, ensuring that version updates are constrained to the appropriate prefix. The changes include comprehensive unit and E2E tests to validate this behavior. I have no feedback to provide.

@greptile-apps

greptile-apps Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes mise outdated (and --inactive) for tools with vendor prefixes (e.g. temurin-17.0.0+35): instead of querying the backend for the absolute latest across all prefixed versions, it now restricts the query to the major version of the requested spec (e.g. temurin-17), so the reported latest stays within the same major line.

  • Adds prefixed_latest_query which extracts the first version chunk via chunkify_version and builds a narrowed query string; correctly short-circuits for empty prefixes, empty versions, and colon-containing prefix formats.
  • Introduces a new test_outdated_slow e2e test that installs [email protected] and asserts the reported latest contains temurin-21.0.

Confidence Score: 5/5

Safe to merge — the core logic change is small, well-guarded, and thoroughly unit-tested; the only gap is a missing teardown in the new e2e test.

The prefixed_latest_query function is straightforward and all meaningful edge cases (empty prefix, empty version, colon-prefixed versions, date-style versions, ea tags) are covered by unit tests. The behavioral change on the use_backend_latest path is intentional and matches the documented motivation. No correctness issues were found in the Rust code.

e2e/cli/test_outdated_slow — missing teardown leaves a Java installation behind after the test runs.

Important Files Changed

Filename Overview
src/toolset/outdated_info.rs Adds prefixed_latest_query helper that restricts the version query to the major component of the requested version when a prefix is present (e.g. temurin-17.0.0+35 → query temurin-17), and wires it into the use_backend_latest code path. Well-tested with unit tests covering prefixed, date-based, ea, colon-containing, and empty inputs.
e2e/cli/test_outdated_slow New e2e test for prefixed latest queries using a real temurin-21.0.0 install. Missing teardown (mise uninstall java --all) after the assertion leaves a stale Java installation.

Reviews (3): Last reviewed commit: "feat: add support for prefixed latest ve..." | Re-trigger Greptile

Comment thread e2e/cli/test_outdated Outdated
Comment thread e2e/cli/test_outdated Outdated
Comment thread src/toolset/outdated_info.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates mise outdated latest-version resolution so vendor-prefixed versions (e.g., temurin-17.0.0+35) query for the latest within the requested major (temurin-17…) instead of returning the absolute latest for the vendor prefix (temurin-26…). This fits into the toolset/outdated reporting path by improving how OutdatedInfo chooses the backend “latest” query in --inactive/--bump scenarios.

Changes:

  • Build a more specific backend latest-version query for prefixed versions by combining the vendor prefix with the first parsed version chunk (typically major).
  • Add unit tests covering the new prefixed-query helper.
  • Add an e2e assertion validating prefixed latest behavior for Java --inactive output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/toolset/outdated_info.rs Adds prefixed_latest_query and uses it when resolving backend “latest” for bumps/inactive-unknown tools.
e2e/cli/test_outdated Adds an e2e check intended to validate prefixed latest-version behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/toolset/outdated_info.rs
Comment thread e2e/cli/test_outdated Outdated
@roele roele force-pushed the issues/outdated-prefix branch from 18dd47c to b207247 Compare May 10, 2026 14:28
@roele roele force-pushed the issues/outdated-prefix branch from b207247 to bbb5147 Compare May 10, 2026 14:35
@jdx jdx merged commit 7b901c1 into jdx:main May 10, 2026
33 checks passed
@roele roele deleted the issues/outdated-prefix branch May 10, 2026 17:35
mise-en-dev added a commit that referenced this pull request May 11, 2026
### 🚀 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)
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.

4 participants