Skip to content

[CFX-6915] Fix plugin update/discovery bug in XDG_CONFIG_DIRS#677

Open
victorborshak wants to merge 2 commits into
datarobot-oss:mainfrom
victorborshak:vborshak/CFX-6915-fix-plugin-discovery-bug
Open

[CFX-6915] Fix plugin update/discovery bug in XDG_CONFIG_DIRS#677
victorborshak wants to merge 2 commits into
datarobot-oss:mainfrom
victorborshak:vborshak/CFX-6915-fix-plugin-discovery-bug

Conversation

@victorborshak

@victorborshak victorborshak commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

RATIONALE

In plugin update/validate/backup flows, plugin discovery did not take into account plugins installed in XDG_CONFIG_DIRS (only those installed in XDG_CONFIG_HOME or ~/.config were discovered). This PR fixes it.

CHANGES

PR Automation

Comment-Commands: Trigger CI by commenting on the PR:

  • /trigger-smoke-test or /trigger-test-smoke - Run smoke tests
  • /trigger-install-test or /trigger-test-install - Run installation tests

Labels: Apply labels to trigger workflows:

  • run-smoke-tests or go - Run smoke tests on demand (only works for non-forked PRs)

Important

For Forked PRs: The run-smoke-tests label won't work. A required Smoke Tests check will block merge until a maintainer acts:

  • A maintainer uses /approve-smoke-tests to run smoke tests (results will set the check)
  • A maintainer uses /skip-smoke-tests to bypass the check without running tests

Please comment requesting a maintainer review if you need smoke tests to run.


Note

Low Risk
Localized change to installed-plugin metadata listing with behavior covered by new tests; install/uninstall paths still use the primary dir only.

Overview
GetInstalledPlugins no longer reads only the primary managed plugins path (XDG_CONFIG_HOME / ~/.config). It now walks every directory returned by ManagedPluginsDirs, in priority order, and deduplicates by plugin name so XDG_CONFIG_HOME wins when the same name exists in multiple locations.

The per-directory scan is moved into getInstalledPluginsInDir; missing secondary dirs are still treated as empty (no error). New tests cover discovery-only-in-XDG_CONFIG_DIRS, shadowing, merging distinct names, and skipping a non-existent XDG_CONFIG_DIRS entry.

Reviewed by Cursor Bugbot for commit 6e0a2cf. Configure here.

@datarobot-pr-review-router

Copy link
Copy Markdown

👋 Thanks so much for contributing to the DataRobot community!

As a quick heads-up on how our team handles reviews: if you're still iterating on
this code or running tests, please feel free to convert this to a Draft PR.
We rely heavily on GitHub Drafts to give contributors a stress-free sandbox to experiment!

Once everything is finalized and you're ready for feedback, just click "Ready for review"
and the maintainers will be notified to jump in. (And if this PR is already 100% ready
to go, no action needed, we'll take a look soon!)

@datarobot-pr-review-router

Copy link
Copy Markdown

Code Ownership

Cli Maintainers

  • internal/plugin/remote.go
  • internal/plugin/remote_test.go

Review requested from the teams above. Labels will be removed automatically upon approval.

@victorborshak victorborshak changed the title [CFX-6915] Fix plugin discovery/install bug in XDG_CONFIG_DIRS [CFX-6915] Fix plugin update/discovery bug in XDG_CONFIG_DIRS Jul 17, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 6e0a2cf. Configure here.

Comment thread internal/plugin/remote.go
}

return installed, nil
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Discovery-mutation inconsistency for XDG_CONFIG_DIRS plugins

Medium Severity

GetInstalledPlugins now discovers plugins from XDG_CONFIG_DIRS via ManagedPluginsDirs(), but UninstallPlugin, BackupPlugin, ValidatePlugin, and RestorePlugin still use ManagedPluginsDir() (singular, primary directory only). A plugin discovered exclusively from XDG_CONFIG_DIRS will pass the "is installed" check in the uninstall/update commands, but the subsequent operation will fail with "Plugin X is not installed" because it only looks in XDG_CONFIG_HOME. Before this PR, both discovery and mutation used the same single directory, so they were always consistent.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6e0a2cf. Configure here.

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.

seems valid!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

should be fixed now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@github-actions

Copy link
Copy Markdown
Contributor

🔐 Fork smoke tests started by maintainer

⏳ Security scans passed. Running smoke tests...

Commit: 6fbd43aa053417142a08ff364065adb91ea1879c
View run

@github-actions

Copy link
Copy Markdown
Contributor

All smoke tests passed! (Fork PR)

✅ Security Scan: success
✅ Linux: success
✅ Windows: success

View run details

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants