[APPS][Connections Part 8] Traverse backend module graph for connection IDs#362
Conversation
3058275 to
583c810
Compare
2524101 to
040ba08
Compare
583c810 to
9a8d0b2
Compare
56d16d9 to
28d9e55
Compare
c3f66bf to
a00cd6b
Compare
28d9e55 to
5c15008
Compare
a00cd6b to
ce6fdd3
Compare
5c15008 to
9f34e97
Compare
9f34e97 to
bc0061e
Compare
bc0061e to
e08b6dc
Compare
156e956 to
48e0a11
Compare
|
|
||
| walkModuleGraph(entryId, modules, buildRoot, ({ moduleId, record }) => { | ||
| // Resolve connection IDs while visiting the reachable graph so this | ||
| // step can later receive graph-aware value-resolution context. |
There was a problem hiding this comment.
Essentially this allows us to support in the future traversing modules to find the connectionId. Currently the connection id needs to be defined in the same module as the action-catalog function call.
There was a problem hiding this comment.
In effect, if the user keeps adding to their backend, parsing connection IDs will slow down the more modules they add?
There was a problem hiding this comment.
Per unique backend function entry that is correct (since we do a build per backend function).
I figured we could start simple so its easy to reason about and the iterate and performance optimziations.
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
|
||
| walkModuleGraph(entryId, modules, buildRoot, ({ moduleId, record }) => { | ||
| // Resolve connection IDs while visiting the reachable graph so this | ||
| // step can later receive graph-aware value-resolution context. |
There was a problem hiding this comment.
In effect, if the user keeps adding to their backend, parsing connection IDs will slow down the more modules they add?
| beforeEach(() => { | ||
| jest.restoreAllMocks(); | ||
| mockViteBuild.mockClear(); | ||
| mockViteBuild.mockReset(); |
There was a problem hiding this comment.
Non-blocker/nit, but I think mockClear is fine (generally we should be calling jest.clearAllMocks() in an afterEach anyways). IIRC, the last .mockImplementation call wins?
48e0a11 to
36b022a
Compare
e08b6dc to
0dededb
Compare
e2addec to
e580213
Compare
🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: 938eea6 | Docs | Datadog PR Page | Give us feedback! |
e580213 to
938eea6
Compare

Motivation
Use the backend-build module graph from #353 and the reusable walker from #364 to find action-catalog calls in reachable backend helper modules.
Changes
This PR adds the connection-ID-specific layer on top of the collected module graph and reusable graph walker. It introduces
extractConnectionIdsFromModuleGraphandcreateBackendConnectionIdCollector, then wires graph-derived allowlists into production upload and dev backend execution.The traversal starts at the real backend entry module, visits reachable app-local modules through
walkModuleGraph, and runs the existing same-module connection ID extractor against each reached module. Connection ID values must still be defined in the same module as the action-catalog call site. Imported connection ID values are intentionally unsupported in this PR and continue to fail closed.QA Instructions
Updated focused unit coverage for reachable helper modules, same-module connection ID values, graph cycles, unsupported graph shapes, production manifest enrichment, and dev execution allowlists. Also ran apps plugin typecheck and scoped lint coverage for the graph extraction and Vite integration paths.
Blast Radius
This changes apps plugin backend connection ID analysis for upload and dev execution by using reachable backend build modules instead of only the backend entry file. It preserves conservative fail-closed behavior and does not add imported connection ID value tracing yet.
Documentation