@cnc-tools/storm 0.14.2 → 0.16.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 +9 -7
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-2MAD5NKK.js +108 -0
- package/dist/chunks/{chunk-HDL4WKIB.js → chunk-3L52KNQA.js} +2 -2
- package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
- package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
- package/dist/chunks/chunk-7EENF73W.js +782 -0
- package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
- package/dist/chunks/chunk-CK2GZEPK.js +40 -0
- package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
- package/dist/chunks/{chunk-I7AN3DIJ.js → chunk-DC2CDHNK.js} +1928 -738
- package/dist/chunks/{chunk-UUBZTGLV.js → chunk-DWEAHX4T.js} +140 -130
- package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
- package/dist/chunks/chunk-FCQUJDA4.js +963 -0
- package/dist/chunks/{chunk-VH2POPW5.js → chunk-FOZWA52V.js} +635 -79
- package/dist/chunks/{chunk-XZCDA5PE.js → chunk-G3PHMXH5.js} +7 -2
- package/dist/chunks/{chunk-3HBPNQ4Y.js → chunk-HVNK3I45.js} +2 -2
- package/dist/chunks/chunk-OIY3DMF2.js +74 -0
- package/dist/chunks/{chunk-GJOEPJJL.js → chunk-P357TZAY.js} +446 -52
- package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
- package/dist/chunks/chunk-TJNFVNKR.js +246 -0
- package/dist/chunks/{chunk-RUPD4TLT.js → chunk-V4IKA3WI.js} +198 -63
- package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
- package/dist/chunks/{chunk-LUOHJ3LB.js → chunk-Z5PBVG3Y.js} +1131 -468
- package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
- package/dist/chunks/{live-app-SZGEILCQ.js → live-app-WECQOQ4C.js} +28 -23
- 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 +230 -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 +583 -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 +533 -73
- package/dist/commands/exec/outcomes.js +203 -67
- package/dist/commands/exec/plan-only.d.ts +10 -0
- package/dist/commands/exec/plan-only.js +45 -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 +42 -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 +344 -63
- package/dist/commands/exec/run-command.js +312 -263
- 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 +53 -10
- package/dist/commands/runs/facts.js +60 -32
- package/dist/commands/runs/list/command.d.ts +82 -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 +41 -2
- package/dist/commands/runs/logs/command.d.ts +109 -10
- 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 +52 -3
- package/dist/commands/runs/logs/outcomes.js +110 -6
- package/dist/commands/runs/past-run.d.ts +91 -11
- package/dist/commands/runs/past-run.js +149 -9
- package/dist/commands/runs/show/command.d.ts +574 -12
- 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 +279 -6
- 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 +5 -1
- 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 +163 -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 +1395 -0
- package/dist/commands/test/command.js +581 -0
- package/dist/commands/test/metadata.js +8 -0
- package/dist/commands/test/outcomes.d.ts +768 -0
- package/dist/commands/test/outcomes.js +140 -0
- package/dist/commands/test/plan.d.ts +92 -0
- package/dist/commands/test/plan.js +125 -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 +15 -0
- package/dist/config/check-runner.js +79 -0
- package/dist/config/check-suites.d.ts +14 -0
- package/dist/config/check-suites.js +100 -0
- package/dist/config/gateways.d.ts +31 -3
- package/dist/config/index.d.ts +8 -6
- package/dist/config/index.js +5 -4
- package/dist/config/live/config-gateway.js +5 -2
- 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 +32 -14
- package/dist/config/load.js +162 -116
- 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 +23 -0
- package/dist/config/runner.js +4 -0
- package/dist/config/schema.d.ts +39 -19
- package/dist/config/schema.js +50 -10
- 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/typed-options.d.ts +1 -6
- package/dist/config/typed-options.js +2 -10
- package/dist/config-file/define.d.ts +45 -24
- package/dist/config-file/define.js +9 -8
- package/dist/config-file/runner.d.ts +11 -0
- package/dist/config-file/runner.js +9 -0
- package/dist/config-file/toolchain.d.ts +13 -7
- package/dist/config-file/toolchain.js +51 -35
- package/dist/context.d.ts +12 -8
- package/dist/context.js +9 -3
- 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 +2 -1
- package/dist/core/payload.js +2 -1
- 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 +6 -6
- package/dist/extensions/testserver/resource.js +3 -3
- 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.js +4 -3
- 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 +84 -0
- package/dist/planning/plan-only.js +86 -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 +29 -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 -5
- 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/base.d.ts +0 -6
- package/dist/runner/base.js +0 -15
- package/dist/runner/build-snapshots.d.ts +7 -7
- package/dist/runner/build-snapshots.js +19 -24
- package/dist/runner/events.d.ts +29 -8
- package/dist/runner/gateways.d.ts +54 -6
- package/dist/runner/index.d.ts +6 -4
- package/dist/runner/index.js +3 -2
- package/dist/runner/live/sandbox-gateway.js +173 -31
- 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 +16 -16
- package/dist/runner/prepare.js +11 -12
- 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 +151 -63
- package/dist/runner/recipe.js +277 -200
- package/dist/runner/sandboxed-command.d.ts +22 -8
- package/dist/runner/sandboxed-command.js +33 -10
- 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 +8 -5
- package/dist/runner/snapshot-build.js +56 -29
- package/dist/runner/snapshot-choice.d.ts +37 -0
- package/dist/runner/snapshot-choice.js +38 -0
- package/dist/runner/snapshot-inspect.d.ts +4 -4
- package/dist/runner/snapshot-inspect.js +7 -7
- package/dist/runner/snapshot-key.d.ts +27 -17
- package/dist/runner/snapshot-key.js +51 -26
- 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 +16 -12
- package/dist/sdk/extension/resource-definition.js +10 -4
- package/dist/sdk/extension/resource-factory.js +3 -4
- 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/present.d.ts +3 -3
- package/dist/sdk/run/present.js +1 -3
- 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 +23 -17
- package/skills/plan-runs.md +67 -0
- package/skills/read-run-output.md +51 -19
- package/dist/chunks/chunk-E3QU74NX.js +0 -49
- package/dist/chunks/chunk-HP54VHGY.js +0 -201
- package/dist/chunks/chunk-NMVODY3P.js +0 -19
- package/dist/chunks/chunk-TVMEKVOW.js +0 -607
- 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/config/recipe-run.d.ts +0 -26
- package/dist/config/recipe-run.js +0 -27
- 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
|
@@ -1,63 +1,187 @@
|
|
|
1
|
-
// What `
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// (`
|
|
1
|
+
// What `storm test` and `storm exec` share: the request fields and flag checks every run takes, planning a run
|
|
2
|
+
// (`planCommandRun`) from the effective config, and running a planned run that is not across runner sandboxes once its
|
|
3
|
+
// resources' `beforeRun` let it go on (`runPlannedCommand`). The commands differ only in their part of planning the
|
|
4
|
+
// run (`PlanCommand`, `plan-run.ts`): `storm exec` runs the command after `--` directly, and `storm test` plans
|
|
5
|
+
// through `planDriverCommand` with the driver named in `storm.config.ts`. `run-planned.ts` does what the request asks
|
|
6
|
+
// of a planned run: this file's run, a run across runner sandboxes (`across-sandboxes-run.ts`), or only the planned run
|
|
7
|
+
// (`plan-only.ts`).
|
|
5
8
|
import { z } from "zod";
|
|
6
9
|
import { forwardSigterm } from "../../forward-sigterm.js";
|
|
7
10
|
import { describeMintFailure } from "../../credential/index.js";
|
|
8
11
|
import { prepareRunner, } from "../../runner/index.js";
|
|
9
|
-
import { invalidConfig
|
|
10
|
-
import { isCi } from "../../sdk/extension/index.js";
|
|
12
|
+
import { invalidConfig } from "../../config/index.js";
|
|
11
13
|
import { commandExitStatus, executeRun, timedProgress, } from "../../core/index.js";
|
|
12
14
|
import { DEFINITION_SET } from "../../extensions.js";
|
|
13
15
|
import { recordRun, } from "../../run-directory/index.js";
|
|
14
16
|
import { parseKeepTime } from "../../time/index.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
17
|
+
import { lacksFinalResults } from "../../planning/final-results.js";
|
|
18
|
+
import { redactingObserver, redactingTerminal, redactor, redactStrings, } from "../../planning/redaction.js";
|
|
19
|
+
import { resourceFlagFields, resourceFlagProblems, resourceFlagValues } from "../../planning/resource-flags.js";
|
|
20
|
+
import { recordedPlan, testPlanLine } from "../../planning/test-plan.js";
|
|
21
|
+
import { keptText, RUN_CLEANUP, notDeletedText, notKeptText, notStoppedText, } from "../../shared/cleanup.js";
|
|
22
|
+
import { jobSummaryMarkdown } from "../../shared/job-summary.js";
|
|
23
|
+
import { testsSummaryLines } from "../../shared/tests-summary.js";
|
|
24
|
+
import { waterfallLines } from "../../shared/waterfall.js";
|
|
25
|
+
import { hasPoorParallelism, testsChart } from "../../shared/worker-chart.js";
|
|
22
26
|
import { mintFailedErrors } from "./mint-failed.js";
|
|
23
|
-
import { resourceRefused } from "./resource-refusals.js";
|
|
24
27
|
import { outcomes, runErrors } from "./outcomes.js";
|
|
25
|
-
import { keptText, RUN_CLEANUP, notDeletedText, notKeptText, notStoppedText, } from "./cleanup.js";
|
|
26
|
-
import { redactingObserver, redactingTerminal, redactor, redactStrings } from "./redaction.js";
|
|
27
|
-
import { recordedPlan, testPlanLine } from "./test-plan.js";
|
|
28
28
|
import { canceledBeforeStart, planRun, resourcesBeforeRun, } from "./plan-run.js";
|
|
29
|
+
import { resourceRefused } from "./resource-refusals.js";
|
|
30
|
+
import { runView } from "./view.js";
|
|
29
31
|
/** The run's own request fields, which every run takes beside the resources' flags. */
|
|
30
32
|
const OWN_RUN_FIELDS = {
|
|
31
33
|
scope: z.string().min(1).optional(),
|
|
32
34
|
project: z.string().min(1).optional(),
|
|
33
35
|
credential: z.enum(["mint", "github-actions"]).optional(),
|
|
34
|
-
unsandboxed: z.boolean().default(false),
|
|
35
36
|
showOutput: z.boolean().default(false),
|
|
36
37
|
keepSandbox: z.string().optional(),
|
|
37
38
|
verbose: z.boolean().default(false),
|
|
39
|
+
planOnly: z.boolean().default(false),
|
|
38
40
|
};
|
|
39
41
|
/**
|
|
40
|
-
* The request fields every run takes, `
|
|
41
|
-
*
|
|
42
|
+
* The request fields every run takes, `storm test`'s and `storm exec`'s: the run's own, and each resource option's
|
|
43
|
+
* flag (`resource-flags.ts`). Each command adds its own fields (`--runner` on `exec`, `--suite` and `--count-tests`
|
|
44
|
+
* on `test`).
|
|
42
45
|
*/
|
|
43
46
|
export const RUN_REQUEST_FIELDS = { ...OWN_RUN_FIELDS, ...resourceFlagFields(Object.keys(OWN_RUN_FIELDS)) };
|
|
44
47
|
/** The CLI spellings of the fields every run takes. */
|
|
45
48
|
export const RUN_CLI_OPTIONS = { project: { short: "p" } };
|
|
46
49
|
const runRequestSchema = z.object(RUN_REQUEST_FIELDS);
|
|
47
50
|
/**
|
|
48
|
-
*
|
|
49
|
-
* `
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
* What a planned run does before it starts, across runner sandboxes or not: calls each resource's `beforeRun`
|
|
52
|
+
* (`resourcesBeforeRun`), cancels on a signal by then, and says the run's test plan (`plan`) when it has one.
|
|
53
|
+
*/
|
|
54
|
+
export async function beforeRunStarts({ ui, signal }, lifecycles, planned, request, plan) {
|
|
55
|
+
const before = await resourcesBeforeRun(lifecycles, planned, request);
|
|
56
|
+
if (!before.ok)
|
|
57
|
+
return before;
|
|
58
|
+
if (signal.aborted)
|
|
59
|
+
return { ok: false, refusal: canceledBeforeStart() };
|
|
60
|
+
if (plan !== undefined)
|
|
61
|
+
await ui.progress?.(testPlanLine(plan));
|
|
62
|
+
return before;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Prepares a planned run that is not across runner sandboxes for execution: what every run does before it starts
|
|
66
|
+
* (`beforeRunStarts`), then the run's request, from where it runs, the shared secret redactor, and the checkout's git
|
|
67
|
+
* state. Both kinds of run take the same requests. A run with no runner carries the credential choice it made, if any,
|
|
68
|
+
* whose source the core builds; a run with a runner carries the runner's part (`runnerRequestFor`), and its resources
|
|
69
|
+
* share its one mint.
|
|
70
|
+
*/
|
|
71
|
+
export async function prepareRunSession(context, lifecycles, planned, request) {
|
|
72
|
+
const { app } = context;
|
|
73
|
+
const { configFile, argv, testPlan, planOptions } = planned;
|
|
74
|
+
const plan = recordedPlan(testPlan, planOptions);
|
|
75
|
+
const before = await beforeRunStarts(context, lifecycles, planned, request, plan);
|
|
76
|
+
if (!before.ok)
|
|
77
|
+
return before;
|
|
78
|
+
const { where, used } = before;
|
|
79
|
+
const base = {
|
|
80
|
+
argv,
|
|
81
|
+
env: Object.fromEntries(Object.entries(app.env).filter(([name]) => !used.hiddenVariables.includes(name))),
|
|
82
|
+
version: app.version,
|
|
83
|
+
commit: app.commit,
|
|
84
|
+
configFile,
|
|
85
|
+
verbose: request.verbose,
|
|
86
|
+
resources: used.requests,
|
|
87
|
+
skipped: used.skipped,
|
|
88
|
+
};
|
|
89
|
+
let run;
|
|
90
|
+
if (where.kind === "runner") {
|
|
91
|
+
const keepMs = keepSandboxMinutes(request.keepSandbox, where.recipe) * 60_000;
|
|
92
|
+
const requested = await runnerRequestFor(app, where, used, { configFile, sandboxes: 1, keepMs });
|
|
93
|
+
if (!requested.ok)
|
|
94
|
+
return requested;
|
|
95
|
+
run = { ...base, runner: requested.runner };
|
|
96
|
+
}
|
|
97
|
+
else
|
|
98
|
+
run = { ...base, ...(where.credential === undefined ? {} : { credential: where.credential }) };
|
|
99
|
+
// The resources' secrets, the credentials' values, and any unsafe secret environment variables' values: every event
|
|
100
|
+
// and the command's output pass through `redact` before any view, the run directory, or the summary sees them.
|
|
101
|
+
const secrets = [...used.secrets, ...(where.kind === "runner" ? where.secrets : [])];
|
|
102
|
+
const git = await checkoutGit(app.context.checkout, app.cwd);
|
|
103
|
+
return { ok: true, plan, run, secrets, redact: redactor(secrets), git };
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Executes a run inside the shared lifecycle guard: redacts the returned outcome when the run carries secrets, and
|
|
107
|
+
* ensures the view finishes and the recording is abandoned if execution throws.
|
|
108
|
+
*/
|
|
109
|
+
export async function runLifecycle(options) {
|
|
110
|
+
try {
|
|
111
|
+
const ended = await options.execute();
|
|
112
|
+
// An outcome's facts, such as a failed Sandbox call's message, can quote what the run handed its command.
|
|
113
|
+
return options.hasSecrets ? redactStrings(ended, options.redact) : ended;
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
// A live region must not outlive the run, however it ends, and abandoning the recording completes the run
|
|
117
|
+
// directory and removes the test events an unsandboxed command staged there, unredacted. They are never saved: the
|
|
118
|
+
// run didn't end.
|
|
119
|
+
await options.finishView();
|
|
120
|
+
await options.abandonRecording();
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/** Maps a stopped run outcome to its Clinkr error outcome, including cleanup and cancellation facts. */
|
|
125
|
+
export function mapStoppedOutcome(outcome, canceledOptions) {
|
|
126
|
+
switch (outcome.kind) {
|
|
127
|
+
case "resource_refused":
|
|
128
|
+
return resourceRefused(outcome, RUN_CLEANUP.facts(outcome));
|
|
129
|
+
case "mint_failed":
|
|
130
|
+
return mintFailedErrors.mintFailed({
|
|
131
|
+
...outcome.target,
|
|
132
|
+
...describeMintFailure(outcome.failure, outcome.target),
|
|
133
|
+
runner: outcome.runner,
|
|
134
|
+
cleanup: RUN_CLEANUP.facts(outcome),
|
|
135
|
+
});
|
|
136
|
+
case "spawn_failed":
|
|
137
|
+
return runErrors.spawnFailed({
|
|
138
|
+
executable: outcome.executable,
|
|
139
|
+
message: outcome.message,
|
|
140
|
+
cleanup: RUN_CLEANUP.facts({ runnerCleanup: null, resourceCleanup: outcome.resourceCleanup }),
|
|
141
|
+
});
|
|
142
|
+
case "canceled":
|
|
143
|
+
return outcomes.canceled({ changed: canceledChanges(outcome, canceledOptions) });
|
|
144
|
+
case "runner_failed":
|
|
145
|
+
return runErrors.runnerFailed({
|
|
146
|
+
failure: runnerFailureFacts(outcome.failure),
|
|
147
|
+
cleanup: RUN_CLEANUP.facts(outcome),
|
|
148
|
+
});
|
|
149
|
+
case "snapshot_gone":
|
|
150
|
+
return runErrors.snapshotGone({
|
|
151
|
+
snapshotId: outcome.entry.snapshotId,
|
|
152
|
+
base: outcome.entry.base,
|
|
153
|
+
removal: outcome.removal === undefined ? null : { ...outcome.removal },
|
|
154
|
+
cleanup: RUN_CLEANUP.facts(outcome),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Plans a run command's run (`planRun`) from `request`, with the command's part of planning (`planCommand`), over the resources'
|
|
160
|
+
* lifecycles, which it binds: the planned run with those lifecycles, or the refusal that ends the command before
|
|
161
|
+
* anything is minted, acquired or started. Every run command plans through it, a run across runner sandboxes too, whose
|
|
162
|
+
* part of planning also plans the runner sandboxes (`across-sandboxes-run.ts`).
|
|
163
|
+
*/
|
|
164
|
+
export async function planCommandRun(app, request, planCommand, signal) {
|
|
165
|
+
const lifecycles = DEFINITION_SET.lifecycles(app.resourceContexts);
|
|
166
|
+
const planned = await planRun(app, lifecycles, { ...request, given: resourceFlagValues(request) }, planCommand, signal);
|
|
167
|
+
if (!planned.ok)
|
|
168
|
+
return planned;
|
|
169
|
+
return { ok: true, planned, lifecycles };
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Runs a planned run that is not across runner sandboxes: the command, the argv its plan holds (`exec`'s command after
|
|
173
|
+
* `--`, or the `vitest run` argv `vitest` builds), with the run payload in `STORM_RUN` and the launcher environment
|
|
174
|
+
* variables the run's used resources hide removed (`ResourceUse.hiddenVariables`), waits for it, and prints a
|
|
175
|
+
* waterfall. It first acquires each resource the run holds and says what each one acquired, and releases them once the
|
|
176
|
+
* command has stopped. The process exits with the command's code, or `128 + n` when signal `n` ended it: `bin/storm.ts`
|
|
177
|
+
* applies the status this records in `app.exit`, which Clinkr's 0 or 1 can't carry.
|
|
54
178
|
*
|
|
55
179
|
* A run has a resource when `storm.config.ts` has it under `resources` or the command line gives one of its
|
|
56
180
|
* options' own flags, `--<prefix>-<option>`, which the registry's resource definitions declare (`resource-flags.ts`).
|
|
57
181
|
* Without one, the run payload names no resource.
|
|
58
182
|
*
|
|
59
183
|
* Signals: before the command starts, the first signal stops the run at its next step, lets each resource's acquire
|
|
60
|
-
* end, releases what it took, and cancels (exit `128 + n`). A signal while `
|
|
184
|
+
* end, releases what it took, and cancels (exit `128 + n`). A signal while the command's part of planning runs (`PlanCommand`), such as while
|
|
61
185
|
* `vitest` counts the tests, stops it and cancels the run before anything is minted, acquired or started
|
|
62
186
|
* (`canceledBeforeStart`). While the command runs, Ctrl+C and a closed terminal reach it directly through its process
|
|
63
187
|
* group, so only SIGTERM is passed on; either way the run waits for the command. A second signal makes Clinkr's host
|
|
@@ -71,80 +195,57 @@ const runRequestSchema = z.object(RUN_REQUEST_FIELDS);
|
|
|
71
195
|
* the file. A flag value its option's schema refuses is a usage error. Options that don't fit together once merged, as
|
|
72
196
|
* the definition's `check` says, are `invalid_resource_options`, which names each value's source.
|
|
73
197
|
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* always mints
|
|
78
|
-
*
|
|
79
|
-
* the run started is stopped and deleted, the resources are released,
|
|
80
|
-
* builds runner snapshots without a run. A run saves no runner snapshot as
|
|
81
|
-
* the keep time.
|
|
198
|
+
* Where the command runs is declared under `runner` in `storm.config.ts` (`launchMachine()` or `vercelSandbox({ … })`,
|
|
199
|
+
* inherited or overridden by suites); `storm exec` also takes `--runner launch-machine`. Without either, the run
|
|
200
|
+
* refuses with `missing_runner`. When using the Vercel Sandbox runner, the runner's local checks (`prepareRunner`) run
|
|
201
|
+
* before anything is minted, acquired, or created, and the run always mints for the runner sandbox, so it needs `scope`
|
|
202
|
+
* and `project` whatever its resources are. In a runner sandbox, the first SIGINT, SIGTERM, or SIGHUP stops the run in
|
|
203
|
+
* any phase: the command is killed, every sandbox the run started is stopped and deleted, the resources are released,
|
|
204
|
+
* and the run cancels. `storm snapshots build` builds runner snapshots without a run. A run saves no runner snapshot as
|
|
205
|
+
* it ends, and keeps the runner sandbox only for the keep time `--keep-sandbox` or the recipe's `keepSandbox` gives.
|
|
82
206
|
*
|
|
83
207
|
* `--credential` (no config key) picks the credential source: `mint`, the default, or `github-actions`, which requests
|
|
84
|
-
* a GitHub Actions OIDC token instead and so needs no `--scope` or `--project`; any given are unused.
|
|
85
|
-
* needs the mint, so `--credential github-actions`
|
|
208
|
+
* a GitHub Actions OIDC token instead and so needs no `--scope` or `--project`; any given are unused. The Vercel
|
|
209
|
+
* Sandbox runner needs the mint, so `--credential github-actions` with it is `conflicting_options`. Each resource's
|
|
86
210
|
* `beforeRun` says whether it needs the Vercel credential (`needsVercelCredential`), from its options. A `--credential`
|
|
87
211
|
* given to a run where none does is `credential_unused`.
|
|
88
212
|
*
|
|
89
213
|
* Progress shows by the app's presentation (`presentation.ts`): a live view on a terminal a person watches, plain lines
|
|
90
|
-
* elsewhere, folded for GitHub Actions, nothing under `--json`. `--show-output` (no config key,
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
214
|
+
* elsewhere, folded for GitHub Actions, nothing under `--json`. `--show-output` (no config key, Vercel Sandbox runner
|
|
215
|
+
* only) prints the runner's step output above the live view. `--verbose` (no config key) prints each resource's
|
|
216
|
+
* detailed progress and the runner's step output, and sets `verbose` in the run payload. Every run, `--json` included,
|
|
217
|
+
* writes a run directory (`recordRun`, `run-directory/`), and a run that can't make one goes on without it; the
|
|
218
|
+
* waterfall names it and the `storm runs show` command that reads the run back by its run id, which a ran outcome
|
|
95
219
|
* carries as `runId`, and in a GitHub Actions step with a job summary the run appends a Markdown summary there.
|
|
96
220
|
*
|
|
97
221
|
* Each resource comes from an extension (the registry, `src/extensions.ts`, lists them), whose folder under
|
|
98
222
|
* `src/extensions/` says what the run does with it. storm first plans the run (`planRun`), then calls each resource's
|
|
99
|
-
* `beforeRun` and chooses the credential source (`resourcesBeforeRun`), and only then mints, acquires or starts
|
|
223
|
+
* `beforeRun` and chooses the credential source (`resourcesBeforeRun`), and only then mints, acquires, or starts
|
|
100
224
|
* anything or opens the run directory. A `beforeRun` may skip its resource, and the run says so right after it starts.
|
|
101
|
-
* With a test plan (`
|
|
102
|
-
* under `--json`. The run refuses in this order: `invalid_config`;
|
|
103
|
-
* `missing_target`, then `
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
225
|
+
* With a test plan (`storm test`), it says the plan on stderr once the resources' `beforeRun` let the run go on, unless
|
|
226
|
+
* under `--json`. The run refuses in this order: `invalid_config`; `missing_runner`; `conflicting_options`; for Vercel
|
|
227
|
+
* Sandbox, `missing_target`, then `credentials_invalid`, then `keep_sandbox_unsafe_secret_env_vars`, then
|
|
228
|
+
* `unsafe_secret_env_vars_invalid`; then `invalid_resource_options` for a required option nothing gives, which no count
|
|
229
|
+
* can change; then `spec.planCommand`'s refusal, if any; `invalid_resource_options` for the checks across a resource's
|
|
230
|
+
* options, which may read a default sized from the count; each resource's `beforeRun` refusal, in registry order
|
|
231
|
+
* (`resource_refused_before_run`), with the config file beside it; `credential_unused`; on the launch machine,
|
|
232
|
+
* `resource_needs_runner_sandbox` when a resource it uses needs a runner sandbox (a resource whose acquire gives the
|
|
233
|
+
* command sandbox credentials, which only the runner sandbox's firewall can add); and on the launch machine where a
|
|
234
|
+
* resource needs the credential, `missing_target` for the mint. A resource's secrets, such as a token, and in a runner
|
|
235
|
+
* sandbox the credentials' and unsafe secret environment variables' values, are hidden as `<token>` in the run's
|
|
236
|
+
* progress, its run directory, its job summary, its outcome, a runner sandbox's preparation refusal
|
|
237
|
+
* (`prepareRunner`'s), its command's output and step output, and `spec.planCommand`'s refusal. That refusal comes
|
|
238
|
+
* before `beforeRun`, which may do I/O, so storm reads the resources' secrets for it from each one's pure `secrets`,
|
|
239
|
+
* over its options merged once, each function default given `NOT_COUNTED` (`settleRunResources`), whether or not the
|
|
240
|
+
* checks across them pass.
|
|
113
241
|
*/
|
|
114
|
-
export async function
|
|
115
|
-
|
|
116
|
-
const lifecycles = DEFINITION_SET.lifecycles(app.resourceContexts);
|
|
117
|
-
const planned = await planRun(app, lifecycles, { ...request, given: resourceFlagValues(request) }, spec.planCommand, signal);
|
|
118
|
-
if (!planned.ok)
|
|
119
|
-
return planned.refusal;
|
|
242
|
+
export async function runPlannedCommand(context, request, spec, planned, lifecycles) {
|
|
243
|
+
const { app, ui, signal } = context;
|
|
120
244
|
const { configFile, argv, testPlan, planOptions } = planned;
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
return canceledBeforeStart();
|
|
126
|
-
const { where, used } = before;
|
|
127
|
-
const plan = recordedPlan(testPlan, planOptions);
|
|
128
|
-
if (plan !== undefined)
|
|
129
|
-
await ui.progress?.(testPlanLine(plan));
|
|
130
|
-
const base = {
|
|
131
|
-
argv,
|
|
132
|
-
// A resource the run uses can hide launcher environment variables that could point the command at something else
|
|
133
|
-
// than the run payload names, so the command never sees one.
|
|
134
|
-
env: Object.fromEntries(Object.entries(app.env).filter(([name]) => !used.hiddenVariables.includes(name))),
|
|
135
|
-
version: app.version,
|
|
136
|
-
commit: app.commit,
|
|
137
|
-
configFile,
|
|
138
|
-
verbose: request.verbose,
|
|
139
|
-
};
|
|
140
|
-
const requested = await runRequestFor(app, { where, used, base, request, configFile });
|
|
141
|
-
if (!requested.ok)
|
|
142
|
-
return requested.refusal;
|
|
143
|
-
const { run } = requested;
|
|
144
|
-
// The resources' secrets and the runner secrets' values: every event and the command's output pass through `redact`
|
|
145
|
-
// before any view, the run directory or the summary sees them.
|
|
146
|
-
const secrets = [...used.secrets, ...Object.values(run.runner?.secrets ?? {})];
|
|
147
|
-
const redact = redactor(secrets);
|
|
245
|
+
const session = await prepareRunSession(context, lifecycles, planned, request);
|
|
246
|
+
if (!session.ok)
|
|
247
|
+
return session.refusal;
|
|
248
|
+
const { plan, run, secrets, redact, git } = session;
|
|
148
249
|
// Only SIGTERM is passed on to the command (`forwardSigterm`); a run in a runner sandbox stops on any signal itself
|
|
149
250
|
// (`RunControl`).
|
|
150
251
|
const sigterm = forwardSigterm(signal);
|
|
@@ -155,13 +256,13 @@ export async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
155
256
|
showOutput: request.showOutput,
|
|
156
257
|
verbose: request.verbose,
|
|
157
258
|
});
|
|
158
|
-
const git = await checkoutGit(app.context.checkout, app.cwd);
|
|
159
259
|
const recording = await recordRun(app.context.runDirectories, {
|
|
160
260
|
definitionSet: DEFINITION_SET,
|
|
161
|
-
|
|
261
|
+
clock: app.context.clock,
|
|
162
262
|
cwd: app.cwd,
|
|
163
263
|
configFile,
|
|
164
264
|
argv,
|
|
265
|
+
...(spec.test === undefined ? {} : { test: spec.test }),
|
|
165
266
|
plan,
|
|
166
267
|
run,
|
|
167
268
|
git,
|
|
@@ -174,22 +275,15 @@ export async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
174
275
|
// Where the command reports its tests: a runner sandbox's own file, which the runner follows, or the run directory's
|
|
175
276
|
// test events file, which a run with no runner hands its command only once the run directory opened.
|
|
176
277
|
const collected = run.runner !== undefined || recording.testEvents !== undefined;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const ended = await executeRun(DEFINITION_SET, { ...app.context, runnerTerminal: secrets.length === 0 ? terminal : redactingTerminal(terminal, redact) }, app.resourceContexts, run.runner === undefined && recording.testEvents !== undefined
|
|
278
|
+
const outcome = await runLifecycle({
|
|
279
|
+
execute: async () => await executeRun(DEFINITION_SET, { ...app.context, runnerTerminal: secrets.length === 0 ? terminal : redactingTerminal(terminal, redact) }, app.resourceContexts, run.runner === undefined && recording.testEvents !== undefined
|
|
180
280
|
? { ...run, testEvents: recording.testEvents }
|
|
181
|
-
: run, { signal, terminate: sigterm.terminate }, timedProgress(app.context.clock, secrets.length === 0 ? observer : redactingObserver(observer, redact)))
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
// directory and removes the test events an unsandboxed command staged there, unredacted. They are never saved: the
|
|
188
|
-
// run didn't end.
|
|
189
|
-
await view.finish([]);
|
|
190
|
-
await recording.abandon();
|
|
191
|
-
throw error;
|
|
192
|
-
}
|
|
281
|
+
: run, { signal, terminate: sigterm.terminate }, timedProgress(app.context.clock, secrets.length === 0 ? observer : redactingObserver(observer, redact))),
|
|
282
|
+
redact,
|
|
283
|
+
hasSecrets: secrets.length > 0,
|
|
284
|
+
finishView: async () => await view.finish([]),
|
|
285
|
+
abandonRecording: async () => await recording.abandon(),
|
|
286
|
+
});
|
|
193
287
|
sigterm.release();
|
|
194
288
|
const { timeline: ran, finalResults } = await summarize(app, {
|
|
195
289
|
command: spec.name,
|
|
@@ -198,98 +292,65 @@ export async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
198
292
|
recording,
|
|
199
293
|
outcome,
|
|
200
294
|
});
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}, { testPlan, options: planOptions });
|
|
237
|
-
}
|
|
238
|
-
case "resource_refused":
|
|
239
|
-
return resourceRefused(outcome, RUN_CLEANUP.facts(outcome));
|
|
240
|
-
// The run's mint: in a sandboxed run for the runner sandbox, in an unsandboxed run for a resource that needed it:
|
|
241
|
-
// its `acquireForRun` answered `mintFailed`, which the launcher owns.
|
|
242
|
-
case "mint_failed":
|
|
243
|
-
return mintFailedErrors.mintFailed({
|
|
244
|
-
...outcome.target,
|
|
245
|
-
...describeMintFailure(outcome.failure, outcome.target),
|
|
246
|
-
runner: outcome.runner,
|
|
247
|
-
cleanup: RUN_CLEANUP.facts(outcome),
|
|
248
|
-
});
|
|
249
|
-
case "spawn_failed":
|
|
250
|
-
return runErrors.spawnFailed({
|
|
251
|
-
executable: outcome.executable,
|
|
252
|
-
message: outcome.message,
|
|
253
|
-
// Only an unsandboxed run spawns its command on this machine, so it holds no runner sandbox.
|
|
254
|
-
cleanup: RUN_CLEANUP.facts({ runnerCleanup: null, resourceCleanup: outcome.resourceCleanup }),
|
|
255
|
-
});
|
|
256
|
-
case "canceled":
|
|
257
|
-
return outcomes.canceled({ changed: canceledChanges(outcome) });
|
|
258
|
-
case "runner_failed":
|
|
259
|
-
return runErrors.runnerFailed({
|
|
260
|
-
failure: runnerFailureFacts(outcome.failure),
|
|
261
|
-
cleanup: RUN_CLEANUP.facts(outcome),
|
|
262
|
-
});
|
|
263
|
-
case "snapshot_gone":
|
|
264
|
-
return runErrors.snapshotGone({
|
|
265
|
-
snapshotId: outcome.entry.snapshotId,
|
|
266
|
-
base: outcome.entry.base,
|
|
267
|
-
removal: outcome.removal === undefined ? null : { ...outcome.removal },
|
|
268
|
-
cleanup: RUN_CLEANUP.facts(outcome),
|
|
269
|
-
});
|
|
270
|
-
}
|
|
295
|
+
if (outcome.kind !== "ran")
|
|
296
|
+
return mapStoppedOutcome(outcome);
|
|
297
|
+
const { command } = outcome;
|
|
298
|
+
const runId = recording.opened.ok ? recording.opened.id : null;
|
|
299
|
+
app.exit.status = commandExitStatus(outcome.command);
|
|
300
|
+
return spec.ran({
|
|
301
|
+
version: app.version,
|
|
302
|
+
commit: app.commit,
|
|
303
|
+
configFile,
|
|
304
|
+
resources: DEFINITION_SET.reports.ranFacts(outcome.resources),
|
|
305
|
+
cleanup: RUN_CLEANUP.facts(outcome),
|
|
306
|
+
command: command.kind === "exited"
|
|
307
|
+
? { exitCode: command.code, signal: null }
|
|
308
|
+
: command.kind === "signaled"
|
|
309
|
+
? { exitCode: null, signal: command.signal }
|
|
310
|
+
: { exitCode: null, signal: null },
|
|
311
|
+
runner: outcome.runner === undefined
|
|
312
|
+
? null
|
|
313
|
+
: {
|
|
314
|
+
snapshotId: outcome.runner.snapshotId,
|
|
315
|
+
base: outcome.runner.base,
|
|
316
|
+
builtBehind: outcome.runner.builtBehind,
|
|
317
|
+
uploadBytes: outcome.runner.uploadBytes,
|
|
318
|
+
built: outcome.runner.built,
|
|
319
|
+
vcpus: outcome.runner.vcpus,
|
|
320
|
+
region: outcome.runner.region,
|
|
321
|
+
runtime: outcome.runner.runtime,
|
|
322
|
+
buildMs: outcome.runner.buildMs,
|
|
323
|
+
},
|
|
324
|
+
timeline: ran,
|
|
325
|
+
runId,
|
|
326
|
+
}, { testPlan, options: planOptions }, lacksFinalResults(command.kind === "exited" ? command.code : null, {
|
|
327
|
+
...finalResults,
|
|
328
|
+
collected,
|
|
329
|
+
}));
|
|
271
330
|
}
|
|
272
|
-
/**
|
|
273
|
-
|
|
274
|
-
|
|
331
|
+
/**
|
|
332
|
+
* What is wrong with `--sandboxes` or `--file-lists` combined with other run flags, whatever the runner, as `validate`
|
|
333
|
+
* reports it. The launch machine runner refuses both flags in `planRun` (`conflicting_options`), once it knows the
|
|
334
|
+
* effective runner.
|
|
335
|
+
*/
|
|
336
|
+
export function sandboxesFlagProblems(request) {
|
|
337
|
+
const flag = request.sandboxes !== undefined ? "--sandboxes" : request.fileLists !== undefined ? "--file-lists" : undefined;
|
|
338
|
+
if (flag === undefined)
|
|
339
|
+
return [];
|
|
340
|
+
return request.showOutput
|
|
341
|
+
? [
|
|
342
|
+
{
|
|
343
|
+
field: "showOutput",
|
|
344
|
+
message: `A run with ${flag} prints status lines and no step output, and each runner sandbox entry of its run directory keeps its step logs; drop --show-output.`,
|
|
345
|
+
},
|
|
346
|
+
]
|
|
347
|
+
: [];
|
|
348
|
+
}
|
|
349
|
+
/** Flag checks that hold regardless of which runner the run uses (`validate`). */
|
|
350
|
+
export function runFlagProblems(request) {
|
|
351
|
+
const { keepSandbox } = request;
|
|
275
352
|
return [
|
|
276
353
|
...resourceFlagProblems(request),
|
|
277
|
-
...(!unsandboxed && credential === "github-actions"
|
|
278
|
-
? [
|
|
279
|
-
{
|
|
280
|
-
field: "credential",
|
|
281
|
-
message: "A sandboxed run needs the mint: the runner sandbox uses a minted Vercel token. Add --unsandboxed, or drop --credential github-actions.",
|
|
282
|
-
},
|
|
283
|
-
]
|
|
284
|
-
: []),
|
|
285
|
-
...(showOutput && unsandboxed
|
|
286
|
-
? [
|
|
287
|
-
{
|
|
288
|
-
field: "showOutput",
|
|
289
|
-
message: "--show-output prints a sandboxed run's step output; drop it or --unsandboxed.",
|
|
290
|
-
},
|
|
291
|
-
]
|
|
292
|
-
: []),
|
|
293
354
|
...(keepSandbox !== undefined && parseKeepTime(keepSandbox) === undefined
|
|
294
355
|
? [
|
|
295
356
|
{
|
|
@@ -298,63 +359,38 @@ export function runProblems(request) {
|
|
|
298
359
|
},
|
|
299
360
|
]
|
|
300
361
|
: []),
|
|
301
|
-
...(keepSandbox !== undefined && unsandboxed
|
|
302
|
-
? [
|
|
303
|
-
{
|
|
304
|
-
field: "keepSandbox",
|
|
305
|
-
message: "--keep-sandbox keeps a sandboxed run's runner sandbox; drop it or --unsandboxed.",
|
|
306
|
-
},
|
|
307
|
-
]
|
|
308
|
-
: []),
|
|
309
362
|
];
|
|
310
363
|
}
|
|
311
364
|
/**
|
|
312
|
-
* The
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
* secrets' values as `<token>`.
|
|
365
|
+
* The runner's part of the request of a run with a runner, which starts `sandboxes` runner sandboxes, each kept running
|
|
366
|
+
* for `keepMs` once the run ends. The runner's local checks run here (`prepareRunner`), before anything is minted,
|
|
367
|
+
* acquired, or started. Their refusal ends the command and leaves no run directory; it can quote what preparation saw,
|
|
368
|
+
* such as a declared base file path or a `vcpus` rule's resource option value, so it shows the resources' secrets and
|
|
369
|
+
* the runner secrets' values as `<token>`.
|
|
318
370
|
*/
|
|
319
|
-
async function
|
|
320
|
-
const { where, used, base, request, configFile } = options;
|
|
321
|
-
if (where.kind === "unsandboxed") {
|
|
322
|
-
const run = {
|
|
323
|
-
...base,
|
|
324
|
-
resources: used.requests,
|
|
325
|
-
skipped: used.skipped,
|
|
326
|
-
...(where.credential === undefined ? {} : { credential: where.credential }),
|
|
327
|
-
};
|
|
328
|
-
return { ok: true, run };
|
|
329
|
-
}
|
|
371
|
+
export async function runnerRequestFor(app, where, used, options) {
|
|
330
372
|
const prepared = await prepareRunner(app.context, {
|
|
331
373
|
cwd: app.cwd,
|
|
332
374
|
recipe: where.recipe,
|
|
333
|
-
|
|
334
|
-
vcpusRun: recipeRun(recipeResources(used.requests)),
|
|
375
|
+
vcpuRun: { resources: recipeResources(used.requests), sandboxes: options.sandboxes },
|
|
335
376
|
});
|
|
336
377
|
if (prepared.kind !== "ok") {
|
|
337
|
-
const refusal = prepareRefusal(prepared, configFile);
|
|
338
|
-
const secrets = [...used.secrets, ...
|
|
378
|
+
const refusal = prepareRefusal(prepared, options.configFile);
|
|
379
|
+
const secrets = [...used.secrets, ...where.secrets];
|
|
339
380
|
return {
|
|
340
381
|
ok: false,
|
|
341
382
|
refusal: secrets.length === 0 ? refusal : redactStrings(refusal, redactor(secrets)),
|
|
342
383
|
};
|
|
343
384
|
}
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
target: where.target,
|
|
352
|
-
user: app.user,
|
|
353
|
-
secrets: where.secrets,
|
|
354
|
-
keepMs,
|
|
355
|
-
},
|
|
385
|
+
const runner = {
|
|
386
|
+
prepared: prepared.prepared,
|
|
387
|
+
target: where.target,
|
|
388
|
+
user: app.user,
|
|
389
|
+
credentials: where.credentials,
|
|
390
|
+
...(Object.keys(where.unsafeSecretEnvVars).length === 0 ? {} : { unsafeSecretEnvVars: where.unsafeSecretEnvVars }),
|
|
391
|
+
keepMs: options.keepMs,
|
|
356
392
|
};
|
|
357
|
-
return { ok: true,
|
|
393
|
+
return { ok: true, runner };
|
|
358
394
|
}
|
|
359
395
|
/**
|
|
360
396
|
* The refusal for a runner whose local checks failed: no base, submodules, a recipe storm can't use at the run's
|
|
@@ -387,7 +423,7 @@ export function checkoutFailedRefusal(failure) {
|
|
|
387
423
|
/**
|
|
388
424
|
* Once the run is done: ends its recording, which writes how the run ended to the run directory and closes it
|
|
389
425
|
* (`RunRecording.end`). Then it appends the job summary, and has the view print the waterfall, with the worker chart
|
|
390
|
-
* under its
|
|
426
|
+
* under its command row, the tests' summary, the logs of failed steps, and what went wrong with the run directory. The
|
|
391
427
|
* job summary leaves the worker chart out. It answers the timeline, which a ran outcome carries, and how many final
|
|
392
428
|
* test results the run's test events held (`FinalResultsRead`).
|
|
393
429
|
*/
|
|
@@ -401,6 +437,7 @@ async function summarize(app, run) {
|
|
|
401
437
|
const stepLogs = failedStepLogs(timeline, recording, app.env);
|
|
402
438
|
const clock = workerClock(recorded);
|
|
403
439
|
const charted = clock === undefined ? undefined : testsChart(tests.events, run.hints, tests.unreadable, clock, tests.incomplete);
|
|
440
|
+
const workersHint = charted !== undefined && hasPoorParallelism(charted.parallelism);
|
|
404
441
|
const summarized = await app.context.jobSummary.appendJobSummary(jobSummaryMarkdown(timeline, {
|
|
405
442
|
command: run.command,
|
|
406
443
|
logs,
|
|
@@ -408,8 +445,8 @@ async function summarize(app, run) {
|
|
|
408
445
|
}));
|
|
409
446
|
await view.finish(waterfallLines(timeline, {
|
|
410
447
|
width: view.width,
|
|
411
|
-
|
|
412
|
-
logs: logsText(recording, recorded.writeFailure, app.env, failed),
|
|
448
|
+
colorDepth: view.colorDepth,
|
|
449
|
+
logs: logsText(recording, recorded.writeFailure, app.env, failed, workersHint),
|
|
413
450
|
...(charted === undefined ? {} : { workers: charted.lanes }),
|
|
414
451
|
details: [
|
|
415
452
|
...(charted?.notes ?? testsLines),
|
|
@@ -428,18 +465,18 @@ async function summarize(app, run) {
|
|
|
428
465
|
};
|
|
429
466
|
}
|
|
430
467
|
/**
|
|
431
|
-
* How the workers' clock maps to the run's, for the worker chart under the
|
|
468
|
+
* How the workers' clock maps to the run's, for the worker chart under the command row; undefined without one. The
|
|
432
469
|
* offset comes from when the run heard each worker test event it followed, and is 0 when it followed none: workers
|
|
433
470
|
* whose test events the command staged in the run directory share the run's clock.
|
|
434
471
|
*/
|
|
435
472
|
function workerClock({ timeline, workerOffsetMs }) {
|
|
436
|
-
const tests = timeline.rows.find((row) => row.name === "
|
|
473
|
+
const tests = timeline.rows.find((row) => row.name === "command");
|
|
437
474
|
if (tests === undefined)
|
|
438
475
|
return undefined;
|
|
439
476
|
return { runStartedAt: Date.parse(timeline.startedAt), offsetMs: workerOffsetMs, tests };
|
|
440
477
|
}
|
|
441
478
|
/** A path as a person reads it: under `HOME`, starting `~/`. */
|
|
442
|
-
function displayPath(path, env) {
|
|
479
|
+
export function displayPath(path, env) {
|
|
443
480
|
const home = env["HOME"];
|
|
444
481
|
if (home === undefined || home === "" || !path.startsWith(`${home}/`))
|
|
445
482
|
return path;
|
|
@@ -448,9 +485,10 @@ function displayPath(path, env) {
|
|
|
448
485
|
/**
|
|
449
486
|
* Where the run directory is, for the summary's logs line, and what went wrong with it: it couldn't be made, a write
|
|
450
487
|
* failed, or pruning couldn't remove an older one or the staged test events left in one. The run goes on whichever it
|
|
451
|
-
* was. Then the command that reads the run back by its run id, with `--failed` when a test `failed
|
|
488
|
+
* was. Then the command that reads the run back by its run id, with `--failed` when a test `failed` and `--workers`
|
|
489
|
+
* when parallelism was poor.
|
|
452
490
|
*/
|
|
453
|
-
function logsText({ opened }, writeFailure, env, failed) {
|
|
491
|
+
export function logsText({ opened }, writeFailure, env, failed, workersHint) {
|
|
454
492
|
if (!opened.ok)
|
|
455
493
|
return `none: couldn't make ${opened.failure.path}: ${opened.failure.message}`;
|
|
456
494
|
const path = `${displayPath(opened.path, env)}/`;
|
|
@@ -458,14 +496,15 @@ function logsText({ opened }, writeFailure, env, failed) {
|
|
|
458
496
|
...(writeFailure === undefined ? [] : [`couldn't write ${writeFailure.path}: ${writeFailure.message}`]),
|
|
459
497
|
...opened.pruneFailures.slice(0, 1).map((failure) => `couldn't remove ${failure.path}: ${failure.message}`),
|
|
460
498
|
];
|
|
461
|
-
const
|
|
499
|
+
const flags = `${failed ? " --failed" : ""}${workersHint ? " --workers" : ""}`;
|
|
500
|
+
const show = `storm runs show ${opened.id}${flags}`;
|
|
462
501
|
return `${problems.length === 0 ? path : `${path} (${problems.join("; ")})`} · ${show}`;
|
|
463
502
|
}
|
|
464
503
|
/**
|
|
465
504
|
* Where the checkout `cwd` is in was as the run starts, for `run.json`; null outside a Git checkout, or when git
|
|
466
505
|
* can't say. The run goes on either way.
|
|
467
506
|
*/
|
|
468
|
-
async function checkoutGit(checkout, cwd) {
|
|
507
|
+
export async function checkoutGit(checkout, cwd) {
|
|
469
508
|
const root = await checkout.repositoryRoot({ cwd });
|
|
470
509
|
if (!root.ok)
|
|
471
510
|
return null;
|
|
@@ -473,27 +512,25 @@ async function checkoutGit(checkout, cwd) {
|
|
|
473
512
|
return head.ok ? { ...head.value } : null;
|
|
474
513
|
}
|
|
475
514
|
/**
|
|
476
|
-
* Each resource's
|
|
477
|
-
* function reads.
|
|
515
|
+
* Each resource's resolved options, by resource key: what a runner recipe's declared `vcpus` rule reads.
|
|
478
516
|
*/
|
|
479
|
-
function recipeResources(requests) {
|
|
480
|
-
return Object.fromEntries(Object.entries(requests).map(([key, {
|
|
517
|
+
export function recipeResources(requests) {
|
|
518
|
+
return Object.fromEntries(Object.entries(requests).map(([key, { options }]) => {
|
|
481
519
|
// A resource's options are the plain values its definition merges to: always an object.
|
|
482
520
|
if (typeof options !== "object" || options === null)
|
|
483
521
|
throw new Error(`${key}'s options are not an object`);
|
|
484
|
-
return [key,
|
|
522
|
+
return [key, options];
|
|
485
523
|
}));
|
|
486
524
|
}
|
|
487
|
-
/** How long a runner sandbox keeps running once its run ends, when neither the flag nor the recipe says. */
|
|
488
|
-
export const DEFAULT_KEEP_SANDBOX_MINUTES = 30;
|
|
489
525
|
/**
|
|
490
526
|
* How long the runner sandbox keeps running once the run ends, in minutes: `--keep-sandbox`, else the recipe's
|
|
491
|
-
* `keepSandbox`, else
|
|
527
|
+
* `keepSandbox`, else 0. A run keeps its runner sandbox only on request, since anyone who can update the Vercel project
|
|
528
|
+
* can connect to it.
|
|
492
529
|
*/
|
|
493
|
-
function keepSandboxMinutes(flag, recipe
|
|
530
|
+
function keepSandboxMinutes(flag, recipe) {
|
|
494
531
|
// `validate` refused a flag this can't read.
|
|
495
532
|
const fromFlag = flag === undefined ? undefined : parseKeepTime(flag);
|
|
496
|
-
return fromFlag ?? recipe.keepSandboxMinutes ??
|
|
533
|
+
return fromFlag ?? recipe.keepSandboxMinutes ?? 0;
|
|
497
534
|
}
|
|
498
535
|
/** For each runner step that failed, where its whole output is: the summary's lines after the critical path. */
|
|
499
536
|
function failedStepLogs(timeline, recording, env) {
|
|
@@ -517,6 +554,15 @@ export function runnerFailureFacts(failure) {
|
|
|
517
554
|
return { kind: failure.kind, operation: failure.operation, status: failure.status, message: failure.message };
|
|
518
555
|
case "checkout-failed":
|
|
519
556
|
return { kind: failure.kind, message: failure.failure.message, command: failure.failure.displayCommand ?? null };
|
|
557
|
+
case "network-policy-failed":
|
|
558
|
+
return {
|
|
559
|
+
kind: failure.kind,
|
|
560
|
+
operation: failure.operation,
|
|
561
|
+
around: failure.around,
|
|
562
|
+
reason: failure.reason,
|
|
563
|
+
status: failure.status,
|
|
564
|
+
message: failure.message,
|
|
565
|
+
};
|
|
520
566
|
case "credential-claims-missing":
|
|
521
567
|
return { kind: failure.kind, ...failure.target };
|
|
522
568
|
}
|
|
@@ -527,28 +573,31 @@ const NOTHING_RELEASED = { runnerCleanup: null, resourceCleanup: {} };
|
|
|
527
573
|
* What a canceled run changed, for a person: whether its command ran, what happened to a sandboxed run's sandboxes, and
|
|
528
574
|
* what each of its resource instances says of what it changed (`DEFINITION_SET.reports.canceledLines`).
|
|
529
575
|
*/
|
|
530
|
-
function canceledChanges(outcome) {
|
|
576
|
+
export function canceledChanges(outcome, options = {}) {
|
|
531
577
|
const { commandStopped } = outcome;
|
|
532
578
|
const lines = [
|
|
533
|
-
|
|
579
|
+
options.commandLine ??
|
|
580
|
+
(commandStopped === true ? "The command was stopped in the runner sandbox." : "The command didn't run."),
|
|
534
581
|
];
|
|
535
582
|
const cleanup = RUN_CLEANUP.facts(outcome).runner;
|
|
536
583
|
if (cleanup !== null)
|
|
537
|
-
lines.push(...runnerCleanupLines(cleanup));
|
|
584
|
+
lines.push(...runnerCleanupLines(cleanup, options.keptLines));
|
|
585
|
+
else if (options.keptLines !== undefined)
|
|
586
|
+
lines.push(...options.keptLines);
|
|
538
587
|
lines.push(...DEFINITION_SET.reports.canceledLines(outcome.resourceCleanup));
|
|
539
588
|
return lines.join("\n");
|
|
540
589
|
}
|
|
541
|
-
|
|
542
|
-
function runnerCleanupLines({ kept, notKept, notStopped, notDeleted }) {
|
|
590
|
+
function runnerCleanupLines({ kept, notKept, notStopped, notDeleted }, keptLines) {
|
|
543
591
|
const problems = [
|
|
544
592
|
...(notKept === null ? [] : [notKeptText(notKept)]),
|
|
545
593
|
...notStopped.map(notStoppedText),
|
|
546
594
|
...notDeleted.map(notDeletedText),
|
|
547
595
|
];
|
|
548
|
-
|
|
596
|
+
const allKept = [...(kept === null ? [] : [keptText(kept)]), ...(keptLines ?? [])];
|
|
597
|
+
if (allKept.length === 0)
|
|
549
598
|
return problems.length === 0 ? ["Every sandbox the runner started is stopped and deleted."] : problems;
|
|
550
599
|
return [
|
|
551
|
-
|
|
600
|
+
...allKept,
|
|
552
601
|
...(problems.length === 0 ? ["Every other sandbox the runner started is stopped and deleted."] : problems),
|
|
553
602
|
];
|
|
554
603
|
}
|