Initial support for experimental features within Data Prepper plugins.#6811
Merged
dlvenable merged 3 commits intoopensearch-project:mainfrom May 6, 2026
Merged
Conversation
This allows plugin authors to add an @experimental annotation to configuration fields where the default value is null. This works well especially for nested configurations. The approach to implementing this is to expand our Hibernate Validator to be able to get custom ConstraintValidator instances from the Spring application context. This adds an ExperimentalFeatureValidator which implements ConstraintValidator for the @experimental annotation. This allows data-prepper-api to retain the @experimental annotation but not have any knowledge of how the constraint is implemented. Signed-off-by: David Venable <dlv@amazon.com>
8a05cf9 to
2655a78
Compare
…ompatibility test. These elements are not breaking backward compatibility. They have default values and Java handles them at runtime. However, the byte code does generate abstract methods, which are generally backward incompatible. That is why it is flagged as a breaking change. Signed-off-by: David Venable <dlv@amazon.com>
dlvenable
commented
May 1, 2026
| } | ||
|
|
||
|
|
||
| tasks.named('validateCompatibility') { |
Member
Author
There was a problem hiding this comment.
See the PR description for details on this change.
divbok
reviewed
May 6, 2026
| final ConstraintValidator<?, ?> instance = objectUnderTest.getInstance(constraintValidator.getClass()); | ||
|
|
||
| assertThat(instance, notNullValue()); | ||
| } |
Collaborator
There was a problem hiding this comment.
nit: Add unit tests for releaseInstance method
Member
Author
There was a problem hiding this comment.
@divbok , That is good feedback.
I also refactored the code some to support dependency injection and to improve the tests for this class.
…ors the class to support dependency injection for cleaner testing. Signed-off-by: David Venable <dlv@amazon.com>
divbok
approved these changes
May 6, 2026
This file contains hidden or 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
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.
Description
With this change plugin authors can add an
@Experimentalannotation to configuration fields where the default value isnull. This works well especially for nested configurations. If the@Experimentalhas a non-default, it will violate the validation for now.The approach to implementing this is to expand our Hibernate Validator to be able to get custom
ConstraintValidatorinstances from the Spring application context. This adds anExperimentalFeatureValidatorwhich implementsConstraintValidatorfor the@Experimentalannotation. This allows data-prepper-api to retain the@Experimentalannotation but not have any knowledge of how the constraint is implemented.This solution builds on the work for #2695, but extends it to features within plugins. For now, I've taken the approach that you must
enable_allexperimental plugins and features for this to work.I plan to use this to implement pull-based ingestion per #6796 without creating a strict change to the
opensearchplugin.Issues Resolved
N/A
Note on backward compatibility
This changes adds new annotation elements to
@Experimental. These elements were flagged by japicmp as incompatible. This is probably strictly true at a byte-code level. They generate abstract methods. However, the Java runtime automatically implements these. As these elements all have default values, Java will give expected values.I have excluded these methods from the backward compatibility checks to resolve this.
There is a related issue for japicmp: siom79/japicmp#249
Also, JUnit hit this problem and solved it in a similar way per this comment.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.