[APPS][Connections Part 2] Extract inline backend connection IDs#339
[APPS][Connections Part 2] Extract inline backend connection IDs#339sdkennedy2 wants to merge 1 commit intomasterfrom
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9320d3ef3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| exportNames, | ||
| id, | ||
| context.buildRoot, | ||
| extractConnectionIds(ast, id), |
There was a problem hiding this comment.
Follow or reject re-exported backend implementations
For supported facades such as export { run } from './impl' or import { run } from './impl'; export { run }, the transform registers run as a backend function but this call only scans the facade AST. If ./impl contains the inline action-catalog call with connectionId, the generated backend bundle still executes it while the manifest records an empty allowedConnectionIds, so those functions fail once the action requires that connection.
Useful? React with 👍 / 👎.
b9320d3 to
3e1b24d
Compare
9a1dbe0 to
04d954f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e1b24d7de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3e1b24d to
97a160d
Compare
04d954f to
d230cbd
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97a160dd20
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d230cbd to
a91c48b
Compare
97a160d to
9bcbfc1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bcbfc188e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| exportNames, | ||
| id, | ||
| context.buildRoot, | ||
| extractConnectionIds(ast, id), | ||
| ); |
There was a problem hiding this comment.
Preserve allowlists for re-exported backend handlers
When a .backend file uses the supported export { run } from './impl' shape, extractExportedFunctions still registers run, but this call only scans the wrapper file's AST, not the re-export source. If ./impl contains the action-catalog call with an inline connectionId, the generated manifest records allowedConnectionIds: [] for that backend function even though the bundled function will execute the action, so re-exported handlers are denied/misrepresented at runtime. The new enumerateBackendExports metadata includes source, but the transform discards it here.
Useful? React with 👍 / 👎.
9bcbfc1 to
a0cea42
Compare
a91c48b to
9ce0085
Compare
9ce0085 to
b89f346
Compare
806c29a to
61615b2
Compare
b89f346 to
5c93fa8
Compare
61615b2 to
5e1d743
Compare
5c93fa8 to
2234d86
Compare
5e1d743 to
c5c7d75
Compare
2234d86 to
4769d38
Compare
4769d38 to
8aeb377
Compare
c5c7d75 to
0affdd3
Compare
0affdd3 to
a013be2
Compare
🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: c3c12a6 | Docs | Datadog PR Page | Give us feedback! |
a013be2 to
5c281d2
Compare
5c281d2 to
c3c12a6
Compare

Motivation
This is part 2 of the connection ID manifest stack. After part 1 adds manifest plumbing with empty allowlists, this PR introduces the smallest useful static analysis behavior: inline string literal
connectionIdvalues in same-file action-catalog calls.Changes
Adds
extract-connection-ids.tsand wires it into backend proxy generation so every export in a backend file receives the same sorted, deduped file-level union of inline connection IDs. This PR also refactors backend export discovery aroundenumerateBackendExports, keeping existingextractExportedFunctionsbehavior while making export-shape validation shared and testable.Supported in this PR:
The extractor recognizes named/default/namespace action-catalog imports from the package root and subpaths. It ignores unrelated calls with
connectionId, ignores action-catalog object arguments that visibly lackconnectionId, and fails closed for unsupported call shapes that could hide a connection ID.Same-module identifiers, object members, and imported values are intentionally deferred to later PRs.
QA Instructions
NODE_OPTIONS=--experimental-vm-modules ~/.yarn/switch/bin/yarn workspace @dd/tests jest --config jest.config.ts ../plugins/apps/src/backend/discovery.test.ts ../plugins/apps/src/backend/extract-connection-ids.test.ts ../plugins/apps/src/index.test.ts ../plugins/apps/src/vite/index.test.ts ../plugins/apps/src/vite/dev-server.test.ts ../plugins/apps/src/upload.test.ts --runInBand.~/.yarn/switch/bin/yarn workspace @dd/apps-plugin typecheck.~/.yarn/switch/bin/yarn workspace @dd/tests typecheck.Blast Radius
This affects apps backend function proxy generation and static analysis for action-catalog calls inside backend entry files only. It does not traverse imported local modules and does not add dependency on a connections registry.
Documentation