-
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
[Backport 2.x] [Enhancement] Enhance validation for create connector API #3287
base: 2.x
Are you sure you want to change the base?
Conversation
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)
|
Hi @akolarkunnu in ConnectorActionTest.java, there is unused imported in 2.x branch, can you clone this branch and apply the new commit to fix it? backport/backport-3260-to-2.x |
ok, I will check. |
@mingshl There is no any unused imports. But it is complaining about String Blocks(line number 103). String Blocks are introduced in JDK15. And this project(ml-commons 2.x branch) is based on JDK17. So it should not complain. Or Am I missing anything? |
@akolarkunnu try checking the Spotless configuration in the build file to ensure it's set up correctly for Java 17. And check if the project's build configuration in build.gradle is correctly set to use Java 17. |
|
||
XContentBuilder builder = XContentBuilder.builder(XContentType.JSON.xContent()); | ||
action.toXContent(builder, ToXContent.EMPTY_PARAMS); | ||
String content = TestHelper.xContentBuilderToString(builder); | ||
Assert.assertEquals("{\"action_type\":\"PREDICT\",\"method\":\"http\",\"url\":\"https://test.com\"}", content); | ||
String expctedContent = """ |
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.
This doesn't support in Java 17. In main branch, we use JAVA 21 which support this string. So for you I would suggest to do:
- Fix main branch code with not using
"""
- And then backport both of the commits together in 2.x branch.
Backport 58903ba from #3260