Skip to content

Fixes #37572: Keep a metric's hierarchy, reviewers and experts when ingestion re-PUTs it (backport 2.1 #37575) - #37891

Merged
ulixius9 merged 1 commit into
2.1from
backport/2.1/pr-37575
Nov 16, 2026
Merged

ulixius9 merged 1 commit into
2.1from
backport/2.1/pr-37575

Conversation

@ulixius9

@ulixius9 ulixius9 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #37572

Backports #37575 to 2.1. #37575 fixed the issue on main; 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 parent or metricGroup: users build the hierarchy in the UI on top of ingested metrics. On 2.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-rc2 does 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.
  • User PUTs and all PATCHes are unchanged.

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:

  • Bug fix

Tests:

Backend integration tests

  • MetricResourceIT carries 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.
  • GlossaryTermResourceIT added to the run because the reviewer/expert guard is in the shared EntityUpdater.

Local Java test run: PASSED

  • Commit: eb39b47af208 (base origin/2.1)
  • Finished: 2026-11-16 11:48 UTC · 8.9 min
  • Scope: focused; merge readiness is not established. Broader steps deferred: 9 (run --scope full).
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-service (1 class) 1 41 0 0 1.4 passed
integration mysql-elasticsearch · parallel 2 620 0 46 7.5 passed
  • Impacted, not run locally: 6 classes (listed in the details)

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

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Checklist:

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence 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.

  • Bot re-ingestion keeps metric hierarchy that connectors leave out.
  • Bot PUTs keep reviewers and experts when their lists are empty.

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

…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)
@ulixius9
ulixius9 requested a review from a team as a code owner November 16, 2026 11:48
@ulixius9
ulixius9 requested review from sonika-shah and removed request for a team November 16, 2026 11:48
@ulixius9

Copy link
Copy Markdown
Member Author

Local Java test run: PASSED — details

  • Commit: eb39b47af208 (base origin/2.1)
  • The summary is in the PR description.

Tests run locally

  • unit · openmetadata-service (1 class): MetricRepositoryTest (41 passed)
  • integration · mysql-elasticsearch · parallel: BaseEntityIT$ListEntityHistoryByTimestampPaginationTest (6 passed), GlossaryTermResourceIT (187 passed, 1 skipped), MetricResourceIT (3 passed)

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

  • mvn -B package -pl openmetadata-mcp,openmetadata-service -am -Dspring-boot.repackage.skip=true '-Dtest=org/openmetadata/DefaultOperationalConfigProviderTest.java,org/openmetadata/csv/**/*Test.java,org/openmetadata/csv/**/Test*.java,org/openmetadata/csv/**/*Tests.java,org/openmetadata/csv/**/*TestCase.java,org/openmetadata/schema/**/*Test.java,org/openmetadata/schema/**/Test*.java,org/openmetadata/schema/**/*Tests.java,org/openmetadata/schema/**/*TestCase.java,org/openmetadata/sdk/**/*Test.java,org/openmetadata/sdk/**/Test*.java,org/openmetadata/sdk/**/*Tests.java,org/openmetadata/sdk/**/*TestCase.java,org/openmetadata/service/**/*Test.java,org/openmetadata/service/**/Test*.java,org/openmetadata/service/**/*Tests.java,org/openmetadata/service/**/*TestCase.java,CreateEntityToolTest,PatchEntityToolTest' -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=<496 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state '-Dit.test=<37 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf '-Dit.test=<37 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pcache-tests -DintegrationTests.lane=parallel -Dit.test=AlertStateIT,BundleWarmupCertificationIT,ContainerCacheCorrectnessIT,EntityCacheWriteOrderIT,OneTransactionFlushAtomicityIT,RelationshipCacheInvalidationIT,TagRenameCacheIT,UncachedReadIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pcache-tests -DintegrationTests.lane=global-state -Dit.test=CredentialRedisDownIT,CredentialRedisNoRoundTripIT,SessionRedisMultiNodeIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Ppostgres-opensearch -DintegrationTests.lane=parallel -Dit.test=FlattenedChildrenHighlightSearchIT,InheritedFieldPropagationRecoveryIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Ppostgres-opensearch -DintegrationTests.lane=global-state -Dit.test=PatchTableEmbeddingIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Psearch-it -DdatabaseType=postgres -DsearchType=opensearch -Djpw.data.mode=ingest -Dit.test=ColumnIndexingToggleIT,GlossarySynonymNgramIT,SearchAccessRulesIT,SearchAggregateRbacIT,SearchClusterFitnessReindexE2EIT,SearchCountConsistencyIT,SearchEntityRankingIT,SearchRelevancyPreviewIT,SearchScoringIT,TableTotalCountAggregationIT,TestCaseStaleDefinitionReindexIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
Why these tests
  • added by author: the reviewers/experts bot-PUT guard is in the shared EntityUpdater; glossary terms carry reviewers ← GlossaryTermResourceIT
Impacted, not run locally (6)
  • ReindexBenchmarkIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • TableTotalCountScaleIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • EntityLoaderSmokeUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • PipelineOwnerIndexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • SearchAvailableAllKindsDuringReindexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • SearchAvailableDuringReindexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
Commands
mvn -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

@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.

@gitar-bot

gitar-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Changing 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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@ulixius9
ulixius9 merged commit 70b68f7 into 2.1 Nov 16, 2026
56 of 58 checks passed
@ulixius9
ulixius9 deleted the backport/2.1/pr-37575 branch November 16, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants