@cnc-tools/storm 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application.js +3 -1
- package/dist/bin/storm.js +18 -8
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-4U4DZ7VG.js +40 -0
- package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
- package/dist/chunks/chunk-5GBMR4HM.js +966 -0
- package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
- package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
- package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
- package/dist/chunks/{chunk-27P2QSIM.js → chunk-CXAT7ZKP.js} +2 -2
- package/dist/chunks/chunk-E4PJNZVG.js +783 -0
- package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
- package/dist/chunks/{chunk-ZH5R7W4A.js → chunk-KC4KDJ5K.js} +147 -26
- package/dist/chunks/{chunk-5ED3IDUJ.js → chunk-L36GBUBB.js} +1652 -681
- package/dist/chunks/{chunk-QBR5VHJ7.js → chunk-OX7X4B2L.js} +7 -2
- package/dist/chunks/{chunk-Z5OXOZD3.js → chunk-PN5ULTTH.js} +140 -130
- package/dist/chunks/chunk-QUHY6FGN.js +108 -0
- package/dist/chunks/chunk-QVS7HRU7.js +74 -0
- package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
- package/dist/chunks/{chunk-YBPTMJUM.js → chunk-RAQEXKL6.js} +1120 -465
- package/dist/chunks/{chunk-RKONDLPS.js → chunk-SZEURWRS.js} +446 -52
- package/dist/chunks/chunk-TJNFVNKR.js +246 -0
- package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
- package/dist/chunks/{chunk-XPCUINWS.js → chunk-XEVHP5ZW.js} +2 -2
- package/dist/chunks/{chunk-5TMHYH7G.js → chunk-YV7GE6EV.js} +638 -80
- package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
- package/dist/chunks/{live-app-FBVWUUMT.js → live-app-PI3BAN6Y.js} +37 -26
- package/dist/command-tree.d.ts +2 -2
- package/dist/command-tree.js +2 -2
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +364 -0
- package/dist/commands/exec/across-sandboxes-outcomes.js +229 -0
- package/dist/commands/exec/across-sandboxes-run.d.ts +180 -0
- package/dist/commands/exec/across-sandboxes-run.js +339 -0
- package/dist/commands/exec/command.d.ts +577 -75
- package/dist/commands/exec/command.js +165 -32
- package/dist/commands/exec/driver-plan.d.ts +8 -2
- package/dist/commands/exec/driver-plan.js +13 -3
- package/dist/commands/exec/exec-words.d.ts +17 -3
- package/dist/commands/exec/exec-words.js +27 -16
- package/dist/commands/exec/live-view.d.ts +3 -4
- package/dist/commands/exec/live-view.js +37 -28
- package/dist/commands/exec/metadata.js +2 -2
- package/dist/commands/exec/mint-failed.d.ts +4 -4
- package/dist/commands/exec/mint-failed.js +6 -6
- package/dist/commands/exec/outcomes.d.ts +530 -73
- package/dist/commands/exec/outcomes.js +202 -66
- package/dist/commands/exec/plan-only.d.ts +10 -0
- package/dist/commands/exec/plan-only.js +46 -0
- package/dist/commands/exec/plan-run.d.ts +54 -35
- package/dist/commands/exec/plan-run.js +81 -38
- package/dist/commands/exec/planned-outcome.d.ts +15 -0
- package/dist/commands/exec/planned-outcome.js +35 -0
- package/dist/commands/exec/progress.d.ts +2 -2
- package/dist/commands/exec/progress.js +35 -18
- package/dist/commands/exec/resource-refusals.d.ts +2 -2
- package/dist/commands/exec/resource-refusals.js +3 -3
- package/dist/commands/exec/run-bin.d.ts +1 -1
- package/dist/commands/exec/run-bin.js +2 -2
- package/dist/commands/exec/run-command.d.ts +345 -63
- package/dist/commands/exec/run-command.js +308 -258
- package/dist/commands/exec/run-metadata.d.ts +42 -8
- package/dist/commands/exec/run-metadata.js +40 -21
- package/dist/commands/exec/run-planned.d.ts +20 -0
- package/dist/commands/exec/run-planned.js +22 -0
- package/dist/commands/exec/sandbox-lines.d.ts +42 -0
- package/dist/commands/exec/sandbox-lines.js +59 -0
- package/dist/commands/exec/sandbox-progress.d.ts +30 -0
- package/dist/commands/exec/sandbox-progress.js +232 -0
- package/dist/commands/exec/sandbox-view.d.ts +19 -0
- package/dist/commands/exec/sandbox-view.js +72 -0
- package/dist/commands/exec/view.d.ts +3 -2
- package/dist/commands/exec/view.js +10 -6
- package/dist/commands/runs/facts.d.ts +51 -9
- package/dist/commands/runs/facts.js +49 -29
- package/dist/commands/runs/list/command.d.ts +80 -4
- package/dist/commands/runs/list/command.js +11 -10
- package/dist/commands/runs/list/metadata.js +1 -1
- package/dist/commands/runs/list/outcomes.d.ts +40 -2
- package/dist/commands/runs/logs/command.d.ts +103 -8
- package/dist/commands/runs/logs/command.js +139 -24
- package/dist/commands/runs/logs/metadata.d.ts +4 -0
- package/dist/commands/runs/logs/metadata.js +14 -7
- package/dist/commands/runs/logs/outcomes.d.ts +49 -2
- package/dist/commands/runs/logs/outcomes.js +110 -6
- package/dist/commands/runs/past-run.d.ts +77 -6
- package/dist/commands/runs/past-run.js +133 -4
- package/dist/commands/runs/show/command.d.ts +568 -10
- package/dist/commands/runs/show/command.js +634 -119
- package/dist/commands/runs/show/metadata.d.ts +17 -0
- package/dist/commands/runs/show/metadata.js +48 -7
- package/dist/commands/runs/show/outcomes.d.ts +276 -5
- package/dist/commands/runs/show/outcomes.js +484 -96
- package/dist/commands/snapshots/build/command.d.ts +109 -18
- package/dist/commands/snapshots/build/command.js +72 -36
- package/dist/commands/snapshots/build/metadata.d.ts +4 -0
- package/dist/commands/snapshots/build/metadata.js +5 -1
- package/dist/commands/snapshots/build/outcomes.d.ts +53 -8
- package/dist/commands/snapshots/build/outcomes.js +26 -3
- package/dist/commands/snapshots/list/command.d.ts +72 -7
- package/dist/commands/snapshots/list/command.js +57 -24
- package/dist/commands/snapshots/list/metadata.d.ts +4 -0
- package/dist/commands/snapshots/list/metadata.js +4 -0
- package/dist/commands/snapshots/list/outcomes.d.ts +31 -0
- package/dist/commands/snapshots/list/outcomes.js +25 -2
- package/dist/commands/suites/list/command.d.ts +129 -0
- package/dist/commands/suites/list/command.js +162 -0
- package/dist/commands/suites/list/metadata.d.ts +11 -0
- package/dist/commands/suites/list/metadata.js +15 -0
- package/dist/commands/suites/list/outcomes.d.ts +91 -0
- package/dist/commands/suites/list/outcomes.js +122 -0
- package/dist/commands/suites/metadata.js +8 -0
- package/dist/commands/test/command.d.ts +1389 -0
- package/dist/commands/test/command.js +583 -0
- package/dist/commands/test/metadata.js +8 -0
- package/dist/commands/test/outcomes.d.ts +765 -0
- package/dist/commands/test/outcomes.js +140 -0
- package/dist/commands/test/plan.d.ts +92 -0
- package/dist/commands/test/plan.js +128 -0
- package/dist/commands/test/test-words.d.ts +12 -0
- package/dist/commands/test/test-words.js +42 -0
- package/dist/config/check-resources.d.ts +14 -0
- package/dist/config/check-resources.js +98 -0
- package/dist/config/check-runner.d.ts +13 -0
- package/dist/config/check-runner.js +54 -0
- package/dist/config/check-suites.d.ts +14 -0
- package/dist/config/check-suites.js +99 -0
- package/dist/config/gateways.d.ts +24 -0
- package/dist/config/index.d.ts +6 -3
- package/dist/config/index.js +3 -1
- package/dist/config/live/file-lists-file-gateway.d.ts +4 -0
- package/dist/config/live/file-lists-file-gateway.js +27 -0
- package/dist/config/load.d.ts +11 -10
- package/dist/config/load.js +35 -103
- package/dist/config/recipe-run.d.ts +8 -1
- package/dist/config/recipe-run.js +2 -1
- package/dist/config/resolve.d.ts +3 -2
- package/dist/config/resolve.js +6 -3
- package/dist/config/resolver.d.ts +20 -6
- package/dist/config/resolver.js +11 -8
- package/dist/config/runner.d.ts +24 -0
- package/dist/config/runner.js +4 -0
- package/dist/config/schema.d.ts +26 -18
- package/dist/config/schema.js +41 -9
- package/dist/config/settings-file.d.ts +9 -3
- package/dist/config/settings-file.js +41 -4
- package/dist/config/suite.d.ts +39 -0
- package/dist/config/suite.js +5 -0
- package/dist/config-file/define.d.ts +49 -18
- package/dist/config-file/define.js +9 -8
- package/dist/config-file/runner.d.ts +12 -0
- package/dist/config-file/runner.js +9 -0
- package/dist/context.d.ts +13 -8
- package/dist/context.js +13 -4
- package/dist/core/across-sandboxes.d.ts +43 -0
- package/dist/core/across-sandboxes.js +319 -0
- package/dist/core/before-run.d.ts +5 -3
- package/dist/core/before-run.js +12 -1
- package/dist/core/events.d.ts +62 -6
- package/dist/core/events.js +14 -0
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +3 -1
- package/dist/core/payload.d.ts +7 -4
- package/dist/core/payload.js +10 -4
- package/dist/core/presentations.js +1 -1
- package/dist/core/resource.d.ts +1 -1
- package/dist/core/resources.d.ts +56 -6
- package/dist/core/resources.js +81 -5
- package/dist/core/run-state.js +9 -0
- package/dist/core/run.d.ts +77 -15
- package/dist/core/run.js +150 -86
- package/dist/core/sandbox-end.d.ts +64 -0
- package/dist/core/sandbox-end.js +128 -0
- package/dist/core/timeline.d.ts +4 -4
- package/dist/core/timeline.js +3 -3
- package/dist/credential/live/vercel-cli-gateway.d.ts +7 -0
- package/dist/credential/live/vercel-cli-gateway.js +14 -1
- package/dist/extensions/github/context.d.ts +1 -1
- package/dist/extensions/github/definition.d.ts +11 -9
- package/dist/extensions/github/definition.js +8 -6
- package/dist/extensions/github/extension.d.ts +3 -3
- package/dist/extensions/github/fixture-repo.d.ts +21 -2
- package/dist/extensions/github/fixture-repo.js +31 -2
- package/dist/extensions/github/index.d.ts +2 -2
- package/dist/extensions/github/index.js +2 -2
- package/dist/extensions/github/lifecycle.d.ts +16 -6
- package/dist/extensions/github/lifecycle.js +42 -25
- package/dist/extensions/github/options.d.ts +17 -11
- package/dist/extensions/github/options.js +14 -13
- package/dist/extensions/github/refusals.d.ts +23 -6
- package/dist/extensions/github/refusals.js +34 -12
- package/dist/extensions/github/resource.d.ts +21 -12
- package/dist/extensions/github/resource.js +16 -8
- package/dist/extensions/github/run/payload.d.ts +6 -6
- package/dist/extensions/github/run/payload.js +3 -5
- package/dist/extensions/github/split.d.ts +10 -0
- package/dist/extensions/github/split.js +12 -0
- package/dist/extensions/playwright/driver.js +6 -26
- package/dist/extensions/playwright/extension.js +1 -1
- package/dist/extensions/testserver/commands/pool/create/command.js +8 -8
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/definition.d.ts +4 -4
- package/dist/extensions/testserver/definition.js +41 -31
- package/dist/extensions/testserver/extension.d.ts +4 -5
- package/dist/extensions/testserver/extension.js +14 -41
- package/dist/extensions/testserver/index.d.ts +1 -1
- package/dist/extensions/testserver/index.js +1 -1
- package/dist/extensions/testserver/lifecycle.d.ts +10 -2
- package/dist/extensions/testserver/lifecycle.js +29 -6
- package/dist/extensions/testserver/options/rules.d.ts +5 -5
- package/dist/extensions/testserver/options/rules.js +10 -8
- package/dist/extensions/testserver/options/sandboxes.d.ts +4 -2
- package/dist/extensions/testserver/options/sandboxes.js +8 -3
- package/dist/extensions/testserver/pool/gateways.d.ts +29 -4
- package/dist/extensions/testserver/pool/index.d.ts +2 -2
- package/dist/extensions/testserver/pool/index.js +1 -1
- package/dist/extensions/testserver/pool/lease.d.ts +10 -0
- package/dist/extensions/testserver/pool/lease.js +21 -0
- package/dist/extensions/testserver/pool/live/pool-store-gateway.js +38 -3
- package/dist/extensions/testserver/refusals.d.ts +12 -0
- package/dist/extensions/testserver/refusals.js +18 -0
- package/dist/extensions/testserver/release.d.ts +16 -0
- package/dist/extensions/testserver/release.js +56 -4
- package/dist/extensions/testserver/resource.d.ts +4 -4
- package/dist/extensions/testserver/resource.js +1 -1
- package/dist/extensions/testserver/split.d.ts +9 -0
- package/dist/extensions/testserver/split.js +22 -0
- package/dist/extensions/testserver/vitest/fixtures.d.ts +5 -5
- package/dist/extensions/testserver/vitest/fixtures.js +9 -38
- package/dist/extensions/vitest/driver.d.ts +7 -0
- package/dist/extensions/vitest/driver.js +33 -37
- package/dist/extensions/vitest/extension.js +1 -1
- package/dist/extensions/vitest/plan/plan-over.d.ts +8 -1
- package/dist/extensions/vitest/plan/plan-over.js +16 -2
- package/dist/extensions.d.ts +17 -16
- package/dist/extensions.js +5 -4
- package/dist/forward-sigterm.js +1 -1
- package/dist/launcher-resolvers/local-services.d.ts +1 -1
- package/dist/live-app.d.ts +3 -1
- package/dist/live-app.js +9 -5
- package/dist/local-services.js +1 -1
- package/dist/planning/driver-file-lists.d.ts +61 -0
- package/dist/planning/driver-file-lists.js +66 -0
- package/dist/{commands/exec → planning}/driver-refusals.d.ts +11 -10
- package/dist/{commands/exec → planning}/driver-refusals.js +18 -14
- package/dist/planning/file-lists-file.d.ts +58 -0
- package/dist/planning/file-lists-file.js +105 -0
- package/dist/planning/file-lists.d.ts +28 -0
- package/dist/planning/file-lists.js +52 -0
- package/dist/{commands/exec → planning}/final-results.d.ts +1 -1
- package/dist/{commands/exec → planning}/final-results.js +6 -6
- package/dist/planning/plan-only.d.ts +81 -0
- package/dist/planning/plan-only.js +83 -0
- package/dist/{commands/exec → planning}/redaction.d.ts +2 -2
- package/dist/{commands/exec → planning}/redaction.js +5 -4
- package/dist/{commands/exec → planning}/resource-flags.d.ts +5 -12
- package/dist/{commands/exec → planning}/resource-flags.js +6 -16
- package/dist/planning/run-kind-flags.d.ts +20 -0
- package/dist/planning/run-kind-flags.js +48 -0
- package/dist/planning/run-plan.d.ts +30 -0
- package/dist/planning/run-plan.js +4 -0
- package/dist/planning/sandbox-placeholders.d.ts +22 -0
- package/dist/planning/sandbox-placeholders.js +60 -0
- package/dist/planning/suite-not-found.d.ts +37 -0
- package/dist/planning/suite-not-found.js +36 -0
- package/dist/planning/suites.d.ts +43 -0
- package/dist/planning/suites.js +89 -0
- package/dist/{commands/exec → planning}/test-plan.d.ts +8 -3
- package/dist/{commands/exec → planning}/test-plan.js +32 -4
- package/dist/playwright/reporter.d.ts +20 -8
- package/dist/playwright/reporter.js +195 -15
- package/dist/presentation.d.ts +10 -6
- package/dist/presentation.js +13 -15
- package/dist/run-directory/gateways.d.ts +60 -4
- package/dist/run-directory/index.d.ts +4 -4
- package/dist/run-directory/index.js +2 -1
- package/dist/run-directory/live/run-directory-gateway.js +92 -16
- package/dist/run-directory/plan.d.ts +35 -2
- package/dist/run-directory/plan.js +44 -7
- package/dist/run-directory/reader.d.ts +26 -5
- package/dist/run-directory/reader.js +24 -1
- package/dist/run-directory/recording.d.ts +75 -49
- package/dist/run-directory/recording.js +214 -28
- package/dist/run-directory/run-directory.d.ts +22 -1
- package/dist/run-directory/run-directory.js +24 -0
- package/dist/run-directory/run-record.d.ts +144 -21
- package/dist/run-directory/run-record.js +118 -19
- package/dist/run-directory/timeline-facts.js +4 -4
- package/dist/runner/build-snapshots.d.ts +7 -7
- package/dist/runner/build-snapshots.js +12 -16
- package/dist/runner/events.d.ts +29 -8
- package/dist/runner/gateways.d.ts +59 -8
- package/dist/runner/index.d.ts +6 -4
- package/dist/runner/index.js +3 -2
- package/dist/runner/live/sandbox-gateway.js +177 -33
- package/dist/runner/live/terminal.d.ts +15 -3
- package/dist/runner/live/terminal.js +25 -3
- package/dist/runner/network-policy.d.ts +55 -0
- package/dist/runner/network-policy.js +46 -0
- package/dist/runner/policy-writes.d.ts +40 -0
- package/dist/runner/policy-writes.js +124 -0
- package/dist/runner/prepare.d.ts +6 -7
- package/dist/runner/ready.d.ts +39 -10
- package/dist/runner/ready.js +59 -47
- package/dist/runner/recipe-check.d.ts +6 -0
- package/dist/runner/recipe-check.js +29 -0
- package/dist/runner/recipe-secrets.d.ts +67 -0
- package/dist/runner/recipe-secrets.js +230 -0
- package/dist/runner/recipe.d.ts +118 -28
- package/dist/runner/recipe.js +147 -154
- package/dist/runner/sandboxed-command.d.ts +24 -10
- package/dist/runner/sandboxed-command.js +37 -12
- package/dist/runner/scope.d.ts +107 -21
- package/dist/runner/scope.js +274 -54
- package/dist/runner/secrets.d.ts +42 -31
- package/dist/runner/secrets.js +62 -40
- package/dist/runner/session.d.ts +59 -26
- package/dist/runner/session.js +82 -41
- package/dist/runner/snapshot-build.d.ts +7 -4
- package/dist/runner/snapshot-build.js +48 -28
- package/dist/runner/snapshot-choice.d.ts +37 -0
- package/dist/runner/snapshot-choice.js +38 -0
- package/dist/runner/snapshot-key.d.ts +16 -14
- package/dist/runner/snapshot-key.js +24 -18
- package/dist/runner/steps.d.ts +13 -5
- package/dist/runner/steps.js +34 -4
- package/dist/runner/time-limit.d.ts +10 -0
- package/dist/runner/time-limit.js +43 -0
- package/dist/sdk/extension/commands.d.ts +1 -7
- package/dist/sdk/extension/driver.d.ts +39 -46
- package/dist/sdk/extension/driver.js +6 -6
- package/dist/sdk/extension/index.d.ts +3 -3
- package/dist/sdk/extension/index.js +3 -4
- package/dist/sdk/extension/lifecycle.d.ts +52 -9
- package/dist/sdk/extension/lifecycle.js +1 -1
- package/dist/sdk/extension/resource-definition.d.ts +13 -10
- package/dist/sdk/extension/resource-definition.js +7 -2
- package/dist/sdk/extension/resource.d.ts +2 -2
- package/dist/sdk/extension/secret-source.d.ts +58 -0
- package/dist/sdk/extension/secret-source.js +78 -0
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/run/launcher.d.ts +1 -1
- package/dist/sdk/run/launcher.js +1 -1
- package/dist/sdk/run/payload.d.ts +16 -1
- package/dist/sdk/run/payload.js +17 -2
- package/dist/sdk/run/redact.js +2 -2
- package/dist/sdk/run/test-events.d.ts +23 -6
- package/dist/sdk/run/test-events.js +6 -4
- package/dist/sdk/run/test-result-writer.d.ts +8 -3
- package/dist/sdk/run/test-result-writer.js +22 -2
- package/dist/{commands/exec → shared}/cleanup.d.ts +3 -3
- package/dist/{commands/exec → shared}/cleanup.js +11 -6
- package/dist/shared/job-summary.d.ts +19 -0
- package/dist/{commands/exec → shared}/job-summary.js +17 -0
- package/dist/shared/sandbox-table.d.ts +48 -0
- package/dist/shared/sandbox-table.js +109 -0
- package/dist/{commands/exec → shared}/snapshot-text.d.ts +1 -1
- package/dist/{commands/exec → shared}/tests-summary.d.ts +22 -6
- package/dist/{commands/exec → shared}/tests-summary.js +74 -31
- package/dist/{commands/exec → shared}/text.d.ts +7 -2
- package/dist/{commands/exec → shared}/text.js +9 -1
- package/dist/{commands/exec → shared}/waterfall.d.ts +8 -6
- package/dist/{commands/exec → shared}/waterfall.js +71 -24
- package/dist/shared/worker-chart.d.ts +172 -0
- package/dist/shared/worker-chart.js +623 -0
- package/dist/vitest/config.d.ts +35 -11
- package/dist/vitest/config.js +47 -14
- package/dist/vitest/index.d.ts +1 -1
- package/dist/vitest/index.js +3 -3
- package/dist/vitest/sequencer.d.ts +23 -0
- package/dist/vitest/sequencer.js +73 -0
- package/dist/vitest/setup.d.ts +1 -0
- package/dist/vitest/setup.js +34 -0
- package/dist/vitest/test-events.d.ts +32 -6
- package/dist/vitest/test-events.js +25 -5
- package/dist/vitest/test-results.d.ts +8 -3
- package/dist/vitest/test-results.js +6 -0
- package/package.json +7 -2
- package/skills/overview.md +21 -17
- package/skills/plan-runs.md +67 -0
- package/skills/read-run-output.md +51 -19
- package/dist/chunks/chunk-BFLYGMG3.js +0 -607
- package/dist/chunks/chunk-HOKDKP5A.js +0 -49
- package/dist/chunks/chunk-IVRRGGCD.js +0 -201
- package/dist/chunks/chunk-NMVODY3P.js +0 -19
- package/dist/commands/exec/define-run-command.d.ts +0 -671
- package/dist/commands/exec/define-run-command.js +0 -91
- package/dist/commands/exec/job-summary.d.ts +0 -10
- package/dist/commands/exec/worker-chart.d.ts +0 -87
- package/dist/commands/exec/worker-chart.js +0 -343
- package/dist/commands/playwright/command.d.ts +0 -661
- package/dist/commands/playwright/command.js +0 -31
- package/dist/commands/playwright/metadata.js +0 -8
- package/dist/commands/vitest/command.d.ts +0 -662
- package/dist/commands/vitest/command.js +0 -31
- package/dist/commands/vitest/metadata.js +0 -8
- package/dist/sdk/extension/ci.d.ts +0 -2
- package/dist/sdk/extension/ci.js +0 -6
- package/dist/chunks/{chunk-YM6TZV4L.js → chunk-VL7WFTVQ.js} +52 -52
- package/dist/commands/{playwright → suites}/metadata.d.ts +1 -1
- package/dist/commands/{vitest → test}/metadata.d.ts +1 -1
- /package/dist/{commands → shared}/dashboard.d.ts +0 -0
- /package/dist/{commands → shared}/dashboard.js +0 -0
- /package/dist/{commands/exec → shared}/snapshot-text.js +0 -0
package/dist/core/run.js
CHANGED
|
@@ -12,27 +12,12 @@ import { lineSplitter, openRunnerSession, SANDBOX_TEST_EVENTS_PATH, } from "../r
|
|
|
12
12
|
import { parseTestEvent } from "../sdk/run/launcher.js";
|
|
13
13
|
import { colorEnvironment, commandEnvironment, runPayload } from "./payload.js";
|
|
14
14
|
import { LOOKUP } from "./resource-definition-set.js";
|
|
15
|
-
import { acquireResources, announceAcquired, canceledStop, runInstances, releaseResources, resourceWarnings, releasedResources, resourceInstances, resourcesPayload, resourcesRan, } from "./resources.js";
|
|
15
|
+
import { acquireResources, announceAcquired, canceledStop, runInstances, releaseResources, resourceWarnings, releasedResources, resourceInstances, resourcesCredentials, resourcesPayload, resourcesRan, } from "./resources.js";
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* says each resource `beforeRun` skipped right after it starts (`resource-skipped`), acquires the other resource
|
|
20
|
-
* instances all at once through their `acquireForRun` (`acquireResources`), says each acquired (`resource-acquired`),
|
|
21
|
-
* runs the command with the run payload in `STORM_RUN`, waits for it, and hands each instance what its acquire took to
|
|
22
|
-
* its `releaseAfterRun`. It reports each step to `progress`. What acquiring and releasing do is each resource
|
|
23
|
-
* definition's own: see its lifecycle. A run that asks for no resource goes straight to its command. It calls each
|
|
24
|
-
* definition's lifecycle with its own Context from `resourceContexts`, and hands `context` to none.
|
|
25
|
-
*
|
|
26
|
-
* In a sandboxed run (`request.runner`), the command runs in a runner sandbox, readied beside the resources (see
|
|
27
|
-
* `runSandboxed`).
|
|
28
|
-
*
|
|
29
|
-
* Release happens however the run ended, a throw included: once the command has stopped and, in a sandboxed run, the
|
|
30
|
-
* runner session has closed its sandbox scope, each resource instance is released in reverse order, even when the
|
|
31
|
-
* `cleanup-started` event can't be reported. An unsandboxed run releases them in `finally`; a sandboxed run's runner
|
|
32
|
-
* session does, as it finishes or closes.
|
|
17
|
+
* Shared opening events emitted at the start of every run (across runner sandboxes or not): `started`, skips, and
|
|
18
|
+
* `runner-prepared`.
|
|
33
19
|
*/
|
|
34
|
-
export async function
|
|
35
|
-
const instances = resourceInstances(definitionSet[LOOKUP], resourceContexts, request.resources);
|
|
20
|
+
export async function emitRunOpening(progress, request, instances) {
|
|
36
21
|
await progress.emit({
|
|
37
22
|
kind: "started",
|
|
38
23
|
version: request.version,
|
|
@@ -52,12 +37,77 @@ export async function executeRun(definitionSet, context, resourceContexts, reque
|
|
|
52
37
|
notes: prepared.notes,
|
|
53
38
|
});
|
|
54
39
|
}
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Mints a Vercel OIDC credential for `target`, checks its team and project claims, and honors `signal`. Every run
|
|
43
|
+
* shares it, across runner sandboxes or not.
|
|
44
|
+
*/
|
|
45
|
+
export async function mintCredential(context, target, signal, progress) {
|
|
46
|
+
const canceled = () => ({ ...canceledStop(), commandStopped: false });
|
|
47
|
+
if (signal.aborted)
|
|
48
|
+
return { ok: false, outcome: canceled() };
|
|
49
|
+
const mint = credentialSourceFor({ source: "mint", target }, context, progress);
|
|
50
|
+
const minted = await mint.obtain();
|
|
51
|
+
if (!minted.ok)
|
|
52
|
+
return { ok: false, outcome: { kind: "mint_failed", failure: minted.failure.failure, target, runner: true } };
|
|
53
|
+
const project = minted.credential.vercelProject();
|
|
54
|
+
if (project === undefined)
|
|
55
|
+
return {
|
|
56
|
+
ok: false,
|
|
57
|
+
outcome: { kind: "runner_failed", failure: { kind: "credential-claims-missing", target } },
|
|
58
|
+
};
|
|
59
|
+
if (signal.aborted)
|
|
60
|
+
return { ok: false, outcome: canceled() };
|
|
61
|
+
return { ok: true, mint, access: { credential: minted.credential, ...project } };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Runs `request.argv` in `session` with `request.runPayload`, pumping test events in arrival order and mapping sandbox
|
|
65
|
+
* exit/kill/failure outcomes into `RanCommand` or `RunStopped`. Every run shares it, across runner sandboxes or not.
|
|
66
|
+
*/
|
|
67
|
+
export async function runCommandInSandbox(session, request, signal, progress, onStarted) {
|
|
68
|
+
await progress.emit({ kind: "command-started", argv: request.argv });
|
|
69
|
+
if (signal.aborted)
|
|
70
|
+
return { ok: false, outcome: { ...canceledStop(), commandStopped: false } };
|
|
71
|
+
onStarted?.();
|
|
72
|
+
// Test events arrive from a callback that can't wait, so they are emitted in order through a chain.
|
|
73
|
+
let testEvents = Promise.resolve();
|
|
74
|
+
const sandboxed = await session.runCommand({
|
|
75
|
+
argv: request.argv,
|
|
76
|
+
runPayload: request.runPayload,
|
|
77
|
+
...(request.credentials === undefined ? {} : { credentials: request.credentials }),
|
|
78
|
+
testEvents: {
|
|
79
|
+
onLine: (line) => {
|
|
80
|
+
const event = parseTestEvent(line);
|
|
81
|
+
testEvents = testEvents.then(() => progress.emit(event === undefined ? { kind: "test-event-unreadable" } : { kind: "test", event }));
|
|
82
|
+
},
|
|
83
|
+
onIncomplete: (message) => {
|
|
84
|
+
testEvents = testEvents.then(() => progress.emit({ kind: "test-events-incomplete", message }));
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
await testEvents;
|
|
89
|
+
// Closing on a signal can stop the runner sandbox under the command, so a failed call then is the stop too.
|
|
90
|
+
if (sandboxed.kind === "killed" || (sandboxed.kind === "failed" && signal.aborted))
|
|
91
|
+
return { ok: false, outcome: { ...canceledStop(), commandStopped: true } };
|
|
92
|
+
if (sandboxed.kind === "failed")
|
|
93
|
+
return { ok: false, outcome: { kind: "runner_failed", failure: sandboxed.failure } };
|
|
94
|
+
const command = sandboxed.exitCode === null ? { kind: "no-exit-code" } : { kind: "exited", code: sandboxed.exitCode };
|
|
95
|
+
await progress.emit({
|
|
96
|
+
kind: "command-ended",
|
|
97
|
+
command: posix.basename(request.argv[0] ?? ""),
|
|
98
|
+
outcome: command,
|
|
99
|
+
ms: sandboxed.ms,
|
|
100
|
+
});
|
|
101
|
+
return { ok: true, command };
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Runs `body` with idempotent `startCleanup` / `release` hooks, guarantees every acquired resource instance is
|
|
105
|
+
* released in `finally`, and returns both `body`'s result and the collected `resourceCleanup`.
|
|
106
|
+
*/
|
|
107
|
+
export async function withResourceCleanup(instances, keepMs, progress, body) {
|
|
57
108
|
let cleanupStarted = false;
|
|
58
|
-
// Said once, before the runner's sandboxes are
|
|
59
|
-
// with how long cleanup keeps the runner sandbox running, if the run has one.
|
|
60
|
-
const keepMs = request.runner === undefined ? null : request.runner.keepMs;
|
|
109
|
+
// Said once, before the runner's sandboxes are fenced in a sandboxed run, else before the resources are released,
|
|
110
|
+
// with how long cleanup keeps the runner sandbox running, if the run has one (`keepMs`, null for a run with no runner).
|
|
61
111
|
const startCleanup = async () => {
|
|
62
112
|
if (cleanupStarted)
|
|
63
113
|
return;
|
|
@@ -66,27 +116,59 @@ export async function executeRun(definitionSet, context, resourceContexts, reque
|
|
|
66
116
|
};
|
|
67
117
|
let resourceCleanup = {};
|
|
68
118
|
let releasing;
|
|
69
|
-
// Once: reporting cleanup's start can fail, and releasing what the acquires took must not depend on it.
|
|
70
|
-
|
|
119
|
+
// Once: reporting cleanup's start can fail, and releasing what the acquires took must not depend on it. The first
|
|
120
|
+
// call's `runner` is the one every release gets: whether the launcher fenced the run's runner sandbox.
|
|
121
|
+
const release = (runner) => (releasing ??= (async () => {
|
|
71
122
|
try {
|
|
72
123
|
await startCleanup();
|
|
73
124
|
}
|
|
74
125
|
finally {
|
|
75
|
-
resourceCleanup = await releaseResources(instances, progress);
|
|
126
|
+
resourceCleanup = await releaseResources(instances, progress, runner);
|
|
76
127
|
}
|
|
77
128
|
})());
|
|
78
|
-
let
|
|
79
|
-
let runnerCleanup = null;
|
|
129
|
+
let value;
|
|
80
130
|
try {
|
|
81
|
-
({
|
|
82
|
-
request.runner === undefined
|
|
83
|
-
? { ended: await runUnsandboxed(context, request, instances, control, progress), runnerCleanup: null }
|
|
84
|
-
: await runSandboxed(context, request, instances, control, progress, { startCleanup, release }));
|
|
131
|
+
value = await body({ startCleanup, release });
|
|
85
132
|
}
|
|
86
133
|
finally {
|
|
87
|
-
// A no
|
|
88
|
-
|
|
134
|
+
// A run with no runner (`keepMs` null) has nothing to fence, so the release hears true. With a runner this is a
|
|
135
|
+
// no-op: its runner session released the resources once it fenced its sandboxes, saying whether it fenced the runner
|
|
136
|
+
// sandbox. Should a session ever end without releasing, nothing has confirmed the fence, so the release hears false.
|
|
137
|
+
await release({ runnerSandboxFenced: keepMs === null });
|
|
89
138
|
}
|
|
139
|
+
return { value, resourceCleanup };
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Runs `request.argv` with the resources it asks for, through `definitionSet`'s resource definitions, in definition
|
|
143
|
+
* order. Each resource's `beforeRun` has run already, before the run started: the request holds what it answered. It
|
|
144
|
+
* says each resource `beforeRun` skipped right after it starts (`resource-skipped`), acquires the other resource
|
|
145
|
+
* instances all at once through their `acquireForRun` (`acquireResources`), says each acquired (`resource-acquired`),
|
|
146
|
+
* runs the command with the run payload in `STORM_RUN`, waits for it, and hands each instance what its acquire took to
|
|
147
|
+
* its `releaseAfterRun`. It reports each step to `progress`. What acquiring and releasing do is each resource
|
|
148
|
+
* definition's own: see its lifecycle. A run that asks for no resource goes straight to its command. It calls each
|
|
149
|
+
* definition's lifecycle with its own Context from `resourceContexts`, and hands `context` to none.
|
|
150
|
+
*
|
|
151
|
+
* In a sandboxed run (`request.runner`), the command runs in a runner sandbox, readied beside the resources (see
|
|
152
|
+
* `runSandboxed`).
|
|
153
|
+
*
|
|
154
|
+
* Release happens however the run ended, a throw included: once the command has stopped and, in a sandboxed run, the
|
|
155
|
+
* runner session has fenced the run's sandboxes, each resource instance is released in reverse order, even when the
|
|
156
|
+
* `cleanup-started` event can't be reported. An unsandboxed run releases them in `finally`; a sandboxed run's runner
|
|
157
|
+
* session does, as it finishes or closes, between the fence and the scope's close: the fence stops every sandbox the
|
|
158
|
+
* run doesn't keep and leaves the runner sandbox it keeps with no network access; the close then deletes the stopped
|
|
159
|
+
* sandboxes and keeps the kept one running. Each release hears whether the launcher fenced the run's runner sandbox
|
|
160
|
+
* (`ReleaseAfterRunInput.runnerSandboxFenced`): what the runner session says once the fence answered, and true in an
|
|
161
|
+
* unsandboxed run, which has nothing to fence.
|
|
162
|
+
*/
|
|
163
|
+
export async function executeRun(definitionSet, context, resourceContexts, request, control, progress) {
|
|
164
|
+
const instances = resourceInstances(definitionSet[LOOKUP], resourceContexts, request.resources);
|
|
165
|
+
await emitRunOpening(progress, request, instances);
|
|
166
|
+
// Each instance keeps what its acquire took, as `acquireForRun` hands it over: the run releases all of it however
|
|
167
|
+
// it ends.
|
|
168
|
+
const keepMs = request.runner === undefined ? null : request.runner.keepMs;
|
|
169
|
+
const { value: { ended, runnerCleanup }, resourceCleanup, } = await withResourceCleanup(instances, keepMs, progress, async (cleanup) => request.runner === undefined
|
|
170
|
+
? { ended: await runUnsandboxed(context, request, instances, control, progress), runnerCleanup: null }
|
|
171
|
+
: await runSandboxed(context, request, instances, control, progress, cleanup));
|
|
90
172
|
await progress.emit({
|
|
91
173
|
kind: "cleanup-finished",
|
|
92
174
|
resourceWarnings: resourceWarnings(resourceCleanup),
|
|
@@ -110,7 +192,8 @@ export async function executeRun(definitionSet, context, resourceContexts, reque
|
|
|
110
192
|
* request as the run's own event, and handed to every instance; the mint is lazy, so a run mints only when a resource
|
|
111
193
|
* asks for a credential.
|
|
112
194
|
* The command's stdout and stderr reach `runnerTerminal` a line at a time per stream, and its environment says whether
|
|
113
|
-
* to color them (`colorEnvironment`), since the command writes to pipes.
|
|
195
|
+
* to color them (`colorEnvironment`), since the command writes to pipes. A run with no runner has no firewall, so a
|
|
196
|
+
* resource that answered sandbox credentials throws: the launcher refuses such a run before it starts.
|
|
114
197
|
*/
|
|
115
198
|
async function runUnsandboxed(context, request, instances, control, progress) {
|
|
116
199
|
const acquisition = await acquireResources(instances, {
|
|
@@ -120,6 +203,11 @@ async function runUnsandboxed(context, request, instances, control, progress) {
|
|
|
120
203
|
});
|
|
121
204
|
if (acquisition.kind === "stopped")
|
|
122
205
|
return acquisition.outcome;
|
|
206
|
+
// Only a runner sandbox's firewall can add a credential: the launcher refuses a run with no runner whose resources
|
|
207
|
+
// need a runner sandbox before it starts, so a resource that answers credentials here is a programmer error.
|
|
208
|
+
const crediting = resourcesCredentials(instances);
|
|
209
|
+
if (crediting.length > 0)
|
|
210
|
+
throw new Error(`resource ${crediting[0]?.resource ?? ""} answered sandbox credentials in a run with no runner sandbox; its beforeRun must say it needs one`);
|
|
123
211
|
await announceAcquired(instances, progress);
|
|
124
212
|
const terminal = context.runnerTerminal;
|
|
125
213
|
const env = commandEnvironment(colorEnvironment(request.env, terminal.color), runPayload(resourcesPayload(instances), {
|
|
@@ -179,21 +267,21 @@ function runnerStopped(outcome) {
|
|
|
179
267
|
/**
|
|
180
268
|
* In a sandboxed run, everything between the run's start and releasing its resources. It opens the run's runner session
|
|
181
269
|
* (`openRunnerSession`) before the mint, which owns the runner's sandbox scope and the order its stages run in, runs
|
|
182
|
-
* `runInSandbox` in it, and
|
|
183
|
-
*
|
|
184
|
-
* whatever its resources are, so its request names no credential
|
|
185
|
-
* `--credential github-actions` with it.
|
|
270
|
+
* `runInSandbox` in it, and cleans up the session, which fences the run's sandboxes, releases the resources, saying
|
|
271
|
+
* whether it fenced the runner sandbox, and closes the scope. A run that throws cleans up the session in `finally`,
|
|
272
|
+
* which does the same. A sandboxed run always mints, whatever its resources are, so its request names no credential
|
|
273
|
+
* source: the command layer refuses `--credential github-actions` with it.
|
|
186
274
|
*/
|
|
187
275
|
async function runSandboxed(context, request, instances, control, progress, cleanup) {
|
|
188
276
|
const runnerProgress = { emit: (event) => progress.emit({ kind: "runner", event }) };
|
|
189
277
|
const session = openRunnerSession(context, request.runner, { signal: control.signal, cleanup }, runnerProgress);
|
|
190
278
|
try {
|
|
191
279
|
const ended = await runInSandbox(context, request, instances, session, control, progress);
|
|
192
|
-
return { ended, runnerCleanup: await session.
|
|
280
|
+
return { ended, runnerCleanup: await session.cleanUp() };
|
|
193
281
|
}
|
|
194
282
|
finally {
|
|
195
|
-
// Memoized: a no-op once the session
|
|
196
|
-
await session.
|
|
283
|
+
// Memoized: a no-op once the session cleaned up, and the cleanup when the run threw.
|
|
284
|
+
await session.cleanUp();
|
|
197
285
|
}
|
|
198
286
|
}
|
|
199
287
|
/**
|
|
@@ -201,27 +289,23 @@ async function runSandboxed(context, request, instances, control, progress, clea
|
|
|
201
289
|
* runner sandbox needs the run's credential: it builds the mint's source (`credentialSourceFor`) and obtains from it
|
|
202
290
|
* once, and hands the same source to the resources, so one that asks for a credential gets the one mint's outcome and
|
|
203
291
|
* the run reports no other mint. Then it acquires the resources and readies the runner sandbox at once (`readyBoth`),
|
|
204
|
-
* and runs the command in the runner sandbox once all are ready, saying each resource acquired first.
|
|
292
|
+
* and runs the command in the runner sandbox once all are ready, saying each resource acquired first. The sandbox
|
|
293
|
+
* credentials the acquired resources answered (`Acquired.credentials`) go to the runner session, which has the firewall
|
|
294
|
+
* add each to the requests to its domain for the length of the command, beside the run's own; two credentials, of two
|
|
295
|
+
* resources or of a resource and the run's config (`runner.credentials`), for the same domain and header, or for one
|
|
296
|
+
* domain with different `requests`, throw before the command starts (`resourcesCredentials`).
|
|
205
297
|
*/
|
|
206
298
|
async function runInSandbox(context, request, instances, session, control, progress) {
|
|
207
299
|
const { runner } = request;
|
|
208
300
|
// Canceled before a command started in the runner sandbox.
|
|
209
301
|
const canceled = () => ({ ...canceledStop(), commandStopped: false });
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const minted = await mint.obtain();
|
|
214
|
-
if (!minted.ok)
|
|
215
|
-
return { kind: "mint_failed", failure: minted.failure.failure, target: runner.target, runner: true };
|
|
216
|
-
const project = minted.credential.vercelProject();
|
|
217
|
-
if (project === undefined)
|
|
218
|
-
return { kind: "runner_failed", failure: { kind: "credential-claims-missing", target: runner.target } };
|
|
219
|
-
if (control.signal.aborted)
|
|
220
|
-
return canceled();
|
|
302
|
+
const credential = await mintCredential(context, runner.target, control.signal, progress);
|
|
303
|
+
if (!credential.ok)
|
|
304
|
+
return credential.outcome;
|
|
221
305
|
const acquisition = await readyBoth({
|
|
222
306
|
instances,
|
|
223
|
-
credential: mint,
|
|
224
|
-
ready: (signal) => session.ready(
|
|
307
|
+
credential: credential.mint,
|
|
308
|
+
ready: (signal) => session.ready(credential.access, signal),
|
|
225
309
|
}, control, progress);
|
|
226
310
|
if (acquisition.kind === "stopped") {
|
|
227
311
|
const { outcome } = acquisition;
|
|
@@ -232,41 +316,21 @@ async function runInSandbox(context, request, instances, session, control, progr
|
|
|
232
316
|
if (readied?.kind !== "ready")
|
|
233
317
|
return canceled();
|
|
234
318
|
const ready = readied.runner;
|
|
319
|
+
// Each sandbox credential a resource gives the command, which the runner session puts on the requests to its domain
|
|
320
|
+
// while the command runs; a clash with another resource's or the config's throws here, before the command starts.
|
|
321
|
+
const credentials = resourcesCredentials(instances, runner.credentials).map(({ credential }) => credential);
|
|
235
322
|
await announceAcquired(instances, progress);
|
|
236
|
-
await
|
|
237
|
-
if (control.signal.aborted)
|
|
238
|
-
return canceled();
|
|
239
|
-
// Test events arrive from a callback that can't wait, so they are emitted in order through a chain.
|
|
240
|
-
let testEvents = Promise.resolve();
|
|
241
|
-
const sandboxed = await session.runCommand({
|
|
323
|
+
const ran = await runCommandInSandbox(session, {
|
|
242
324
|
argv: request.argv,
|
|
243
325
|
runPayload: JSON.stringify(runPayload(resourcesPayload(instances), {
|
|
244
326
|
testEvents: SANDBOX_TEST_EVENTS_PATH,
|
|
245
327
|
...(request.verbose === undefined ? {} : { verbose: request.verbose }),
|
|
246
328
|
})),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
onIncomplete: (message) => {
|
|
253
|
-
testEvents = testEvents.then(() => progress.emit({ kind: "test-events-incomplete", message }));
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
});
|
|
257
|
-
await testEvents;
|
|
258
|
-
// Closing on a signal can stop the runner sandbox under the command, so a failed call then is the stop too.
|
|
259
|
-
if (sandboxed.kind === "killed" || (sandboxed.kind === "failed" && control.signal.aborted))
|
|
260
|
-
return { ...canceledStop(), commandStopped: true };
|
|
261
|
-
if (sandboxed.kind === "failed")
|
|
262
|
-
return { kind: "runner_failed", failure: sandboxed.failure };
|
|
263
|
-
const command = sandboxed.exitCode === null ? { kind: "no-exit-code" } : { kind: "exited", code: sandboxed.exitCode };
|
|
264
|
-
await progress.emit({
|
|
265
|
-
kind: "command-ended",
|
|
266
|
-
command: posix.basename(request.argv[0] ?? ""),
|
|
267
|
-
outcome: command,
|
|
268
|
-
ms: sandboxed.ms,
|
|
269
|
-
});
|
|
329
|
+
credentials,
|
|
330
|
+
}, control.signal, progress);
|
|
331
|
+
if (!ran.ok)
|
|
332
|
+
return ran.outcome;
|
|
333
|
+
const { command } = ran;
|
|
270
334
|
return {
|
|
271
335
|
kind: "command-ended",
|
|
272
336
|
resources: resourcesRan(instances),
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ChosenSnapshot, RunnerCleanupFacts } from "../runner/index.ts";
|
|
2
|
+
import type { SandboxEndFacts } from "./events.ts";
|
|
3
|
+
import type { ResourceRanRecords } from "./resource.ts";
|
|
4
|
+
import type { RunCleanup, RunStopped } from "./run.ts";
|
|
5
|
+
import type { RanCommand } from "./timing.ts";
|
|
6
|
+
/**
|
|
7
|
+
* How one runner sandbox ended, in the kinds any other run ends with, and one more:
|
|
8
|
+
*
|
|
9
|
+
* - `ran`: its command ran and ended.
|
|
10
|
+
* - a run's stop (`RunStopped`): `canceled` when a signal stopped it; `runner_failed` when its runner sandbox's start,
|
|
11
|
+
* upload, apply, install, build, or command call failed, or a step that runs once failed; `snapshot_gone` when the
|
|
12
|
+
* chosen runner snapshot was gone as its runner sandbox started; `mint_failed` when the run's mint failed;
|
|
13
|
+
* `resource_refused` when a resource's acquire or split refused the run.
|
|
14
|
+
* - `threw`: something in the runner sandbox threw, a mistake in storm, with the error's message.
|
|
15
|
+
*/
|
|
16
|
+
export type SandboxEnd = {
|
|
17
|
+
readonly kind: "ran";
|
|
18
|
+
readonly command: RanCommand;
|
|
19
|
+
} | RunStopped | {
|
|
20
|
+
readonly kind: "threw";
|
|
21
|
+
readonly message: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* One runner sandbox once it ended: its runner sandbox index, its command, how it ended (`end`), its runner sandbox
|
|
25
|
+
* state, exit code, and cause from that, and what closing its runner sandbox scope left (null when its session never
|
|
26
|
+
* opened).
|
|
27
|
+
*/
|
|
28
|
+
export interface EndedSandbox extends SandboxEndFacts {
|
|
29
|
+
readonly sandbox: number;
|
|
30
|
+
readonly argv: readonly string[];
|
|
31
|
+
readonly end: SandboxEnd;
|
|
32
|
+
readonly runnerCleanup: RunnerCleanupFacts | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Every runner sandbox of a run across runner sandboxes ended, and no signal stopped one: each runner sandbox's end, in
|
|
36
|
+
* order of runner sandbox index (`sandboxes`), the runner snapshot each started from, and what it reports of each
|
|
37
|
+
* acquired resource instance that reports something (`resources`), for the whole run, as a `ran` outcome does. Its
|
|
38
|
+
* `runnerCleanup` sums what every runner sandbox scope of the run couldn't stop or delete, and names no kept runner
|
|
39
|
+
* sandbox of its own: each runner sandbox's is in its own `runnerCleanup`.
|
|
40
|
+
*/
|
|
41
|
+
export interface SandboxesRanRun extends RunCleanup {
|
|
42
|
+
readonly kind: "sandboxes_ran";
|
|
43
|
+
readonly sandboxes: readonly EndedSandbox[];
|
|
44
|
+
readonly snapshot: ChosenSnapshot;
|
|
45
|
+
readonly resources: ResourceRanRecords;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* How a run across runner sandboxes ended: its runner sandboxes ran (`SandboxesRanRun`), or the run stopped before
|
|
49
|
+
* then, in one of the ways any run stops (`RunStopped`). It never ends as `ran`, which is the outcome of a run's one
|
|
50
|
+
* command.
|
|
51
|
+
*/
|
|
52
|
+
export type AcrossSandboxesOutcome = SandboxesRanRun | (RunStopped & RunCleanup);
|
|
53
|
+
/**
|
|
54
|
+
* The status storm exits with once a run's runner sandboxes ran: 0 when every runner sandbox passed, else 1. A cleanup
|
|
55
|
+
* failure never changes it.
|
|
56
|
+
*/
|
|
57
|
+
export declare function acrossSandboxesExitStatus(sandboxes: readonly Pick<SandboxEndFacts, "state">[]): number;
|
|
58
|
+
/**
|
|
59
|
+
* A runner sandbox's state, exit code, and cause, from how it ended and whether its command started: a command that
|
|
60
|
+
* started and did not exit 0 is `failed`, a command that never started is `not-started`, and a signal makes the runner
|
|
61
|
+
* sandbox `canceled`. The Sandbox call that runs the command failing means the command started, whether or not its start
|
|
62
|
+
* was heard.
|
|
63
|
+
*/
|
|
64
|
+
export declare function sandboxEndFacts(end: SandboxEnd, commandStarted: boolean): SandboxEndFacts;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// Pure types and helpers for how a runner sandbox ends, shared by `core/across-sandboxes.ts`, `run-directory/`, and the
|
|
2
|
+
// composition layer: how one runner sandbox ends, the exit status of a run across runner sandboxes, and the one-line
|
|
3
|
+
// cause for a runner sandbox that did not pass.
|
|
4
|
+
import { describeMintFailure } from "../credential/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* The status storm exits with once a run's runner sandboxes ran: 0 when every runner sandbox passed, else 1. A cleanup
|
|
7
|
+
* failure never changes it.
|
|
8
|
+
*/
|
|
9
|
+
export function acrossSandboxesExitStatus(sandboxes) {
|
|
10
|
+
return sandboxes.every(({ state }) => state === "passed") ? 0 : 1;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A runner sandbox's state, exit code, and cause, from how it ended and whether its command started: a command that
|
|
14
|
+
* started and did not exit 0 is `failed`, a command that never started is `not-started`, and a signal makes the runner
|
|
15
|
+
* sandbox `canceled`. The Sandbox call that runs the command failing means the command started, whether or not its start
|
|
16
|
+
* was heard.
|
|
17
|
+
*/
|
|
18
|
+
export function sandboxEndFacts(end, commandStarted) {
|
|
19
|
+
const short = (cause, failedStage, started = commandStarted) => ({
|
|
20
|
+
state: started ? "failed" : "not-started",
|
|
21
|
+
failedStage,
|
|
22
|
+
exitCode: null,
|
|
23
|
+
cause: oneLine(cause),
|
|
24
|
+
});
|
|
25
|
+
switch (end.kind) {
|
|
26
|
+
case "ran": {
|
|
27
|
+
const { command } = end;
|
|
28
|
+
if (command.kind === "exited")
|
|
29
|
+
return {
|
|
30
|
+
state: command.code === 0 ? "passed" : "failed",
|
|
31
|
+
failedStage: command.code === 0 ? null : "command",
|
|
32
|
+
exitCode: command.code,
|
|
33
|
+
cause: null,
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
state: "failed",
|
|
37
|
+
failedStage: "command",
|
|
38
|
+
exitCode: null,
|
|
39
|
+
cause: command.kind === "signaled" ? `signaled: ${command.signal}` : "no-exit-code",
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
case "canceled":
|
|
43
|
+
return { state: "canceled", failedStage: null, exitCode: null, cause: "canceled" };
|
|
44
|
+
case "runner_failed": {
|
|
45
|
+
const { failure } = end;
|
|
46
|
+
const ranCommand = failure.kind === "sandbox-api-failed" && failure.operation === "run-command";
|
|
47
|
+
return short(runnerFailureCause(failure), runnerFailureStage(failure), commandStarted || ranCommand);
|
|
48
|
+
}
|
|
49
|
+
case "mint_failed":
|
|
50
|
+
return short(`mint-failed: ${describeMintFailure(end.failure, end.target).cause}`, "mint");
|
|
51
|
+
case "snapshot_gone":
|
|
52
|
+
return short("snapshot-gone", "snapshot");
|
|
53
|
+
case "spawn_failed":
|
|
54
|
+
return short(`spawn-failed: ${end.message}`, "command");
|
|
55
|
+
case "resource_refused":
|
|
56
|
+
return short(`resource-refused: ${end.resource}: ${end.refusal.message}`, "resource");
|
|
57
|
+
case "threw":
|
|
58
|
+
return short(`threw: ${end.message}`, "storm");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** The factual runner stage that failed. */
|
|
62
|
+
function runnerFailureStage(failure) {
|
|
63
|
+
switch (failure.kind) {
|
|
64
|
+
case "snapshot-build-step-failed":
|
|
65
|
+
return "snapshot";
|
|
66
|
+
case "apply-failed":
|
|
67
|
+
return "apply";
|
|
68
|
+
case "install-failed":
|
|
69
|
+
return "install";
|
|
70
|
+
case "build-failed":
|
|
71
|
+
return "build";
|
|
72
|
+
case "checkout-failed":
|
|
73
|
+
return "checkout";
|
|
74
|
+
case "credential-claims-missing":
|
|
75
|
+
return "mint";
|
|
76
|
+
case "sandbox-api-failed":
|
|
77
|
+
switch (failure.operation) {
|
|
78
|
+
case "start-build-sandbox":
|
|
79
|
+
case "save-snapshot":
|
|
80
|
+
return "snapshot";
|
|
81
|
+
case "start-runner-sandbox":
|
|
82
|
+
case "login-path":
|
|
83
|
+
case "run-script":
|
|
84
|
+
return "start";
|
|
85
|
+
case "upload":
|
|
86
|
+
return "upload";
|
|
87
|
+
case "run-command":
|
|
88
|
+
return "command";
|
|
89
|
+
}
|
|
90
|
+
// A policy write fails at the stage it guards: a snapshot build's steps or save, the install and build steps, or
|
|
91
|
+
// the command.
|
|
92
|
+
case "network-policy-failed":
|
|
93
|
+
switch (failure.around) {
|
|
94
|
+
case "snapshot-steps":
|
|
95
|
+
case "snapshot-save":
|
|
96
|
+
return "snapshot";
|
|
97
|
+
case "run-steps":
|
|
98
|
+
return "install";
|
|
99
|
+
case "command":
|
|
100
|
+
return "command";
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Why the runner couldn't run a runner sandbox's command, as one line: the failure's kind or the Sandbox call, then
|
|
106
|
+
* what it said.
|
|
107
|
+
*/
|
|
108
|
+
function runnerFailureCause(failure) {
|
|
109
|
+
switch (failure.kind) {
|
|
110
|
+
case "sandbox-api-failed":
|
|
111
|
+
return `${failure.operation}: ${failure.message}`;
|
|
112
|
+
case "checkout-failed":
|
|
113
|
+
return `checkout-failed: ${failure.failure.message}`;
|
|
114
|
+
case "credential-claims-missing":
|
|
115
|
+
return `credential-claims-missing: ${failure.target.team}/${failure.target.project}`;
|
|
116
|
+
case "snapshot-build-step-failed":
|
|
117
|
+
case "apply-failed":
|
|
118
|
+
case "install-failed":
|
|
119
|
+
case "build-failed":
|
|
120
|
+
return `${failure.kind}: ${failure.exitCode === null ? "no exit code" : `exited ${failure.exitCode}`}`;
|
|
121
|
+
case "network-policy-failed":
|
|
122
|
+
return `network-policy-failed: ${failure.operation} around ${failure.around}: ${failure.status === null ? "" : `HTTP ${failure.status}: `}${failure.message}`;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/** `text` as one line: each line break, with the spaces around it, becomes one space. */
|
|
126
|
+
function oneLine(text) {
|
|
127
|
+
return text.trim().replace(/\s*\n\s*/g, " ");
|
|
128
|
+
}
|
package/dist/core/timeline.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface TimelineStep extends TimelineSpan {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* The rows of a waterfall, by name: `mint`, the run's one mint; each resource instance's lane, by its lane's name;
|
|
21
|
-
* `runner`, readying the runner sandbox; `
|
|
21
|
+
* `runner`, readying the runner sandbox; `command`, the command; `cleanup`, stopping the runner's
|
|
22
22
|
* sandboxes and releasing the resources.
|
|
23
23
|
*/
|
|
24
24
|
export type TimelineRowName = string;
|
|
@@ -54,13 +54,13 @@ export interface Timeline {
|
|
|
54
54
|
/** From the run's start to its last event. */
|
|
55
55
|
readonly totalMs: number;
|
|
56
56
|
/**
|
|
57
|
-
* The rows in order: mint, each resource instance's lane in the order the lanes started, runner,
|
|
57
|
+
* The rows in order: mint, each resource instance's lane in the order the lanes started, runner, command, cleanup;
|
|
58
58
|
* each only when the run got that far.
|
|
59
59
|
*/
|
|
60
60
|
readonly rows: readonly TimelineRow[];
|
|
61
61
|
/**
|
|
62
|
-
* The lane the command waited on, then the command, each by its row: the runner, then the
|
|
63
|
-
* was ready last or ran alone; the
|
|
62
|
+
* The lane the command waited on, then the command, each by its row: the runner, then the command, when the runner
|
|
63
|
+
* was ready last or ran alone; the command alone when the run had no lane; empty when the command didn't start.
|
|
64
64
|
*/
|
|
65
65
|
readonly criticalPath: readonly TimelineRowRef[];
|
|
66
66
|
}
|
package/dist/core/timeline.js
CHANGED
|
@@ -74,7 +74,7 @@ export function timeline(resources, state) {
|
|
|
74
74
|
rows[index] = { ...waited, idleMs: last.readyAt - lane.readyAt };
|
|
75
75
|
}
|
|
76
76
|
if (command !== undefined)
|
|
77
|
-
rows.push(row(
|
|
77
|
+
rows.push(row(COMMAND, command));
|
|
78
78
|
if (cleanup !== undefined)
|
|
79
79
|
rows.push(row(CLEANUP, cleanup));
|
|
80
80
|
// The lane the command waited on last: the one ready last when it had two or more, else the first resource lane it
|
|
@@ -84,13 +84,13 @@ export function timeline(resources, state) {
|
|
|
84
84
|
startedAt: new Date(origin).toISOString(),
|
|
85
85
|
totalMs,
|
|
86
86
|
rows,
|
|
87
|
-
criticalPath: command === undefined ? [] : waitedOn === undefined ? [
|
|
87
|
+
criticalPath: command === undefined ? [] : waitedOn === undefined ? [COMMAND] : [waitedOn, COMMAND],
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
/** The rows no resource instance owns. */
|
|
91
91
|
const MINT = { name: "mint", resource: null };
|
|
92
92
|
const RUNNER = { name: "runner", resource: null };
|
|
93
|
-
const
|
|
93
|
+
const COMMAND = { name: "command", resource: null };
|
|
94
94
|
const CLEANUP = { name: "cleanup", resource: null };
|
|
95
95
|
/**
|
|
96
96
|
* Whether `a` and `b` are the same row: by name, and for a resource instance's lane by the resource key. It takes any
|
|
@@ -8,3 +8,10 @@ export declare function mintArgs(target: MintTarget): readonly string[];
|
|
|
8
8
|
* soon as it has one.
|
|
9
9
|
*/
|
|
10
10
|
export declare function liveCredentialGateway(): CredentialGateway;
|
|
11
|
+
/**
|
|
12
|
+
* The environment of a `vercel` invocation: `host` without `VERCEL_TOKEN`, with color and the update notifier off.
|
|
13
|
+
* `vercel` reads `VERCEL_TOKEN` when there's no `--token`, and then ignores its saved login. An inherited token, such
|
|
14
|
+
* as a test account's token that `vtest teams run` hands its command, would make `vercel` mint the credential as that
|
|
15
|
+
* identity, and not as the person or CI job that runs storm.
|
|
16
|
+
*/
|
|
17
|
+
export declare function vercelEnvironment(host: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
@@ -31,6 +31,8 @@ export function liveCredentialGateway() {
|
|
|
31
31
|
* Runs `vercel` with `args`, with no shell, in `os.tmpdir()` so no linked project in the working directory
|
|
32
32
|
* changes what it does, with color and the update notifier off and a 30s timeout. Never rejects.
|
|
33
33
|
*
|
|
34
|
+
* It passes on storm's own environment without `VERCEL_TOKEN` (`vercelEnvironment`).
|
|
35
|
+
*
|
|
34
36
|
* It uses `execFile`'s callback form rather than `promisify(execFile)`, whose stdout-and-stderr result
|
|
35
37
|
* depends on `util.promisify.custom`.
|
|
36
38
|
*/
|
|
@@ -39,7 +41,7 @@ function runVercel(args) {
|
|
|
39
41
|
try {
|
|
40
42
|
execFile("vercel", args, {
|
|
41
43
|
cwd: tmpdir(),
|
|
42
|
-
env:
|
|
44
|
+
env: vercelEnvironment(process.env),
|
|
43
45
|
timeout: VERCEL_TIMEOUT_MS,
|
|
44
46
|
maxBuffer: 16 * 1024 * 1024,
|
|
45
47
|
encoding: "utf8",
|
|
@@ -52,6 +54,17 @@ function runVercel(args) {
|
|
|
52
54
|
}
|
|
53
55
|
});
|
|
54
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* The environment of a `vercel` invocation: `host` without `VERCEL_TOKEN`, with color and the update notifier off.
|
|
59
|
+
* `vercel` reads `VERCEL_TOKEN` when there's no `--token`, and then ignores its saved login. An inherited token, such
|
|
60
|
+
* as a test account's token that `vtest teams run` hands its command, would make `vercel` mint the credential as that
|
|
61
|
+
* identity, and not as the person or CI job that runs storm.
|
|
62
|
+
*/
|
|
63
|
+
export function vercelEnvironment(host) {
|
|
64
|
+
const env = { ...host, NO_COLOR: "1", NO_UPDATE_NOTIFIER: "1" };
|
|
65
|
+
delete env["VERCEL_TOKEN"];
|
|
66
|
+
return env;
|
|
67
|
+
}
|
|
55
68
|
function failedRun(error, stdout, stderr) {
|
|
56
69
|
const fields = typeof error === "object" && error !== null ? error : {};
|
|
57
70
|
const out = typeof stdout === "string" ? stdout : "";
|
|
@@ -5,7 +5,7 @@ import type { Clock } from "../../sdk/extension/index.ts";
|
|
|
5
5
|
* GitHub's REST API, the random suffix a run prefix ends with, and the clock its time comes from.
|
|
6
6
|
*/
|
|
7
7
|
export interface GitHubFixtureRepoContext {
|
|
8
|
-
/** The launcher environment, which holds the token
|
|
8
|
+
/** The launcher environment, which holds the token when `token.source` is `{ kind: "env", name }`. */
|
|
9
9
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
10
10
|
/** GitHub's REST API. */
|
|
11
11
|
readonly githubFixtureRepos: GitHubFixtureRepoGateway;
|