LuciferYang opened a new pull request, #13564:
URL: https://github.com/apache/gravitino/pull/13564

   ### What changes were proposed in this pull request?
   
   Cherry-pick of #13524 to branch-1.3. `UserGroupManager.addUser`, 
`removeUser`, `addGroup`, and `removeGroup` now call 
`MetalakeManager.checkMetalake` on entry, so a missing or not-in-use metalake 
surfaces the documented `NoSuchMetalakeException` / `MetalakeNotInUseException` 
instead of a raw entity error.
   
   The automatic cherry-pick in #13559 conflicted because branch-1.3 does not 
have the bulk user/group feature that #13524's test sat next to on main. This 
PR applies the same fix adapted to branch-1.3: the two new tests, plus the 
`NameIdentifier` and `MetalakeManager` imports that branch-1.3's 
`UserGroupManager` did not yet have. It supersedes #13559.
   
   ### Why are the changes needed?
   
   Backport the fix for #13519 to branch-1.3.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Adding or removing a user or group in a missing or disabled metalake now 
returns the documented metalake exception instead of a generic entity error. No 
API or property changes.
   
   ### How was this patch tested?
   
   `testAddRemoveUserGroupChecksMetalakeExists` asserts all four methods throw 
`NoSuchMetalakeException` for a missing metalake; 
`testAddRemoveUserGroupRejectsDisabledMetalake` asserts 
`MetalakeNotInUseException` for a disabled one. Both fail against the pre-fix 
code.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to