Repository navigation
fix(asset-export): write sub-domains with their full parent path - #2927
Draft
connectivity-ai[bot] wants to merge 2 commits into
Draft
connectivity-ai[bot] wants to merge 2 commits into
connectivity-ai[bot] wants to merge 2 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failure
Enrichment Migrator extracts through
AssetExporter, which never preloaded the data-domain cache (MeshExporteralready does, since #2561). When an asset's domain is a sub-domain:DataDomainXformer.encodeFromGuidlooks up the sub-domain by GUID.DataDomainCache.getIdentityForAssetreads the parent's identity from the cache only.Childinstead ofParent@Child.getByIdentity("Child")misses and the run throwsDomain 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 asMeshExporterdoes after fix(asset-export-basic): preload domain cache to fix truncated hierarchy paths (CSA-444) #2561.DataDomainCache.lookupByIdnow 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.DataDomainCacheis nowopen, and the single-domain search moved intoprotected 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.ktis a pure unit test with no tenant. It serves domains from an in-memory subclass and makes the same two callsencodeFromGuidmakes (getByGuid, thengetIdentity) on a cold cache:subDomainOnColdCacheResolvesToFullPathexpectsParent@Child.nestedSubDomainOnColdCacheResolvesEveryAncestorexpectsGrandparent@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]andexpected [Grandparent@Parent@Child] but found [Child]. After the fix commit (8a014bc), pr-build and pr-test both pass.What ran
pr-build(assemble, shadowJar, spotlessCheck) andpr-test(./gradlew testClasses test) on both commits, with the results above../gradlew :package-toolkit:runtime:test --tests 'cache.DataDomainCacheSubDomainTest'could not configure. The managed Gradle repository firewall does not serve thekotlin-dsl5.2.0 plugin thatbuildSrcneeds, and--offlinehas no cached copy. So CI is the only place these ran.Related: CONNECT-3803, #2561.
🤖 Generated with Claude Code