Skip to content

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

Merged
yan-3005 merged 4 commits into
2.0from
fix/37053-dp-domain-validation-2.0
Nov 5, 2026
Merged

yan-3005 merged 4 commits into
2.0from
fix/37053-dp-domain-validation-2.0

Conversation

@yan-3005

@yan-3005 yan-3005 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #37053

Backport of #37006 and #37096 to 2.0. The automated backport of #37006 could not resolve its conflicts, so this ports both changes by hand onto 2.0's code.

Rules see inherited domains

  • PATCH evaluates the rules against the entity's own owners and domains plus the ones it inherits now, resolved on a scratch copy so setInheritedFields side effects (alert templates, team domains merged into users) never reach the stored entity.
  • Create, bulk create, PUT and bulk PUT defer the rule check for an entity with data products and no domain of its own until its parent is attached (RuleEngine.dependsOnInheritedDomains), so an asset whose domain comes from its schema is no longer rejected. Bulk PUT checks before restoring a soft-deleted entity.
  • "Domain cannot be empty when data products are provided" counts inherited domains.

Data migration (2.0.8)

  • DataProductDomainContainmentRepair 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 the old domain in CONTAINS, which the "Data Product Domain Validation" rule reads, so every edit to their assets was rejected.
  • Runs in the MySQL and Postgres 2.0.8 data migrations, walking data products in id batches; only links that disagree are rewritten, so a rerun changes nothing.

2.0-specific differences from main

  • IdBatches (keyset id batching for data migrations) is ported from main with its unit test; 2.0 did not have it.
  • The repair's relationship DAO types come from CollectionDAO on 2.0.
  • 2.0 has no 2.0.9 / 2.1.0 migrations, so the repair runs in 2.0.8 only.

Type of change:

  • Bug fix

High-level design:

Same design as #37006 and #37096; see those PRs.

Tests:

Use cases covered

  • Tag-only edit of a table that inherits its domain from its schema and carries a data product of that domain succeeds.
  • An edit that drops the domain an asset's data product needs is still rejected.
  • Create / PUT / bulk PUT of an asset that inherits its domain and carries a data product passes; one whose data product belongs to another domain is rejected.
  • Upgrading through 2.0.8 repairs a data product whose CONTAINS link still names its old domain, revives a soft-deleted link, and leaves correct links alone.

Unit tests

  • RuleEngineTest 15/0, DataProductDomainContainmentRepairTest 6/0, IdBatchesTest 2/0.

Integration tests

  • DataProductDomainContainmentMigrationIT, DataProductResourceIT, UserResourceIT#test_removingOwnDomainAlsoGivenByTeamDropsIt, NegatedListRuleMigrationIT:
    • MySQL + Elasticsearch: Tests run: 278, Failures: 0, Errors: 0
    • Postgres + OpenSearch: Tests run: 278, Failures: 0, Errors: 0
  • SystemResourceIT#test_taskPatchKeepsItsTargetsInheritedDomainsForTheRules (global-state lane): 1/0 on MySQL + Elasticsearch and Postgres + OpenSearch.

Playwright

  • DataAssetRulesEnabled.spec.ts (CI): asset with an inherited domain and a data product can be edited.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.

…nd 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)
@yan-3005
yan-3005 requested review from a team as code owners November 5, 2026 07:19
@yan-3005
yan-3005 requested review from karthicksharan and mohityadav766 and removed request for a team November 5, 2026 07:19
@github-actions

github-actions Bot commented Nov 5, 2026

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.

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

github-actions Bot commented Nov 5, 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: 571 → 571
- 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

@pmbrull
pmbrull requested review from a team, akash-jain-10, harshach and tutte as code owners November 5, 2026 07:20
@gitar-bot

gitar-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · The 2.0.8 migration rewrites data-product domain relationships, and incorrect link repair could misassign products or alter domain-validation outcomes.

Backports the data product domain validation fix to 2.0: rule checks now account for inherited domains, deferred validation for assets whose domain comes from their parent, and a 2.0.8 migration that repairs stale data product CONTAINS links. 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

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.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

3 participants