Skip to content

fix(asset-export): write sub-domains with their full parent path - #2927

Draft
connectivity-ai[bot] wants to merge 2 commits into
mainfrom
ca/fix/export-subdomain-full-path
Draft

connectivity-ai[bot] wants to merge 2 commits into
mainfrom
ca/fix/export-subdomain-full-path

Conversation

@connectivity-ai

@connectivity-ai connectivity-ai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Failure

Enrichment Migrator extracts through AssetExporter, which never preloaded the data-domain cache (MeshExporter already does, since #2561). When an asset's domain is a sub-domain:

  1. DataDomainXformer.encodeFromGuid looks up the sub-domain by GUID.
  2. DataDomainCache.getIdentityForAsset reads the parent's identity from the cache only.
  3. On a cold cache the parent is absent, so the domain is exported as Child instead of Parent@Child.
  4. On load, the preloaded cache keys domains by full path, so getByIdentity("Child") misses and the run throws Domain not found (in domainGUIDs).

It only worked when another in-scope asset happened to sit in the parent domain and was processed first, which is order-dependent under the parallel stream.

Fix

  • AssetExporter.export() preloads the data-domain cache before streaming, the same as MeshExporter does after fix(asset-export-basic): preload domain cache to fix truncated hierarchy paths (CSA-444) #2561.
  • DataDomainCache.lookupById now fetches and caches a missing parent by GUID before computing the child's identity. It recurses one level per ancestor. Every exporter now gets the full path even without a preload. refreshCache (the preload) is unchanged.
  • DataDomainCache is now open, and the single-domain search moved into protected open fun fetchById(guid), so a test can serve domains from memory. Production behaviour of that search is unchanged.

Test

package-toolkit/runtime/src/test/kotlin/cache/DataDomainCacheSubDomainTest.kt is a pure unit test with no tenant. It serves domains from an in-memory subclass and makes the same two calls encodeFromGuid makes (getByGuid, then getIdentity) on a cold cache:

  • subDomainOnColdCacheResolvesToFullPath expects Parent@Child.
  • nestedSubDomainOnColdCacheResolvesEveryAncestor expects Grandparent@Parent@Child.

Seen failing first. The test landed in its own commit (6d16d1d), before the fix. CI pr-test on that commit failed with expected [Parent@Child] but found [Child] and expected [Grandparent@Parent@Child] but found [Child]. After the fix commit (8a014bc), pr-build and pr-test both pass.

What ran

  • CI pr-build (assemble, shadowJar, spotlessCheck) and pr-test (./gradlew testClasses test) on both commits, with the results above.
  • Locally, ./gradlew :package-toolkit:runtime:test --tests 'cache.DataDomainCacheSubDomainTest' could not configure. The managed Gradle repository firewall does not serve the kotlin-dsl 5.2.0 plugin that buildSrc needs, and --offline has no cached copy. So CI is the only place these ran.
  • No integration test or tenant was used.

Related: CONNECT-3803, #2561.

🤖 Generated with Claude Code

AtMrun and others added 2 commits November 5, 2026 10:51
Preload the data-domain cache in AssetExporter before streaming, as
MeshExporter already does, and add a seam so the single-domain fetch can
be served from memory in a unit test. The new test asserts a sub-domain
whose parent is not yet cached resolves to Parent@Child; it is expected
to fail until the cache resolves missing parents by GUID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
getIdentityForAsset reads the parent's identity cache-only. On a cache
that was not preloaded, a sub-domain fetched before its parent was cached
as just its own name, so exports wrote Child instead of Parent@Child and
the import could not resolve the domain. Fetch the missing parent first
when looking a domain up by GUID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant