Skip to content

[2.1] Fixes #38343: CheckChangeDescription governance rules trigger for sparse entity-reference changes - #38514

Merged
yan-3005 merged 1 commit into
2.1from
backport/2.1/pr-38380
Nov 24, 2026
Merged

yan-3005 merged 1 commit into
2.1from
backport/2.1/pr-38380

Conversation

@gh-bot-collate

@gh-bot-collate gh-bot-collate Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Automated backport of #38380 to 2.1.

Source PR #38380
Author @detail-app[bot]
Merge commit 27cc0b0ac582b15fc3b022ae0976d0cd664b930b
Method Clean cherry-pick — identical to the commit on main.

Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #38380 is asked to look.

resolver run

RetriggerView in GreptileConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking gap in regression coverage for user changes.

Findings

  1. P2 User changes lack regression coverage ▶

Summary

Hydrates sparse defaultPersona references for teams and users before governance rules inspect their changes.

  • Team and user writes record the selected persona's full name.

Reviews (1) · Last reviewed commit: "Fixes #38343: CheckChangeDescription gov..." · Reviewed by Greptile

…rse entity-reference changes (#38380)

* Fixes #38343: CheckChangeDescription governance rules trigger for sparse entity-reference changes

* test: assert on PATCH ChangeDescription, not GET-hydrated ref

Address greptile review: the GET rebuilds defaultPersona from the stored
persona (getDefaultPersona via findTo), so it carries a fullyQualifiedName
regardless of the fix. Assert the recorded ChangeDescription's
defaultPersona newValue carries a fullyQualifiedName, which is what the
fix actually changes and what governance rules match against.

* fix: cast FieldChange.getNewValue() to String for compile

getNewValue() returns Object; the defaultPersona change is recorded as a
JSON string via recordChange(..., jsonValue=true), so a direct cast is
correct and unblocks compilation of the integration-tests module.

* Keep the defaultPersona hydration, drop the old-value fallback

Hydrating defaultPersona in TeamRepository/UserRepository is what fixes the
sparse-reference bug: with FieldChangeValueExtractor and
CheckChangeDescriptionTaskImpl back to main, TeamDefaultPersonaIT passes 38/38
(and test_sparseRefPatchIsHydratedWithFullyQualifiedName fails on main).

The fallback matched a rule against the value a field was changed from
whenever the new value was sparse, which changes rule semantics beyond this
bug, and the debug-to-WARN bump would log on every unmatched change. Removed
both and the five unit cases that asserted the fallback.

---------

Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com>
Co-authored-by: Ram Narayan Balaji <[email protected]>
Co-authored-by: Ram Narayan Balaji <[email protected]>
(cherry picked from commit 27cc0b0)
@gh-bot-collate
gh-bot-collate Bot requested a review from a team as a code owner November 23, 2026 16:12
@gh-bot-collate
gh-bot-collate Bot requested review from pmbrull and removed request for a team November 23, 2026 16:12
@gh-bot-collate gh-bot-collate Bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 23, 2026
@gh-bot-collate

Copy link
Copy Markdown
Author

🤖 This backport will not merge itself: 2.1 has no required status checks, so there is nothing for auto-merge to wait on. Merge it by hand once CI is green.

}
validateRoles(user.getRoles());
validateDefaultDomain(user);
validateDefaultPersona(user);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 User changes lack regression coverage

The new UserRepository.validateDefaultPersona path has no test that checks the returned ChangeDescription. The added integration test covers only teams. The existing sparse user PATCH test checks a later GET, which rebuilds the reference and hides this bug.

Extend that user test to assert that the PATCH response records the new persona's fullyQualifiedName. Otherwise, removing the user-side fix would leave every added test passing.

@yan-3005 yan-3005 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean cherry-pick of #38380 (identical patch-id), verified on main.

@yan-3005
yan-3005 merged commit 8d89e72 into 2.1 Nov 24, 2026
48 checks passed
@yan-3005
yan-3005 deleted the backport/2.1/pr-38380 branch November 24, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants