-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Do not reference values for filtered settings #48066
Conversation
Pinging @elastic/es-core-infra (:Core/Infra/Settings) |
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.
LGTM
Thanks, @rjernst. Any opinion on whether the same logic should be applied to typed settings such as int, float, date? |
Seems like it should apply to any settings marked as filtered, regardless of type. |
👍 I'll make the same changes for all the types, then. |
@elasticmachine update branch |
@elasticmachine run elasticsearch-ci/packaging-sample |
@rjernst, my second commit on this PR removes any mention of values from validation errors on all typed settings with the |
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.
Thanks, looks good. Just a comment on some tests.
Settings build = Settings.builder().put("foo.bar", "I am not a boolean").build(); | ||
try { | ||
settingUpdater.apply(build, Settings.EMPTY); | ||
fail("not a boolean"); |
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.
Please use expectThrows
instead of try/fail/catch
try { | ||
predicateSettingUpdater.apply(Settings.builder().put("foo.bar.1.value", "1").put("foo.bar.2.value", "2").build(), | ||
Settings.EMPTY); | ||
fail("not accepted"); |
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.
same here, use expectThrows
@elasticmachine update branch |
Validation exceptions are often logged so the value of filtered properties (of any data type) shouldn't be included.