paultanay opened a new pull request, #12686: URL: https://github.com/apache/gravitino/pull/12686
## What changes were proposed in this pull request? Fix the validation of `supportedObjectTypes` when updating built-in policies. `PolicyManager.updatePolicyEntity()` currently uses `Sets.difference(oldTypes, newTypes).isEmpty()`, which only detects removed object types. When the updated set contains additional object types, the validation incorrectly passes. This change: - validates that the old and new supported object type sets are exactly equal; - fixes the validation error message by supplying the expected and actual sets; - adds a regression test covering attempted supported object type changes for a built-in policy. ## Why are the changes needed? Built-in policies must not change their supported metadata object types during an update. The previous asymmetric set comparison did not enforce this invariant for additions. Fixes #12685 -- 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]
