Skip to content

fix(doctor): list installed plugins from install state#9863

Merged
jdx merged 3 commits into
jdx:mainfrom
risu729:risu/fix-disable-backends-installed-plugins
May 17, 2026
Merged

fix(doctor): list installed plugins from install state#9863
jdx merged 3 commits into
jdx:mainfrom
risu729:risu/fix-disable-backends-installed-plugins

Conversation

@risu729

@risu729 risu729 commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • list installed plugins in mise doctor from install state instead of enabled backend instances
  • include installed plugins in mise doctor -J under a new plugins object
  • avoid probing git metadata for non-git plugin directories

Root Cause

mise doctor rendered plugins by iterating backend::list(). That list respects enabled backends, so plugins installed through a disabled backend could disappear from doctor output even though they were still present in install state. This made it harder to diagnose reports like #6021.

This PR is intentionally scoped to doctor output only. The separate disable_backends resolution behavior change is split into another PR.

Tests

  • mise run test:e2e e2e/backend/test_disable_backends
  • cargo check --all-features
  • mise run lint

This PR description was generated by an AI coding assistant.

@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 the ability to disable specific backends through configuration. It adds validation logic in the backend and CLI argument modules to ensure disabled backends are not utilized, returning an error when attempted. The mise doctor command was also updated to include plugin details in its JSON output, supported by a refactor of plugin-related helper functions. A review comment suggests optimizing the is_disabled_backend_type function to reduce string allocations and improve performance by potentially caching disabled backend types.

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

greptile-apps Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes disable_backends not being respected during plugin visibility in mise doctor. The text and JSON doctor outputs now source the installed-plugin list directly from install_state::list_plugins() instead of the filtered backend::list(), so disabled backends no longer cause their associated plugins to disappear from the doctor report.

  • render_plugins() is refactored to call the new shared installed_plugins() helper, which reads from install_state directly and covers Asdf, Vfox, and VfoxBackend types (previously only Asdf was shown).
  • render_plugins_json() is a new function that serializes installed plugins into a structured JSON object (type, url, ref, sha) and is added as a "plugins" key in the mise doctor -J output.
  • The e2e test is extended to install age via asdf, then confirm it appears in both text and JSON doctor output even when the asdf backend is disabled.

Confidence Score: 5/5

Safe to merge — the change is narrowly scoped to the doctor output path and does not alter any tool resolution logic.

Both code paths call render_plugins()/render_plugins_json() only after Config::get().await completes, guaranteeing install_state::init() has run. The refactor from backend::list() to install_state::list_plugins() is correct for a diagnostic command that should reflect actual on-disk plugin state regardless of which backends are enabled.

No files require special attention.

Important Files Changed

Filename Overview
src/cli/doctor/mod.rs Refactors plugin listing to read from install_state directly (bypassing disabled-backend filter), adds render_plugins_json() for JSON output, and inserts a new "plugins" key in the JSON doctor response
e2e/backend/test_disable_backends Extends the existing disable-backends test to verify that an asdf-installed plugin ("age") is still visible in both text and JSON doctor output when the asdf backend is disabled

Reviews (3): Last reviewed commit: "fix(doctor): isolate installed plugin re..." | Re-trigger Greptile

Comment thread e2e/backend/test_disable_backends Outdated
Comment thread src/cli/args/backend_arg.rs
@risu729

This comment was marked as outdated.

@risu729 risu729 changed the title fix(backend): honor disabled backends during resolution fix(doctor): list installed plugins from install state May 15, 2026
@risu729 risu729 marked this pull request as ready for review May 16, 2026 08:56
@jdx jdx merged commit 5bc25fc into jdx:main May 17, 2026
32 checks passed
@risu729 risu729 deleted the risu/fix-disable-backends-installed-plugins branch May 17, 2026 15:31
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.

2 participants