fix(relationships): normalize element refs to source_id at write time#82
Merged
Merged
Conversation
…_id at write time MCP and REST API were storing element UUIDs in source_element/target_element. All 11 viewer queries (Integration Map, App Landscape, Dependency Graph, Capability Tree, Technology Stack, etc.) JOIN on elements.source_id, so they returned empty results for MCP-created workspaces. Fix: resolve UUID→source_id in the relationship create/update handlers before persisting. AOEF-imported values (already source_ids) pass through unchanged. Migration 025 backfills existing rows that contain UUIDs.
Deploying archipulse with
|
| Latest commit: |
fdbc43a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://15edd804.archipulse.pages.dev |
| Branch Preview URL: | https://fix-normalize-relationship-e.archipulse.pages.dev |
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.
Summary
Continuation of #81. Same root cause: MCP and REST API stored element UUIDs in
source_element/target_elementinstead of ArchiMatesource_idstrings.All 11 analytics viewer queries JOIN on
elements.source_id = relationships.source_element/target_element, so they silently returned empty results for any workspace created via MCP (Integration Map, App Landscape, Dependency Graph, Capability Tree, Technology Stack, Process-App, App Dashboard, etc).relationship_handler.go: addsresolveElementRefhelper — if the value is a valid UUID, translates tosource_idbefore persisting; otherwise passes through unchanged (AOEF-imported values are already source_ids)migrations/025: backfills existing rows that contain UUIDsMCP server calls the REST API, so it is fixed automatically with no changes to
mcpserver/server.go.Test plan
source_element/target_elementshould contain source_ids, not UUIDsgo test ./internal/...