-
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
fix cannot specify model access control parameters error #1068
Conversation
Signed-off-by: Yaliang Wu <[email protected]>
if (input.getModelAccessMode() != null || input.getIsAddAllBackendRoles() != null || input.getBackendRoles() != null) { | ||
if (input.getModelAccessMode() != null | ||
|| input.getIsAddAllBackendRoles() != null | ||
|| !CollectionUtils.isEmpty(input.getBackendRoles())) { |
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.
Seems strange, we better not allow backend_roles
field show up in user's request instead of passing a empty list, can you change to this behavior?
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, think the same. I submit a new commit which add unit test for model group and fix some bug
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.
I think we can change this back to input.getBackEndRoles() != null
, right?
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.
I think keep as CollectionUtils.isEmpty
is safer. Do you see any bug if we keep CollectionUtils.isEmpty
?
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.
I mean we better make the field not showing up when access control is not enabled, user can pass the backend_roles
field with empty list when using CollectionUtils.isEmpty
, I prefer to make the field not shown.
Signed-off-by: Yaliang Wu <[email protected]>
Signed-off-by: Yaliang Wu <[email protected]>
Codecov Report
@@ Coverage Diff @@
## 2.x #1068 +/- ##
============================================
+ Coverage 77.32% 77.33% +0.01%
- Complexity 2052 2054 +2
============================================
Files 167 167
Lines 8532 8534 +2
Branches 846 848 +2
============================================
+ Hits 6597 6600 +3
+ Misses 1557 1555 -2
- Partials 378 379 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
* fix cannot specify model access control parameters error Signed-off-by: Yaliang Wu <[email protected]> * add unit test for model group class and fix some bug Signed-off-by: Yaliang Wu <[email protected]> * fix failed ut Signed-off-by: Yaliang Wu <[email protected]> --------- Signed-off-by: Yaliang Wu <[email protected]> (cherry picked from commit 6294a76)
* fix cannot specify model access control parameters error Signed-off-by: Yaliang Wu <[email protected]> * add unit test for model group class and fix some bug Signed-off-by: Yaliang Wu <[email protected]> * fix failed ut Signed-off-by: Yaliang Wu <[email protected]> --------- Signed-off-by: Yaliang Wu <[email protected]> (cherry picked from commit 6294a76) Co-authored-by: Yaliang Wu <[email protected]>
…project#1068) * fix cannot specify model access control parameters error Signed-off-by: Yaliang Wu <[email protected]> * add unit test for model group class and fix some bug Signed-off-by: Yaliang Wu <[email protected]> * fix failed ut Signed-off-by: Yaliang Wu <[email protected]> --------- Signed-off-by: Yaliang Wu <[email protected]>
* fix cannot specify model access control parameters error Signed-off-by: Yaliang Wu <[email protected]> * add unit test for model group class and fix some bug Signed-off-by: Yaliang Wu <[email protected]> * fix failed ut Signed-off-by: Yaliang Wu <[email protected]> --------- Signed-off-by: Yaliang Wu <[email protected]>
Description
See such error when register pretrained model without model group id,
The reason is
input.getBackendRoles()
is not null, but it's empty.This PR fixed the bug.
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.