-
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
Reimplement LogStash::String setting in Java #16576
base: main
Are you sure you want to change the base?
Conversation
f1abaf3
to
8ffcede
Compare
c3bcbd5
to
0602b98
Compare
end | ||
end | ||
context 'to an invalid value not in the allow-list' do | ||
let(:possible_strings) { %w(this that)} | ||
let(:candidate_value) { "another" } # wrong type, expects String | ||
it 'is an invalid setting' do | ||
expect { nullable_setting.validate_value }.to raise_error(ArgumentError, a_string_including("Invalid value")) | ||
expect { nullable_setting.validate_value }.to raise_error(java.lang.IllegalArgumentException, a_string_including("Invalid value")) |
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.
…stead of Ruby one
…ingWithDeprecatedAlias spec test.
…when it closes the logger context
Reworked log capture in setting_with_deprecated_alias_spec to use Logger's addAppender and a spy appender implementation. This leverages the idea to don't reconfigure the Log4J with a custom build configuration, but simply adding an appender that could spy the appended lines to a logger.
…e also in runner_spec, removing the programmatic configuration way
91e2048
to
180d597
Compare
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
💚 Build Succeeded
History
cc @andsel |
Release notes
[rn:skip]
What does this PR do?
Reimplements
LogStash::Setting::String
Ruby setting class into theorg.logstash.settings.StringSetting
and exposes it throughjava_import
asLogStash::Setting::StringSetting
.Updates the rspec tests in two ways:
java.lang.IllegalArgumentException
instead ofArgumentError
is thrown because the kind of exception thrown by Java code, during verification.Why is it important/What is the impact to the user?
As a developer I want use Java classes to shape the configuration settings.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files (and/or docker env variables)Author's Checklist
SPEC_OPTS="-fd -P logstash-core/spec/logstash/runner_spec.rb" ./gradlew --rerun-tasks :logstash-core:rubyTests
there is a problem in reading the deprecation logger messages inlogstash/logstash-core/spec/logstash/runner_spec.rb
Line 269 in 467ab3f
Appender
and reconfigure logs?LogStash::String.new
[ ] Renameconverting means to make explicit reference toStringSetting
toString
and use explicitjava.lang.String
aroundjava.lang.String
in all places inside the packageorg.logstash.settings.*
.How to test this PR locally
config.field_reference.escape_style
inconfig/logstash.yml
Related issues