Allow removing plugin that's optionally extended#20417
Allow removing plugin that's optionally extended#20417cwperks merged 7 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Craig Perkins <cwperx@amazon.com>
📝 WalkthroughWalkthroughfindPluginsByDependency now returns two lists (required dependents and optional extenders). The plugin removal flow uses both lists: required dependents still block removal, while optional extenders are collected and emitted as a warning. CHANGELOG updated with a Fixed entry. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CLI as RemovePluginCommand
participant Service as PluginsService
participant FS as PluginsDir/FileSystem
User->>CLI: remove <pluginName>
CLI->>Service: findPluginsByDependency(pluginsDir, pluginName)
Service-->>CLI: Tuple(requiredBy, optionallyExtendedBy)
alt requiredBy non-empty
CLI->>User: print error blocking removal (list requiredBy)
else requiredBy empty
alt optionallyExtendedBy non-empty
CLI->>User: print warning (list optionallyExtendedBy)
end
CLI->>FS: delete plugin directory
FS-->>CLI: deletion result
CLI->>User: print success/failure
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2026-01-13T17:40:27.167ZApplied to files:
🧬 Code graph analysis (2)server/src/test/java/org/opensearch/plugins/PluginsServiceTests.java (1)
distribution/tools/plugin-cli/src/main/java/org/opensearch/tools/cli/plugin/RemovePluginCommand.java (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
🔇 Additional comments (3)
✏️ Tip: You can disable this entire section by setting Comment |
Signed-off-by: Craig Perkins <cwperx@amazon.com>
server/src/main/java/org/opensearch/plugins/PluginsService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Craig Perkins <cwperx@amazon.com>
|
❌ Gradle check result for 6661e58: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
server/src/main/java/org/opensearch/plugins/PluginsService.java
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #20417 +/- ##
============================================
- Coverage 73.32% 73.22% -0.11%
+ Complexity 71862 71797 -65
============================================
Files 5793 5792 -1
Lines 328644 328629 -15
Branches 47313 47307 -6
============================================
- Hits 240990 240629 -361
- Misses 68324 68706 +382
+ Partials 19330 19294 -36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Craig Perkins <cwperx@amazon.com>
…penSearch into remove-optional-plugin
…20417) * Allow removing plugin that's optionally extended Signed-off-by: Craig Perkins <cwperx@amazon.com> * Add to CHANGELOG Signed-off-by: Craig Perkins <cwperx@amazon.com> * Address feedback Signed-off-by: Craig Perkins <cwperx@amazon.com> * Address feedback Signed-off-by: Craig Perkins <cwperx@amazon.com> * Address feedback Signed-off-by: Craig Perkins <cwperx@amazon.com> --------- Signed-off-by: Craig Perkins <cwperx@amazon.com>
…20417) * Allow removing plugin that's optionally extended Signed-off-by: Craig Perkins <cwperx@amazon.com> * Add to CHANGELOG Signed-off-by: Craig Perkins <cwperx@amazon.com> * Address feedback Signed-off-by: Craig Perkins <cwperx@amazon.com> * Address feedback Signed-off-by: Craig Perkins <cwperx@amazon.com> * Address feedback Signed-off-by: Craig Perkins <cwperx@amazon.com> --------- Signed-off-by: Craig Perkins <cwperx@amazon.com>
Description
This is a small PR to fix an issue calling
./bin/opensearch-plugin remove <plugin-name>on a plugin that is optionally extended from another installed plugin. Given that the plugin is optionally extensible, it means the extending plugin does not require for it to be installed.Tested by installing workload-management, then security and then removing workload-management.
Before the change it fails with the message from the linked issue. After the change workload-management can be removed as expected.
Related Issues
Resolves #20387
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.