Commit 2a864e8
committed
wire local execution into the real dev server
- npm run dev's /__dd/executeAction now runs backend functions via
executeScriptLocally (a real forked child process) instead of the cloud
preview-async round trip, per the design doc's Rollout section: no
customer-facing toggle, local execution is the new unconditional default.
- Preserves today's cloud round trip as a new, additive
/__dd/executeActionViaCloud endpoint rather than deleting it -- no
`npm run dev:verify` script exists yet to replace it (that requires
create-apps scaffolding template changes, outside this package), and the
existing dev-server.test.ts suite has extensive coverage of the cloud path
that would otherwise be silently orphaned.
- /__dd/executeAction no longer requires Datadog credentials to be
configured, unlike /__dd/executeActionViaCloud -- local execution's
$.Actions calls are stubbed today (see local-execution.ts), so there's
nothing for it to authenticate yet.
- Wires killAllLocalExecutionChildren() (from #471) into the dev server's
own shutdown via server.httpServer's 'close' event, so killing the dev
server mid-execution doesn't leave an orphaned child process.
- Registers local-exec-child.js in the package's buildPlugin.toBuild config
(same mechanism apps-runtime.ts already uses) so it's actually copied
into the published dist/src output next to the compiled bundle.
local-execution.ts resolves it at runtime via a __dirname-relative path,
which only works if the file exists on disk next to the bundle -- found
by running a real npm-linked build against a scaffolded app, since the
existing jest tests resolve local-execution.ts's source directly and
never exercise the published package layout.
$.Actions calls remain stubbed until the single-action execution endpoint
resolves (design doc's Open Dependency section) -- this is explicitly not
customer-ready yet, same as the rest of this PR stack.
Milestone 2 of APPS-2792's local Node execution kickoff plan.1 parent 4ac0179 commit 2a864e8
4 files changed
Lines changed: 209 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
205 | 232 | | |
206 | 233 | | |
207 | 234 | | |
| |||
218 | 245 | | |
219 | 246 | | |
220 | 247 | | |
221 | | - | |
| 248 | + | |
222 | 249 | | |
223 | 250 | | |
224 | 251 | | |
| |||
314 | 341 | | |
315 | 342 | | |
316 | 343 | | |
317 | | - | |
| 344 | + | |
318 | 345 | | |
319 | 346 | | |
320 | 347 | | |
| |||
346 | 373 | | |
347 | 374 | | |
348 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
349 | 475 | | |
350 | 476 | | |
351 | 477 | | |
| |||
362 | 488 | | |
363 | 489 | | |
364 | 490 | | |
365 | | - | |
| 491 | + | |
366 | 492 | | |
367 | 493 | | |
368 | 494 | | |
| |||
414 | 540 | | |
415 | 541 | | |
416 | 542 | | |
417 | | - | |
| 543 | + | |
418 | 544 | | |
419 | 545 | | |
420 | 546 | | |
| |||
462 | 588 | | |
463 | 589 | | |
464 | 590 | | |
465 | | - | |
| 591 | + | |
466 | 592 | | |
467 | 593 | | |
468 | 594 | | |
| |||
488 | 614 | | |
489 | 615 | | |
490 | 616 | | |
491 | | - | |
| 617 | + | |
492 | 618 | | |
493 | 619 | | |
494 | 620 | | |
| |||
539 | 665 | | |
540 | 666 | | |
541 | 667 | | |
542 | | - | |
| 668 | + | |
543 | 669 | | |
544 | 670 | | |
545 | 671 | | |
| |||
598 | 724 | | |
599 | 725 | | |
600 | 726 | | |
601 | | - | |
| 727 | + | |
602 | 728 | | |
603 | 729 | | |
604 | 730 | | |
| |||
653 | 779 | | |
654 | 780 | | |
655 | 781 | | |
656 | | - | |
| 782 | + | |
657 | 783 | | |
658 | 784 | | |
659 | 785 | | |
| |||
680 | 806 | | |
681 | 807 | | |
682 | 808 | | |
683 | | - | |
| 809 | + | |
684 | 810 | | |
685 | 811 | | |
686 | 812 | | |
| |||
708 | 834 | | |
709 | 835 | | |
710 | 836 | | |
711 | | - | |
| 837 | + | |
712 | 838 | | |
713 | 839 | | |
714 | 840 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
308 | 309 | | |
309 | 310 | | |
310 | 311 | | |
311 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
312 | 322 | | |
313 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
314 | 358 | | |
315 | 359 | | |
316 | 360 | | |
| |||
323 | 367 | | |
324 | 368 | | |
325 | 369 | | |
326 | | - | |
| 370 | + | |
327 | 371 | | |
328 | 372 | | |
329 | 373 | | |
| |||
340 | 384 | | |
341 | 385 | | |
342 | 386 | | |
343 | | - | |
| 387 | + | |
344 | 388 | | |
345 | 389 | | |
346 | 390 | | |
| |||
380 | 424 | | |
381 | 425 | | |
382 | 426 | | |
383 | | - | |
| 427 | + | |
384 | 428 | | |
385 | 429 | | |
386 | 430 | | |
| |||
397 | 441 | | |
398 | 442 | | |
399 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
400 | 452 | | |
401 | 453 | | |
402 | 454 | | |
403 | 455 | | |
404 | | - | |
| 456 | + | |
405 | 457 | | |
406 | 458 | | |
407 | 459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
213 | 221 | | |
214 | 222 | | |
215 | 223 | | |
0 commit comments