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

   ### What changes were proposed in this pull request?
   
   Add an optional owner to `MetalakeDTO` and populate it for each visible 
metalake returned by `GET /api/metalakes`. Return explicit `owner: null` when 
authorization is disabled or no owner is assigned. Update the OpenAPI schema 
and add HTTP JSON and DTO compatibility tests.
   
   ### Why are the changes needed?
   
   Clients need ownership alongside metalake list entries without making 
separate owner requests. The MCP `list_metalakes` tool forwards these entries 
and will also expose the owner.
   
   Fix: #13127
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Listed metalakes include `owner: {"name": "alice", "type": "user"}` or 
a group owner using `type: "group"`. Unavailable ownership is represented as 
`null`.
   
   Since `MetalakeDTO` is shared, other metalake responses also serialize 
`owner: null` when their operations do not load ownership. Existing response 
fields remain intact, and responses without the new field can still be 
deserialized. Ownership lookup adds one dispatcher call per visible metalake 
when authorization is enabled.
   
   ### How was this patch tested?
   
   - 21 tests passed: `TestMetalakeOperations` (13) and `TestDTOJsonSerDe` (8).
   - HTTP tests use the production `ObjectMapperProvider` and check user/group 
owners and explicit null values for unassigned ownership and disabled 
authorization.
   - DTO tests verify owner round trips and compatibility with older JSON 
without an owner field.
   - Module Spotless checks, `:docs:build`, and `git diff --check` passed.
   
   HTTP tests use mocked metalake and owner dispatchers; no live database 
integration test was run.
   


-- 
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