-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: introduce validateFields method to SourceConnectionConfig and implement validation for all source configurations #3956
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,4 +23,11 @@ | |
| * | ||
| * <p>This interface will be expanded in Phase 2 during the platformization phase. | ||
| */ | ||
| public interface SourceConnectionConfig {} | ||
| public interface SourceConnectionConfig { | ||
|
|
||
| /** | ||
| * Validates that the source configuration is valid. Throws IllegalArgumentException if the | ||
| * configuration is invalid. | ||
| */ | ||
| void validateFields(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the validation is implemented at the source, then it can be private. This method should not be required.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only validates the null checks and basic checks. It is called by the SourceConfigParser before returning the config. Interface fields cannot be private.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If validate is called in each of the flows right after reading the config, then this validation is not really achieving anything. Especially if the code of what to validate is within the source implementation. The value of the validate would be if it lies outside of the source implementation. Can you think of a scenario where the source specific validation can not be done while reading the source config ? |
||
| } | ||
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.
secret manager or password can be null. It is possible to pass only one of them.
Can you please verify the logic here ?
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.
We have integration tests for both secretManagerUri and password. Unless someone sets the value as null manually in the JSON or HOCON string, these values will not be null.
Hence, this check is added.
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.
2 questions