Skip to content

[P3] feat(doctor): Warn when an enabled plugin isn't installed #731

Description

@github-actions

Users who mistype a plugin name in doberman plugins enable get a success message, and nothing tells them later that no installed package provides that plugin.

Problem

plugin_config.enable (src/doberman/engine/plugin_config.py:130) checks only the name's format and then saves it. plugins_enable in src/doberman/cli/main.py prints "Enabled ..." either way. doberman doctor is where you'd expect to catch this, but run_checks has no plugin row (src/doberman/cli/doctor.py:584-601). This is tracked in #719.

Impact

Nothing fails open. An unmatched name never loads anything. But a user can think a plugin protects them when it does not. Today, the only way to spot this is to read doberman plugins list yourself. I couldn't measure how often it happens because the CLI sends no telemetry.

Solution

Add a non-critical _safe_check("Plugins", False, ...) to run_checks. It compares plugin_config.enabled_plugins() with the entry-point names from registry._iter_entry_points across ALL_GROUPS, the same name-only loop that plugins list uses, so no plugin is ever imported or loaded. It prints [warn] enabled but not installed: <name>, and it passes when every enabled name is installed or nothing is enabled. For tests in tests/unit/test_cli_doctor.py, the existing enable_plugins fixture points DOBERMAN_PLUGINS_FILE at tmp_path. Stretch goal: plugins enable writes the same warning to stderr.

Expected impact

I can't give a credible estimate because there's no usage data for this CLI. After the fix, every enabled but uninstalled name shows up on the next doberman doctor run instead of going unnoticed.

  • Actionability: immediately_actionable
  • Inbox status: ready
  • Signals behind it: 1

Open the report in PostHog

Filed automatically from the PostHog Self-driving inbox. It mirrors the finding; the fix is a maintainer's call.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    posthogFiled automatically from the PostHog Self-driving inbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions