Skip to content

Cross-source linking is broken at 3 layers #562

@jeevanpillay

Description

@jeevanpillay

Summary

Cross-source linking between providers (Vercel, GitHub, Sentry) is non-functional. Three independent layers are broken. Not blocking — we're not live with multi-provider yet — but needs fixing before launch.

Layer 1: Entity Pipeline — Edge Rules Are Dead Code

GitHub declares a commit → deployment edge rule to link commits to Vercel deployments. It never fires because:

  • Vercel transformer puts commit SHA in attributes.gitCommitSha instead of relations[]
  • GitHub has no push event transformer; PR transformer puts headSha in attributes too
  • Text-extracted SHAs get category: "reference" which the edge resolver filters out (only accepts structural types: commit, branch, pr, issue, deployment)
  • The extractFromRelations function already has a case "commit" path — it just never executes because no relation with entityType: "commit" is ever produced

Fix: Both Vercel and GitHub transformers need to emit { entityType: "commit" } in their relations array. ~20 lines across 2 files.

Layer 2: Resource Linking — Zero Cross-Provider Awareness

  • orgIntegrations rows are fully independent — no FK or field links a Vercel project to its GitHub repo
  • providerConfig JSONB stores only { provider, type, sync } — no linkedRepoId, no rootDirectory
  • bulkLink accepts resourceName in input but never writes it to DB
  • Installed sources UI resolves display names via live API call on every page load (no cached name)

Fix: Extend providerConfig Zod schemas with optional linkedRepo field (no DB migration — it's JSONB). Fetch cross-provider metadata inline during bulkLink using createMemoryCaller (already imported). Add resourceName column (one migration).

Layer 3: API Catalog — Missing Endpoints

Provider APIs expose rich cross-linking data that isn't registered in the catalog:

  • Vercel: No get-project endpoint (returns link.repoId, rootDirectory for monorepo awareness)
  • Sentry: No list-repos, list-code-mappings, or list-releases endpoints
  • GitHub: No deployments or deployment-statuses endpoints
  • vercelProjectsListSchema uses .loose() which silently drops link and rootDirectory from list responses

Fix: Register missing endpoints as Zod-typed catalog entries. ~30 lines of schemas.

TL;DR

The data exists in every provider's API. We just don't fetch it (Layer 3), don't store it (Layer 2), and don't produce the right entity types for the graph rules that already exist (Layer 1). Total fix is ~70 lines across ~6 files. Do it when we're ready to go live with multi-provider connections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions