-
Notifications
You must be signed in to change notification settings - Fork 141
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
add register action request/response #1769
Conversation
Signed-off-by: Yaliang Wu <ylwu@amazon.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1769 +/- ##
============================================
+ Coverage 82.53% 82.69% +0.16%
- Complexity 4719 4745 +26
============================================
Files 459 462 +3
Lines 18881 18940 +59
Branches 1976 1976
============================================
+ Hits 15583 15662 +79
+ Misses 2471 2451 -20
Partials 827 827
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
common/src/main/java/org/opensearch/ml/common/transport/undeploy/MLUndeployModelsResponse.java
Show resolved
Hide resolved
Signed-off-by: Yaliang Wu <ylwu@amazon.com>
for (MLToolSpec toolSpec : tools) { | ||
String toolName = Optional.ofNullable(toolSpec.getName()).orElse(toolSpec.getType()); | ||
if (toolNames.contains(toolName)) { | ||
throw new IllegalArgumentException("Tool has duplicate name or alias: " + toolName); |
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.
Can we cover this section in test?.
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.
sure
Signed-off-by: Yaliang Wu <ylwu@amazon.com>
for (MLToolSpec toolSpec : tools) { | ||
String toolName = Optional.ofNullable(toolSpec.getName()).orElse(toolSpec.getType()); | ||
if (toolNames.contains(toolName)) { | ||
throw new IllegalArgumentException("Duplicate tool defined: " + toolName); |
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.
Is it expected to throw this exception or just remove the redundancy in the tools and return normally?
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.
Yes, it's expected, we can't remove redundancy for the user automatically as we don't know which one is the correct.
* add register action request/response Signed-off-by: Yaliang Wu <ylwu@amazon.com> * add ut for MLUndeployModelsResponse Signed-off-by: Yaliang Wu <ylwu@amazon.com> * add more ut Signed-off-by: Yaliang Wu <ylwu@amazon.com> --------- Signed-off-by: Yaliang Wu <ylwu@amazon.com> (cherry picked from commit 94c5d21)
* add register action request/response Signed-off-by: Yaliang Wu <ylwu@amazon.com> * add ut for MLUndeployModelsResponse Signed-off-by: Yaliang Wu <ylwu@amazon.com> * add more ut Signed-off-by: Yaliang Wu <ylwu@amazon.com> --------- Signed-off-by: Yaliang Wu <ylwu@amazon.com> (cherry picked from commit 94c5d21) Co-authored-by: Yaliang Wu <ylwu@amazon.com>
* add register action request/response Signed-off-by: Yaliang Wu <ylwu@amazon.com> * add ut for MLUndeployModelsResponse Signed-off-by: Yaliang Wu <ylwu@amazon.com> * add more ut Signed-off-by: Yaliang Wu <ylwu@amazon.com> --------- Signed-off-by: Yaliang Wu <ylwu@amazon.com>
* add register action request/response Signed-off-by: Yaliang Wu <ylwu@amazon.com> * add ut for MLUndeployModelsResponse Signed-off-by: Yaliang Wu <ylwu@amazon.com> * add more ut Signed-off-by: Yaliang Wu <ylwu@amazon.com> --------- Signed-off-by: Yaliang Wu <ylwu@amazon.com>
Description
Add register agent action request/response
Issues Resolved
[List any issues this PR will resolve]
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.