[APPS][Connections Part 2] Extract inline backend connection IDs#349
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: 5740b4654b
ℹ️ 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".
dca9665 to
bb15b8c
Compare
51ffd3b to
e8b5f13
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8b5f13859
ℹ️ 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".
bc33ec1 to
ed2ddae
Compare
|
AI validation note: I revalidated this PR with Validated paths:
Scope note: the original test-app shape had the action-catalog call in an imported helper module. That failed closed with Datadog's expected allowlist error because this PR extracts inline connection IDs from the |

Motivation
Backend manifests currently carry required
allowedConnectionIdsarrays, but they remain empty.This PR extracts connectionIds that are statically defined within action catalog function calls such as the following:
This should include
'358b602d-794f-420e-9802-3caca434060a'inallowedConnectionIds.Changes
Adds the inline connection ID extractor in the same module structure used by the follow-up static value resolution work:
action-catalog-imports.tscollects action-catalog function and namespace imports.action-catalog-call-sites.tsuseseslint-scopeand the internalwalkAsthelper from [APPS][Connections Part 1] Add internal AST traversal helper #350 to find action-catalog call sites while staying safe around shadowed names and unsupported aliases.connection-id-values.tsreads theconnectionIdproperty from a known action-catalog call and extracts inline string literals.extract-connection-ids.tsstays as the small public orchestration layer used by backend proxy module generation.extractConnectionIdsdoes the following for each*.backend.tsfile:Collects the names imported from the action catalog library.
Uses
eslint-scopeto map identifiers back to their declarations. This lets us distinguish an actual action-catalog import from a local binding with the same name, such as this shadowedrequestparameter:Uses the internal
walkAsthelper from [APPS][Connections Part 1] Add internal AST traversal helper #350 to traverse the ESTree AST for each*.backend.tsfile.Finds action-catalog call sites and extracts inline string
connectionIdvalues.Fails closed for action-catalog call shapes that could hide a connection ID.
Added dependencies
eslint-scope: despite the name, this package is focused on ESTree scope analysis. It lets us resolve each identifier to the declaration it actually references, which is what makes shadowing-safe extraction possible.rollupas a dev dependency because the tests needparseAstto create the same Rollup ESTree shape that pluginthis.parse()provides. Vite re-exportsparseAstfrom its ESM API, but this repo's Jest/ts-jest setup loads Vite through its CJS facade, where Vite intentionally throws forparseAst. Importingrollup/parseAstdirectly keeps the tests simple and avoids adding a misleading Vite test shim.QA Instructions
Added extractor tests.
Validated with
/Users/scott.kennedy/dd/test-action-catalog-appby building the linked local Vite plugin, redirecting app upload to a local capture server, and inspecting the captured manifest. A temporary backend entrypoint with one inline stringconnectionIdand one shadowedcatch (request)call produced only the inline ID inallowedConnectionIds.Blast Radius
This affects backend manifest connection ID extraction during the apps plugin build/dev-preview flow. It adds a direct
eslint-scoperuntime dependency to@dd/apps-plugin, plus arollupdev dependency for parser-backed tests. AST traversal comes from the internal helper added in #350.Documentation