Skip to content

Fixes 37053: Data Product Domain Validation with inherited domains and stale data product domain links - #37006

Merged
yan-3005 merged 17 commits into
mainfrom
agent/dev-2-0-7-data-contract-rule
Nov 4, 2026
Merged

yan-3005 merged 17 commits into
mainfrom
agent/dev-2-0-7-data-contract-rule

Conversation

@harshach

@harshach harshach commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #37053

Two causes of Rule [Data Product Domain Validation] validation failed on updates to an asset whose domain is inherited from its parent and that belongs to a data product.

1. Stale data product domain links left by moves before 1.12.12 / 1.13.1 (the 2.0.7 customer report).
A data product stores its domains twice in entity_relationship: domain HAS dataProduct, which the API and UI read, and domain CONTAINS dataProduct, which the Data Product Domain Validation rule reads (LogicOps#getDataProductDomains). Before 1.12.12 / 1.13.1, changing a data product's domain rewrote only HAS, so a product moved on those versions still contains its old domain. 1.x hid this because the rule then read the product's shown domains. From 2.0 it reads CONTAINS, so after upgrading every edit to that product's assets is rejected, tag-only edits included, even though the UI shows matching domains.

This adds a step to the 2.0.9 data migration (MySQL and Postgres) that rewrites CONTAINS to match HAS:

  • walks data_product_entity in keyset id batches (IdBatches, 500 ids), two relationship reads per batch;
  • for each product whose live CONTAINS set differs from its live HAS set, it adds the missing CONTAINS links first, then drops the stale ones, so an interrupted run leaves the product in both domains (which the rule accepts), never in neither;
  • deletes before inserting, because insert() upserts only json and would not revive a soft-deleted row;
  • skips products with no live HAS row (nothing to repair from) and logs every repaired product with its old and new domains;
  • also runs from 2.1.0 under its own runOnce marker: a database already at 2.1.0 reprocesses 2.0.9 for its SQL only, so its data step would never run there. The repair is a fixed point, so a second run changes nothing.

No change to assets is needed: every version that allowed a data product's domain to change also moved its assets (batchMigrateAssetDomains), so after the repair the rule agrees with where the assets already are. 2.0.x itself keeps both links in sync (#29138; verified that rapid consecutive moves that get consolidated still leave CONTAINS == HAS), so this only repairs old data.

2. A PATCH that drops the asset's own domain is validated without the inherited one. preparePatched evaluates the rules on the patched copy before inheritance is reapplied, so a patch that removes the direct domain (or sends domains: [] alongside a tag change) makes the rule see a data product with no domain. The rules now see a copy of the patched entity with its inherited owners and domains; the patched entity itself takes the inherited domains only when the patch leaves it with none of its own, so it keeps belonging to them in the response and in updateDataProducts. Inherited refs are still never stored (getEntityReferences strips them). Inheritance runs on a copy because some repositories' setInheritedFields reload other stored state: on the patched entity it silently undid an alert's notification-template change and stored back a user's removed own domain when a team also gives it.

3. Create and PUT checked the rules before the entity inherits. The mapper builds the entity and checks the rules before its parent is attached, so a create or PUT of a table carrying a data product with only an inherited domain was rejected by Data Product Domain Validation, and a PUT update then failed Domain cannot be empty when data products are provided. Entities with data products and no domain of their own are now checked by the repository once the parent is set, with inherited owners and domains, on create, bulk create, PUT update and bulk PUT (sync and async), against the owners and domains the PUT keeps (a PUT that sends none keeps the stored ones), and the domain guard counts inherited domains. Every other entity keeps the mapper-time check.

Type of change:

  • Bug fix

High-level design:

N/A — a data repair in an existing migration version plus a one-line inheritance step in preparePatched; no API or schema change.

Tests:

Use cases covered

  • Create/PUT: a PUT creating and then updating a table with a data product and only an inherited domain succeeds; a PUT with a data product from another domain is still rejected; a PUT without domains on a table with its own domain is checked against that domain; a bulk PUT is checked per item, and one the rules reject leaves a soft-deleted table deleted; a task PATCH keeps the domains the task takes from its target.
  • Inheritance on a copy: changing an alert's notification template by PATCH still works; removing a user's own domain that a team also gives drops it.
  • Inherited-domain fix: a tag PATCH that also removes the inherited domain passes the rule; a table that loses its own domain falls back to the schema's and keeps its data product; a data product from another domain is still rejected; removing a table's own owner falls back to the schema's owner without storing it.
  • A product moved before the fix (shows domain B, contains domain A) rejects a tag-only PATCH on its asset with Data Product Domain Validation; after the repair the same PATCH succeeds and CONTAINS == {B}.
  • A second repair run on a repaired product changes nothing (returns 0).
  • A product whose links already agree is not touched.
  • A soft-deleted CONTAINS row for the shown domain is revived through repairAll (the full batched walk).
  • Multi-domain products, products with no shown domain, and links from other entity types (unit).

Unit tests

  • DataProductDomainContainmentRepairTest — 6 cases on the drift/plan logic (DomainLinks).
  • IngestionPipelineMigrationEntryPointTest — asserts 2.1.0 runs the repair on MySQL and Postgres.
  • RuleEngineTest — inherited domains and owners as rule facts, and which entities wait for inheritance (dependsOnInheritedDomains).

Backend integration tests

  • DataProductDomainContainmentMigrationIT (new) — 3 tests.
  • DataProductResourceIT — new tests for the inherited-domain fix (test_updatesToAssetWithInheritedDomainAndDataProductPassDomainValidation, test_dataProductFromAnotherDomainIsStillRejectedOnInheritedDomainAsset, test_dataProductOnTableThatFallsBackToInheritedDomain, test_tagOnlyPatchOnInheritedDomainAssetWithDataProduct, test_tagPatchDroppingInheritedDomainPassesDomainValidation, test_removingDirectOwnerFallsBackToInheritedOwnerWithoutStoringIt); test_dataProductOnTableThatFallsBackToInheritedDomain fails on main without the EntityRepository change.
  • UserResourceIT#test_removingOwnDomainAlsoGivenByTeamDropsIt (new) — a user's own domain that a team also gives is dropped by PATCH, not stored back.
  • EventSubscriptionResourceIT#test_updateSubscriptionAddTemplate, #test_updateSubscriptionChangeTemplate — existing; they cover the alert-template path the inheritance step could undo.

Local Java test run (commit 136a0cf50f, base origin/main, MySQL + Elasticsearch and PostgreSQL + OpenSearch)

Step Scope Passed
unit DataProductDomainContainmentRepairTest, IngestionPipelineMigrationEntryPointTest, MigrationWiringTest, MigrationWorkflowDataMigrationTest, MigrationWorkflowTest, MigrationCodeFingerprintTest, RuleEngineTest 83 / 83
integration · mysql-elasticsearch · parallel 38 impacted classes (below) 3,241
integration · mysql-elasticsearch · isolated SystemResourceIT 60 / 60
integration · postgres-opensearch · parallel same 38 classes 3,241
integration · postgres-opensearch · isolated SystemResourceIT 60 / 60

Every test this PR adds or changes passes on both engines: DataProductDomainContainmentMigrationIT (3), DataProductResourceIT inherited-domain, create/PUT and bulk PUT tests (11), SystemResourceIT#test_taskPatchKeepsItsTargetsInheritedDomainsForTheRules, UserResourceIT#test_removingOwnDomainAlsoGivenByTeamDropsIt, EventSubscriptionResourceIT template tests, IngestionPipelineMigrationEntryPointTest, RuleEngineTest, DataProductDomainContainmentRepairTest.

Classes: TaskResourceIT, DataProductResourceIT, DataProductDomainContainmentMigrationIT, DataProductDomainMigrationIT, DomainResourceIT, DomainBulkAssetsDryRunIT, DomainReassignmentAuthorizationIT, MultiDomainHasDomainIT, TableResourceIT, DatabaseSchemaResourceIT, DatabaseResourceIT, DatabaseServiceResourceIT, UserResourceIT, TeamResourceIT, TeamHierarchyInheritanceIT, IngestionPipelineOwnerInheritanceIT, EventSubscriptionResourceIT, GlossaryTermResourceIT, TagResourceIT, and the migration-area ITs (AlertBacklogMigrationIT, ConnectionSecretsMigrationIT, ConsumerIdMigrationIT, ContextMemoryStatusMigrationIT, ContinuousMigrationIT, CreationAuditMigrationIT, CredentialIndexMigrationIT, CustomSqlDefinitionMigrationIT, DataQualityDimensionMigrationIT, FirstTimeUserMigrationIT, LifeCycleCreatedSentinelMigrationIT, McpGrantMigrationIT, NegatedListRuleMigrationIT, OverrideMetadataRestoreMigrationIT, QuartzTablePurgeMigrationIT, SampleDataStorageMigrationIT, SeedDataPresenceIT, ServiceLineagePipelineRoutingMigrationIT, ThresholdParameterMigrationIT).

Verified live: a 1.12.11 PostgreSQL database with a data product moved between domains, upgraded to 2.0.7 (tag PATCH rejected with the reported error), then migrated and served by this branch: both domain links repaired, tag PATCH 200, alert template PATCH kept, a user's own domain also given by a team dropped on PATCH, and removing a table's own domain falls back to the inherited one and keeps the data product.

Ingestion integration tests

Not applicable (no ingestion changes).

Playwright (UI) tests

  • DataAssetRulesEnabled.spec.ts — editing an asset with an inherited domain and a data product (not run locally; runs in the merge queue).

Manual testing performed

Reproduced the customer path end to end with the released Docker images, on MySQL and on PostgreSQL:

  1. Started openmetadata/server:1.12.11 (and separately 1.13.0) from the quickstart compose.
  2. Created domains EXPLOITATION and MAINTENANCE, a schema in MAINTENANCE with a table that inherits it, and a data product in EXPLOITATION.
  3. PATCHed the data product's domain to MAINTENANCE: CONTAINS stayed EXPLOITATION, HAS became MAINTENANCE. Added the table to the product; a tag PATCH returned 200 on 1.12.11.
  4. Upgraded the same database to openmetadata/server:2.0.7: migrations ran clean, the stale CONTAINS survived, and a tag-only PATCH on the table returned 400 Rule [Data Product Domain Validation] validation failed.
  5. Rewrote CONTAINS to match HAS (what this migration does): the tag PATCH returned 200, no restart needed.
  6. On 2.0.7, moved a product through four domains back to back (consolidated into one version): both links ended on the same domain, so new moves do not drift.

UI screen recording:

Not applicable — backend data migration only.

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation>

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. (No schema change.)

  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable). (Not applicable — backend only.)

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.

    • Migration, reviewed at af65144ff3: no 🔴. Fixed: the 2.1.0 rerun (the 2.0.9 step never runs on databases already at 2.1.0); the IT covers repairAll, soft-deleted revival and a rerun, and asserts the rule message; IngestionPipelineMigrationEntryPointTest asserts 2.1.0 calls the repair.
    • Combined diff, reviewed at 1bc8925341: two 🔴 in the preparePatched inheritance step (alert template change undone; user's removed own domain stored back when a team gives it), both fixed in 51081a63c5 by evaluating the rules on an inherited copy, with tests above.
    • Answered, not fixed: the inheritance step adds a parent load to every PATCH (accepted; bounded to the entity's own parent chain); DataProductRepository.setInheritedFields reads stored domains for owner inheritance (pre-existing).
  • Decision check: no record needed — this restores an existing invariant (CONTAINS mirrors HAS for data product domains) rather than deciding a new one.

  • I have added a test that covers the exact scenario we are fixing.

@harshach
harshach requested review from a team as code owners November 4, 2026 05:05
@harshach
harshach requested review from TeddyCr and karthicksharan and a balanced review from Copilot November 4, 2026 05:05
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This 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 skip-pr-checks label.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 1029 → 1029
- 0 added, 0 removed, 1 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/components/common/EntityDescription/Description.tsx

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

Copilot AI 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.

🟡 Changes recommended

The new inheritance call overwrites patched notification-template values with the stored relationship, preventing requested additions, changes, or removals from being saved.

3 open issues
What changed in this PR

This PR updates entity PATCH handling so validation rules can see inherited owners and domains, and preserves inherited domains when direct domain assignments are removed.

Changes:

  • Resolves inherited fields before evaluating update rules.
  • Retains inherited domains in the updated entity when no direct domains remain.
  • Adds unit, integration, and browser regression coverage for inherited-field validation and data-product domain matching.
File Description
openmetadata-ui/​src/​main/​resources/​ui/​playwright/​e2e/​Features/​DataAssetRulesEnabled.spec.ts Adds a browser test for editing an asset with an inherited domain and data product.
openmetadata-service/​src/​test/​java/​org/​openmetadata/​service/​rules/​RuleEngineTest.java Adds domain and ownership rule cases for inherited references.
openmetadata-service/​src/​main/​java/​org/​openmetadata/​service/​jdbi3/​EntityRepository.java Resolves inheritance before PATCH validation and preserves inherited domains.
openmetadata-integration-tests/​src/​test/​java/​org/​openmetadata/​it/​tests/​DataProductResourceIT.java Tests inherited-domain updates, mismatched products, and direct-domain removal.

Review effort: Balanced

try (var ignored = phase("patchInheritance")) {
// Inheritance ran when original was loaded, not on the patched copy: a patch that removes
// the direct owners or domains must leave the inherited ones visible to the rules.
setInheritedFields(updated, new Fields(allowedFields, "owners,domains", true));

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.

Fixed in 51081a6: inheritance now runs on a copy, so EventSubscriptionRepository.setInheritedFields can no longer reload the stored template onto the patched alert. EventSubscriptionResourceIT#test_updateSubscriptionAddTemplate / #test_updateSubscriptionChangeTemplate pass.

// productDomain is rejected by the rule.
const rejectedDomainTable = new TableClass();
// Domain comes only from its schema; carries a Data Product of that domain.
const inheritedDomainTable = new TableClass();

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.

Fixed in 00e928c: the inherited-domain table owns its service (new TableClass({ service: new DatabaseServiceClass() })), so patching its schema's domain leaves the shared fixtures alone and cleanup deletes the owned chain.

.thenReturn(List.of());
when(relationshipRepository.getEntityReferences(
org.mockito.ArgumentMatchers.anyList(), org.mockito.ArgumentMatchers.any()))
.thenReturn(List.of(domain.withInherited(null)));

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.

Fixed in 00e928c: the relationship mock returns a separate domain reference, so the facts' domain stays inherited=true.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 05:11

Copilot AI 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.

🟡 Changes recommended

The new inheritance call can silently discard notification-template PATCH edits, and a new test call passes an incompatible endpoint string that fails TypeScript checking.

4 open issues

Review effort: Balanced

await inheritedDomainTable.visitEntityPage(page);

const description = `edited with inherited domain ${Date.now()}`;
await updateDescription(page, description, false, undefined, 'tables');

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.

Fixed in 00e928c: passes EntityTypeEndpoint.Table; tsc:playwright is clean.

…llback

A tag-only patch on a table that inherits its domain keeps the data product
and stores no domain of its own; a patch that also drops the inherited domain
still passes Data Product Domain Validation; removing a table's own owner falls
back to the schema's owner without storing it or recording it as added.
…ation

A data product stores its domains twice: domain HAS dataProduct, read by the
API, and domain CONTAINS dataProduct, read by the Data Product Domain
Validation rule. Before 1.12.12 / 1.13.1 a domain change rewrote only HAS, so
a product moved on those versions still contains its old domain. On 2.0 the
rule then rejects every edit to the product's assets, tag-only edits included.

The 2.0.9 data migration walks data products in id batches and rewrites
CONTAINS to match HAS: it adds the missing links before dropping the stale
ones, revives soft-deleted rows, and leaves products without a HAS link alone.
…in the IT

A database already at 2.1.0 reprocesses 2.0.9 for its SQL only, so the 2.0.9
step never runs there. 2.1.0 runs the same idempotent repair under its own
marker. The IT now asserts the rule rejection message, a second run that
changes nothing, and a soft-deleted containment row revived through
repairAll.
@yan-3005 yan-3005 added the To release Will cherry-pick this PR into the release branch label Nov 4, 2026
… patch

setInheritedFields on the patched entity reloaded stored state in some
repositories: an alert's notification template, which made a template change
a silent no-op, and a user's team domains, which stored back a removed own
domain the team also gives. The rules now see a copy with inherited owners
and domains; the patched entity takes the inherited domains only when it is
left with none of its own.
Copilot AI balanced review requested due to automatic review settings November 4, 2026 13:38
@yan-3005 yan-3005 changed the title Fix entity rules for inherited fields Fixes 37053: Data Product Domain Validation with inherited domains and stale data product domain links Nov 4, 2026

Copilot AI 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.

Copilot AI 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.

Comment on lines +39 to +41
if (!RuleEngine.dependsOnInheritedDomains(entity)) {
RuleEngine.getInstance().evaluate(entity);
}

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.

Fixed in 0ca99ed: bulkUpdateEntities (the sync and async bulk path for existing entities) runs the same deferred check per item before the updater, so a mismatched item is reported as failed and none of it is saved. DataProductResourceIT#test_bulkPutChecksDataProductsAgainstTheInheritedDomain fails before the change.

@yan-3005
yan-3005 disabled auto-merge November 4, 2026 16:10
A PUT that sends no domains keeps the stored ones, but the deferred check
inherited the parent's instead, so a table with its own domain A under a
schema in B was checked against B. The deferred PUT check now uses the stored
owners and domains, and inherits only when the entity has none of its own.
Bulk PUT of existing entities (sync and async) now runs the same per-item
check before writing; a failing item is reported and nothing of it is saved.
Copilot AI balanced review requested due to automatic review settings November 4, 2026 16:34
The bulk PUT loop restored a soft-deleted entity before its deferred rule
check, so an item the rules rejected was reported as failed but stayed
restored. The check now runs first, as on a single PUT.

Copilot AI 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.

🟡 Changes recommended

Bulk PUT validation can fail after restoring a soft-deleted table and its children without rolling back that restoration, so validation must precede restoration and a regression test must confirm rejected items remain deleted.

7 open issues
1 resolved since last review

Review effort: Balanced

The rule facts dropped the patch's inherited refs and resolved inheritance
again, but a task takes its target's domains in prepare and has no
inheritance hook, so its domains vanished and a rule requiring one rejected
an unrelated PATCH. When inheritance resolves nothing, the facts keep the
refs the patched entity already carries.
Copilot AI balanced review requested due to automatic review settings November 4, 2026 17:13
@yan-3005

yan-3005 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@gitar-bot the bulk PUT restore-order suggestion is fixed in c914cbf: the deferred rule check now runs before the restore, with DataProductResourceIT#test_bulkPutRejectedByTheRulesDoesNotRestoreADeletedTable covering it.

Copilot AI 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.

The generated with* setters mutate in place, so the test's snapshot picked up
the temporary rule and the cleanup reinstalled it. The original settings are
now kept as their own JSON copy, restored in finally, and checked to be back.
Copilot AI balanced review requested due to automatic review settings November 4, 2026 17:29
@gitar-bot

gitar-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🔴 High risk · The migration rewrites existing data-product domain links; incorrect reconciliation could mislead validation, rejecting valid asset edits or accepting mismatched products.

Fixes Data Product Domain Validation failures on assets with inherited domains by repairing stale data product domain links in the 2.0.9 migration (also run from 2.1.0), evaluating PATCH, create and PUT rules against inherited owners and domains, and checking deferred PUT rules before restoring soft-deleted entities. Resolved this session: the PUT/create path no longer evaluates rules without inherited domains, and the bulk PUT now runs its rule check before restoring a soft-deleted entity, covered by DataProductResourceIT#test_bulkPutRejectedByTheRulesDoesNotRestoreADeletedTable. No open findings remain.

✅ 2 closed
✅ Edge Case: PUT/create path still evaluates rules without inherited domains

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java:5307-5314
The fix runs setInheritedFields(updated, owners,domains) only in preparePatched, so only PATCH gets it. The other rule entry point, copy() (EntityRepository.java:1890), still calls RuleEngine.getInstance().evaluate(entity) on an entity whose domains come only from request.getDomains(). Take a PUT (createOrUpdate) of a CreateTable that carries dataProducts but no domains, where the schema supplies the domain. That is the IT scenario sent through PUT instead of PATCH. validateDataProductDomainMatch still sees an empty domain list and rejects the write, as dataProductWithoutAnyDomainFailsTheDomainRule shows. The same applies to the ownership rule. The fix is to resolve inheritance before rule evaluation in the create/PUT path too, or to move the inheritance step into a shared rule-evaluation helper that both paths call. Then add an IT that PUTs a table which has a data product and an inherited domain.

✅ Edge Case: Bulk PUT restores a soft-deleted entity before its rules can reject it

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java:15150-15154
In the bulk PUT loop, evaluatePutRulesDeferredUntilInherited(original, entity) runs after restoreEntity(...). Take a soft-deleted table with an inherited domain and a bulk PUT that carries a data product from a different domain. The table is restored first, then the rule throws, and the item is reported as failed while the restore stays in place. The single PUT path (updateInternal, line 4971) runs the check before the restore at line 5008, so the two paths now behave differently. Fix: run the rule check before the restore, as the single PUT path does.

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

Copilot AI 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.

🔵 Needs a closer look

Human assessment is needed because parent-reference restoration and approval-gated bulk staging can undermine validation, allowing domain–data-product mismatches to be saved or submitted for approval.

5 open issues
1 resolved since last review

Review effort: Balanced

@yan-3005
yan-3005 enabled auto-merge (squash) November 4, 2026 17:38
@yan-3005
yan-3005 merged commit 16b6974 into main Nov 4, 2026
68 of 71 checks passed
@yan-3005
yan-3005 deleted the agent/dev-2-0-7-data-contract-rule branch November 4, 2026 17:56
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

gh-bot-collate Bot commented Nov 4, 2026

Copy link
Copy Markdown

🤖 Backport to 2.0 failed. The conflict could not be resolved, so this change is not on that branch. Resolver run.

yan-3005 added a commit that referenced this pull request Nov 5, 2026
…nd stale data product domain links (2.0) (#37109)

* Fixes #37053: Data Product Domain Validation with inherited domains and stale data product domain links (2.0)

Backport of #37006 and #37096 to 2.0.

- Rules on PATCH, create, PUT and bulk PUT see the domains an entity
  inherits from its parent, so an asset whose domain comes from its schema
  and carries a data product of that domain is no longer rejected.
- The 2.0.8 migration rewrites a data product's CONTAINS link to the domain
  it shows. Products moved to another domain before 1.12.12 / 1.13.1 kept
  their old domain there, which the rule reads, so every edit to their
  assets was rejected. The repair walks data products in id batches
  (IdBatches, ported from main) and only rewrites links that disagree.

(cherry picked from commit 16b6974)

* chore(playwright): auto-refresh impact-map.generated.json

* Stub the containment repair in the 2.0.8 entry-point test

The test runs the 2.0.8 data migration against a mocked handle, so the
repair step now in that migration needs stubbing like the other steps.

---------

Co-authored-by: Sriharsha Chintalapani <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@yan-3005 yan-3005 self-assigned this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.1 backend safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Data Product domain relationships are not synchronized when moving Data Products between Domains

4 participants