Repository navigation
Fixes #37572: Keep a metric's hierarchy, reviewers and experts when ingestion re-PUTs it (backport 2.1 #37575) - #37891
Conversation
…ngestion re-PUTs it (#37575) * Keep a metric's parent and group when ingestion re-PUTs it Connectors never send parent or metricGroup, so every re-ingestion removed the hierarchy users built on ingested metrics and versioned each curated metric. A bot PUT that names no parent now keeps the stored live parent and its inherited group; a root keeps its stored group. A deleted parent is not kept, so the restore rule still holds. ADR:2026-11-11-a-bot-put-never-removes-a-metric-parent-or-group * Test that a group a bot names moves a root but not a child * Keep reviewers and experts when a bot PUT names none Ingestion re-PUTs metrics with no reviewers or experts, and the updater applied the empty lists, so every run cleared what users had assigned. A bot PUT that names none now keeps the stored ones, as owners already do. Also adds re-ingestion ITs for a user-added child under an ingested parent and for related metrics never becoming hierarchy parents. (cherry picked from commit c640011)
|
Local Java test run: PASSED — details
Tests run locally
Per-class counts come from the test reports, which can credit a test to the wrong class when classes run concurrently, and keep only the last run of a nested class that several test classes inherit. The summary's step totals are Maven's own counts. Broader coverage not executed by this focused run
Why these tests
Impacted, not run locally (6)
Commandsmvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=MetricRepositoryTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel -Dit.test=GlossaryTermResourceIT,MetricResourceIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
Code Review ✅ Approved 🔴 High riskChanging bot PUT rules preserves stored metric hierarchy and reviewer/expert assignments, but could retain stale relationships or review assignments when a bot intends removal. Backports the fix that keeps a metric's parent, metric group, reviewers, and experts when ingestion re-PUTs it, carrying the change to the 2.1 release branch. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #37572
Backports #37575 to
2.1. #37575 fixed the issue onmain; this carries the fix to the release branch.Why 2.1 needs it. Metric hierarchy (parent and metric group) is new in 2.1, and no metric connector sends
parentormetricGroup: users build the hierarchy in the UI on top of ingested metrics. On2.1, every scheduled re-ingestion PUTs each metric without those fields and removes the curated hierarchy, versioning every curated metric. The same re-PUT also clears the reviewers and experts users set. We reproduced both on a 2.1 build (2.1.202611160000): after one unchanged re-ingestion, a root lost its group and its child lost its parent (both went v0.2 → v0.3), and a child lost its reviewers and experts when only its expression changed upstream.2.1.0-rc2does not contain the fix.What #37575 does.
MetricUpdater.keepHierarchyTheBotLeftOut: a bot PUT that names no parent keeps a live stored parent and the group inherited from it; a root keeps its stored group unless the bot names one; a stored parent that is deleted is not kept, so the metric comes back as a root (ADR:2026-11-03-a-metric-is-restored-with-its-parent-never-under-a-deleted-one still holds).EntityUpdater.updateReviewers/updateExperts: a bot PUT that names none keeps the stored ones, as owners already did. This covers every entity type with reviewers or experts.What is in this PR.
c640011c747, the squash of #37575, cherry-picked with-x. It applied without conflicts. Decision records:docs/decisions/2026-11-11-a-bot-put-never-removes-a-metric-parent-or-group.md,docs/decisions/2026-11-12-a-bot-put-never-removes-reviewers-or-experts.md.Type of change:
Tests:
Backend integration tests
MetricResourceITcarries the tests added in Fixes #37572: Keep a metric's hierarchy, reviewers and experts when ingestion re-PUTs it #37575:put_reingestingKeepsParentAndGroupSetInTheUi,put_byBotChildOfDeletedParent_restoresItAsARoot,put_byBotNamingAGroupMovesARootButNotAChild,put_reingestingANewExpressionChangesOnlyTheExpression,put_reingestingAParentKeepsTheChildAUserAddedUnderIt.GlossaryTermResourceITadded to the run because the reviewer/expert guard is in the sharedEntityUpdater.Local Java test run: PASSED
eb39b47af208(baseorigin/2.1)--scope full).All five re-ingestion tests from #37575 ran and passed on this branch (failsafe reports checked, none skipped). Not run locally: PostgreSQL + OpenSearch and the full IT suite, which run in the merge queue.
Ingestion integration tests
Playwright (UI) tests
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable defects were found.Summary
Backports the fix that keeps user-curated metric details during ingestion.
No actionable issues found. Tests were not run during this review.
Reviews (1) · Last reviewed commit: "Fixes #37572: Keep a metric's hierarchy,..." · Reviewed by Greptile