Repository navigation
[2.1] Fixes 37376: Let data products take assets from subdomains of their domain (backport 2.1 #39252) - #39470
Conversation
…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)
(cherry picked from commit 4e3d473)
❌ 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 riskBroadening 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. 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 |
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.Retailin a data product movingSales->Mktends 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 holdingD.Scould delete aD -> Xedge another asset still supports, and an asset inheritingD.Sleft a staleD.S -> Xedge. 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 (
assetEdgesof domain -> domain edges after moving the data productD->E; assetAin the data product,Bnot):D->Xmust stay 1)D->XdeletedD.S->Xmust go)D.S->X=1D->XD.S->Dwidening) staysD->XdeletedD->XdeletedD2->XdeletedD2->XdeletedX -> A, A holds D.S, B holds DX->DdeletedClearing the data product's domains (
remove /domains), assetAin the data product, lineageA -> X:D.S->Xstays)D.S->Xstays)D->Xstays)D->XdeletedDataProductResourceIT#test_domainMoveKeepsParentDomainLineageOfOtherAssetscovers L3.Tests on 2.1 (unpatched 2.1 tip build vs this branch)
SalesOpsvsSales)Sales->Mkt: subdomain assetsMkt, data product kept, later edits 200[Mkt, Sales.Emea.Retail][Mkt](see note)SalesOpsexcluded; add 200The 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 (
diffexit 0 after removing run prefixes and ids; the only difference is a timing line), and the UI checks give the same results.mvn package(service, dist, integration tests) BUILD SUCCESS;RuleEngineTest17/17;spotless:applyno diffDomainFilterUtils.test.ts,DomainUtils.test.tsx,dataProductAPI.test.ts26/26 (no UI change in the lineage commit)test_forgedDomainFqnCannotBypassTheDomainRulenow expectsOpenMetadataException: the SDK'supdate()wraps the server's 400 in it, so the oldInvalidRequestExceptionassertion could never pass; the message check and the not-attached check are kept. IT lanes on3fdb9401c27: Postgres + ES + Redis, MySQL + ES:DataProductResourceIT303 tests, 0 failures in both lanes (all tests added here pass). The only failures are 2 tests inContextMemoryAnchorIT(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 committrailers on the first 7):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
planDomainMoverunning 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.