Repository navigation
[2.1] Fixes #38343: CheckChangeDescription governance rules trigger for sparse entity-reference changes - #38514
Merged
Merged
Conversation
…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
Bot
requested review from
pmbrull
and removed request for
a team
November 23, 2026 16:12
Author
|
🤖 This backport will not merge itself: |
10 of 12 tasks
| } | ||
| validateRoles(user.getRoles()); | ||
| validateDefaultDomain(user); | ||
| validateDefaultPersona(user); |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated backport of #38380 to
2.1.27cc0b0ac582b15fc3b022ae0976d0cd664b930bmain.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
The PR appears safe to merge, with a non-blocking gap in regression coverage for user changes.
Findings
Summary
Hydrates sparse
defaultPersonareferences for teams and users before governance rules inspect their changes.Reviews (1) · Last reviewed commit: "Fixes #38343: CheckChangeDescription gov..." · Reviewed by Greptile