Repository navigation
[APPS-2961] Refactor: move local execution's side-effect-free helpers into their own module - #604
Conversation
🎉 All green!🧪 All tests passed 🔗 Commit SHA: f1f4210 | Docs | View more details | Give us feedback! |
|
@codex review |
There was a problem hiding this comment.
🟢 Approval recommended
The focused extraction preserves validation, serialization, and dispatch behavior, with no blocking issues identified.
No open issues 🎉
What changed in this PR
Extracts reusable local-execution helpers into a side-effect-free module, preparing for sandboxed backend calls without changing current behavior.
Changes:
- Moves action validation, JSON checks, and proxy creation into a shared module.
- Injects a dispatch callback while preserving existing in-process execution.
| File | Description |
|---|---|
packages/plugins/apps/src/vite/local-execution.ts |
Imports shared helpers and supplies guarded dispatch. |
packages/plugins/apps/src/vite/local-execution-shared.ts |
Exports reusable helpers without installing the global $ accessor. |
Review effort: Balanced
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ 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". |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
144ff8a to
6bf6b18
Compare
df0e1ca to
a181de9
Compare
6bf6b18 to
9a36cab
Compare
a181de9 to
8cc274c
Compare
9a36cab to
b6220fb
Compare
8cc274c to
9847ad6
Compare
b6220fb to
5721b26
Compare
9847ad6 to
ddbd01f
Compare
5721b26 to
74f28bc
Compare
ddbd01f to
ef2034f
Compare
74f28bc to
11b2000
Compare
ef2034f to
5b3a161
Compare
11b2000 to
f08b751
Compare
Live Debugger Runtime BenchmarkSDK-loaded dormant-probe runtime overhead, measured against an uninstrumented bundle in the same browser session.
What do the Tiny and Hot workloads represent? Browser Debugger SDK: Full diagnosticsRaw samples are in the |
…their own module The $.Actions validation, JSON round-trip checks and $.Actions proxy move to local-execution-shared.ts, so a separate process can bundle them without local-execution.ts's import-time globalThis.$ accessor. The proxy takes a dispatch callback, so its caller decides where a call goes, and validateActionCallShape and returnValueSubject give that process the allowlist-free check and the return-value error subject, with validateActionCallShape tested directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f08b751 to
f1f4210
Compare
0b42188
into
master
Motivation
$.Actionsvalidation, JSON checks and$.Actionsproxy live inlocal-execution.ts, which installs aglobalThis.$accessor when it's imported.Changes
5 changes across local-execution-shared.ts, local-execution.ts and local-execution-shared.test.ts
$.Actionsvalidation,serializeActionInputs,assertJsonRoundTrippableandmakeActionsProxy, with unchanged behavior, into a module with no import-time side effects.local-execution-shared.tsmakeActionsProxytakes a dispatch callback, so its caller decides where a call goes.local-execution-shared.tsvalidateActionCallasvalidateActionCallShape, and names the return-value error subject inreturnValueSubject, for the next PR's child process.local-execution-shared.tslocal-execution.tsvalidateActionCallShapedirectly, including that it leaves the connection allowlist to its caller.local-execution-shared.test.tsQA Instructions
11b20006. Against a Datadog staging org, the same calls reach the real action runner: a$.Actions.http.requestGET returns 200, and every refusal matches. Setup: build-plugins: Testing and QA Guide.{"hello":"qa","pid":18412}, dev server pid 18412$.Actionscall whose action failsQuery execution failed: QA mock: the HTTP action returned 503 Service Unavailable$.Actionsinputs declaringallowedConnectionIdsmust not declare its own allowedConnectionIds in inputs$.Actionscall on an unlisted connectionused connection "not-allowed", which is not in this function's allowed connections: []$.Actionsinputs holding aMapInputs to action $.Actions.http.request contains a Map (at "m")$.Actionscall with no argumentsNo arguments provided to action $.Actions.http.requestMapLocal execution of "mapReturn"'s return value contains a MapPOST /__dd/debugBundleTMPDIR=/private/tmp: the manifest-tags and parameters suites fail under/var/folders, onmastertoo.Local QA app, helper script and output
Staging QA against a Datadog staging org
auth: { site: process.env.DD_SITE, apiKey: process.env.DD_API_KEY, appKey: process.env.DD_APP_KEY }, this extra export insrc/qa.backend.js, anddev-qa.mjswithout thenocklines (port 5214,callActionGetadded to its call list):Blast Radius
local-execution.tsimports the moved code, and its tests run unchanged.Documentation
🤖 Generated with Claude Code