bharos opened a new pull request, #10848: URL: https://github.com/apache/gravitino/pull/10848
### What changes were proposed in this pull request? Remove the USER-only restriction in `OwnerManager.setOwner()` and add GROUP support to `notifyOwnerChange()`, enabling groups to be set as metadata object owners. Changes: - Remove `Preconditions.checkArgument(ownerType == Owner.Type.USER)` guard in `OwnerManager.setOwner()` - Extend `notifyOwnerChange()` to resolve group entity IDs (previously only handled USER, threw `UnsupportedOperationException` for GROUP) - Fix `GroupEntity` namespace in test (was using `ofUserNamespace`, corrected to `ofGroupNamespace`) - Replace `testGroupTypeOwnerNotSupported` with tests that verify group ownership works ### Why are the changes needed? The owner field was implicitly assumed to point to a User. In practice, the logical owner of a resource (Schema, Table, etc.) is often a team (Group) rather than an individual. The downstream layers (REST API, DTOs, relational store) already support GROUP — only `OwnerManager` had a guard blocking it. Fix: #10411 ### Does this PR introduce _any_ user-facing change? Yes. The `setOwner` API now accepts `Owner.Type.GROUP` in addition to `Owner.Type.USER`. ### How was this patch tested? Unit tests in `TestOwnerManager`: - `testGroupTypeOwner`: Sets group as owner, verifies, then replaces with user owner (exercises `notifyOwnerChange` GROUP path) - `testSetNonExistentGroupAsOwner`: Verifies `NotFoundException` for non-existent group -- 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]
