fix(prepare_create_asset): surface relation type publicId, roles and complex relation legs#100
Open
topizio wants to merge 2 commits into
Open
fix(prepare_create_asset): surface relation type publicId, roles and complex relation legs#100topizio wants to merge 2 commits into
topizio wants to merge 2 commits into
Conversation
…le and direction
Relation slots previously exposed only a UUID. publicId is now threaded
through from the scoped assignment (mirroring the attribute path), and
role/coRole are hydrated from /relationTypes/{id} since they are not part
of the assignment payload. direction and the other-leg type restriction
are read from the assignment reference (relationTypeDirection /
relationTypeRestriction), replacing a speculative characteristicTypes
metadata struct the API never populated.
Also cross-references get_asset_details -> prepare_create_asset for
type ids/publicIds, adds a concept->tool id-source table, and documents
that complex relation types have no role via /relationTypes/{id}.
Verified end-to-end against a live Collibra instance (Column / Supply
Chain): ColumnIsPartOfTable returns role "is part of", coRole "contains",
direction "TO_TARGET".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Complex relation types (e.g. FieldMapping_C, ForeignKeyMapping) are not
resolvable via /relationTypes/{id} — that endpoint 404s for them. They
also have no single role: a complex relation has two or more legs, each
with its own role, coRole and asset type.
Relation slots now carry a Kind discriminator. Simple relations hydrate
from /relationTypes/{id} as before; complex ones hydrate from
/complexRelationTypes/{id} and expose a legs[] list. This removes the
previous 404 that leaked into the response message.
Verified end-to-end against a live Collibra instance: FieldMapping_C and
ForeignKeyMapping return their three legs with roles and asset types.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Description of your changes
prepare_create_assetpreviously returned relation slots with only a UUID — no publicId, and emptyrole/coRole/direction/targetType. The empty role was a broken contract: the reducer read those fields from the assignment'scharacteristicTypesarray, which the DGC API never populates for them.This PR is split into two independent, separately-droppable commits:
1.
fix: simple relation types (d2bc1a4)role/coRoleare hydrated from/rest/2.0/relationTypes/{id}— they live on the relation type resource, not the assignment.directionand the other-leg type restriction are read from the assignment reference (relationTypeDirection/relationTypeRestriction), replacing the speculativecharacteristicTypesmetadata struct.get_asset_details→prepare_create_assetfor type ids/publicIds; concept→tool id-source table; corrected direction values (TO_TARGET/TO_SOURCE).2.
feat: complex relation types (5e5d2e1) — optional; safe to drop if out of scopeFieldMapping_C,ForeignKeyMapping) 404 on/relationTypes/{id}and have no single role — they have two or more legs, each with its own role and asset type.kinddiscriminator; complex ones hydrate from/rest/2.0/complexRelationTypes/{id}and expose alegs[]list. This removes the 404 that previously leaked into the response message.Impact Analysis
Scope is limited to the
prepare_create_assettool and its client.RelationSchemaEntrygainskindandlegs(bothomitempty, additive); existing fields are unchanged. Adds one/relationTypes/{id}(or/complexRelationTypes/{id}) call per relation slot during hydration, tolerant of per-item errors.Verified end-to-end against a live Collibra instance (
Column/Supply Chain, 19 relation slots): all simple relations return role/coRole/direction;FieldMapping_CandForeignKeyMappingreturn their three legs; the response message no longer carries a hydration 404. Full test suite: 291 passed / 37 packages.🤖 Generated with Claude Code