Skip to content

[APPS][Connections Part 8] Trace imported connection ID values#363

Closed
sdkennedy2 wants to merge 1 commit into
graphite-base/363from
sdkennedy2/imported-connection-id-value-tracing
Closed

[APPS][Connections Part 8] Trace imported connection ID values#363
sdkennedy2 wants to merge 1 commit into
graphite-base/363from
sdkennedy2/imported-connection-id-value-tracing

Conversation

@sdkennedy2
Copy link
Copy Markdown
Collaborator

@sdkennedy2 sdkennedy2 commented May 13, 2026

Motivation

Allow backend helper modules discovered by the reachable module graph pass to keep static connection IDs in separate local modules.

Changes

This PR adds graph-aware imported value tracing on top of the module graph traversal refactor. Module records now include the import/export metadata needed for value semantics, and connection ID resolution can follow named imports, local export aliases, re-exports, import/export relays, and unambiguous export * declarations back to static values.

Supported values include imported string constants, static template literals, const chains, and static object roots such as:

import { CONNECTIONS } from './connections';
request({ connectionId: CONNECTIONS.HTTP.PROD, inputs: {} });

The resolver still fails closed for unsupported graph/value shapes including default imports, namespace imports, missing exports, mutable exports, ambiguous star exports, and import/export cycles.

QA Instructions

  • yarn workspace @dd/apps-plugin typecheck
  • yarn eslint packages/plugins/apps/src/backend/ast-parsing/module-graph.ts packages/plugins/apps/src/backend/ast-parsing/walk-module-graph.ts packages/plugins/apps/src/backend/ast-parsing/extract-connection-ids-from-module-graph.ts packages/plugins/apps/src/backend/ast-parsing/extract-connection-ids-from-module-graph.test.ts packages/plugins/apps/src/backend/ast-parsing/connection-id-values.ts packages/plugins/apps/src/vite/backend-connection-id-collector.ts --quiet
  • yarn workspace @dd/tests test:unit packages/plugins/apps/src/backend/ast-parsing/extract-connection-ids-from-module-graph.test.ts packages/plugins/apps/src/backend/ast-parsing/extract-connection-ids.test.ts packages/plugins/apps/src/vite/dev-server.test.ts packages/plugins/apps/src/vite/index.test.ts packages/plugins/apps/src/index.test.ts --runInBand

Blast Radius

This affects apps plugin backend connection ID analysis for reachable backend modules. It broadens static analysis support for local imported values while preserving fail-closed behavior for unsupported cases.

Documentation

Copy link
Copy Markdown
Collaborator Author

sdkennedy2 commented May 13, 2026

@sdkennedy2 sdkennedy2 changed the title Trace imported connection ID values [APPS][Connections Part 8] Trace imported connection ID values May 13, 2026
@sdkennedy2 sdkennedy2 changed the base branch from sdkennedy2/refactor-connection-id-extraction-modules to graphite-base/363 May 13, 2026 13:50
@sdkennedy2 sdkennedy2 closed this May 13, 2026
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