Skip to content

[2.1] Replacing a default policy or role keeps it protected (backport 2.1 #38847) - #38956

Merged
manerow merged 1 commit into
2.1from
backport-2.1-policy-system-marks
Nov 27, 2026
Merged

manerow merged 1 commit into
2.1from
backport-2.1-policy-system-marks

Conversation

@manerow

@manerow manerow commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Cherry-pick of PR #38847 (issue #38846).

Verification

  • One conflict, in the migration folder: on main the PR filled the 2.1.2 postDataMigrationSQLScript.sql files, which already existed there empty, while 2.1 has no 2.1.2 folder. They are added here with the same SQL as main. Every other file is the same patch.
  • 2.1 is version 2.1.2 and has no Java migration class for 2.1.2, so the folder runs with the default migration process.
  • 2.1 seeds the same protected default policies and roles that the migration names, so DefaultSystemMarksMigrationTest holds here too.
  • On 2.1: DefaultSystemMarksMigrationTest passes (4 tests), and PolicyResourceIT and RoleResourceIT pass on both PostgreSQL and MySQL (460 tests each, 0 failures), including the six new tests. spotless:check passes.

Summary by Gitar

  • Protected defaults:
    • PUT on default policies and roles now keeps provider and allowDelete from the stored entity
    • PATCH that clears system delete protection or changes provider is rejected with a 400
  • Data migration:
    • Added 2.1.2 postDataMigrationSQLScript.sql for MySQL and PostgreSQL to restore system marks on default policies and roles
  • Tests:
    • Added DefaultSystemMarksMigrationTest and integration tests in PolicyResourceIT and RoleResourceIT

This will update automatically on new commits.

@manerow
manerow requested a review from a team as a code owner November 27, 2026 09:53
@manerow manerow added backend skip-pr-checks Bypass PR metadata validation check labels Nov 27, 2026
@manerow
manerow requested review from IceS2 and removed request for a team November 27, 2026 09:53
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@manerow
manerow merged commit fd90d52 into 2.1 Nov 27, 2026
44 of 45 checks passed
@manerow
manerow deleted the backport-2.1-policy-system-marks branch November 27, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant