-
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
Open
andsel
wants to merge
13
commits into
elastic:main
Choose a base branch
from
andsel:feature/string_setting_to_java
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andsel
force-pushed
the
feature/string_setting_to_java
branch
from
October 29, 2024 18:18
f1abaf3
to
8ffcede
Compare
andsel
force-pushed
the
feature/string_setting_to_java
branch
from
November 12, 2024 10:10
c3bcbd5
to
0602b98
Compare
andsel
changed the title
Reimplemented LogStash::String setting in Java
Reimplement LogStash::String setting in Java
Nov 12, 2024
andsel
commented
Nov 12, 2024
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
andsel
force-pushed
the
feature/string_setting_to_java
branch
from
November 12, 2024 16:04
91e2048
to
180d597
Compare
Quality Gate passedIssues Measures |
💚 Build Succeeded
History
cc @andsel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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