-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugins: add clean
command to remove inactive plugins/dependencies
#16998
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems pretty straight forward! I like partitioning by plugin gem vs supporting gem dep.
> ~~~ > ╭─{ rye@perhaps:~/src/elastic/logstash@main (pluginmanager-clean-command ✘) } > ╰─● bin/logstash-plugin remove logstash-integration-aws > Using system java: /Users/rye/.jenv/shims/java > Resolving dependencies...... > Resolving dependencies...... > Successfully removed logstash-integration-aws > [success (00:00:06)] > > ╭─{ rye@perhaps:~/src/elastic/logstash@main (pluginmanager-clean-command ✘) } > ╰─● bin/logstash-plugin clean > Using system java: /Users/rye/.jenv/shims/java > cleaned inactive plugin logstash-integration-aws-7.1.8 (java) > cleaned inactive dependency aws-eventstream (1.3.0) > cleaned inactive dependency aws-partitions (1.1043.0) > cleaned inactive dependency aws-sdk-cloudfront (1.109.0) > cleaned inactive dependency aws-sdk-cloudwatch (1.109.0) > cleaned inactive dependency aws-sdk-core (3.217.0) > cleaned inactive dependency aws-sdk-kms (1.97.0) > cleaned inactive dependency aws-sdk-resourcegroups (1.77.0) > cleaned inactive dependency aws-sdk-s3 (1.179.0) > cleaned inactive dependency aws-sdk-sns (1.94.0) > cleaned inactive dependency aws-sdk-sqs (1.91.0) > cleaned inactive dependency aws-sigv4 (1.11.0) > cleaned inactive dependency jar-dependencies (0.4.1) > cleaned inactive dependency jmespath (1.6.2) > [success] > ~~~
a9896fb
to
131e22c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned about something... When i do a clean build (check out this code) and run ./gradlew --console=plain clean bootstrap assemble installDefaultGems
to get a fresh build. Running the clean command a couple times removes some gems we actually need.... Once that happens I get messages about jar-dependencies not being able to be loaded etc. @yaauie Is this a problem with out I'm building/testing? Or is is this an issue we need to dig further in to?
➜ logstash git:(c4196a9676) ✗ bin/logstash-plugin clean
Using system java: /Users/cas/.jenv/shims/java
cleaned inactive dependency public_suffix (6.0.1)
cleaned inactive dependency ruby-maven (3.9.3)
➜ logstash git:(c4196a9676) ✗ bin/logstash-plugin clean
Using system java: /Users/cas/.jenv/shims/java
cleaned inactive dependency jar-dependencies (0.4.1)
➜ logstash git:(c4196a9676) ✗ bin/logstash-plugin clean
Using system java: /Users/cas/.jenv/shims/java
That said I did some additional manual testing with two example gems a
and b
:
➜ logstash git:(c4196a9676) ✗ cat a.gemspec
Gem::Specification.new do |s|
s.name = 'a'
s.version = '0.1.1'
s.summary = "A depends on B"
s.authors = ["Test"]
s.files = [__FILE__]
s.add_runtime_dependency "winrm", ">= 0.1"
s.metadata = { "logstash_plugin" => "true" }
end
➜ logstash git:(c4196a9676) ✗ cat b.gemspec
Gem::Specification.new do |s|
s.name = 'b'
s.version = '0.1.1'
s.summary = "B - no dependencies"
s.authors = ["Test"]
s.files = [__FILE__]
s.add_runtime_dependency "erubi", ">= 0"
s.metadata = { "logstash_plugin" => "true" }
end
I did combinations of adding/removing and cleaning and everything I could come up with worked as expected!
That is in fact concerning. We're just proxying to bundler, so I don't see why that dependency should get cleaned. I'll dig in. |
|
💛 Build succeeded, but was flaky
Failed CI StepsHistory
|
Release notes
bin/logstash-plugin clean
command to allow the plugin manager to prune orphaned dependenciesWhat does this PR do?
adds
bin/logstash-plugin clean
command to allow the plugin manager to prune orphaned dependenciesWhy is it important/What is the impact to the user?
clean
option allows us to build a true subset of the dependency graph after removing plugins that are not needed in a minimalized artifactChecklist
[ ] 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 worksThere are existing tests aroundLogStash::Bunder#invoke!(clean: true)
Author's Checklist
main
is lifted.How to test this PR locally
logstash-integration-aws
)bin/logstash-plugin remove logstash-integration-aws
clean
commandbin/logstash-plugin clean
vendor
Logs