Skip to content

feat: add --inactive option to outdated and upgrade commands for inactive tools#9640

Merged
jdx merged 2 commits into
jdx:mainfrom
roele:feature/upgrade-inactive
May 9, 2026
Merged

feat: add --inactive option to outdated and upgrade commands for inactive tools#9640
jdx merged 2 commits into
jdx:mainfrom
roele:feature/upgrade-inactive

Conversation

@roele

@roele roele commented May 6, 2026

Copy link
Copy Markdown
Contributor

Adds a new --inactive flag to outdated and upgrade command to allow to show/upgrade tools which are currently not active or defined in a configuration.

@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 introduces a --no-source flag to the outdated and upgrade commands, allowing users to manage installed tools even if they are not currently active in the configuration. The changes include updates to the CLI arguments, the toolset resolution logic, and the addition of end-to-end tests. Feedback suggests refactoring a redundant match block in outdated_info.rs using the ba() method for better readability and improving error handling in mod.rs by logging warnings instead of silently defaulting on version discovery failures.

Comment thread src/toolset/outdated_info.rs
Comment thread src/toolset/mod.rs Outdated
@greptile-apps

greptile-apps Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a --inactive flag to mise outdated and mise upgrade that surfaces installed-but-unconfigured tools alongside the normal active-tool output. The implementation chains list_all_versions (current + disk-installed) in list_outdated_versions_filtered when the flag is set, uses the backend's absolute latest for inactive (ToolSource::Unknown) entries, and rewrites the tool request to point to that latest before upgrade.

  • upgrade.rs correctly threads filter_tools into list_outdated_versions_filtered, so mise upgrade tool --inactive scopes to just that tool.
  • outdated.rs still calls the zero-argument list_outdated_versions (which forwards filter_tools = None), so the previously-reported issue where mise outdated tool --inactive ignores the tool-name filter remains unaddressed.
  • Two inline comments in outdated_info.rs reference the old working name --no-source instead of --inactive.

Confidence Score: 4/5

The upgrade path is correct, but the outdated command still drops the tool-name filter for inactive entries, a gap carried over from earlier review rounds.

The upgrade --inactive path correctly passes filter_tools so tool-name arguments are respected. However, outdated --inactive still calls list_outdated_versions with filter_tools = None, meaning mise outdated node --inactive reports every inactive tool on disk rather than just node. This unresolved issue in outdated.rs keeps the score from being higher.

src/cli/outdated.rs — the tool-name filter is not forwarded when --inactive is set.

Important Files Changed

Filename Overview
src/cli/outdated.rs Adds --inactive flag; passes it through ResolveOptions but calls list_outdated_versions (which forwards filter_tools=None), so per-tool filtering of inactive entries is silently dropped — already tracked in prior review threads.
src/cli/upgrade.rs Adds --inactive flag and correctly passes filter_tools slice to list_outdated_versions_filtered; tool-level filtering works for inactive entries. ResolveOptions threaded through to both the list and install stages.
src/toolset/mod.rs Branches on opts.inactive to call list_all_versions (current + installed) instead of list_current_versions; filter_tools/exclude_tools are applied uniformly to both active and inactive entries.
src/toolset/outdated_info.rs Uses use_backend_latest for inactive tools and rewrites tool_request to point to latest; two new comments still say --no-source instead of --inactive.
src/toolset/tool_version.rs Adds inactive field to ResolveOptions struct with default false; threaded correctly through ToolVersion::resolve and the Default impl.
e2e/cli/test_outdated New test block correctly removes global config, verifies tiny disappears from normal mise outdated, then reappears with --inactive.
e2e/cli/test_upgrade New test installs tiny, removes it from config, then verifies mise upgrade tiny --inactive upgrades it to the latest version.

Reviews (9): Last reviewed commit: "[autofix.ci] apply automated fixes" | Re-trigger Greptile

Comment thread e2e/cli/test_outdated Outdated
Comment thread src/cli/outdated.rs
Comment thread e2e/cli/test_outdated Outdated
@roele roele force-pushed the feature/upgrade-inactive branch from 743e34d to caad380 Compare May 6, 2026 17:17
@roele roele marked this pull request as ready for review May 8, 2026 14:16
Copilot AI review requested due to automatic review settings May 8, 2026 14:16

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

Adds a --no-source flag to mise outdated and mise upgrade so they can include/operate on tools that are installed but no longer have a config source (i.e., inactive/not present in the current config), and updates generated/help documentation and completion metadata accordingly.

Changes:

  • Add --no-source flag wiring for outdated and upgrade, plus completion/usage/man/doc updates.
  • Extend outdated/upgrade internals to include installed-but-inactive tool versions and resolve “latest” appropriately for ToolSource::Unknown.
  • Add e2e coverage for showing/upgrading an installed tool after removing it from config.

Reviewed changes

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

Show a summary per file
File Description
xtasks/fig/src/mise.ts Adds --no-source to Fig completion specs for outdated and upgrade.
src/toolset/tool_version.rs Extends ResolveOptions with no_source and threads it through latest-version lookup options.
src/toolset/outdated_info.rs Adjusts latest-version resolution and upgrade request construction for installed-but-inactive tools under --no-source.
src/toolset/mod.rs Switches outdated listing to include installed versions when no_source is set.
src/cli/use.rs Updates ResolveOptions initialization to include the new no_source field; minor help formatting tweak.
src/cli/upgrade.rs Adds --no-source flag and passes it into resolution/install options.
src/cli/outdated.rs Adds --no-source flag and passes it into outdated listing options.
src/cli/install.rs Updates ResolveOptions initialization to include the new no_source field.
mise.usage.kdl Adds --no-source to usage spec for outdated and upgrade (feeds generated docs/man).
man/man1/mise.1 Documents --no-source in the man page for outdated and upgrade.
e2e/cli/test_upgrade Adds e2e test ensuring mise upgrade <tool> --no-source upgrades an installed-but-inactive tool.
e2e/cli/test_outdated Adds e2e test ensuring mise outdated --no-source shows an installed-but-inactive tool.
docs/cli/use.md Minor markdown formatting adjustment in examples section.
docs/cli/upgrade.md Documents --no-source in generated CLI docs for upgrade.
docs/cli/outdated.md Documents --no-source in generated CLI docs for outdated.

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

Comment thread src/toolset/tool_version.rs Outdated
Comment thread src/cli/outdated.rs Outdated
Comment thread src/cli/upgrade.rs Outdated
Comment thread docs/cli/outdated.md Outdated
Comment thread docs/cli/upgrade.md Outdated
@roele roele force-pushed the feature/upgrade-inactive branch from be8938b to a6db3e4 Compare May 8, 2026 15:09
Comment thread docs/cli/outdated.md Outdated
@roele roele force-pushed the feature/upgrade-inactive branch 2 times, most recently from 457bbd1 to 54ddc85 Compare May 8, 2026 15:38
Comment thread src/toolset/mod.rs
@roele roele changed the title feat: add --no-source option to outdated and upgrade commands for inactive tools feat: add --inactive option to outdated and upgrade commands for inactive tools May 8, 2026
@roele roele force-pushed the feature/upgrade-inactive branch from cc9cd55 to f05457f Compare May 8, 2026 18:16
@jdx jdx merged commit 5d469b8 into jdx:main May 9, 2026
33 of 34 checks passed
@roele roele deleted the feature/upgrade-inactive branch May 9, 2026 12:41
mise-en-dev added a commit that referenced this pull request May 10, 2026
### 🚀 Features

- add --inactive option to outdated and upgrade commands for inactive
tools by @roele in [#9640](#9640)

### 🐛 Bug Fixes

- **(aqua)** resolve bin paths for prefixed v tags by @risu729 in
[#9759](#9759)
- **(bun)** create bunx alongside bun.exe on Windows install by
@JamBalaya56562 in [#9732](#9732)
- **(dotnet)** use shared prerelease tool option by @risu729 in
[#9720](#9720)
- **(node)** use matching node in npm shim by @jdx in
[#9749](#9749)
- **(task)** resolve bash deterministically on Windows to avoid WSL
launcher by @JamBalaya56562 in
[#9750](#9750)

### 📚 Documentation

- **(secrets)** clarify age strict mode default by @risu729 in
[#9737](#9737)
- **(tasks)** add bash shebang to conditional-dependencies example by
@JamBalaya56562 in [#9747](#9747)
- update backend tool option docs by @risu729 in
[#9738](#9738)

### 📦 Registry

- remove tools with zero users by @jdx in
[#9725](#9725)
- add scalafmt
([github:scalameta/scalafmt](https://github.com/scalameta/scalafmt)) by
@pokir in [#9757](#9757)
- remove flarectl by @risu729 in
[#9756](#9756)

### Chore

- **(release)** strip pre-existing sponsor block before appending
canonical one by @jdx in [#9745](#9745)

### New Contributors

- @pokir made their first contribution in
[#9757](#9757)
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