Skip to content

[2.1] Fixes 37376: Let data products take assets from subdomains of their domain (backport 2.1 #39252) - #39470

Merged
sonika-shah merged 10 commits into
2.1from
backport/2.1-39252
Dec 2, 2026
Merged

sonika-shah merged 10 commits into
2.1from
backport/2.1-39252

Conversation

@sonika-shah

@sonika-shah sonika-shah commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Backport of #39252 to 2.1. Merge after #39252 lands on main.

Fixes #37376

With "Data Product Domain Validation" on, a data product now accepts assets from its domain and from any subdomain of it, not only from the exact domain. A data product domain move and a subdomain hard delete keep those assets consistent.

Adaptations vs main: the first 7 commits are cherry-picked cleanly with -x (merge commit skipped); their changed lines are identical to the main PR diff. Two extra 2.x-only commits (7b3bf99f4e6, 66bef4f81b8) fix domain lineage on a data product move, see below.

Behaviour note (same as #39252 on main): with the rule turned off, moving a data product's domain now also removes an old subdomain that an asset holds directly (e.g. an asset on Sales.Emea.Retail in a data product moving Sales -> Mkt ends with [Mkt], before it kept [Mkt, Sales.Emea.Retail]). Everything else with the rule off is unchanged.

Domain lineage on data product move

On 2.x a data product domain move decremented the domain -> domain lineage count (assetEdges) of every old domain for every moved asset, so an asset holding D.S could delete a D -> X edge another asset still supports, and an asset inheriting D.S left a stale D.S -> X edge. Now each moved asset decrements only the old domains it counted toward: its effective domains (held, else inherited, read before the move rewrites them) within the old domains and, when the move strips them, their subdomains. When the data product's domains are cleared, assets keep their inherited domains and subdomains, so only old domains an asset holds directly are decremented.

Lineage matrix (assetEdges of domain -> domain edges after moving the data product D -> E; asset A in the data product, B not):

Case 2.1 tip Backport before fix This branch main #39252
L1 A holds D PASS PASS PASS PASS
L2 A inherits D PASS PASS PASS PASS
L3 A holds D.S, B holds D (D->X must stay 1) n/a (add 400) FAIL: D->X deleted PASS PASS
L4 A inherits D.S (D.S->X must go) n/a (add 400) FAIL: stale D.S->X=1 PASS PASS
L5 two moved assets support D->X PASS PASS PASS PASS
L6 one of two supporters moves PASS PASS PASS PASS
L7 covered asset (D.S -> D widening) stays n/a (add 400) PASS PASS PASS
L8 rule off, A holds unrelated Y, B holds D FAIL: D->X deleted FAIL: D->X deleted PASS PASS
L9 data product in [D1, D2], A holds D1, B holds D2 FAIL: D2->X deleted FAIL: D2->X deleted PASS PASS
L10 upstream X -> A, A holds D.S, B holds D n/a (add 400) FAIL: X->D deleted PASS PASS
Total 4/10 5/10 10/10 10/10

Clearing the data product's domains (remove /domains), asset A in the data product, lineage A -> X:

Case Backport before fix This branch main #39252
C1 A holds D.S (D.S->X stays) PASS PASS PASS
C2 A inherits D.S (D.S->X stays) PASS PASS PASS
C3 A inherits D (D->X stays) FAIL: D->X deleted PASS PASS
Total 2/3 3/3 3/3

DataProductResourceIT#test_domainMoveKeepsParentDomainLineageOfOtherAssets covers L3.

Tests on 2.1 (unpatched 2.1 tip build vs this branch)

Case Before After
Bulk add asset from same domain 200 200
Bulk add asset from subdomain / child domain / inherited subdomain / subdomain glossary term 400 200
Bulk add asset from prefix-sibling domain (SalesOps vs Sales) 400 400
PATCH subdomain asset into parent-domain data product 400 200
Reverse (parent asset into subdomain data product), sibling, forged domain FQN 400 400
Data product move Sales -> Mkt: subdomain assets not attachable re-homed to Mkt, data product kept, later edits 200
Hard delete of subdomain holding a data product asset n/a (not attachable) asset detached and domainless, edit 200
Rule off: bulk add / PATCH / domain-page move / hard delete baseline identical
Rule off: data product move, asset holding an old subdomain [Mkt, Sales.Emea.Retail] [Mkt] (see note)
UI Add Assets picker on data product exact domain only domain + subdomains, SalesOps excluded; add 200
UI data product picker on subdomain / inherited-domain asset "No Data Products are available" parent-domain data products offered; PATCH 200
UI with rule off all domains offered same

The lineage commit changes none of these: on the build with it, the API scenario, data product move/delete and rule-off outputs match the build without it (diff exit 0 after removing run prefixes and ids; the only difference is a timing line), and the UI checks give the same results.

  • Build: mvn package (service, dist, integration tests) BUILD SUCCESS; RuleEngineTest 17/17; spotless:apply no diff
  • Jest: DomainFilterUtils.test.ts, DomainUtils.test.tsx, dataProductAPI.test.ts 26/26 (no UI change in the lineage commit)
  • organize-imports, eslint --fix, prettier on the changed UI files: no diff
  • The new IT compiles in the build above; it was not run locally (CI)
  • test_forgedDomainFqnCannotBypassTheDomainRule now expects OpenMetadataException: the SDK's update() wraps the server's 400 in it, so the old InvalidRequestException assertion could never pass; the message check and the not-attached check are kept. IT lanes on 3fdb9401c27: Postgres + ES + Redis, MySQL + ES: DataProductResourceIT 303 tests, 0 failures in both lanes (all tests added here pass). The only failures are 2 tests in ContextMemoryAnchorIT (context memory search access), which this change does not touch; they fail the same way on the unpatched 2.1 tip (MySQL + ES, Postgres + ES + Redis).
Details

Commits (original author kept, cherry picked from commit trailers on the first 7):

  • adacc0b Let data products take assets from subdomains of their domain
  • d1b78d0 Keep subdomain assets consistent when a data product moves or a subdomain is deleted
  • 0ee2404 Re-home only uncovered assets and reconcile inheriting descendants on domain delete
  • 064fe46 Leave assets inheriting a covered subdomain in place on a data product move
  • c468fc3 Reconcile a deleted domain's assets by their effective domains after its edges go
  • d1927e8 Judge asset domains by stored FQNs and clear inherited subdomains from search on a move
  • cf4d74f Assert the forged-FQN IT is rejected by the domain rule itself
  • 7b3bf99 Decrement domain lineage only for the domains a moved asset counted toward (2.x only)
  • 66bef4f Keep inherited domain lineage when a data product's domains are cleared (2.x only)
  • 3fdb940 Expect the SDK's wrapped exception in the forged-FQN IT (2.x only)

The API and UI cases ran against a local server built from this branch and from the unpatched 2.1 tip (Postgres + Elasticsearch), with the UI on the dev server in system Chrome. The rule-off move change comes from planDomainMove running on every data product domain change, while the conflicting-data-product detach right after it only runs with the rule on.

Lineage fix notes: the effective-domain lookup now runs on every data product domain move (one batched HAS read, plus a domains read for assets that inherit), not only when the old domains have subdomains. "2.1 tip" L3/L4/L7/L10 are n/a because 2.1 rejects adding a subdomain asset to a parent-domain data product; L8/L9 fail there too, so the fix also corrects an existing 2.1 over-decrement.

…domain

With Data Product Domain Validation enabled, a data product accepted only assets
assigned directly to its own domain, while the domain's Assets tab counts the
whole subtree. The rule (LogicOps), its reconcile mirror (DataProductRepository
conflicts) and both UI pickers now treat a subdomain at any depth as within the
data product's domain.

(cherry picked from commit c81326e)
…main is deleted

Moving a data product's domain now removes its assets from the old domains'
whole subtree, and hard-deleting a domain detaches data products its assets no
longer match. Adds regression ITs and the decision record.

(cherry picked from commit 49058f1)
… domain delete

A data product's domain move now leaves assets in subdomains the new domains
still cover, and removes each re-homed asset only from the subdomains it holds,
so no other asset's domain lineage changes. Hard-deleting a domain also
reconciles descendants that inherit it. The subdomain check reuses FQNs the
caller already holds and resolves the rest once per reconcile chunk.

(cherry picked from commit 492cace)
…t move

Coverage now also uses an asset's inherited domain, so a table under a schema in
a still-covered subdomain keeps inheriting it instead of being pinned to the new
domain. The Domain-page conflict check prefetches FQNs once; adds ITs for the
inherited and Domain-page cases.

(cherry picked from commit 49be4f2)
…its edges go

Hard-deleting a domain now captures its direct assets before the edges are
removed and reconciles them in postDelete with the inheritance-aware detach, so
an asset that now inherits a matching domain keeps its data product. The work
runs only when a surviving ancestor domain holds a data product.

(cherry picked from commit 0ffd6a6)
…m search on a move

The domain rule now resolves the asset's domain FQNs by id instead of trusting
the request body. A data product move also drops inherited old subdomains from
the re-homed assets' search documents, skips the subdomain work when there is
none, and the deleted-domain reconcile runs when the delete lifecycle closes so
its per-thread entry is always cleared.

(cherry picked from commit 3a76f7d)
@sonika-shah
sonika-shah marked this pull request as ready for review December 1, 2026 14:16
@sonika-shah
sonika-shah requested review from a team as code owners December 1, 2026 14:16
@sonika-shah
sonika-shah requested review from pmbrull and shah-harshit and removed request for a team December 1, 2026 14:16
@github-actions

github-actions Bot commented Dec 1, 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.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 18:46

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@sonika-shah
sonika-shah marked this pull request as draft December 1, 2026 18:47
@sonika-shah
sonika-shah marked this pull request as ready for review December 1, 2026 18:53
Copilot AI balanced review requested due to automatic review settings December 1, 2026 19:46

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 21:13

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@gitar-bot

gitar-bot Bot commented Dec 1, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Broadening domain validation changes which assets data products may accept; faulty move/delete reconciliation could misassign assets and corrupt domain lineage.

Lets data products accept assets from their domain and any subdomain of it when Data Product Domain Validation is on, and keeps those assets consistent on data product domain moves and subdomain deletes. Domain lineage counts are also corrected so only the domains a moved asset actually counted toward are decremented. 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

@sonika-shah
sonika-shah merged commit c5d5a7a into 2.1 Dec 2, 2026
69 of 81 checks passed
@sonika-shah
sonika-shah deleted the backport/2.1-39252 branch December 2, 2026 04:52
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.

4 participants