-
Notifications
You must be signed in to change notification settings - Fork 138
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
[Enhancement] Enhance validation for create connector API #3260
[Enhancement] Enhance validation for create connector API #3260
Conversation
ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/ConnectorUtils.java
Outdated
Show resolved
Hide resolved
common/src/test/java/org/opensearch/ml/common/connector/ConnectorActionTest.java
Outdated
Show resolved
Hide resolved
common/src/test/java/org/opensearch/ml/common/connector/ConnectorActionTest.java
Outdated
Show resolved
Hide resolved
The overall change looks fine to me, added some nitpicks. Thanks for the contribution! |
db98d71
to
f1d1af1
Compare
common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInput.java
Outdated
Show resolved
Hide resolved
common/src/test/java/org/opensearch/ml/common/connector/ConnectorActionTest.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/opensearch/ml/common/connector/ConnectorAction.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/opensearch/ml/common/connector/ConnectorAction.java
Outdated
Show resolved
Hide resolved
common/src/test/java/org/opensearch/ml/common/connector/ConnectorActionTest.java
Outdated
Show resolved
Hide resolved
f1d1af1
to
22eb03d
Compare
This PR addresses the first part of this enhancement "Validate if connector payload has all the required fields. If not provided, throw the illegal argument exception". Validation of fields description, parameters, credential, and request_body are missing. That validations are added in this fix. Added new test cases correspong to these validations and fixed all failing test cases because of these new validations. Partially Resolves opensearch-project#1382 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
22eb03d
to
ff5392b
Compare
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 for your contribution.
LGTM, thanks for adding the null or empty checks for credentials! Just a following up thoughts, if we can check if the credentials is valid in the create API, that would be even better as a further enhancement coming next. Then we can help user ensure the credentials work before calling the model. |
This PR addresses the first part of this enhancement "Validate if connector payload has all the required fields. If not provided, throw the illegal argument exception". Validation of fields description, parameters, credential, and request_body are missing. That validations are added in this fix. Added new test cases correspong to these validations and fixed all failing test cases because of these new validations. Partially Resolves #1382 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]> (cherry picked from commit 58903ba)
Ok, copied this to bug #2993 to include in the upcoming enhancement. |
Description
This PR addresses the first part of this enhancement "Validate if connector payload has all the required fields. If not provided, throw the illegal argument exception". Validation of field credentials is added in this fix. All other validations already exist. Added new test cases corresponding to this validation, fixed all failing test cases because of this new validation and refactored some of the test case code.
Related Issues
Partially Resolves #2993
Check List
--signoff
.- [ ] Public documentation issue/PR created.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.