Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Feb 19, 2025

Backport PR #17030 to 9.0 branch, original message:


Release notes

The plugin manager bin/logstash-plugin's remove command now allows multiple plugins to be removed in a single call. This simplifies removing plugins that depend on other plugins, so that the caller no longer needs to perform the removals in dependency order.

What does this PR do?

Removal works by optimistically removing all specified plugin-gems from a mutable gemspec, then validating that doing so does not leave plugin-gems with orphaned runtime dependencies, saving the result and succeeding only if no conflicts were created.

╭─{ rye@perhaps:~/src/elastic/logstash@main (pluginmanager-remove-multiple ✘) }
╰─● bin/logstash-plugin remove logstash-input-syslog logstash-filter-grok
Using system java: /Users/rye/.jenv/shims/java
Resolving dependencies......
Successfully removed logstash-input-syslog
Successfully removed logstash-filter-grok
[success (00:00:05)]

Why is it important/What is the impact to the user?

Because the plugin manager (rightly) refuses to remove plugins that are depended on by other plugins and the plugin manager has historically only allowed one plugin to be removed at a time, the caller removing many plugins has needed to be aware of dependency order.

By allowing a list of plugins to be provided, the plugin manager is able to remove the requirement for dependency-order, and is able to handle the removals in a single execution.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • TODO: file separate docs issue/PR

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

Removal works in a single pass by finding plugins that would have unmet
dependencies if all of the specified plugins were to be removed, and
proceeding with the removal only if no conflicts were created.

> ~~~
> ╭─{ rye@perhaps:~/src/elastic/logstash@main (pluginmanager-remove-multiple ✘) }
> ╰─● bin/logstash-plugin remove logstash-input-syslog logstash-filter-grok
> Using system java: /Users/rye/.jenv/shims/java
> Resolving dependencies......
> Successfully removed logstash-input-syslog
> Successfully removed logstash-filter-grok
> [success (00:00:05)]
~~~

(cherry picked from commit 0895588)
@elastic-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Copy link
Member

@yaauie yaauie left a comment

Choose a reason for hiding this comment

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

Clean & Green ✅

@yaauie yaauie merged commit de68d4b into 9.0 Feb 19, 2025
5 checks passed
@yaauie yaauie deleted the backport_17030_9.0 branch February 19, 2025 23:42
andsel added a commit that referenced this pull request Mar 10, 2025
andsel added a commit that referenced this pull request Apr 7, 2025
* Update release notes for 8.18.0

* Refined release notes

* Updated plugins section after Nokogiri update

* Updated release docs after backport of #17185

* Re-added plugins section for 8.18.0

* Update after backport of #17120

* Update release notes with plugin changes

* Update release notes with recent changes

* Update docs/static/releasenotes.asciidoc

Co-authored-by: Karen Metts <[email protected]>

* Removed duplicated PR description

Co-authored-by: Karen Metts <[email protected]>

* Moved JDK update section before the plugin section

---------

Co-authored-by: logstashmachine <[email protected]>
Co-authored-by: andsel <[email protected]>
Co-authored-by: Karen Metts <[email protected]>
mergify bot pushed a commit that referenced this pull request Apr 15, 2025
* Update release notes for 8.18.0

* Refined release notes

* Updated plugins section after Nokogiri update

* Updated release docs after backport of #17185

* Re-added plugins section for 8.18.0

* Update after backport of #17120

* Update release notes with plugin changes

* Update release notes with recent changes

* Update docs/static/releasenotes.asciidoc

Co-authored-by: Karen Metts <[email protected]>

* Removed duplicated PR description

Co-authored-by: Karen Metts <[email protected]>

* Moved JDK update section before the plugin section

---------

Co-authored-by: logstashmachine <[email protected]>
Co-authored-by: andsel <[email protected]>
Co-authored-by: Karen Metts <[email protected]>
(cherry picked from commit 5a66afa)
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.

2 participants