Skip to content

[Cherry-pick to branch-1.3] [#12685] fix(core): Fix built-in policy supportedObjectTypes validation and error message (#12686) - #12882

Merged
jerryshao merged 1 commit into
branch-1.3from
cherry-pick-cbadfbf9-to-branch-1.3
Sep 3, 2026
Merged

[Cherry-pick to branch-1.3] [#12685] fix(core): Fix built-in policy supportedObjectTypes validation and error message (#12686)#12882
jerryshao merged 1 commit into
branch-1.3from
cherry-pick-cbadfbf9-to-branch-1.3

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Cherry-pick Information:

  • Original commit: cbadfbf
  • Target branch: branch-1.3
  • Status: ✅ Clean cherry-pick (no conflicts)

…on and error message (#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
@github-actions github-actions Bot added the cherry-pick Automatically opened cherry-pick PR label Sep 3, 2026
@github-actions
github-actions Bot requested a review from jerryshao September 3, 2026 10:52
@jerryshao
jerryshao merged commit 510627e into branch-1.3 Sep 3, 2026
35 checks passed
@jerryshao
jerryshao deleted the cherry-pick-cbadfbf9-to-branch-1.3 branch September 3, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick Automatically opened cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants