@cnc-tools/storm 0.9.0 → 0.10.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/bin/storm.js +11 -13
- package/dist/application.d.ts +18 -10
- package/dist/application.js +13 -12
- package/dist/bin/storm.js +102 -42
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-AGWW3HDT.js +2559 -0
- package/dist/chunks/chunk-AKKNF3WZ.js +2023 -0
- package/dist/chunks/chunk-H2VCSNVU.js +351 -0
- package/dist/chunks/chunk-I5GZLOLQ.js +38 -0
- package/dist/chunks/chunk-J6ZNYUDV.js +21 -0
- package/dist/chunks/chunk-JQ2HK4RN.js +425 -0
- package/dist/chunks/chunk-OVXD7GES.js +841 -0
- package/dist/chunks/chunk-VJQLMGOH.js +4716 -0
- package/dist/chunks/chunk-WF4KJ7YG.js +431 -0
- package/dist/chunks/chunk-XHJGHJBW.js +1509 -0
- package/dist/chunks/chunk-YF3ICDBY.js +10 -0
- package/dist/chunks/chunk-ZJ2USLAT.js +4420 -0
- package/dist/chunks/live-app-RIJM3QFD.js +97 -0
- package/dist/chunks/version-X7RMSKZI.js +12 -0
- package/dist/command-tree.d.ts +3 -0
- package/dist/command-tree.js +3 -0
- package/dist/commands/dashboard.d.ts +1 -1
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/exec/cleanup.d.ts +27 -43
- package/dist/commands/exec/cleanup.js +20 -54
- package/dist/commands/exec/command.d.ts +72 -544
- package/dist/commands/exec/command.js +69 -22
- package/dist/commands/exec/job-summary.d.ts +2 -2
- package/dist/commands/exec/job-summary.js +3 -3
- package/dist/commands/exec/live-view.d.ts +9 -9
- package/dist/commands/exec/live-view.js +48 -41
- package/dist/commands/exec/metadata.d.ts +0 -65
- package/dist/commands/exec/metadata.js +7 -58
- package/dist/commands/exec/mint-failed.d.ts +1 -1
- package/dist/commands/exec/mint-failed.js +8 -8
- package/dist/commands/exec/outcomes.d.ts +63 -468
- package/dist/commands/exec/outcomes.js +42 -69
- package/dist/commands/exec/plan-run.d.ts +150 -0
- package/dist/commands/exec/plan-run.js +121 -0
- package/dist/commands/exec/progress.d.ts +25 -15
- package/dist/commands/exec/progress.js +61 -40
- package/dist/commands/exec/redaction.d.ts +3 -3
- package/dist/commands/exec/redaction.js +4 -4
- package/dist/commands/exec/resource-flags.d.ts +50 -0
- package/dist/commands/exec/resource-flags.js +125 -0
- package/dist/commands/exec/resource-refusals.d.ts +64 -0
- package/dist/commands/exec/resource-refusals.js +58 -0
- package/dist/commands/exec/run-collector.d.ts +15 -10
- package/dist/commands/exec/run-collector.js +5 -5
- package/dist/commands/exec/run-command.d.ts +80 -165
- package/dist/commands/exec/run-command.js +264 -275
- package/dist/commands/exec/run-metadata.d.ts +20 -43
- package/dist/commands/exec/run-metadata.js +18 -37
- package/dist/commands/exec/run-record.d.ts +67 -58
- package/dist/commands/exec/run-record.js +15 -32
- package/dist/commands/exec/test-plan.d.ts +45 -0
- package/dist/commands/exec/test-plan.js +59 -0
- package/dist/commands/exec/tests-summary.d.ts +5 -5
- package/dist/commands/exec/tests-summary.js +2 -2
- package/dist/commands/exec/text.d.ts +8 -2
- package/dist/commands/exec/text.js +8 -0
- package/dist/commands/exec/timeline-facts.d.ts +57 -0
- package/dist/commands/exec/timeline-facts.js +92 -0
- package/dist/commands/exec/view.d.ts +5 -7
- package/dist/commands/exec/view.js +21 -13
- package/dist/commands/exec/waterfall.d.ts +2 -9
- package/dist/commands/exec/waterfall.js +9 -30
- package/dist/commands/exec/worker-chart.d.ts +1 -1
- package/dist/commands/ext/metadata.d.ts +4 -0
- package/dist/commands/ext/metadata.js +8 -0
- package/dist/commands/runs/facts.d.ts +9 -5
- package/dist/commands/runs/facts.js +26 -14
- package/dist/commands/runs/list/command.d.ts +15 -8
- package/dist/commands/runs/list/command.js +142 -33
- package/dist/commands/runs/list/metadata.d.ts +16 -14
- package/dist/commands/runs/list/metadata.js +21 -15
- package/dist/commands/runs/list/outcomes.d.ts +6 -2
- package/dist/commands/runs/logs/command.d.ts +3 -4
- package/dist/commands/runs/logs/command.js +135 -49
- package/dist/commands/runs/logs/metadata.d.ts +17 -15
- package/dist/commands/runs/logs/metadata.js +23 -17
- package/dist/commands/runs/metadata.js +6 -2
- package/dist/commands/runs/past-run.d.ts +3 -9
- package/dist/commands/runs/past-run.js +2 -17
- package/dist/commands/runs/show/command.d.ts +57 -42
- package/dist/commands/runs/show/command.js +404 -74
- package/dist/commands/runs/show/metadata.d.ts +20 -18
- package/dist/commands/runs/show/metadata.js +23 -17
- package/dist/commands/runs/show/outcomes.d.ts +27 -19
- package/dist/commands/runs/show/outcomes.js +8 -6
- package/dist/commands/vitest/command.d.ts +94 -559
- package/dist/commands/vitest/command.js +176 -132
- package/dist/commands/vitest/metadata.d.ts +0 -65
- package/dist/commands/vitest/metadata.js +7 -38
- package/dist/commands/vitest/outcomes.d.ts +44 -274
- package/dist/commands/vitest/outcomes.js +7 -14
- package/dist/config/credential-resolver.d.ts +131 -0
- package/dist/config/credential-resolver.js +69 -0
- package/dist/{credential/settle.d.ts → config/credential-settle.d.ts} +1 -2
- package/dist/config/errors.d.ts +1 -1
- package/dist/config/errors.js +5 -5
- package/dist/config/index.d.ts +7 -6
- package/dist/config/index.js +13 -9
- package/dist/config/load.d.ts +16 -13
- package/dist/config/load.js +55 -40
- package/dist/config/recipe-run.d.ts +26 -0
- package/dist/config/recipe-run.js +27 -0
- package/dist/config/resolve.d.ts +103 -15
- package/dist/config/resolve.js +137 -47
- package/dist/config/resolver.d.ts +40 -0
- package/dist/config/resolver.js +31 -0
- package/dist/config/schema.d.ts +13 -17
- package/dist/config/schema.js +14 -35
- package/dist/config/settings-file.d.ts +28 -16
- package/dist/config/settings-file.js +39 -24
- package/dist/config/typed-options.d.ts +21 -0
- package/dist/config/typed-options.js +28 -0
- package/dist/config-file/define.d.ts +33 -31
- package/dist/config-file/define.js +14 -4
- package/dist/config-file/toolchain.d.ts +1 -1
- package/dist/context.d.ts +37 -24
- package/dist/context.js +16 -8
- package/dist/core/before-run.d.ts +37 -0
- package/dist/core/before-run.js +44 -0
- package/dist/core/events.d.ts +55 -46
- package/dist/core/gateways.d.ts +17 -18
- package/dist/core/index.d.ts +12 -12
- package/dist/core/index.js +12 -8
- package/dist/core/launcher-supplies.d.ts +11 -0
- package/dist/core/launcher-supplies.js +28 -0
- package/dist/core/mint.js +2 -2
- package/dist/core/payload.d.ts +13 -14
- package/dist/core/payload.js +9 -8
- package/dist/core/presentations.d.ts +37 -37
- package/dist/core/presentations.js +49 -56
- package/dist/core/reports.d.ts +5 -0
- package/dist/core/reports.js +13 -0
- package/dist/core/resource-registry.d.ts +54 -0
- package/dist/core/resource-registry.js +57 -0
- package/dist/core/resource-reports.d.ts +36 -0
- package/dist/core/resource-reports.js +38 -0
- package/dist/core/resource.d.ts +135 -243
- package/dist/core/resource.js +7 -5
- package/dist/core/resources-of.d.ts +16 -0
- package/dist/core/resources-of.js +8 -0
- package/dist/core/resources.d.ts +96 -84
- package/dist/core/resources.js +168 -165
- package/dist/core/run-directory.d.ts +10 -11
- package/dist/core/run-directory.js +9 -9
- package/dist/core/run-state.d.ts +29 -41
- package/dist/core/run-state.js +56 -60
- package/dist/core/run.d.ts +77 -66
- package/dist/core/run.js +83 -74
- package/dist/core/state-directory.js +4 -3
- package/dist/core/timeline.d.ts +42 -24
- package/dist/core/timeline.js +45 -27
- package/dist/core/timing.d.ts +3 -3
- package/dist/core/timing.js +1 -1
- package/dist/credential/gateways.d.ts +1 -80
- package/dist/credential/index.d.ts +3 -5
- package/dist/credential/index.js +7 -5
- package/dist/credential/live/github-actions-token-response.js +1 -1
- package/dist/credential/live/vercel-cli-gateway.d.ts +2 -1
- package/dist/credential/live/vercel-cli-gateway.js +1 -1
- package/dist/credential/live/vercel-output.d.ts +1 -1
- package/dist/credential/source.d.ts +16 -59
- package/dist/credential/source.js +21 -7
- package/dist/credential/target.d.ts +1 -1
- package/dist/extension-commands.d.ts +14 -0
- package/dist/extension-commands.js +20 -0
- package/dist/extensions/github/definition.d.ts +26 -0
- package/dist/extensions/github/definition.js +29 -0
- package/dist/extensions/github/extension.d.ts +18 -0
- package/dist/extensions/github/extension.js +6 -0
- package/dist/{resources → extensions}/github/fixture-repo.d.ts +11 -8
- package/dist/{resources → extensions}/github/fixture-repo.js +8 -4
- package/dist/extensions/github/index.d.ts +13 -0
- package/dist/extensions/github/index.js +17 -0
- package/dist/extensions/github/lifecycle.d.ts +30 -0
- package/dist/extensions/github/lifecycle.js +69 -0
- package/dist/extensions/github/live/world.d.ts +6 -0
- package/dist/extensions/github/live/world.js +16 -0
- package/dist/extensions/github/options.d.ts +36 -0
- package/dist/extensions/github/options.js +36 -0
- package/dist/extensions/github/refusals.d.ts +32 -0
- package/dist/extensions/github/refusals.js +43 -0
- package/dist/extensions/github/release.d.ts +17 -0
- package/dist/extensions/github/release.js +34 -0
- package/dist/extensions/github/resource.d.ts +36 -0
- package/dist/extensions/github/resource.js +21 -0
- package/dist/extensions/github/run/payload.d.ts +27 -0
- package/dist/extensions/github/run/payload.js +42 -0
- package/dist/extensions/github/world.d.ts +15 -0
- package/dist/extensions/github/world.js +3 -0
- package/dist/extensions/testserver/canceled.d.ts +7 -0
- package/dist/extensions/testserver/canceled.js +27 -0
- package/dist/extensions/testserver/command-tree.d.ts +6 -0
- package/dist/extensions/testserver/command-tree.js +21 -0
- package/dist/extensions/testserver/commands/app.d.ts +22 -0
- package/dist/extensions/testserver/commands/app.js +5 -0
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/command.d.ts +277 -237
- package/dist/extensions/testserver/commands/pool/create/command.js +352 -0
- package/dist/extensions/testserver/commands/pool/create/metadata.d.ts +33 -0
- package/dist/extensions/testserver/commands/pool/create/metadata.js +55 -0
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/outcomes.d.ts +132 -112
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/outcomes.js +6 -24
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/command.d.ts +3 -4
- package/dist/extensions/testserver/commands/pool/list/command.js +203 -0
- package/dist/extensions/testserver/commands/pool/list/metadata.d.ts +11 -0
- package/dist/extensions/testserver/commands/pool/list/metadata.js +15 -0
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/outcomes.js +1 -1
- package/dist/extensions/testserver/commands/pool/metadata.d.ts +3 -0
- package/dist/extensions/testserver/commands/pool/metadata.js +7 -0
- package/dist/extensions/testserver/commands/tree.d.ts +2 -0
- package/dist/extensions/testserver/commands/tree.js +6 -0
- package/dist/{resources → extensions}/testserver/credential-facts.d.ts +6 -40
- package/dist/{resources → extensions}/testserver/credential-facts.js +13 -35
- package/dist/extensions/testserver/definition.d.ts +57 -0
- package/dist/extensions/testserver/definition.js +71 -0
- package/dist/{resources → extensions}/testserver/events.d.ts +5 -4
- package/dist/extensions/testserver/events.js +4 -0
- package/dist/extensions/testserver/extension.d.ts +46 -0
- package/dist/extensions/testserver/extension.js +68 -0
- package/dist/extensions/testserver/index.d.ts +20 -0
- package/dist/extensions/testserver/index.js +31 -0
- package/dist/extensions/testserver/lifecycle.d.ts +24 -0
- package/dist/extensions/testserver/lifecycle.js +116 -0
- package/dist/{core → extensions/testserver}/limit.js +1 -0
- package/dist/extensions/testserver/live/world.d.ts +8 -0
- package/dist/extensions/testserver/live/world.js +38 -0
- package/dist/{resources/testserver/sandbox → extensions/testserver/options}/channels.d.ts +1 -1
- package/dist/extensions/testserver/options/index.d.ts +5 -0
- package/dist/extensions/testserver/options/index.js +11 -0
- package/dist/extensions/testserver/options/rules.d.ts +69 -0
- package/dist/extensions/testserver/options/rules.js +92 -0
- package/dist/extensions/testserver/options/sandboxes.d.ts +29 -0
- package/dist/extensions/testserver/options/sandboxes.js +33 -0
- package/dist/extensions/testserver/options/ttl.d.ts +23 -0
- package/dist/extensions/testserver/options/ttl.js +42 -0
- package/dist/{resources → extensions}/testserver/pool/channels.d.ts +3 -3
- package/dist/{resources → extensions}/testserver/pool/channels.js +2 -2
- package/dist/{resources → extensions}/testserver/pool/create.d.ts +1 -2
- package/dist/{resources → extensions}/testserver/pool/create.js +2 -1
- package/dist/{resources → extensions}/testserver/pool/index.d.ts +0 -1
- package/dist/{resources → extensions}/testserver/pool/index.js +2 -3
- package/dist/{resources → extensions}/testserver/pool/inspect.d.ts +1 -1
- package/dist/{resources → extensions}/testserver/pool/lease.d.ts +1 -1
- package/dist/extensions/testserver/pool/live/pool-store-gateway.d.ts +12 -0
- package/dist/{resources → extensions}/testserver/pool/live/pool-store-gateway.js +4 -4
- package/dist/{resources → extensions}/testserver/pool/pull-request.d.ts +8 -5
- package/dist/{resources → extensions}/testserver/pool/pull-request.js +2 -2
- package/dist/extensions/testserver/pr-build-facts.d.ts +156 -0
- package/dist/extensions/testserver/pr-build-facts.js +309 -0
- package/dist/extensions/testserver/presentation.d.ts +11 -0
- package/dist/{resources → extensions}/testserver/presentation.js +35 -56
- package/dist/{resources/testserver/lane.d.ts → extensions/testserver/progress.d.ts} +10 -6
- package/dist/{resources/testserver/lane.js → extensions/testserver/progress.js} +21 -16
- package/dist/extensions/testserver/provision.d.ts +160 -0
- package/dist/{resources/testserver/provider.js → extensions/testserver/provision.js} +80 -108
- package/dist/{resources → extensions}/testserver/pull-request/gateways.d.ts +1 -1
- package/dist/extensions/testserver/pull-request/gateways.js +5 -0
- package/dist/{resources → extensions}/testserver/pull-request/index.js +2 -2
- package/dist/{resources → extensions}/testserver/pull-request/live/github-token-gateway.d.ts +4 -4
- package/dist/{resources → extensions}/testserver/pull-request/live/github-token-gateway.js +4 -4
- package/dist/extensions/testserver/refusals.d.ts +72 -0
- package/dist/extensions/testserver/refusals.js +117 -0
- package/dist/extensions/testserver/release.d.ts +14 -0
- package/dist/extensions/testserver/release.js +26 -0
- package/dist/extensions/testserver/resource.d.ts +57 -0
- package/dist/extensions/testserver/resource.js +19 -0
- package/dist/extensions/testserver/result.d.ts +55 -0
- package/dist/extensions/testserver/result.js +98 -0
- package/dist/extensions/testserver/run/connection.d.ts +21 -0
- package/dist/extensions/testserver/run/connection.js +39 -0
- package/dist/extensions/testserver/run-sandbox.d.ts +16 -0
- package/dist/extensions/testserver/run-sandbox.js +11 -0
- package/dist/{resources → extensions}/testserver/sandbox/create.d.ts +1 -11
- package/dist/{resources → extensions}/testserver/sandbox/create.js +0 -15
- package/dist/{resources → extensions}/testserver/sandbox/gateways.d.ts +1 -1
- package/dist/{resources → extensions}/testserver/sandbox/index.d.ts +1 -3
- package/dist/extensions/testserver/sandbox/index.js +6 -0
- package/dist/extensions/testserver/testserver-sdk.d.ts +1 -0
- package/dist/extensions/testserver/testserver-sdk.js +4 -0
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/arguments.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/context.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/driver.d.ts +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/gateways.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/index.js +4 -4
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/invocation.d.ts +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/invocation.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/redaction.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/report.d.ts +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/report.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/verbose.js +1 -1
- package/dist/extensions/testserver/vitest/config.d.ts +28 -0
- package/dist/extensions/testserver/vitest/config.js +39 -0
- package/dist/{vitest → extensions/testserver/vitest}/container-scope.d.ts +33 -15
- package/dist/{vitest → extensions/testserver/vitest}/container-scope.js +75 -14
- package/dist/extensions/testserver/vitest/container-start.d.ts +19 -0
- package/dist/extensions/testserver/vitest/container-start.js +31 -0
- package/dist/{vitest → extensions/testserver/vitest}/diagnostics.d.ts +72 -29
- package/dist/{vitest → extensions/testserver/vitest}/diagnostics.js +151 -52
- package/dist/{vitest → extensions/testserver/vitest}/fixtures.d.ts +8 -5
- package/dist/{vitest → extensions/testserver/vitest}/fixtures.js +45 -22
- package/dist/extensions/testserver/vitest/index.d.ts +3 -0
- package/dist/extensions/testserver/vitest/index.js +10 -0
- package/dist/extensions/testserver/vitest/sandbox.d.ts +25 -0
- package/dist/extensions/testserver/vitest/sandbox.js +43 -0
- package/dist/{vitest → extensions/testserver/vitest}/types.d.ts +1 -1
- package/dist/extensions/testserver/world.d.ts +25 -0
- package/dist/extensions/testserver/world.js +4 -0
- package/dist/extensions.d.ts +153 -0
- package/dist/extensions.js +53 -0
- package/dist/help-logo.js +5 -5
- package/dist/launch.js +46 -0
- package/dist/launcher-resolvers/index.d.ts +1 -0
- package/dist/launcher-resolvers/index.js +7 -0
- package/dist/live-app.d.ts +9 -0
- package/dist/live-app.js +25 -0
- package/dist/presentation.js +2 -2
- package/dist/runner/base.js +1 -1
- package/dist/runner/context.js +1 -1
- package/dist/runner/events.js +1 -1
- package/dist/runner/gateways.d.ts +11 -11
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/index.d.ts +4 -4
- package/dist/runner/index.js +1 -1
- package/dist/runner/live/sandbox-gateway.js +4 -4
- package/dist/runner/live/terminal.d.ts +1 -1
- package/dist/runner/live/terminal.js +1 -1
- package/dist/runner/prepare.d.ts +13 -12
- package/dist/runner/prepare.js +3 -3
- package/dist/runner/ready.js +2 -2
- package/dist/runner/recipe.d.ts +24 -20
- package/dist/runner/recipe.js +19 -17
- package/dist/runner/{remote-command.d.ts → sandboxed-command.d.ts} +18 -19
- package/dist/runner/{remote-command.js → sandboxed-command.js} +21 -22
- package/dist/runner/scope.d.ts +3 -3
- package/dist/runner/secrets.js +1 -1
- package/dist/runner/snapshot-key.d.ts +1 -1
- package/dist/runner/snapshot-key.js +4 -4
- package/dist/runner/snapshot-save.js +3 -3
- package/dist/sdk/extension/commands.d.ts +71 -0
- package/dist/sdk/extension/commands.js +31 -0
- package/dist/{credential/diagnosis.d.ts → sdk/extension/credential-diagnosis.d.ts} +1 -7
- package/dist/{credential/diagnosis.js → sdk/extension/credential-diagnosis.js} +2 -11
- package/dist/sdk/extension/credential-source.d.ts +132 -0
- package/dist/sdk/extension/credential-source.js +5 -0
- package/dist/{credential → sdk/extension}/credential.d.ts +8 -7
- package/dist/{credential → sdk/extension}/credential.js +9 -6
- package/dist/sdk/extension/index.d.ts +15 -0
- package/dist/sdk/extension/index.js +39 -0
- package/dist/sdk/extension/launcher-supplies.d.ts +24 -0
- package/dist/sdk/extension/launcher-supplies.js +3 -0
- package/dist/sdk/extension/lifecycle.d.ts +211 -0
- package/dist/sdk/extension/lifecycle.js +9 -0
- package/dist/sdk/extension/presentation.d.ts +31 -0
- package/dist/sdk/extension/presentation.js +7 -0
- package/dist/sdk/extension/progress.d.ts +75 -0
- package/dist/sdk/extension/progress.js +8 -0
- package/dist/sdk/extension/reports.d.ts +15 -0
- package/dist/sdk/extension/reports.js +5 -0
- package/dist/sdk/extension/resource-definition.d.ts +204 -0
- package/dist/sdk/extension/resource-definition.js +24 -0
- package/dist/sdk/extension/resource-factory.d.ts +10 -0
- package/dist/sdk/extension/resource-factory.js +15 -0
- package/dist/sdk/extension/resource.d.ts +60 -0
- package/dist/sdk/extension/resource.js +42 -0
- package/dist/sdk/extension/rules.d.ts +16 -0
- package/dist/sdk/extension/rules.js +30 -0
- package/dist/sdk/extension/span.d.ts +8 -0
- package/dist/sdk/extension/span.js +4 -0
- package/dist/sdk/extension/time.d.ts +11 -0
- package/dist/sdk/extension/time.js +4 -0
- package/dist/sdk/extension/token-request-facts.d.ts +39 -0
- package/dist/sdk/extension/token-request-facts.js +35 -0
- package/dist/sdk/index.d.ts +4 -7
- package/dist/sdk/index.js +7 -15
- package/dist/sdk/run/contract.d.ts +32 -0
- package/dist/sdk/run/contract.js +12 -0
- package/dist/sdk/run/launcher.d.ts +5 -0
- package/dist/sdk/run/launcher.js +6 -0
- package/dist/sdk/run/payload.d.ts +58 -0
- package/dist/sdk/run/payload.js +73 -0
- package/dist/sdk/run/present.d.ts +11 -0
- package/dist/sdk/run/present.js +4 -0
- package/dist/sdk/run/redact.d.ts +5 -0
- package/dist/sdk/run/redact.js +12 -0
- package/dist/time/duration.js +2 -2
- package/dist/time/index.js +2 -1
- package/dist/time/time.d.ts +2 -11
- package/dist/time/time.js +2 -2
- package/dist/{sdk → vendor/testserver-sdk}/container/api-request.d.ts +14 -2
- package/dist/vendor/testserver-sdk/container/api-request.js +68 -0
- package/dist/{sdk → vendor/testserver-sdk}/container/container.d.ts +74 -24
- package/dist/{sdk → vendor/testserver-sdk}/container/container.js +180 -90
- package/dist/vendor/testserver-sdk/container/external.d.ts +111 -0
- package/dist/vendor/testserver-sdk/container/external.js +76 -0
- package/dist/vendor/testserver-sdk/container/gateways.d.ts +156 -0
- package/dist/{sdk → vendor/testserver-sdk}/container/index.d.ts +2 -1
- package/dist/{sdk → vendor/testserver-sdk}/container/index.js +2 -1
- package/dist/vendor/testserver-sdk/container/live/container-gateway.d.ts +22 -0
- package/dist/vendor/testserver-sdk/container/live/container-gateway.js +165 -0
- package/dist/vendor/testserver-sdk/container/recorder.d.ts +69 -0
- package/dist/vendor/testserver-sdk/container/recorder.js +121 -0
- package/dist/{sdk → vendor/testserver-sdk}/factories/build.d.ts +33 -12
- package/dist/{sdk → vendor/testserver-sdk}/factories/build.js +36 -14
- package/dist/vendor/testserver-sdk/factories/definition.d.ts +39 -0
- package/dist/{sdk → vendor/testserver-sdk}/factories/definition.js +1 -1
- package/dist/{sdk → vendor/testserver-sdk}/factories/definitions.d.ts +7 -4
- package/dist/{sdk → vendor/testserver-sdk}/factories/definitions.js +10 -0
- package/dist/vendor/testserver-sdk/factories/gateways.d.ts +31 -0
- package/dist/vendor/testserver-sdk/factories/index.d.ts +4 -0
- package/dist/{sdk → vendor/testserver-sdk}/factories/index.js +3 -3
- package/dist/vendor/testserver-sdk/index.d.ts +6 -0
- package/dist/vendor/testserver-sdk/index.js +11 -0
- package/dist/{sdk → vendor/testserver-sdk}/proxy/exchange.d.ts +2 -1
- package/dist/{sdk → vendor/testserver-sdk}/proxy/exchange.js +8 -4
- package/dist/{sdk → vendor/testserver-sdk}/proxy/faulted-exchange.js +7 -2
- package/dist/{sdk → vendor/testserver-sdk}/proxy/faults.d.ts +2 -1
- package/dist/{sdk → vendor/testserver-sdk}/proxy/records.d.ts +10 -1
- package/dist/{sdk → vendor/testserver-sdk}/proxy/records.js +13 -0
- package/dist/{sdk → vendor/testserver-sdk}/records/index.d.ts +1 -1
- package/dist/{sdk → vendor/testserver-sdk}/records/records.d.ts +17 -1
- package/dist/vendor/testserver-sdk/testserver/external-ids.d.ts +38 -0
- package/dist/vendor/testserver-sdk/testserver/external-ids.js +46 -0
- package/dist/vendor/testserver-sdk/testserver/failure.d.ts +101 -0
- package/dist/vendor/testserver-sdk/testserver/failure.js +108 -0
- package/dist/vendor/testserver-sdk/testserver/index.d.ts +7 -0
- package/dist/vendor/testserver-sdk/testserver/index.js +11 -0
- package/dist/{sdk → vendor/testserver-sdk}/testserver/live/request.d.ts +8 -10
- package/dist/{sdk → vendor/testserver-sdk}/testserver/live/request.js +8 -6
- package/dist/vendor/testserver-sdk/testserver/routes.d.ts +60 -0
- package/dist/vendor/testserver-sdk/testserver/routes.js +84 -0
- package/dist/vendor/testserver-sdk/testserver/service-ids.d.ts +31 -0
- package/dist/{sdk → vendor/testserver-sdk}/testserver/service-ids.js +27 -4
- package/dist/version.d.ts +2 -2
- package/dist/version.js +10 -11
- package/dist/vitest/config.d.ts +2 -32
- package/dist/vitest/config.js +6 -40
- package/dist/vitest/gateways.js +1 -1
- package/dist/vitest/index.d.ts +2 -3
- package/dist/vitest/index.js +5 -9
- package/dist/vitest/plan.d.ts +1 -16
- package/dist/vitest/plan.js +4 -36
- package/dist/vitest/test-events.d.ts +1 -18
- package/dist/vitest/test-events.js +2 -31
- package/package.json +53 -23
- package/skills/overview.md +9 -9
- package/skills/read-run-output.md +25 -2
- package/skills/testserver-builds.md +8 -8
- package/bin/node-version.js +0 -24
- package/dist/closed-terminal.d.ts +0 -7
- package/dist/closed-terminal.js +0 -18
- package/dist/combine-errors.d.ts +0 -11
- package/dist/combine-errors.js +0 -19
- package/dist/commands/exec/testserver-flags.d.ts +0 -48
- package/dist/commands/exec/testserver-flags.js +0 -80
- package/dist/config/by-name.d.ts +0 -24
- package/dist/config/by-name.js +0 -26
- package/dist/config/resource-config.d.ts +0 -132
- package/dist/config/resource-config.js +0 -19
- package/dist/config/set.d.ts +0 -27
- package/dist/config/set.js +0 -71
- package/dist/core/command-provider.d.ts +0 -126
- package/dist/core/command-provider.js +0 -13
- package/dist/core/command-slots.d.ts +0 -73
- package/dist/core/command-slots.js +0 -140
- package/dist/core/keyed.d.ts +0 -12
- package/dist/core/keyed.js +0 -24
- package/dist/core/lane.d.ts +0 -46
- package/dist/core/lane.js +0 -5
- package/dist/core/presentation.d.ts +0 -87
- package/dist/core/presentation.js +0 -5
- package/dist/core/provider.d.ts +0 -69
- package/dist/core/provider.js +0 -5
- package/dist/resources/github/cleanup.d.ts +0 -23
- package/dist/resources/github/cleanup.js +0 -39
- package/dist/resources/github/command.d.ts +0 -126
- package/dist/resources/github/command.js +0 -117
- package/dist/resources/github/config.d.ts +0 -16
- package/dist/resources/github/config.js +0 -37
- package/dist/resources/github/events.d.ts +0 -26
- package/dist/resources/github/events.js +0 -2
- package/dist/resources/github/index.d.ts +0 -12
- package/dist/resources/github/index.js +0 -15
- package/dist/resources/github/live/gateways.d.ts +0 -6
- package/dist/resources/github/live/gateways.js +0 -13
- package/dist/resources/github/presentation.d.ts +0 -13
- package/dist/resources/github/presentation.js +0 -43
- package/dist/resources/github/provider.d.ts +0 -66
- package/dist/resources/github/provider.js +0 -58
- package/dist/resources/github/resource-provider.d.ts +0 -6
- package/dist/resources/github/resource-provider.js +0 -20
- package/dist/resources/github/resource.d.ts +0 -33
- package/dist/resources/github/resource.js +0 -12
- package/dist/resources/testserver/cleanup.d.ts +0 -14
- package/dist/resources/testserver/cleanup.js +0 -22
- package/dist/resources/testserver/command.d.ts +0 -520
- package/dist/resources/testserver/command.js +0 -252
- package/dist/resources/testserver/commands/app.d.ts +0 -18
- package/dist/resources/testserver/commands/app.js +0 -3
- package/dist/resources/testserver/commands/create/command.js +0 -208
- package/dist/resources/testserver/commands/create/metadata.d.ts +0 -31
- package/dist/resources/testserver/commands/create/metadata.js +0 -49
- package/dist/resources/testserver/commands/list/command.js +0 -56
- package/dist/resources/testserver/commands/list/metadata.d.ts +0 -9
- package/dist/resources/testserver/commands/list/metadata.js +0 -9
- package/dist/resources/testserver/config.d.ts +0 -18
- package/dist/resources/testserver/config.js +0 -88
- package/dist/resources/testserver/events.js +0 -4
- package/dist/resources/testserver/index.d.ts +0 -16
- package/dist/resources/testserver/index.js +0 -25
- package/dist/resources/testserver/live/gateways.d.ts +0 -8
- package/dist/resources/testserver/live/gateways.js +0 -39
- package/dist/resources/testserver/options.d.ts +0 -5
- package/dist/resources/testserver/options.js +0 -5
- package/dist/resources/testserver/pool/directory.d.ts +0 -4
- package/dist/resources/testserver/pool/directory.js +0 -5
- package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +0 -12
- package/dist/resources/testserver/pr-build-facts.d.ts +0 -130
- package/dist/resources/testserver/pr-build-facts.js +0 -261
- package/dist/resources/testserver/presentation.d.ts +0 -9
- package/dist/resources/testserver/provider.d.ts +0 -187
- package/dist/resources/testserver/pull-request/gateways.js +0 -5
- package/dist/resources/testserver/ran.d.ts +0 -92
- package/dist/resources/testserver/ran.js +0 -156
- package/dist/resources/testserver/resource-provider.d.ts +0 -12
- package/dist/resources/testserver/resource-provider.js +0 -38
- package/dist/resources/testserver/resource.d.ts +0 -36
- package/dist/resources/testserver/resource.js +0 -10
- package/dist/resources/testserver/run-sandbox.d.ts +0 -13
- package/dist/resources/testserver/run-sandbox.js +0 -6
- package/dist/resources/testserver/sandbox/index.js +0 -8
- package/dist/resources.d.ts +0 -705
- package/dist/resources.js +0 -88
- package/dist/sdk/container/api-request.js +0 -46
- package/dist/sdk/container/gateways.d.ts +0 -108
- package/dist/sdk/container/live/container-gateway.d.ts +0 -17
- package/dist/sdk/container/live/container-gateway.js +0 -114
- package/dist/sdk/factories/definition.d.ts +0 -28
- package/dist/sdk/factories/gateways.d.ts +0 -25
- package/dist/sdk/factories/index.d.ts +0 -5
- package/dist/sdk/factories/live/factory-gateway.d.ts +0 -10
- package/dist/sdk/factories/live/factory-gateway.js +0 -29
- package/dist/sdk/payload/index.d.ts +0 -2
- package/dist/sdk/payload/index.js +0 -4
- package/dist/sdk/payload/payload.d.ts +0 -47
- package/dist/sdk/payload/payload.js +0 -74
- package/dist/sdk/testserver/failure.d.ts +0 -73
- package/dist/sdk/testserver/failure.js +0 -61
- package/dist/sdk/testserver/index.d.ts +0 -5
- package/dist/sdk/testserver/index.js +0 -8
- package/dist/sdk/testserver/service-ids.d.ts +0 -19
- package/dist/vitest/sandbox.d.ts +0 -16
- package/dist/vitest/sandbox.js +0 -35
- /package/dist/{credential/settle.js → config/credential-settle.js} +0 -0
- /package/dist/{resources → extensions}/github/gateways.d.ts +0 -0
- /package/dist/{resources → extensions}/github/gateways.js +0 -0
- /package/dist/{resources → extensions}/github/live/fixture-repo-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/github/live/fixture-repo-gateway.js +0 -0
- /package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/outcomes.d.ts +0 -0
- /package/dist/{core → extensions/testserver}/limit.d.ts +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/build-reference.d.ts +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/build-reference.js +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/channels.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/gateways.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/gateways.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/host.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/host.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/inspect.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/lease.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/live/pool-records.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/live/pool-records.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/staleness.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/staleness.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/index.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/github-rest.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/github-rest.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/pull-request-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/pull-request-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/testserver-workflow-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/testserver-workflow-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/create-failure.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/create-failure.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/gateways.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/builds-response.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/builds-response.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/control-plane-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/control-plane-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/create-response.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/create-response.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/fetch-failure.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/fetch-failure.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/health-check-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/health-check-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/sse.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/sse.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/ansi.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/ansi.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/arguments.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/auth-config.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/auth-config.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/clock.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/clock.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/config-files.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/config-files.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/context.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/driver.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/entry.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/entry.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/environment.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/environment.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/errors.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/errors.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/gateways.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/index.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/keys.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/keys.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/config-files.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/config-files.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/process-gateway.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/process-gateway.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/redaction.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/verbose.d.ts +0 -0
- /package/dist/{vitest → extensions/testserver/vitest}/types.js +0 -0
- /package/dist/sdk/{payload → run}/test-events.d.ts +0 -0
- /package/dist/sdk/{payload → run}/test-events.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/feature-flags.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/feature-flags.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/gateways.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/factories/gateways.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/faulted-exchange.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/faults.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/index.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/proxy.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/proxy.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/body.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/body.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/records.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/index.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/seed.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/seed.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/clock.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/clock.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/live/connect-failure.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/live/connect-failure.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/test-id.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/test-id.js +0 -0
|
@@ -0,0 +1,2023 @@
|
|
|
1
|
+
import {
|
|
2
|
+
versionText
|
|
3
|
+
} from "./chunk-I5GZLOLQ.js";
|
|
4
|
+
import {
|
|
5
|
+
testsChart,
|
|
6
|
+
testsSummaryLines,
|
|
7
|
+
waterfallLines
|
|
8
|
+
} from "./chunk-JQ2HK4RN.js";
|
|
9
|
+
import {
|
|
10
|
+
NodeSignalCancellation
|
|
11
|
+
} from "./chunk-WF4KJ7YG.js";
|
|
12
|
+
import {
|
|
13
|
+
RESOURCE_FLAG_HELP,
|
|
14
|
+
RESOURCE_USAGE_FLAGS,
|
|
15
|
+
criticalPathStep,
|
|
16
|
+
recordedPlan,
|
|
17
|
+
resourceFlagFields,
|
|
18
|
+
resourceFlagProblems,
|
|
19
|
+
resourceFlagValues,
|
|
20
|
+
runRecordText,
|
|
21
|
+
saveSchema,
|
|
22
|
+
testPlanLine,
|
|
23
|
+
testTotals,
|
|
24
|
+
timelineFacts,
|
|
25
|
+
timelineSchema
|
|
26
|
+
} from "./chunk-H2VCSNVU.js";
|
|
27
|
+
import {
|
|
28
|
+
EMPTY_RUN_STATE,
|
|
29
|
+
RESOURCES,
|
|
30
|
+
RESOURCE_PRESENTATIONS,
|
|
31
|
+
RESOURCE_REPORTS,
|
|
32
|
+
RUN_CLEANUP,
|
|
33
|
+
RUN_DIRECTORIES_KEPT,
|
|
34
|
+
applyStormEvent,
|
|
35
|
+
cleanupProblems,
|
|
36
|
+
commandExitStatus,
|
|
37
|
+
executeRun,
|
|
38
|
+
isoSecondsText,
|
|
39
|
+
keepTimeText,
|
|
40
|
+
keptText,
|
|
41
|
+
megabytesText,
|
|
42
|
+
notDeletedText,
|
|
43
|
+
notKeptText,
|
|
44
|
+
notStoppedText,
|
|
45
|
+
observeAll,
|
|
46
|
+
paint,
|
|
47
|
+
releaseText,
|
|
48
|
+
resourceLifecycles,
|
|
49
|
+
runDirectoryObserver,
|
|
50
|
+
runnerCleanupWarnings,
|
|
51
|
+
seconds,
|
|
52
|
+
secondsOf,
|
|
53
|
+
secondsText,
|
|
54
|
+
short,
|
|
55
|
+
shortFile,
|
|
56
|
+
spread,
|
|
57
|
+
stepLog,
|
|
58
|
+
stormTimeline,
|
|
59
|
+
testEventsPath,
|
|
60
|
+
timedProgress,
|
|
61
|
+
truncate,
|
|
62
|
+
visibleLength,
|
|
63
|
+
warningTally
|
|
64
|
+
} from "./chunk-AGWW3HDT.js";
|
|
65
|
+
import {
|
|
66
|
+
RUNNER_SECRET_MIN_LENGTH,
|
|
67
|
+
configErrors,
|
|
68
|
+
credentialErrors,
|
|
69
|
+
fileSettings,
|
|
70
|
+
invalidConfig,
|
|
71
|
+
loadSettingsFile,
|
|
72
|
+
mintTargetText,
|
|
73
|
+
parseKeepTime,
|
|
74
|
+
parseTestEvent,
|
|
75
|
+
prepareRunner,
|
|
76
|
+
readRunnerSecrets,
|
|
77
|
+
recipeRun,
|
|
78
|
+
redactSecrets,
|
|
79
|
+
requireTarget,
|
|
80
|
+
settleCredential,
|
|
81
|
+
settleRunResources,
|
|
82
|
+
testEventLine
|
|
83
|
+
} from "./chunk-VJQLMGOH.js";
|
|
84
|
+
import {
|
|
85
|
+
describeMintFailure
|
|
86
|
+
} from "./chunk-XHJGHJBW.js";
|
|
87
|
+
import {
|
|
88
|
+
defineErrors,
|
|
89
|
+
defineOutcomes,
|
|
90
|
+
refused,
|
|
91
|
+
renderOutcome
|
|
92
|
+
} from "./chunk-ZJ2USLAT.js";
|
|
93
|
+
|
|
94
|
+
// src/commands/exec/outcomes.ts
|
|
95
|
+
import { z as z3 } from "zod";
|
|
96
|
+
|
|
97
|
+
// src/commands/exec/mint-failed.ts
|
|
98
|
+
import { z } from "zod";
|
|
99
|
+
var mintFailedErrors = defineErrors({
|
|
100
|
+
mintFailed: {
|
|
101
|
+
exitCode: 1,
|
|
102
|
+
description: "The vercel CLI couldn't mint a credential, so the command didn't run. In a sandboxed run, the credential was for the runner sandbox, which always needs one; in an unsandboxed run, for a resource that couldn't go on without it.",
|
|
103
|
+
schema: z.object({
|
|
104
|
+
team: z.string(),
|
|
105
|
+
project: z.string(),
|
|
106
|
+
cause: z.string(),
|
|
107
|
+
fix: z.string(),
|
|
108
|
+
/** Whether the credential was for the runner sandbox, not for a resource. */
|
|
109
|
+
runner: z.boolean(),
|
|
110
|
+
/** What the run couldn't clean up. */
|
|
111
|
+
cleanup: RUN_CLEANUP.schema
|
|
112
|
+
}),
|
|
113
|
+
render: ({ cause, fix, runner, cleanup }) => {
|
|
114
|
+
const rows = RUN_CLEANUP.rows(cleanup);
|
|
115
|
+
return {
|
|
116
|
+
message: runner ? `Couldn't mint a credential for the runner sandbox: ${cause}. The command didn't run.` : `Couldn't mint a credential: ${cause}. One of the run's resources needed it, so the command didn't run.`,
|
|
117
|
+
...rows.length === 0 ? {} : { rows },
|
|
118
|
+
next: [{ type: "text", text: fix }]
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// src/commands/exec/resource-refusals.ts
|
|
125
|
+
import { z as z2 } from "zod";
|
|
126
|
+
var refusalShape = {
|
|
127
|
+
/** The resource instance that refused, by its resource key. */
|
|
128
|
+
resource: z2.string().min(1),
|
|
129
|
+
/** The resource's own snake_case reason for refusing. */
|
|
130
|
+
refusal: z2.string(),
|
|
131
|
+
/** The resource's own data about the refusal, which differs by resource and reason. */
|
|
132
|
+
data: z2.record(z2.string(), z2.unknown())
|
|
133
|
+
};
|
|
134
|
+
function contentOf({ message, next, rows: own = [] }, rows) {
|
|
135
|
+
const all = [...own, ...rows];
|
|
136
|
+
return { message, ...next === void 0 ? {} : { next }, ...all.length === 0 ? {} : { rows: all } };
|
|
137
|
+
}
|
|
138
|
+
var resourceRefusalErrors = defineErrors({
|
|
139
|
+
resourceRefusedBeforeRun: {
|
|
140
|
+
exitCode: 2,
|
|
141
|
+
description: "A resource's beforeRun refused the run before it started, so nothing was minted, acquired or started. data.resource names the resource by its key, data.refusal is the resource's own reason, and data.data its own data.",
|
|
142
|
+
schema: z2.object({
|
|
143
|
+
...refusalShape,
|
|
144
|
+
/** The config file that applied (its absolute path); null when none did. */
|
|
145
|
+
configFile: z2.string().nullable()
|
|
146
|
+
}),
|
|
147
|
+
render: (_data, refusal) => contentOf(refusal, [])
|
|
148
|
+
},
|
|
149
|
+
resourceRefused: {
|
|
150
|
+
exitCode: 1,
|
|
151
|
+
description: "A resource refused while the run acquired its resources, so the command didn't run. data.resource names the resource by its key, data.refusal is the resource's own reason, and data.data its own data.",
|
|
152
|
+
schema: z2.object({
|
|
153
|
+
...refusalShape,
|
|
154
|
+
/** What the run couldn't clean up. */
|
|
155
|
+
cleanup: RUN_CLEANUP.schema
|
|
156
|
+
}),
|
|
157
|
+
render: ({ cleanup }, refusal) => contentOf(refusal, RUN_CLEANUP.rows(cleanup))
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
function resourceRefusedBeforeRun(resource, refusal, configFile) {
|
|
161
|
+
const { refused: refused2, data, ...content } = refusal;
|
|
162
|
+
return resourceRefusalErrors.resourceRefusedBeforeRun(
|
|
163
|
+
{ resource, refusal: refused2, data: { ...data }, configFile },
|
|
164
|
+
content
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
function resourceRefused(outcome, cleanup) {
|
|
168
|
+
const { refused: refused2, data, ...content } = outcome.refusal;
|
|
169
|
+
return resourceRefusalErrors.resourceRefused(
|
|
170
|
+
{ resource: outcome.resource, refusal: refused2, data: { ...data }, cleanup },
|
|
171
|
+
content
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// src/commands/exec/outcomes.ts
|
|
176
|
+
var runnerFailureSchema = z3.union([
|
|
177
|
+
z3.object({
|
|
178
|
+
kind: z3.enum(["snapshot-build-step-failed", "apply-failed", "install-failed", "build-failed"]),
|
|
179
|
+
/** The step's label. */
|
|
180
|
+
label: z3.string(),
|
|
181
|
+
/** Its exit code; null when it ended without one. */
|
|
182
|
+
exitCode: z3.number().nullable(),
|
|
183
|
+
/** Its last 40 output lines. */
|
|
184
|
+
tail: z3.array(z3.string())
|
|
185
|
+
}),
|
|
186
|
+
z3.object({
|
|
187
|
+
kind: z3.literal("sandbox-api-failed"),
|
|
188
|
+
/** The Sandbox call that failed. */
|
|
189
|
+
operation: z3.string(),
|
|
190
|
+
/** The HTTP status the Sandbox API answered; null when it answered none. */
|
|
191
|
+
status: z3.number().nullable(),
|
|
192
|
+
message: z3.string()
|
|
193
|
+
}),
|
|
194
|
+
z3.object({
|
|
195
|
+
kind: z3.literal("checkout-failed"),
|
|
196
|
+
/** What git or tar said. */
|
|
197
|
+
message: z3.string(),
|
|
198
|
+
/** The failed command; null when there was none. */
|
|
199
|
+
command: z3.string().nullable()
|
|
200
|
+
}),
|
|
201
|
+
z3.object({ kind: z3.literal("credential-claims-missing"), team: z3.string(), project: z3.string() })
|
|
202
|
+
]);
|
|
203
|
+
function listed(names) {
|
|
204
|
+
if (names.length <= 1) return names.join("");
|
|
205
|
+
return `${names.slice(0, -1).join(", ")} and ${names.at(-1) ?? ""}`;
|
|
206
|
+
}
|
|
207
|
+
function stepEnded(exitCode) {
|
|
208
|
+
return exitCode === null ? "ended without an exit code" : `exited ${exitCode}`;
|
|
209
|
+
}
|
|
210
|
+
function runnerFailureText(failure) {
|
|
211
|
+
switch (failure.kind) {
|
|
212
|
+
case "snapshot-build-step-failed":
|
|
213
|
+
return {
|
|
214
|
+
message: `The runner snapshot build's step "${failure.label}" ${stepEnded(failure.exitCode)}. The command didn't run.`,
|
|
215
|
+
next: "Fix the step in the runner recipe, then retry. A failed build records no runner snapshot."
|
|
216
|
+
};
|
|
217
|
+
case "apply-failed":
|
|
218
|
+
return {
|
|
219
|
+
message: `Couldn't apply your changes in the runner sandbox: "${failure.label}" ${stepEnded(failure.exitCode)}. The command didn't run.`,
|
|
220
|
+
next: "Check the output for the file that didn't apply, then retry."
|
|
221
|
+
};
|
|
222
|
+
case "install-failed":
|
|
223
|
+
return {
|
|
224
|
+
message: `The runner's install, "${failure.label}", ${stepEnded(failure.exitCode)}. The command didn't run.`,
|
|
225
|
+
next: "Fix run.install in the runner recipe, or what it installs, then retry."
|
|
226
|
+
};
|
|
227
|
+
case "build-failed":
|
|
228
|
+
return {
|
|
229
|
+
message: `The runner's build, "${failure.label}", ${stepEnded(failure.exitCode)}. The command didn't run.`,
|
|
230
|
+
next: "Fix the build, or run.build in the runner recipe, then retry."
|
|
231
|
+
};
|
|
232
|
+
case "sandbox-api-failed":
|
|
233
|
+
return {
|
|
234
|
+
message: `A Vercel Sandbox call failed (${failure.operation}${failure.status === null ? "" : `, HTTP ${failure.status}`}): ${failure.message}. ${failure.operation === "run-command" ? "The command's outcome is unknown." : "The command didn't run."}`,
|
|
235
|
+
next: "Retry; if it keeps failing, check the Vercel Sandbox status and the project's Sandbox access."
|
|
236
|
+
};
|
|
237
|
+
case "checkout-failed":
|
|
238
|
+
return {
|
|
239
|
+
message: `git or tar failed on this machine: ${failure.message}. The command didn't run.`,
|
|
240
|
+
next: "Fix the checkout, then retry."
|
|
241
|
+
};
|
|
242
|
+
case "credential-claims-missing":
|
|
243
|
+
return {
|
|
244
|
+
message: `The credential minted for project ${failure.project} on team ${failure.team} names no team and project ids (its owner_id and project_id claims), so the runner sandbox can't use it. The command didn't run.`,
|
|
245
|
+
next: "Mint for a Vercel project whose development OIDC tokens carry owner_id and project_id, then retry."
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
var ranSchema = z3.object({
|
|
250
|
+
/** storm's version. */
|
|
251
|
+
version: z3.string(),
|
|
252
|
+
/** The git commit storm was built from, as its version line shows it (`3f2a9c1b7d4e`, `-dirty` appended when built from a tree with uncommitted changes); null when unknown. */
|
|
253
|
+
commit: z3.string().nullable(),
|
|
254
|
+
/** The config file the run's settings came from (its absolute path); null when none applied. */
|
|
255
|
+
configFile: z3.string().nullable(),
|
|
256
|
+
/**
|
|
257
|
+
* What each acquired resource instance that reports something says of itself, keyed by resource key: its
|
|
258
|
+
* definition's name (`definition`), its facts (`facts`, what its acquire answered, unknown to the schema, or null
|
|
259
|
+
* when it answered none) and the warnings its acquire reported (`warnings`).
|
|
260
|
+
*/
|
|
261
|
+
resources: RESOURCE_REPORTS.ranSchema,
|
|
262
|
+
/**
|
|
263
|
+
* What the run's cleanup left: the runner sandbox it kept running and the runner's sandboxes it couldn't stop or
|
|
264
|
+
* delete (`runner`, null without a runner sandbox), and what releasing each of its resource instances couldn't do,
|
|
265
|
+
* its warnings, keyed by resource key, each with its definition's name (`resources`, `{}` when it took none).
|
|
266
|
+
*/
|
|
267
|
+
cleanup: RUN_CLEANUP.schema,
|
|
268
|
+
/**
|
|
269
|
+
* How the command ended: its exit code, or the signal that ended it; both null for a command in the runner sandbox
|
|
270
|
+
* that ended without an exit code.
|
|
271
|
+
*/
|
|
272
|
+
command: z3.object({ exitCode: z3.number().nullable(), signal: z3.string().nullable() }),
|
|
273
|
+
/** The runner sandbox the command ran in; null without one. */
|
|
274
|
+
runner: z3.object({
|
|
275
|
+
/** The runner snapshot it started from. */
|
|
276
|
+
snapshotId: z3.string(),
|
|
277
|
+
/** The runner snapshot's base, a full SHA. */
|
|
278
|
+
base: z3.string(),
|
|
279
|
+
/** For a branch snapshot, the local branch of the run that saved it; null for a base snapshot. */
|
|
280
|
+
snapshotBranch: z3.string().nullable(),
|
|
281
|
+
/** For a branch snapshot, the HEAD commit of the run that saved it, a full SHA; null for a base snapshot. */
|
|
282
|
+
snapshotHead: z3.string().nullable(),
|
|
283
|
+
/** Whether this run built the runner snapshot. */
|
|
284
|
+
built: z3.boolean(),
|
|
285
|
+
vcpus: z3.number(),
|
|
286
|
+
region: z3.string(),
|
|
287
|
+
runtime: z3.string(),
|
|
288
|
+
/** How long the build step took, in milliseconds. */
|
|
289
|
+
buildMs: z3.number(),
|
|
290
|
+
/** How saving the runner sandbox as a branch snapshot ended (--save-snapshot); null without the flag. */
|
|
291
|
+
save: saveSchema.nullable()
|
|
292
|
+
}).nullable(),
|
|
293
|
+
/** The run's waterfall, as the run directory's timeline.json holds it: each lane's label, span and steps in milliseconds since the run started, how they ended, idle time, and the critical path. */
|
|
294
|
+
timeline: timelineSchema,
|
|
295
|
+
/** The run's run directory's run id, which `storm runs show` takes; null when the run couldn't make one. */
|
|
296
|
+
runId: z3.string().nullable()
|
|
297
|
+
});
|
|
298
|
+
var RAN_DESCRIPTION = "The command ran and ended. storm exits with its code, or 128 + n when signal n ended it, whatever this result's exit code.";
|
|
299
|
+
function renderRan(ran) {
|
|
300
|
+
const warnings = [
|
|
301
|
+
...RESOURCE_REPORTS.ranWarnings(ran.resources),
|
|
302
|
+
...ran.runner !== null && ran.command.exitCode === null && ran.command.signal === null ? [
|
|
303
|
+
{
|
|
304
|
+
reason: "sandboxed_no_exit_code",
|
|
305
|
+
message: "The command ended in the runner sandbox without an exit code, so storm exits 1."
|
|
306
|
+
}
|
|
307
|
+
] : [],
|
|
308
|
+
...runnerCleanupWarnings(ran.cleanup.runner),
|
|
309
|
+
...RESOURCE_REPORTS.cleanupWarnings(ran.cleanup.resources)
|
|
310
|
+
];
|
|
311
|
+
const kept = ran.cleanup.runner?.kept ?? null;
|
|
312
|
+
return renderOutcome({
|
|
313
|
+
...kept === null ? {} : { message: keptText(kept) },
|
|
314
|
+
...warnings.length === 0 ? {} : { warnings }
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
var runErrors = defineErrors({
|
|
318
|
+
credentialUnused: {
|
|
319
|
+
exitCode: 2,
|
|
320
|
+
description: "--credential was given to a run with no resource that takes a credential.",
|
|
321
|
+
schema: z3.object({
|
|
322
|
+
/** The flags given that none of the run's resources takes, as typed, such as --credential. */
|
|
323
|
+
flags: z3.array(z3.string()),
|
|
324
|
+
/** The config file that applied; null when none did. */
|
|
325
|
+
configFile: z3.string().nullable()
|
|
326
|
+
}),
|
|
327
|
+
render: ({ flags }) => ({
|
|
328
|
+
message: `${flags.join(", ")} ${flags.length === 1 ? "applies" : "apply"} only to a run with a resource that takes a credential, and this run has none.`,
|
|
329
|
+
next: [
|
|
330
|
+
{
|
|
331
|
+
type: "text",
|
|
332
|
+
text: `Drop ${flags.join(" and ")}, or give the run a resource that takes a credential, in storm.config.ts or on the command line.`
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
})
|
|
336
|
+
},
|
|
337
|
+
missingRunner: {
|
|
338
|
+
exitCode: 2,
|
|
339
|
+
description: "A sandboxed run (no --unsandboxed) needs a runner recipe, and no storm.config.ts gives a runner key.",
|
|
340
|
+
schema: z3.object({
|
|
341
|
+
/** The config file that applied; null when none did. */
|
|
342
|
+
configFile: z3.string().nullable()
|
|
343
|
+
}),
|
|
344
|
+
render: ({ configFile }) => ({
|
|
345
|
+
message: configFile === null ? "A sandboxed run needs a runner recipe, and no storm.config.ts applies." : `A sandboxed run needs a runner recipe, and ${configFile} has no runner key.`,
|
|
346
|
+
next: [
|
|
347
|
+
{
|
|
348
|
+
type: "text",
|
|
349
|
+
text: "Add a runner recipe under the runner key of storm.config.ts, or run on this machine with --unsandboxed."
|
|
350
|
+
}
|
|
351
|
+
]
|
|
352
|
+
})
|
|
353
|
+
},
|
|
354
|
+
runnerSecretsInvalid: {
|
|
355
|
+
exitCode: 2,
|
|
356
|
+
description: "In a sandboxed run, launcher environment variables the runner recipe's secrets key names can't be used, so the run didn't start: it minted, acquired and created nothing. Each variable has one problem, the first of: missing, unset or empty; multiline, its value holds a carriage return or a line feed, which line-by-line output would split past storm's redaction; short, its value holds fewer than 8 characters, and storm shows each value as <token> wherever it appears in what it prints and writes, so a value that short would hide ordinary output.",
|
|
357
|
+
schema: z3.object({
|
|
358
|
+
/** Each variable storm can't use and why, in the recipe's order. */
|
|
359
|
+
variables: z3.array(z3.object({ name: z3.string(), problem: z3.enum(["missing", "multiline", "short"]) })),
|
|
360
|
+
/** The fewest characters a runner secret's value may have. */
|
|
361
|
+
minLength: z3.number(),
|
|
362
|
+
/** The config file that gave the runner recipe. */
|
|
363
|
+
configFile: z3.string().nullable()
|
|
364
|
+
}),
|
|
365
|
+
render: ({ variables, minLength, configFile }) => {
|
|
366
|
+
const named = (problem) => variables.filter((variable) => variable.problem === problem).map(({ name }) => name);
|
|
367
|
+
const [missing, multiline, short2] = [named("missing"), named("multiline"), named("short")];
|
|
368
|
+
return {
|
|
369
|
+
message: `runner.secrets${configFile === null ? "" : ` in ${configFile}`} names ${variables.length === 1 ? "a variable" : "variables"} storm can't use. The run didn't start.`,
|
|
370
|
+
rows: [
|
|
371
|
+
[
|
|
372
|
+
"Runner secrets",
|
|
373
|
+
variables.map(
|
|
374
|
+
({ name, problem }) => problem === "missing" ? `${name} is not set` : problem === "multiline" ? `${name} holds a carriage return or a line feed` : `${name} holds fewer than ${minLength} characters`
|
|
375
|
+
)
|
|
376
|
+
]
|
|
377
|
+
],
|
|
378
|
+
next: [
|
|
379
|
+
{
|
|
380
|
+
type: "text",
|
|
381
|
+
text: [
|
|
382
|
+
...missing.length === 0 ? [] : [`Set ${listed(missing)} in this machine's environment.`],
|
|
383
|
+
...multiline.length === 0 ? [] : [
|
|
384
|
+
`Set ${listed(multiline)} to a value on one line: storm hides each value in output a line at a time, and doesn't trim one.`
|
|
385
|
+
],
|
|
386
|
+
...short2.length === 0 ? [] : [`Set ${listed(short2)} to the whole secret.`]
|
|
387
|
+
].join(" ")
|
|
388
|
+
},
|
|
389
|
+
{ type: "text", text: "Or run on this machine with --unsandboxed, which reads no runner secret." }
|
|
390
|
+
]
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
noBaseRef: {
|
|
395
|
+
exitCode: 1,
|
|
396
|
+
description: "In a sandboxed run, none of the runner recipe's baseRefs exists locally and shares history with HEAD, so there is no base. storm never fetches.",
|
|
397
|
+
schema: z3.object({
|
|
398
|
+
/** Each ref in baseRefs, and why it gave no base. */
|
|
399
|
+
refs: z3.array(z3.object({ ref: z3.string(), reason: z3.enum(["missing", "unrelated"]) }))
|
|
400
|
+
}),
|
|
401
|
+
render: ({ refs }) => ({
|
|
402
|
+
message: `No base for the runner: none of ${refs.map(({ ref }) => ref).join(", ")} exists locally and shares history with HEAD. The command didn't run.`,
|
|
403
|
+
rows: [
|
|
404
|
+
[
|
|
405
|
+
"Base refs",
|
|
406
|
+
refs.map(
|
|
407
|
+
({ ref, reason }) => reason === "missing" ? `${ref}: no such local ref` : `${ref}: shares no history with HEAD`
|
|
408
|
+
)
|
|
409
|
+
]
|
|
410
|
+
],
|
|
411
|
+
next: [
|
|
412
|
+
{
|
|
413
|
+
type: "text",
|
|
414
|
+
text: refs.some(({ ref }) => ref === "main" || ref === "origin/main") ? "Run git fetch origin main, then retry." : `Fetch or create one of ${refs.map(({ ref }) => ref).join(", ")}, then retry.`
|
|
415
|
+
}
|
|
416
|
+
]
|
|
417
|
+
})
|
|
418
|
+
},
|
|
419
|
+
submodulesRefused: {
|
|
420
|
+
exitCode: 1,
|
|
421
|
+
description: "In a sandboxed run, the checkout has Git submodules, which neither the upload nor the base's files carry.",
|
|
422
|
+
schema: z3.object({ paths: z3.array(z3.string()) }),
|
|
423
|
+
render: ({ paths }) => ({
|
|
424
|
+
message: `The checkout has Git submodules, which the runner can't carry: ${paths.join(", ")}. The command didn't run.`,
|
|
425
|
+
next: [{ type: "text", text: "Run on this machine with --unsandboxed." }]
|
|
426
|
+
})
|
|
427
|
+
},
|
|
428
|
+
snapshotGone: {
|
|
429
|
+
exitCode: 1,
|
|
430
|
+
description: "In a sandboxed run, the cached runner snapshot the run picked was gone (the Sandbox API answered 410), so its cache entry was removed and the command didn't run. The next run picks another runner snapshot or builds one.",
|
|
431
|
+
schema: z3.object({
|
|
432
|
+
snapshotId: z3.string(),
|
|
433
|
+
/** The runner snapshot's base, a full SHA. */
|
|
434
|
+
base: z3.string(),
|
|
435
|
+
/** Why its cache entry couldn't be removed; null when it was. */
|
|
436
|
+
removal: z3.object({ path: z3.string(), message: z3.string() }).nullable(),
|
|
437
|
+
/** What the run couldn't clean up. */
|
|
438
|
+
cleanup: RUN_CLEANUP.schema
|
|
439
|
+
}),
|
|
440
|
+
render: ({ snapshotId, removal, cleanup }) => {
|
|
441
|
+
const rows = RUN_CLEANUP.rows(cleanup);
|
|
442
|
+
return {
|
|
443
|
+
message: `Runner snapshot ${snapshotId} is gone, before its cache entry said it expires. ${removal === null ? "Removed its cache entry." : `Couldn't remove its cache entry at ${removal.path}: ${removal.message}.`} The command didn't run.`,
|
|
444
|
+
...rows.length === 0 ? {} : { rows },
|
|
445
|
+
next: [
|
|
446
|
+
{
|
|
447
|
+
type: "text",
|
|
448
|
+
text: removal === null ? "Run again: the next run picks another runner snapshot or builds one." : `Remove ${removal.path}, then run again.`
|
|
449
|
+
}
|
|
450
|
+
]
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
runnerFailed: {
|
|
455
|
+
exitCode: 1,
|
|
456
|
+
description: "In a sandboxed run, the runner couldn't run the command: a snapshot build step, applying the changes, the install or the build failed (with the step's last 40 output lines), a Vercel Sandbox call failed, git or tar failed on this machine, or the credential names no team and project ids.",
|
|
457
|
+
schema: z3.object({
|
|
458
|
+
failure: runnerFailureSchema,
|
|
459
|
+
/** What the run couldn't clean up; its `runner` is null when the run failed before it started a sandbox. */
|
|
460
|
+
cleanup: RUN_CLEANUP.schema
|
|
461
|
+
}),
|
|
462
|
+
render: ({ failure, cleanup }) => {
|
|
463
|
+
const { message, next } = runnerFailureText(failure);
|
|
464
|
+
const rows = [
|
|
465
|
+
..."tail" in failure && failure.tail.length > 0 ? [["Last output", failure.tail]] : [],
|
|
466
|
+
...failure.kind === "checkout-failed" && failure.command !== null ? [["Command", failure.command]] : [],
|
|
467
|
+
...RUN_CLEANUP.rows(cleanup)
|
|
468
|
+
];
|
|
469
|
+
return { message, ...rows.length === 0 ? {} : { rows }, next: [{ type: "text", text: next }] };
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
spawnFailed: {
|
|
473
|
+
exitCode: 1,
|
|
474
|
+
description: "The command couldn't start.",
|
|
475
|
+
schema: z3.object({
|
|
476
|
+
/** The command's first argument: what storm tried to run. */
|
|
477
|
+
executable: z3.string(),
|
|
478
|
+
/** What the OS said. */
|
|
479
|
+
message: z3.string(),
|
|
480
|
+
/**
|
|
481
|
+
* What the run couldn't clean up; its `runner` is null, since only a run without a runner sandbox spawns its
|
|
482
|
+
* command here.
|
|
483
|
+
*/
|
|
484
|
+
cleanup: RUN_CLEANUP.schema
|
|
485
|
+
}),
|
|
486
|
+
render: ({ executable, message, cleanup }) => {
|
|
487
|
+
const rows = RUN_CLEANUP.rows(cleanup);
|
|
488
|
+
return {
|
|
489
|
+
message: `Couldn't start the command ${executable}: ${message}`,
|
|
490
|
+
...rows.length === 0 ? {} : { rows },
|
|
491
|
+
next: [
|
|
492
|
+
{ type: "text", text: "Check the command after --; it runs with no shell, as the argument list given." }
|
|
493
|
+
]
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
var RUN_ERRORS = {
|
|
499
|
+
...configErrors,
|
|
500
|
+
...credentialErrors,
|
|
501
|
+
// A resource's refusal, before the run starts or while it acquires.
|
|
502
|
+
...resourceRefusalErrors,
|
|
503
|
+
...mintFailedErrors,
|
|
504
|
+
...runErrors
|
|
505
|
+
};
|
|
506
|
+
var outcomes = defineOutcomes({
|
|
507
|
+
results: { ran: { schema: ranSchema, description: RAN_DESCRIPTION, render: renderRan } },
|
|
508
|
+
errors: RUN_ERRORS
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
// src/commands/exec/redaction.ts
|
|
512
|
+
function redactor(secrets) {
|
|
513
|
+
const kept = secrets.filter((secret) => secret !== "");
|
|
514
|
+
return kept.length === 0 ? (text) => text : (text) => redactSecrets(text, kept);
|
|
515
|
+
}
|
|
516
|
+
function redactStrings(value, redact) {
|
|
517
|
+
if (typeof value === "string") return redact(value);
|
|
518
|
+
if (Array.isArray(value)) return value.map((each) => redactStrings(each, redact));
|
|
519
|
+
if (typeof value === "object" && value !== null) {
|
|
520
|
+
const prototype = Object.getPrototypeOf(value);
|
|
521
|
+
if (prototype !== Object.prototype && prototype !== null) return value;
|
|
522
|
+
return Object.fromEntries(
|
|
523
|
+
Object.entries(value).map(([key, each]) => [key, redactStrings(each, redact)])
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
return value;
|
|
527
|
+
}
|
|
528
|
+
function redactingObserver(observer, redact) {
|
|
529
|
+
return {
|
|
530
|
+
observe: async (timed) => await observer.observe({ event: redactStrings(timed.event, redact), at: timed.at })
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
function redactingTerminal(terminal, redact) {
|
|
534
|
+
return {
|
|
535
|
+
color: terminal.color,
|
|
536
|
+
writeStdout: (text) => terminal.writeStdout(redact(text)),
|
|
537
|
+
writeStderr: (text) => terminal.writeStderr(redact(text))
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// src/commands/exec/plan-run.ts
|
|
542
|
+
async function planRun(app, lifecycles, request, planCommand, signal) {
|
|
543
|
+
const file = await loadSettingsFile(app.context.config, app.cwd, RESOURCES);
|
|
544
|
+
if (!file.ok) return file;
|
|
545
|
+
const configFile = file.path;
|
|
546
|
+
const settings = fileSettings(file, request);
|
|
547
|
+
let where;
|
|
548
|
+
if (request.unsandboxed) where = { kind: "unsandboxed" };
|
|
549
|
+
else {
|
|
550
|
+
if (settings.runner === void 0) return refused(runErrors.missingRunner({ configFile }));
|
|
551
|
+
const required = requireTarget(settings.scope, settings.project);
|
|
552
|
+
if (!required.ok) return required;
|
|
553
|
+
const recipe = settings.runner.value;
|
|
554
|
+
const secrets = readRunnerSecrets(recipe, app.env);
|
|
555
|
+
if (!secrets.ok)
|
|
556
|
+
return refused(
|
|
557
|
+
runErrors.runnerSecretsInvalid({
|
|
558
|
+
variables: secrets.variables.map(({ name, problem }) => ({ name, problem })),
|
|
559
|
+
minLength: RUNNER_SECRET_MIN_LENGTH,
|
|
560
|
+
configFile
|
|
561
|
+
})
|
|
562
|
+
);
|
|
563
|
+
where = { kind: "runner", recipe, target: required.target, secrets: secrets.values };
|
|
564
|
+
}
|
|
565
|
+
const merged = settleRunResources(file, request.given);
|
|
566
|
+
if (!merged.ok) return merged;
|
|
567
|
+
const command = await planCommand(where, signal);
|
|
568
|
+
if (signal.aborted) return refused(canceledBeforeStart());
|
|
569
|
+
if (!command.ok) {
|
|
570
|
+
const secrets = [
|
|
571
|
+
...where.kind === "runner" ? Object.values(where.secrets) : [],
|
|
572
|
+
...lifecycles.secrets(merged.options)
|
|
573
|
+
];
|
|
574
|
+
return refused(secrets.length === 0 ? command.refusal : redactStrings(command.refusal, redactor(secrets)));
|
|
575
|
+
}
|
|
576
|
+
const run = Object.freeze({ testPlan: command.testPlan });
|
|
577
|
+
const resolved = merged.plan(run);
|
|
578
|
+
if (!resolved.ok) return resolved;
|
|
579
|
+
return {
|
|
580
|
+
ok: true,
|
|
581
|
+
configFile,
|
|
582
|
+
settings,
|
|
583
|
+
where,
|
|
584
|
+
argv: command.argv,
|
|
585
|
+
testPlan: command.testPlan,
|
|
586
|
+
resources: resolved.resources,
|
|
587
|
+
planOptions: resolved.planned.map(planOption)
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
function planOption({ path, value, source }) {
|
|
591
|
+
return { path, value, from: source };
|
|
592
|
+
}
|
|
593
|
+
async function resourcesBeforeRun(lifecycles, plan, request) {
|
|
594
|
+
const { configFile, resources, settings } = plan;
|
|
595
|
+
const used = await lifecycles.beforeRun(resources);
|
|
596
|
+
if (!used.ok) return refused(resourceRefusedBeforeRun(used.resource, used.refusal, configFile));
|
|
597
|
+
if (request.credential !== void 0 && !used.needsVercelCredential)
|
|
598
|
+
return refused(runErrors.credentialUnused({ flags: ["--credential"], configFile }));
|
|
599
|
+
let where;
|
|
600
|
+
if (plan.where.kind === "runner") where = plan.where;
|
|
601
|
+
else if (used.needsVercelCredential) {
|
|
602
|
+
const chosen = settleCredential(request.credential ?? "mint", settings.scope, settings.project);
|
|
603
|
+
if (!chosen.ok) return chosen;
|
|
604
|
+
where = { kind: "unsandboxed", credential: chosen.credential };
|
|
605
|
+
} else where = { kind: "unsandboxed", credential: void 0 };
|
|
606
|
+
return { ok: true, where, used };
|
|
607
|
+
}
|
|
608
|
+
function canceledBeforeStart() {
|
|
609
|
+
return outcomes.canceled({ changed: "The command didn't run.\nNothing was minted, acquired or started." });
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// src/commands/exec/run-command.ts
|
|
613
|
+
import { z as z4 } from "zod";
|
|
614
|
+
|
|
615
|
+
// src/commands/exec/job-summary.ts
|
|
616
|
+
function jobSummaryMarkdown(timeline, extras) {
|
|
617
|
+
const lines = [`### storm ${extras.command}`, ""];
|
|
618
|
+
if (timeline.rows.length > 0) {
|
|
619
|
+
lines.push("| Lane | Start | Duration | Idle | Steps |", "| --- | ---: | ---: | ---: | --- |");
|
|
620
|
+
for (const row of timeline.rows) lines.push(tableRow(row));
|
|
621
|
+
lines.push("");
|
|
622
|
+
}
|
|
623
|
+
if (timeline.criticalPath.length > 0) {
|
|
624
|
+
const path = timeline.criticalPath.map((step) => criticalPathStep(step, timeline));
|
|
625
|
+
lines.push(`Critical path: ${path.join(" \u2192 ")}`, "");
|
|
626
|
+
}
|
|
627
|
+
for (const detail of extras.details ?? []) lines.push(`${detail.trim()} `);
|
|
628
|
+
if ((extras.details ?? []).length > 0) lines.push("");
|
|
629
|
+
if (extras.logs !== void 0) lines.push(`Run directory: \`${extras.logs}\``, "");
|
|
630
|
+
return lines.join("\n");
|
|
631
|
+
}
|
|
632
|
+
function tableRow(row) {
|
|
633
|
+
const outcome = row.outcome === "done" ? "" : ` (${row.outcome})`;
|
|
634
|
+
const steps = row.steps.map((step) => `${step.name} ${seconds(step.endMs - step.startMs)}`).join(" \xB7 ");
|
|
635
|
+
const idle = row.idleMs > 0 ? seconds(row.idleMs) : "";
|
|
636
|
+
return `| ${row.label}${outcome} | +${seconds(row.startMs)} | ${seconds(row.endMs - row.startMs)} | ${idle} | ${steps} |`;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// src/commands/exec/progress.ts
|
|
640
|
+
function lineProgress(write, options = { github: false }) {
|
|
641
|
+
let failed = false;
|
|
642
|
+
const render = plainRenderer(options);
|
|
643
|
+
return {
|
|
644
|
+
observe: async (timed) => {
|
|
645
|
+
for (const line of render(timed)) {
|
|
646
|
+
if (failed) return;
|
|
647
|
+
try {
|
|
648
|
+
await write(line);
|
|
649
|
+
} catch {
|
|
650
|
+
failed = true;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
function plainRenderer(options) {
|
|
657
|
+
const state = {
|
|
658
|
+
origin: void 0,
|
|
659
|
+
resourceLanes: [],
|
|
660
|
+
instances: [],
|
|
661
|
+
mintStartedAt: void 0,
|
|
662
|
+
lanesStartedAt: void 0,
|
|
663
|
+
readyAt: { runner: void 0, resources: {} },
|
|
664
|
+
cleanupStartedAt: void 0,
|
|
665
|
+
folded: false
|
|
666
|
+
};
|
|
667
|
+
const resources = RESOURCE_PRESENTATIONS.plain({ verbose: options.verbose === true });
|
|
668
|
+
return ({ event, at }) => {
|
|
669
|
+
const now = at.getTime();
|
|
670
|
+
state.origin ??= now;
|
|
671
|
+
const origin = state.origin;
|
|
672
|
+
const line = (lane, text) => progressLine(now - origin, lane, text);
|
|
673
|
+
if (event.kind === "resource") return resources(event, now).map(({ lane, text }) => line(lane, text));
|
|
674
|
+
return eventLines(event, now, state, line, options);
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
function progressLine(elapsedMs, lane, text) {
|
|
678
|
+
return `[+${secondsText(secondsOf(elapsedMs))}] ${lane.padEnd(LANE_WIDTH)} ${text}`;
|
|
679
|
+
}
|
|
680
|
+
var LANE_WIDTH = Math.max(
|
|
681
|
+
...["run", "mint", "runner", "command", "cleanup", ...RESOURCE_PRESENTATIONS.laneKinds.map(({ lane }) => lane)].map(
|
|
682
|
+
(lane) => lane.length
|
|
683
|
+
)
|
|
684
|
+
);
|
|
685
|
+
function eventLines(event, now, state, line, options) {
|
|
686
|
+
const since = (start) => seconds(now - (start ?? now));
|
|
687
|
+
switch (event.kind) {
|
|
688
|
+
case "started":
|
|
689
|
+
state.resourceLanes = event.resources.flatMap(
|
|
690
|
+
({ resource, lane }) => lane === null ? [] : [{ lane, resource }]
|
|
691
|
+
);
|
|
692
|
+
state.instances = event.resources;
|
|
693
|
+
return [
|
|
694
|
+
line("run", `storm ${versionText(event.version, event.commit)}`),
|
|
695
|
+
...event.configFile === null ? [] : [line("run", `config ${event.configFile}`)]
|
|
696
|
+
];
|
|
697
|
+
case "resource-skipped":
|
|
698
|
+
return [line("run", skippedText(event))];
|
|
699
|
+
// An acquired resource says what it holds in its acquire's `announce`, the progress event that follows.
|
|
700
|
+
case "resource-acquired":
|
|
701
|
+
return [];
|
|
702
|
+
// A line a resource instance reported, in the run's lane or the cleanup's, and a warning, marked as one.
|
|
703
|
+
case "resource-notice":
|
|
704
|
+
return [line(event.lane, event.text)];
|
|
705
|
+
case "resource-warning":
|
|
706
|
+
return [line(event.lane, resourceWarningText(event))];
|
|
707
|
+
case "minting":
|
|
708
|
+
state.mintStartedAt = now;
|
|
709
|
+
return [line("mint", `credential for ${mintTargetText(event.target)}\u2026`)];
|
|
710
|
+
case "minted":
|
|
711
|
+
return [
|
|
712
|
+
line(
|
|
713
|
+
"mint",
|
|
714
|
+
`${event.ok ? "credential" : "no credential"} for ${mintTargetText(event.target)} (${since(state.mintStartedAt)})`
|
|
715
|
+
)
|
|
716
|
+
];
|
|
717
|
+
case "requesting-token":
|
|
718
|
+
return [line("mint", "requesting a GitHub Actions OIDC token\u2026")];
|
|
719
|
+
case "lanes-started":
|
|
720
|
+
state.lanesStartedAt = now;
|
|
721
|
+
return state.resourceLanes.length === 0 ? [] : [line("run", `${[...state.resourceLanes.map(({ lane }) => lane), "runner"].join(" \u2016 ")} start together`)];
|
|
722
|
+
case "lane-ended": {
|
|
723
|
+
const ran = since(state.lanesStartedAt ?? state.origin);
|
|
724
|
+
if (event.outcome !== "ready") return [line(event.lane, `${event.outcome} (${ran})`)];
|
|
725
|
+
if (state.lanesStartedAt === void 0) return [];
|
|
726
|
+
if (event.resource === null) state.readyAt.runner = now;
|
|
727
|
+
else state.readyAt.resources[event.resource] = now;
|
|
728
|
+
const ready = `ready (${ran})`;
|
|
729
|
+
if (state.resourceLanes.length === 0) return [line(event.lane, ready)];
|
|
730
|
+
const others = event.resource === null ? state.resourceLanes : [{ lane: "runner", resource: null }];
|
|
731
|
+
const readyAt = (lane) => lane.resource === null ? state.readyAt.runner : state.readyAt.resources[lane.resource];
|
|
732
|
+
const waiting = others.filter((other) => readyAt(other) === void 0).map(({ lane }) => lane);
|
|
733
|
+
if (waiting.length > 0) return [line(event.lane, `${ready}; waiting for ${waiting.join(", ")}`)];
|
|
734
|
+
const waited = others.map((other) => `${other.lane} waited ${seconds(now - (readyAt(other) ?? now))}`);
|
|
735
|
+
return [line(event.lane, `${ready}; ${waited.join(", ")}`)];
|
|
736
|
+
}
|
|
737
|
+
// A resource lane's start shows in its first line of its own.
|
|
738
|
+
case "lane-started":
|
|
739
|
+
return [];
|
|
740
|
+
case "command-started":
|
|
741
|
+
return [line("command", `running ${event.argv.join(" ")}`)];
|
|
742
|
+
case "command-ended":
|
|
743
|
+
return [line("command", `${event.command} ${commandEnd(event.outcome)} after ${seconds(event.ms)}`)];
|
|
744
|
+
case "cleanup-started":
|
|
745
|
+
state.cleanupStartedAt = now;
|
|
746
|
+
return [line("cleanup", cleanupText(event.runnerSandbox, releaseText(event.resources, false)))];
|
|
747
|
+
case "cleanup-finished": {
|
|
748
|
+
const problems = [
|
|
749
|
+
...event.notStopped === 0 ? [] : [`${event.notStopped} not stopped`],
|
|
750
|
+
...event.notDeleted === 0 ? [] : [`${event.notDeleted} not deleted`],
|
|
751
|
+
...event.resourceWarnings === 0 ? [] : [warningTally(event.resourceWarnings)]
|
|
752
|
+
];
|
|
753
|
+
return [
|
|
754
|
+
line(
|
|
755
|
+
"cleanup",
|
|
756
|
+
`${problems.length === 0 ? "done" : `done: ${problems.join(", ")}`} (${since(state.cleanupStartedAt)})`
|
|
757
|
+
)
|
|
758
|
+
];
|
|
759
|
+
}
|
|
760
|
+
case "runner-prepared":
|
|
761
|
+
return [
|
|
762
|
+
line("runner", `base ${short(event.base)}, HEAD's merge-base with ${event.baseRef}`),
|
|
763
|
+
...preparedNoteTexts(event).map((text) => line("runner", text))
|
|
764
|
+
];
|
|
765
|
+
// The command's own output carries its tests' results; the summary counts them.
|
|
766
|
+
// The summary says when the test results may be incomplete.
|
|
767
|
+
case "test":
|
|
768
|
+
case "test-event-unreadable":
|
|
769
|
+
case "test-events-incomplete":
|
|
770
|
+
return [];
|
|
771
|
+
case "runner":
|
|
772
|
+
return runnerLines(event.event, state, line, options);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
function runnerLines(event, state, line, options) {
|
|
776
|
+
switch (event.kind) {
|
|
777
|
+
case "snapshot-reused":
|
|
778
|
+
return [line("runner", snapshotReusedText(event))];
|
|
779
|
+
case "snapshot-build-started":
|
|
780
|
+
return [
|
|
781
|
+
line(
|
|
782
|
+
"runner",
|
|
783
|
+
`building a runner snapshot of base ${short(event.base)} (${event.reason === "rebuild" ? "--rebuild-snapshot" : "no cached runner snapshot fits"}); this takes a few minutes: ${event.summary}`
|
|
784
|
+
)
|
|
785
|
+
];
|
|
786
|
+
case "runner-sandbox-starting":
|
|
787
|
+
return [];
|
|
788
|
+
case "sandbox-started":
|
|
789
|
+
return [
|
|
790
|
+
line(
|
|
791
|
+
"runner",
|
|
792
|
+
`started the ${event.role === "runner" ? "runner" : "build"} sandbox ${event.name} in ${event.region}, ${event.vcpus} vCPUs (${seconds(event.ms)})`
|
|
793
|
+
)
|
|
794
|
+
];
|
|
795
|
+
case "output-started":
|
|
796
|
+
return [];
|
|
797
|
+
case "output-ended":
|
|
798
|
+
return event.outcome === "finished" ? [] : [...closeFold(state), line("runner", `${event.section} ${event.outcome}`)];
|
|
799
|
+
case "step-started": {
|
|
800
|
+
const text = `${event.phase}: ${event.label}`;
|
|
801
|
+
if (!options.github) return [line("runner", text)];
|
|
802
|
+
state.folded = true;
|
|
803
|
+
return [`::group::${line("runner", text)}`];
|
|
804
|
+
}
|
|
805
|
+
case "step-output":
|
|
806
|
+
return [event.line];
|
|
807
|
+
case "step-finished":
|
|
808
|
+
return [...closeFold(state), line("runner", `${event.phase}: ${event.label}, done in ${seconds(event.ms)}`)];
|
|
809
|
+
case "snapshot-saving":
|
|
810
|
+
return [line("runner", "saving the build sandbox as a runner snapshot\u2026")];
|
|
811
|
+
case "snapshot-built":
|
|
812
|
+
return [
|
|
813
|
+
line(
|
|
814
|
+
"runner",
|
|
815
|
+
`built runner snapshot ${event.snapshotId} of base ${short(event.base)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`
|
|
816
|
+
)
|
|
817
|
+
];
|
|
818
|
+
case "snapshot-entry-not-written":
|
|
819
|
+
return [line("runner", cacheWriteFailureText(event.failure))];
|
|
820
|
+
case "uploading":
|
|
821
|
+
return [];
|
|
822
|
+
case "uploaded":
|
|
823
|
+
return [line("runner", `uploaded your changes, ${megabytesText(event.bytes)} (${seconds(event.ms)})`)];
|
|
824
|
+
case "command-output-started":
|
|
825
|
+
return [line("command", `in the runner sandbox ${event.sandbox} (${event.region})`)];
|
|
826
|
+
case "command-stopped":
|
|
827
|
+
return [line("command", `${event.command} stopped`)];
|
|
828
|
+
case "stopping":
|
|
829
|
+
return [
|
|
830
|
+
line(
|
|
831
|
+
"cleanup",
|
|
832
|
+
`stopping: ${event.commandRunning ? "killing the command, then " : ""}${event.keepMs > 0 ? `keeping the runner sandbox running ${keepTimeText(event.keepMs)}` : "stopping and deleting the runner's sandboxes"}${releasingText(state.instances)}\u2026`
|
|
833
|
+
)
|
|
834
|
+
];
|
|
835
|
+
case "waiting-for-snapshot":
|
|
836
|
+
return [
|
|
837
|
+
line(
|
|
838
|
+
"cleanup",
|
|
839
|
+
`waiting up to ${Math.round(event.settleMs / 6e4)} minutes for the runner snapshot still saving\u2026`
|
|
840
|
+
)
|
|
841
|
+
];
|
|
842
|
+
case "sandbox-kept":
|
|
843
|
+
return [line("cleanup", `kept the runner sandbox ${event.name} running until ${isoSecondsText(event.stopsAt)}`)];
|
|
844
|
+
// The cleanup line says the run saves a branch snapshot.
|
|
845
|
+
case "branch-snapshot-saving":
|
|
846
|
+
return [];
|
|
847
|
+
case "branch-snapshot-saved":
|
|
848
|
+
case "branch-snapshot-not-saved":
|
|
849
|
+
return [line("cleanup", branchSnapshotSaveText(event))];
|
|
850
|
+
case "branch-snapshots-dropped":
|
|
851
|
+
case "branch-snapshots-not-dropped":
|
|
852
|
+
return [line("runner", branchSnapshotsDropText(event))];
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
function snapshotReusedText(event) {
|
|
856
|
+
const reused = `reusing runner snapshot ${event.snapshotId} of base ${short(event.base)}`;
|
|
857
|
+
return event.branch === null || event.head === null ? reused : `${reused} (branch ${event.branch} at ${short(event.head)})`;
|
|
858
|
+
}
|
|
859
|
+
function branchSnapshotSaveText(event) {
|
|
860
|
+
if (event.kind === "branch-snapshot-saved") {
|
|
861
|
+
return `saved branch snapshot ${event.snapshotId} for ${event.branch} at ${short(event.head)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`;
|
|
862
|
+
}
|
|
863
|
+
return `not saving a branch snapshot: ${notSavedReason(event.save)}`;
|
|
864
|
+
}
|
|
865
|
+
function notSavedReason(save) {
|
|
866
|
+
switch (save.kind) {
|
|
867
|
+
case "failed":
|
|
868
|
+
return `the ${save.step === "scrub" ? "scrub" : "save"} failed: ${save.message}`;
|
|
869
|
+
case "stopped":
|
|
870
|
+
return "the run is stopping";
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
function branchSnapshotsDropText(event) {
|
|
874
|
+
if (event.kind === "branch-snapshots-not-dropped")
|
|
875
|
+
return `couldn't drop a branch snapshot of ${event.branch} from the cache at ${event.failure.path}: ${event.failure.message}; a later run on the branch may start from it`;
|
|
876
|
+
const count = event.snapshotIds.length;
|
|
877
|
+
return `dropped ${count} branch ${count === 1 ? "snapshot" : "snapshots"} of ${event.branch} from the cache: ${event.snapshotIds.join(", ")}`;
|
|
878
|
+
}
|
|
879
|
+
function releasingText(instances) {
|
|
880
|
+
const release = releaseText(
|
|
881
|
+
instances.map(({ resource }) => resource),
|
|
882
|
+
false
|
|
883
|
+
);
|
|
884
|
+
return release === void 0 ? "" : ` and ${release}`;
|
|
885
|
+
}
|
|
886
|
+
function closeFold(state) {
|
|
887
|
+
if (!state.folded) return [];
|
|
888
|
+
state.folded = false;
|
|
889
|
+
return ["::endgroup::"];
|
|
890
|
+
}
|
|
891
|
+
function cleanupText(sandbox, release) {
|
|
892
|
+
if (sandbox === null) return release === void 0 ? "nothing to release" : `${release}\u2026`;
|
|
893
|
+
if (sandbox.kind === "save")
|
|
894
|
+
return `saving a branch snapshot of ${sandbox.branch}${release === void 0 ? "" : ` while ${release}`}\u2026`;
|
|
895
|
+
const sandboxes = sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : "stopping and deleting the runner's sandboxes";
|
|
896
|
+
return `${sandboxes}${release === void 0 ? "" : `, then ${release}`}\u2026`;
|
|
897
|
+
}
|
|
898
|
+
function commandEnd(outcome) {
|
|
899
|
+
switch (outcome.kind) {
|
|
900
|
+
case "exited":
|
|
901
|
+
return `exited ${outcome.code}`;
|
|
902
|
+
case "signaled":
|
|
903
|
+
return `ended on ${outcome.signal}`;
|
|
904
|
+
case "no-exit-code":
|
|
905
|
+
return "ended without an exit code";
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
function noteText(note) {
|
|
909
|
+
switch (note.kind) {
|
|
910
|
+
case "cache-unreadable":
|
|
911
|
+
return `couldn't read the runner snapshot cache at ${note.failure.path}: ${note.failure.message}; treating it as empty`;
|
|
912
|
+
case "expired-entry-not-removed":
|
|
913
|
+
return `couldn't remove the expired cache entry for runner snapshot ${note.entry.snapshotId} at ${note.failure.path}: ${note.failure.message}`;
|
|
914
|
+
case "candidate-steps-failed":
|
|
915
|
+
return `not reusing cached runner snapshots of base ${short(note.base)}: runner.${note.path.join(".")} ${note.problem.replace(/\.$/, "")}`;
|
|
916
|
+
case "candidate-check-failed":
|
|
917
|
+
return `not reusing cached runner snapshots of base ${short(note.base)}: ${note.failure.message.replace(/\.$/, "")}`;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
function resourceWarningText(warning) {
|
|
921
|
+
return `warning: ${warning.message}`;
|
|
922
|
+
}
|
|
923
|
+
function skippedText(skipped) {
|
|
924
|
+
return `no ${skipped.resource}: ${skipped.notice}`;
|
|
925
|
+
}
|
|
926
|
+
function preparedNoteTexts(prepared) {
|
|
927
|
+
return [
|
|
928
|
+
...prepared.nestedRepositories.length === 0 ? [] : [`leaving out untracked nested Git repositories: ${prepared.nestedRepositories.join(", ")}`],
|
|
929
|
+
...prepared.notes.map(noteText),
|
|
930
|
+
...prepared.saveSkipped ? ["not saving a branch snapshot: HEAD is detached"] : []
|
|
931
|
+
];
|
|
932
|
+
}
|
|
933
|
+
function cacheWriteFailureText(failure) {
|
|
934
|
+
return `couldn't record the runner snapshot in the cache at ${failure.path}: ${failure.message}; later runs won't reuse it`;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
// src/commands/exec/live-view.ts
|
|
938
|
+
var SPINNER = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
939
|
+
var INDENT = " ".repeat(LANE_WIDTH + 5);
|
|
940
|
+
function laneHead(glyph, lane) {
|
|
941
|
+
return ` ${glyph} ${lane.padEnd(LANE_WIDTH)} `;
|
|
942
|
+
}
|
|
943
|
+
function activePhase(state) {
|
|
944
|
+
if (state.cleanup !== void 0) return "cleanup";
|
|
945
|
+
if (state.command !== void 0) return "tests";
|
|
946
|
+
if (state.lanesStartedAt !== void 0 && state.runner !== void 0) return "lanes";
|
|
947
|
+
if (Object.keys(state.resources).length > 0 && state.runner === void 0) return "resources";
|
|
948
|
+
if (state.mint !== void 0) return "credential";
|
|
949
|
+
return void 0;
|
|
950
|
+
}
|
|
951
|
+
function instanceLanes(state) {
|
|
952
|
+
return RESOURCE_PRESENTATIONS.lanes(state.instances ?? []);
|
|
953
|
+
}
|
|
954
|
+
function startedLanes(state) {
|
|
955
|
+
return RESOURCE_PRESENTATIONS.lanes(
|
|
956
|
+
Object.entries(state.resources).map(([resource, { definition }]) => ({ resource, definition }))
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
function headerLine(state, paint2) {
|
|
960
|
+
const version = state.version === void 0 ? "" : versionText(state.version.version, state.version.commit);
|
|
961
|
+
const header = [
|
|
962
|
+
`storm ${version}`.trimEnd(),
|
|
963
|
+
...state.base === void 0 ? [] : [`base ${short(state.base.sha)} (merge-base ${state.base.ref})`]
|
|
964
|
+
].join(" \xB7 ");
|
|
965
|
+
return paint2.strong(header);
|
|
966
|
+
}
|
|
967
|
+
function phaseFrame(state, phase, now, width, paint2) {
|
|
968
|
+
const view = {
|
|
969
|
+
now,
|
|
970
|
+
width,
|
|
971
|
+
paint: paint2,
|
|
972
|
+
glyph: (status) => statusGlyph(status, now, paint2),
|
|
973
|
+
// A live row is cut to the width: one that wrapped would take a row the next redraw doesn't erase.
|
|
974
|
+
row: (left, right) => spread(left, right, width),
|
|
975
|
+
line: (text) => truncate(text, width)
|
|
976
|
+
};
|
|
977
|
+
switch (phase) {
|
|
978
|
+
case "credential":
|
|
979
|
+
return state.mint === void 0 ? [] : [credentialLine(state.mint, view)];
|
|
980
|
+
case "lanes":
|
|
981
|
+
return lanesFrame(state, view);
|
|
982
|
+
case "resources":
|
|
983
|
+
return unsandboxedResourcesFrame(state, view);
|
|
984
|
+
case "tests":
|
|
985
|
+
return testsFrame(state, view);
|
|
986
|
+
case "cleanup":
|
|
987
|
+
return state.cleanup === void 0 ? [] : [cleanupLine(state.cleanup, state.runner, view, false)];
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
function phaseRecord(state, phase, width, paint2) {
|
|
991
|
+
const view = {
|
|
992
|
+
now: void 0,
|
|
993
|
+
width,
|
|
994
|
+
paint: paint2,
|
|
995
|
+
glyph: (status) => statusGlyph(status === "running" ? "stopped" : status, 0, paint2),
|
|
996
|
+
row: (left, right) => visibleLength(left) + visibleLength(right) + 1 <= width ? spread(left, right, width) : `${left}${right === "" ? "" : ` ${right}`}`,
|
|
997
|
+
line: (text) => text
|
|
998
|
+
};
|
|
999
|
+
switch (phase) {
|
|
1000
|
+
case "credential":
|
|
1001
|
+
return state.mint === void 0 ? [] : [credentialLine(state.mint, view)];
|
|
1002
|
+
case "lanes":
|
|
1003
|
+
return lanesRecord(state, view);
|
|
1004
|
+
case "resources":
|
|
1005
|
+
return unsandboxedResourcesRecord(state, view);
|
|
1006
|
+
case "tests":
|
|
1007
|
+
return state.command === void 0 ? [] : [testsLine(state, state.command, view, false)];
|
|
1008
|
+
case "cleanup":
|
|
1009
|
+
return state.cleanup === void 0 ? [] : [cleanupLine(state.cleanup, state.runner, view, true)];
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
function laneDraw(view) {
|
|
1013
|
+
return {
|
|
1014
|
+
now: view.now,
|
|
1015
|
+
paint: view.paint,
|
|
1016
|
+
glyph: view.glyph,
|
|
1017
|
+
line: view.line,
|
|
1018
|
+
elapsed: (from, to) => elapsed(view, from, to),
|
|
1019
|
+
seconds
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
function elapsed(view, from, to) {
|
|
1023
|
+
const end = to ?? view.now;
|
|
1024
|
+
return from === void 0 || end === void 0 ? "" : seconds(end - from);
|
|
1025
|
+
}
|
|
1026
|
+
function credentialLine(mint, view) {
|
|
1027
|
+
return view.row(
|
|
1028
|
+
` ${view.glyph(mint.status)} credential ${mintTargetText(mint.target)}`,
|
|
1029
|
+
elapsed(view, mint.startedAt, mint.endedAt)
|
|
1030
|
+
);
|
|
1031
|
+
}
|
|
1032
|
+
function lanesFrame(state, view) {
|
|
1033
|
+
const { runner } = state;
|
|
1034
|
+
if (runner === void 0) return [];
|
|
1035
|
+
const { paint: paint2 } = view;
|
|
1036
|
+
const stopping = (status) => state.stopping && status === "running";
|
|
1037
|
+
const draw = laneDraw(view);
|
|
1038
|
+
const resourceRows = instanceLanes(state).map((lane) => {
|
|
1039
|
+
const live = lane.live(state.resources, draw);
|
|
1040
|
+
if (live === void 0) return view.row(laneHead(view.glyph("running"), lane.lane), "");
|
|
1041
|
+
const { span } = live;
|
|
1042
|
+
const text = stopping(span.status) ? "stopping" : live.detail ?? live.text;
|
|
1043
|
+
const waiting = span.status === "done" && runner.status === "running" && span.endedAt !== void 0 && view.now !== void 0 ? `${paint2.faint(`waiting for runner +${seconds(view.now - span.endedAt)}`)} ` : "";
|
|
1044
|
+
return view.row(
|
|
1045
|
+
`${laneHead(view.glyph(span.status), lane.lane)}${text}`,
|
|
1046
|
+
`${waiting}${elapsed(view, span.startedAt, span.endedAt)}`
|
|
1047
|
+
);
|
|
1048
|
+
});
|
|
1049
|
+
const current = runner.steps.find(({ status }) => status === "running") ?? [...runner.steps].filter((step) => step.status !== "pending" && step.endedAt !== void 0).toSorted((a, b) => (a.endedAt ?? 0) - (b.endedAt ?? 0)).at(-1);
|
|
1050
|
+
const currentText = current === void 0 ? "" : [
|
|
1051
|
+
`${current.name}${stepLabel(current, runner) === "" ? "" : ` \xB7 ${stepLabel(current, runner)}`}`,
|
|
1052
|
+
current.startedAt === current.endedAt ? "" : elapsed(view, current.startedAt, current.endedAt),
|
|
1053
|
+
current.status === "failed" || current.status === "stopped" ? view.glyph(current.status) : ""
|
|
1054
|
+
].filter((part) => part !== "").join(" ");
|
|
1055
|
+
const crumbs = stepsText(
|
|
1056
|
+
runner.steps.filter((step) => step !== current),
|
|
1057
|
+
view
|
|
1058
|
+
);
|
|
1059
|
+
const runnerText = stopping(runner.status) ? `stopping \xB7 ${currentText}` : currentText;
|
|
1060
|
+
const runnerRow = view.row(
|
|
1061
|
+
`${laneHead(runnerGlyph(runner, view), "runner")}${runnerText}${crumbs === "" ? "" : ` ${paint2.faint(crumbs)}`}`,
|
|
1062
|
+
elapsed(view, runner.startedAt, runner.endedAt)
|
|
1063
|
+
);
|
|
1064
|
+
const running = runner.steps.find(({ status }) => status === "running");
|
|
1065
|
+
const latest = running === void 0 ? void 0 : latestLine(running, runner);
|
|
1066
|
+
const output = activityText(runner) ?? (latest === "" ? void 0 : latest);
|
|
1067
|
+
return [...resourceRows, runnerRow, output === void 0 ? "" : view.line(`${INDENT}${paint2.faint(output)}`)];
|
|
1068
|
+
}
|
|
1069
|
+
function lanesRecord(state, view) {
|
|
1070
|
+
const { runner } = state;
|
|
1071
|
+
const lines = [];
|
|
1072
|
+
const draw = laneDraw(view);
|
|
1073
|
+
for (const lane of startedLanes(state)) {
|
|
1074
|
+
const record = lane.record(state.resources, draw);
|
|
1075
|
+
if (record === void 0) continue;
|
|
1076
|
+
const { span } = record;
|
|
1077
|
+
const waited = span.status === "done" && span.endedAt !== void 0 && runner?.endedAt !== void 0 && runner.endedAt > span.endedAt ? ` \xB7 waited ${seconds(runner.endedAt - span.endedAt)}` : "";
|
|
1078
|
+
lines.push(
|
|
1079
|
+
view.row(
|
|
1080
|
+
`${laneHead(view.glyph(span.status), lane.lane)}${record.text}`,
|
|
1081
|
+
`${elapsed(view, span.startedAt, span.endedAt)}${waited}`
|
|
1082
|
+
),
|
|
1083
|
+
...record.lines
|
|
1084
|
+
);
|
|
1085
|
+
}
|
|
1086
|
+
if (runner !== void 0) {
|
|
1087
|
+
const snapshot = runner.steps.find(({ name }) => name === "snapshot");
|
|
1088
|
+
const parts = [
|
|
1089
|
+
...runner.sandbox === void 0 ? [] : [`${runner.sandbox.name} \xB7 ${runner.sandbox.region} \xB7 ${runner.sandbox.vcpus} vCPU`],
|
|
1090
|
+
...snapshot === void 0 || snapshot.status === "pending" ? [] : [snapshotText(snapshot, runner)],
|
|
1091
|
+
...runner.status === "failed" || runner.status === "stopped" ? [runner.status] : []
|
|
1092
|
+
];
|
|
1093
|
+
lines.push(
|
|
1094
|
+
view.row(
|
|
1095
|
+
`${laneHead(runnerGlyph(runner, view), "runner")}${parts.join(" \xB7 ")}`,
|
|
1096
|
+
elapsed(view, runner.startedAt, runner.endedAt)
|
|
1097
|
+
)
|
|
1098
|
+
);
|
|
1099
|
+
const steps = stepsText(runner.steps, view);
|
|
1100
|
+
if (steps !== "") lines.push(view.line(`${INDENT}${steps}`));
|
|
1101
|
+
}
|
|
1102
|
+
return lines;
|
|
1103
|
+
}
|
|
1104
|
+
function runnerGlyph(runner, view) {
|
|
1105
|
+
return view.glyph(runner.steps.some(({ status }) => status === "failed") ? "failed" : runner.status);
|
|
1106
|
+
}
|
|
1107
|
+
function snapshotText(step, runner) {
|
|
1108
|
+
if (runner.snapshot?.kind === "reused" || runner.snapshot?.kind === "built")
|
|
1109
|
+
return `snapshot ${runner.snapshot.kind}`;
|
|
1110
|
+
return `snapshot build ${step.status === "running" ? "stopped" : step.status}`;
|
|
1111
|
+
}
|
|
1112
|
+
function stepLabel(step, runner) {
|
|
1113
|
+
if (step.name === "snapshot") {
|
|
1114
|
+
const { snapshot } = runner;
|
|
1115
|
+
if (snapshot === void 0) return step.label;
|
|
1116
|
+
if (snapshot.kind !== "building") return `${snapshot.id} ${snapshot.kind}`;
|
|
1117
|
+
return step.label === "" ? `building: ${snapshot.summary}` : step.label;
|
|
1118
|
+
}
|
|
1119
|
+
if (step.name === "upload" && runner.uploadBytes !== void 0) return megabytesText(runner.uploadBytes);
|
|
1120
|
+
return step.label;
|
|
1121
|
+
}
|
|
1122
|
+
function latestLine(step, runner) {
|
|
1123
|
+
if (step.latest !== void 0) return step.latest.trim();
|
|
1124
|
+
if (step.name === "snapshot" && step.label === "" && runner.buildSandbox !== void 0)
|
|
1125
|
+
return `build sandbox ${runner.buildSandbox} started`;
|
|
1126
|
+
return void 0;
|
|
1127
|
+
}
|
|
1128
|
+
function activityText(runner) {
|
|
1129
|
+
switch (runner.activity) {
|
|
1130
|
+
case "saving-snapshot":
|
|
1131
|
+
return "saving the build sandbox as a runner snapshot";
|
|
1132
|
+
case "waiting-for-snapshot":
|
|
1133
|
+
return WAITING_FOR_SNAPSHOT;
|
|
1134
|
+
case void 0:
|
|
1135
|
+
return void 0;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
var WAITING_FOR_SNAPSHOT = "waiting for the runner snapshot still saving";
|
|
1139
|
+
function stepsText(steps, view) {
|
|
1140
|
+
return steps.filter(
|
|
1141
|
+
(step) => step.status !== "pending" && step.status !== "running" && step.startedAt !== void 0 && step.endedAt !== void 0 && (step.endedAt > step.startedAt || step.status !== "done")
|
|
1142
|
+
).map((step) => {
|
|
1143
|
+
const mark = step.status === "done" ? "" : ` ${view.glyph(step.status)}`;
|
|
1144
|
+
return `${step.name} ${seconds((step.endedAt ?? 0) - (step.startedAt ?? 0))}${mark}`;
|
|
1145
|
+
}).join(" \xB7 ");
|
|
1146
|
+
}
|
|
1147
|
+
function unsandboxedResourcesFrame(state, view) {
|
|
1148
|
+
const { mint } = state;
|
|
1149
|
+
const draw = laneDraw(view);
|
|
1150
|
+
const mintRow = mint !== void 0 && mint.status === "running" ? view.row(
|
|
1151
|
+
` ${view.glyph("running")} minting a credential for ${mintTargetText(mint.target)}`,
|
|
1152
|
+
elapsed(view, mint.startedAt, mint.endedAt)
|
|
1153
|
+
) : void 0;
|
|
1154
|
+
const rows = startedLanes(state).flatMap((lane) => {
|
|
1155
|
+
const row = lane.live(state.resources, draw);
|
|
1156
|
+
return row === void 0 ? [] : [{ lane: lane.lane, ...row }];
|
|
1157
|
+
});
|
|
1158
|
+
return rows.flatMap(({ lane, span, text, detail }, index) => [
|
|
1159
|
+
view.row(`${laneHead(view.glyph(span.status), lane)}${text}`, elapsed(view, span.startedAt, span.endedAt)),
|
|
1160
|
+
index === 0 && mintRow !== void 0 ? mintRow : detail !== void 0 ? view.line(` ${view.glyph("running")} ${detail}`) : ""
|
|
1161
|
+
]);
|
|
1162
|
+
}
|
|
1163
|
+
function unsandboxedResourcesRecord(state, view) {
|
|
1164
|
+
const { mint } = state;
|
|
1165
|
+
const draw = laneDraw(view);
|
|
1166
|
+
const lanes = startedLanes(state).flatMap((lane) => {
|
|
1167
|
+
const record = lane.record(state.resources, draw);
|
|
1168
|
+
if (record === void 0) return [];
|
|
1169
|
+
const { span } = record;
|
|
1170
|
+
return [
|
|
1171
|
+
view.row(
|
|
1172
|
+
`${laneHead(view.glyph(span.status), lane.lane)}${record.text}`,
|
|
1173
|
+
elapsed(view, span.startedAt, span.endedAt)
|
|
1174
|
+
),
|
|
1175
|
+
...record.lines
|
|
1176
|
+
];
|
|
1177
|
+
});
|
|
1178
|
+
if (lanes.length === 0) return [];
|
|
1179
|
+
return [...mint === void 0 ? [] : [credentialLine(mint, view)], ...lanes];
|
|
1180
|
+
}
|
|
1181
|
+
function testsFrame(state, view) {
|
|
1182
|
+
return state.command === void 0 ? [] : [testsLine(state, state.command, view, true)];
|
|
1183
|
+
}
|
|
1184
|
+
var LONG_FILE_MS = 1e4;
|
|
1185
|
+
function testsLine(state, command, view, live) {
|
|
1186
|
+
const { tests } = state;
|
|
1187
|
+
const end = command.outcome === void 0 ? void 0 : endText(command.outcome);
|
|
1188
|
+
const parts = [command.argv.join(" ")];
|
|
1189
|
+
if (end !== void 0) parts.push(end);
|
|
1190
|
+
else if (live && state.stopping) parts.push("stopping");
|
|
1191
|
+
const head = ` ${view.glyph(command.status)} tests `;
|
|
1192
|
+
const time = elapsed(view, command.startedAt, command.endedAt);
|
|
1193
|
+
const text = live && end === void 0 && !state.stopping && tests !== void 0 ? testsProgress(tests, view, view.width - visibleLength(head) - visibleLength(time) - 1) : parts.join(" ");
|
|
1194
|
+
return view.row(`${head}${text}`, time);
|
|
1195
|
+
}
|
|
1196
|
+
function testsProgress(tests, view, room) {
|
|
1197
|
+
const { paint: paint2, now } = view;
|
|
1198
|
+
const running = tests.workers.filter((worker) => worker.file !== void 0 || worker.containerSince !== void 0);
|
|
1199
|
+
const waiting = tests.workers.filter((worker) => worker.containerSince !== void 0).length;
|
|
1200
|
+
const longest = [...running].toSorted((a, b) => (a.fileStartedAt ?? 0) - (b.fileStartedAt ?? 0))[0];
|
|
1201
|
+
const longestMs = longest?.fileStartedAt === void 0 || now === void 0 ? void 0 : now - longest.fileStartedAt;
|
|
1202
|
+
const text = (showWaiting) => [
|
|
1203
|
+
`${tests.passed} passed`,
|
|
1204
|
+
...tests.failed === 0 ? [] : [paint2.failed(`${tests.failed} failed`)],
|
|
1205
|
+
`${tests.filesDone} ${tests.filesDone === 1 ? "file" : "files"} done`,
|
|
1206
|
+
`${running.length} running${waiting === 0 || !showWaiting ? "" : ` (${waiting} waiting on a container)`}`,
|
|
1207
|
+
...longest?.file === void 0 || longestMs === void 0 || longestMs < LONG_FILE_MS ? [] : [`longest: ${shortFile(longest.file)} ${seconds(longestMs)}`]
|
|
1208
|
+
].join(" \xB7 ");
|
|
1209
|
+
const full = text(true);
|
|
1210
|
+
return visibleLength(full) <= room ? full : text(false);
|
|
1211
|
+
}
|
|
1212
|
+
function cleanupLine(cleanup, runner, view, record) {
|
|
1213
|
+
const done = record || cleanup.status !== "running";
|
|
1214
|
+
const release = releaseText(cleanup.resources, done);
|
|
1215
|
+
const { runnerSandbox } = cleanup;
|
|
1216
|
+
const text = !done && cleanup.waiting ? `${WAITING_FOR_SNAPSHOT}\u2026` : runnerSandbox === null ? release ?? "nothing to release" : `${runnerSandboxText(runnerSandbox, runner, done)}${release === void 0 ? "" : `, ${release}`}`;
|
|
1217
|
+
const leftBehind = cleanupProblems(cleanup);
|
|
1218
|
+
const ending = done ? leftBehind === 0 ? "" : `: ${leftBehind} left behind` : "\u2026";
|
|
1219
|
+
return view.row(
|
|
1220
|
+
` ${view.glyph(cleanup.status)} cleanup ${text}${!done && cleanup.waiting ? "" : ending}`,
|
|
1221
|
+
elapsed(view, cleanup.startedAt, cleanup.endedAt)
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
function runnerSandboxText(sandbox, runner, done) {
|
|
1225
|
+
const kept = runner?.kept;
|
|
1226
|
+
if (kept !== void 0) return `kept the runner sandbox until ${isoSecondsText(kept.stopsAt)}`;
|
|
1227
|
+
const removed = `${done ? "stopped and deleted" : "stopping and deleting"} the runner sandbox`;
|
|
1228
|
+
switch (sandbox.kind) {
|
|
1229
|
+
case "keep":
|
|
1230
|
+
return !done && sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : removed;
|
|
1231
|
+
case "save": {
|
|
1232
|
+
const save = runner?.save;
|
|
1233
|
+
if (save?.kind === "saved") return `saved branch snapshot ${save.id} of ${save.branch}`;
|
|
1234
|
+
return !done && save?.kind !== "not-saved" ? `saving a branch snapshot of ${sandbox.branch}` : removed;
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
function statusGlyph(status, now, paint2) {
|
|
1239
|
+
switch (status) {
|
|
1240
|
+
case "pending":
|
|
1241
|
+
return paint2.faint("\xB7");
|
|
1242
|
+
case "running":
|
|
1243
|
+
return paint2.active(SPINNER[Math.floor(now / 90) % SPINNER.length] ?? "\xB7");
|
|
1244
|
+
case "done":
|
|
1245
|
+
return paint2.done("\u2713");
|
|
1246
|
+
case "failed":
|
|
1247
|
+
return paint2.failed("\u2717");
|
|
1248
|
+
case "stopped":
|
|
1249
|
+
return paint2.stopped("\u25A0");
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
function endText(outcome) {
|
|
1253
|
+
return outcome === "stopped" ? "stopped" : commandEnd(outcome);
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
// src/commands/exec/view.ts
|
|
1257
|
+
var PLAIN_WIDTH = 80;
|
|
1258
|
+
function runView(options) {
|
|
1259
|
+
const { presentation, progress, context } = options;
|
|
1260
|
+
if (progress === void 0)
|
|
1261
|
+
return {
|
|
1262
|
+
observer: { observe: async () => {
|
|
1263
|
+
} },
|
|
1264
|
+
runnerTerminal: context.runnerTerminal,
|
|
1265
|
+
width: PLAIN_WIDTH,
|
|
1266
|
+
paint: paint(false),
|
|
1267
|
+
finish: async () => {
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
if (presentation.kind === "plain") {
|
|
1271
|
+
const writer = droppingWriter(progress);
|
|
1272
|
+
return {
|
|
1273
|
+
observer: lineProgress(writer, { github: presentation.github, verbose: options.verbose }),
|
|
1274
|
+
runnerTerminal: context.runnerTerminal,
|
|
1275
|
+
width: Math.min(Math.max(presentation.columns ?? PLAIN_WIDTH, 60), 120),
|
|
1276
|
+
paint: paint(presentation.color),
|
|
1277
|
+
finish: async (summary) => {
|
|
1278
|
+
for (const line of summary) await writer(line);
|
|
1279
|
+
}
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
return liveView(context, paint(presentation.color), {
|
|
1283
|
+
showOutput: options.showOutput || options.verbose,
|
|
1284
|
+
verbose: options.verbose
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
function droppingWriter(write) {
|
|
1288
|
+
let failed = false;
|
|
1289
|
+
return async (line) => {
|
|
1290
|
+
if (failed) return;
|
|
1291
|
+
try {
|
|
1292
|
+
await write(line);
|
|
1293
|
+
} catch {
|
|
1294
|
+
failed = true;
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
function liveView(context, colors, options) {
|
|
1299
|
+
const { showOutput } = options;
|
|
1300
|
+
const terminal = context.progressTerminal;
|
|
1301
|
+
let state = EMPTY_RUN_STATE;
|
|
1302
|
+
let phase;
|
|
1303
|
+
let headerPrinted = false;
|
|
1304
|
+
let live = false;
|
|
1305
|
+
let finished = false;
|
|
1306
|
+
const width = () => terminal.columns() - 1;
|
|
1307
|
+
const frame = () => phase === void 0 || finished ? [] : phaseFrame(state, phase, context.clock.now().getTime(), width(), colors);
|
|
1308
|
+
const print = (lines) => {
|
|
1309
|
+
if (lines.length > 0) terminal.print("stderr", lines.map((line) => `${line}
|
|
1310
|
+
`).join(""));
|
|
1311
|
+
};
|
|
1312
|
+
const header = () => {
|
|
1313
|
+
if (headerPrinted) return [];
|
|
1314
|
+
headerPrinted = true;
|
|
1315
|
+
return [headerLine(state, colors)];
|
|
1316
|
+
};
|
|
1317
|
+
return {
|
|
1318
|
+
observer: {
|
|
1319
|
+
observe: async (timed) => {
|
|
1320
|
+
if (finished) return;
|
|
1321
|
+
state = applyStormEvent(state, timed);
|
|
1322
|
+
const next = activePhase(state);
|
|
1323
|
+
if (next !== phase) {
|
|
1324
|
+
print([
|
|
1325
|
+
...next === void 0 ? [] : header(),
|
|
1326
|
+
...phase === void 0 ? [] : phaseRecord(state, phase, width(), colors)
|
|
1327
|
+
]);
|
|
1328
|
+
phase = next;
|
|
1329
|
+
}
|
|
1330
|
+
print(noticeLines(timed, state.origin ?? timed.at.getTime(), options.verbose));
|
|
1331
|
+
const { event } = timed;
|
|
1332
|
+
if (showOutput && event.kind === "runner" && event.event.kind === "step-output") print([event.event.line]);
|
|
1333
|
+
if (!live) {
|
|
1334
|
+
terminal.show(frame);
|
|
1335
|
+
live = true;
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
},
|
|
1339
|
+
runnerTerminal: {
|
|
1340
|
+
color: context.runnerTerminal.color,
|
|
1341
|
+
writeStdout: (text) => terminal.print("stdout", text),
|
|
1342
|
+
writeStderr: (text) => terminal.print("stderr", text)
|
|
1343
|
+
},
|
|
1344
|
+
// The terminal may have been resized by the time the summary prints.
|
|
1345
|
+
get width() {
|
|
1346
|
+
return terminal.columns();
|
|
1347
|
+
},
|
|
1348
|
+
paint: colors,
|
|
1349
|
+
finish: async (summary) => {
|
|
1350
|
+
if (finished) return;
|
|
1351
|
+
finished = true;
|
|
1352
|
+
print([...header(), ...phase === void 0 ? [] : phaseRecord(state, phase, width(), colors), ...summary]);
|
|
1353
|
+
terminal.settle();
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
function noticeLines(timed, origin, verbose) {
|
|
1358
|
+
const line = (lane, text) => progressLine(timed.at.getTime() - origin, lane, text);
|
|
1359
|
+
const { event } = timed;
|
|
1360
|
+
switch (event.kind) {
|
|
1361
|
+
case "runner-prepared":
|
|
1362
|
+
return preparedNoteTexts(event).map((text) => line("runner", text));
|
|
1363
|
+
case "runner":
|
|
1364
|
+
return runnerNoticeLines(event.event, line);
|
|
1365
|
+
case "resource":
|
|
1366
|
+
return RESOURCE_PRESENTATIONS.notices(event, { verbose }).map(({ lane, text }) => line(lane, text));
|
|
1367
|
+
// A line a resource instance reported prints as it is, in its lane, and a warning marked as one.
|
|
1368
|
+
case "resource-notice":
|
|
1369
|
+
return [line(event.lane, event.text)];
|
|
1370
|
+
case "resource-warning":
|
|
1371
|
+
return [line(event.lane, resourceWarningText(event))];
|
|
1372
|
+
case "resource-skipped":
|
|
1373
|
+
return [line("run", skippedText(event))];
|
|
1374
|
+
// The live view draws what an acquired resource holds from its lane's state.
|
|
1375
|
+
case "resource-acquired":
|
|
1376
|
+
case "started":
|
|
1377
|
+
case "requesting-token":
|
|
1378
|
+
case "minting":
|
|
1379
|
+
case "minted":
|
|
1380
|
+
case "cleanup-started":
|
|
1381
|
+
case "cleanup-finished":
|
|
1382
|
+
case "command-started":
|
|
1383
|
+
case "command-ended":
|
|
1384
|
+
case "lanes-started":
|
|
1385
|
+
case "lane-started":
|
|
1386
|
+
case "lane-ended":
|
|
1387
|
+
case "test":
|
|
1388
|
+
case "test-event-unreadable":
|
|
1389
|
+
case "test-events-incomplete":
|
|
1390
|
+
return [];
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
function runnerNoticeLines(event, line) {
|
|
1394
|
+
switch (event.kind) {
|
|
1395
|
+
case "snapshot-entry-not-written":
|
|
1396
|
+
return [line("runner", cacheWriteFailureText(event.failure))];
|
|
1397
|
+
case "branch-snapshots-dropped":
|
|
1398
|
+
case "branch-snapshots-not-dropped":
|
|
1399
|
+
return [line("runner", branchSnapshotsDropText(event))];
|
|
1400
|
+
case "branch-snapshot-saved":
|
|
1401
|
+
case "branch-snapshot-not-saved":
|
|
1402
|
+
return [line("cleanup", branchSnapshotSaveText(event))];
|
|
1403
|
+
// The live view's phases show the rest.
|
|
1404
|
+
case "snapshot-reused":
|
|
1405
|
+
case "snapshot-build-started":
|
|
1406
|
+
case "runner-sandbox-starting":
|
|
1407
|
+
case "sandbox-started":
|
|
1408
|
+
case "output-started":
|
|
1409
|
+
case "output-ended":
|
|
1410
|
+
case "step-started":
|
|
1411
|
+
case "step-output":
|
|
1412
|
+
case "step-finished":
|
|
1413
|
+
case "snapshot-saving":
|
|
1414
|
+
case "snapshot-built":
|
|
1415
|
+
case "uploading":
|
|
1416
|
+
case "uploaded":
|
|
1417
|
+
case "command-output-started":
|
|
1418
|
+
case "command-stopped":
|
|
1419
|
+
case "stopping":
|
|
1420
|
+
case "waiting-for-snapshot":
|
|
1421
|
+
case "sandbox-kept":
|
|
1422
|
+
case "branch-snapshot-saving":
|
|
1423
|
+
return [];
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
// src/commands/exec/run-collector.ts
|
|
1428
|
+
function runCollector(directory) {
|
|
1429
|
+
let state = EMPTY_RUN_STATE;
|
|
1430
|
+
const events = [];
|
|
1431
|
+
let unreadable = 0;
|
|
1432
|
+
let incomplete;
|
|
1433
|
+
let workerOffsetMs = Infinity;
|
|
1434
|
+
const collect = (event) => {
|
|
1435
|
+
directory?.appendTestEvent(testEventLine(event));
|
|
1436
|
+
events.push(summaryEvent(event));
|
|
1437
|
+
};
|
|
1438
|
+
return {
|
|
1439
|
+
observer: {
|
|
1440
|
+
observe: async (timed) => {
|
|
1441
|
+
const { event } = timed;
|
|
1442
|
+
if (event.kind === "runner" && event.event.kind === "step-output") return;
|
|
1443
|
+
state = applyStormEvent(state, timed);
|
|
1444
|
+
if (event.kind === "test") {
|
|
1445
|
+
collect(event.event);
|
|
1446
|
+
if (event.event.kind !== "test-result")
|
|
1447
|
+
workerOffsetMs = Math.min(workerOffsetMs, timed.at.getTime() - event.event.at);
|
|
1448
|
+
} else if (event.kind === "test-event-unreadable") unreadable += 1;
|
|
1449
|
+
else if (event.kind === "test-events-incomplete") incomplete ??= event.message;
|
|
1450
|
+
}
|
|
1451
|
+
},
|
|
1452
|
+
readStaged: async (runDirectory, redact) => {
|
|
1453
|
+
const read = await runDirectory.readTestEvents((line) => {
|
|
1454
|
+
const event = parseTestEvent(line);
|
|
1455
|
+
if (event === void 0) unreadable += 1;
|
|
1456
|
+
else collect(redactStrings(event, redact));
|
|
1457
|
+
});
|
|
1458
|
+
if (!read.ok) incomplete ??= read.failure.message;
|
|
1459
|
+
},
|
|
1460
|
+
finish: () => ({
|
|
1461
|
+
state,
|
|
1462
|
+
tests: { events, unreadable, incomplete },
|
|
1463
|
+
workerOffsetMs: workerOffsetMs === Infinity ? 0 : workerOffsetMs
|
|
1464
|
+
})
|
|
1465
|
+
};
|
|
1466
|
+
}
|
|
1467
|
+
function summaryEvent(event) {
|
|
1468
|
+
if (event.kind !== "test-result") return event;
|
|
1469
|
+
return {
|
|
1470
|
+
kind: event.kind,
|
|
1471
|
+
id: event.id,
|
|
1472
|
+
file: event.file,
|
|
1473
|
+
test: event.test,
|
|
1474
|
+
state: event.state,
|
|
1475
|
+
retryCount: event.retryCount,
|
|
1476
|
+
flaky: event.flaky,
|
|
1477
|
+
at: event.at
|
|
1478
|
+
};
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
// src/commands/exec/run-command.ts
|
|
1482
|
+
var OWN_RUN_FIELDS = {
|
|
1483
|
+
scope: z4.string().min(1).optional(),
|
|
1484
|
+
project: z4.string().min(1).optional(),
|
|
1485
|
+
credential: z4.enum(["mint", "github-actions"]).optional(),
|
|
1486
|
+
unsandboxed: z4.boolean().default(false),
|
|
1487
|
+
rebuildSnapshot: z4.boolean().default(false),
|
|
1488
|
+
saveSnapshot: z4.boolean().default(false),
|
|
1489
|
+
showOutput: z4.boolean().default(false),
|
|
1490
|
+
keepSandbox: z4.string().optional(),
|
|
1491
|
+
verbose: z4.boolean().default(false)
|
|
1492
|
+
};
|
|
1493
|
+
var RUN_REQUEST_FIELDS = { ...OWN_RUN_FIELDS, ...resourceFlagFields(Object.keys(OWN_RUN_FIELDS)) };
|
|
1494
|
+
var RUN_CLI_OPTIONS = { project: { short: "p" } };
|
|
1495
|
+
var runRequestSchema = z4.object(RUN_REQUEST_FIELDS);
|
|
1496
|
+
async function runCommand({ app, ui, signal }, request, spec) {
|
|
1497
|
+
const lifecycles = resourceLifecycles(app.worlds);
|
|
1498
|
+
const planned = await planRun(
|
|
1499
|
+
app,
|
|
1500
|
+
lifecycles,
|
|
1501
|
+
{ ...request, given: resourceFlagValues(request) },
|
|
1502
|
+
spec.planCommand,
|
|
1503
|
+
signal
|
|
1504
|
+
);
|
|
1505
|
+
if (!planned.ok) return planned.refusal;
|
|
1506
|
+
const { configFile, argv, testPlan, planOptions } = planned;
|
|
1507
|
+
const before = await resourcesBeforeRun(lifecycles, planned, request);
|
|
1508
|
+
if (!before.ok) return before.refusal;
|
|
1509
|
+
if (signal.aborted) return canceledBeforeStart();
|
|
1510
|
+
const { where, used } = before;
|
|
1511
|
+
const plan = recordedPlan(testPlan, planOptions);
|
|
1512
|
+
if (plan !== void 0) await ui.progress?.(testPlanLine(plan));
|
|
1513
|
+
const base = {
|
|
1514
|
+
argv,
|
|
1515
|
+
// A resource the run uses can hide launcher environment variables that could point the command at something else
|
|
1516
|
+
// than the run payload names, so the command never sees one.
|
|
1517
|
+
env: Object.fromEntries(Object.entries(app.env).filter(([name]) => !used.hiddenVariables.includes(name))),
|
|
1518
|
+
version: app.version,
|
|
1519
|
+
commit: app.commit,
|
|
1520
|
+
configFile,
|
|
1521
|
+
verbose: request.verbose
|
|
1522
|
+
};
|
|
1523
|
+
const requested = await runRequestFor(app, { where, used, base, request, configFile });
|
|
1524
|
+
if (!requested.ok) return requested.refusal;
|
|
1525
|
+
const { run } = requested;
|
|
1526
|
+
const secrets = [...used.secrets, ...Object.values(run.runner?.secrets ?? {})];
|
|
1527
|
+
const redact = redactor(secrets);
|
|
1528
|
+
const terminate = new AbortController();
|
|
1529
|
+
const forward = () => {
|
|
1530
|
+
const reason = signal.reason;
|
|
1531
|
+
if (reason instanceof NodeSignalCancellation && reason.signal === "SIGTERM") terminate.abort(reason);
|
|
1532
|
+
};
|
|
1533
|
+
if (signal.aborted) forward();
|
|
1534
|
+
else signal.addEventListener("abort", forward, { once: true });
|
|
1535
|
+
const view = runView({
|
|
1536
|
+
presentation: app.presentation,
|
|
1537
|
+
progress: ui.progress,
|
|
1538
|
+
context: app.context,
|
|
1539
|
+
showOutput: request.showOutput,
|
|
1540
|
+
verbose: request.verbose
|
|
1541
|
+
});
|
|
1542
|
+
const git = await checkoutGit(app.context.checkout, app.cwd);
|
|
1543
|
+
const startedAt = app.context.clock.now();
|
|
1544
|
+
const record = redactStrings(
|
|
1545
|
+
{
|
|
1546
|
+
version: 3,
|
|
1547
|
+
startedAt: startedAt.toISOString(),
|
|
1548
|
+
cwd: app.cwd,
|
|
1549
|
+
configFile,
|
|
1550
|
+
argv,
|
|
1551
|
+
...plan === void 0 ? {} : { plan },
|
|
1552
|
+
where: startedWhere(run),
|
|
1553
|
+
git
|
|
1554
|
+
},
|
|
1555
|
+
redact
|
|
1556
|
+
);
|
|
1557
|
+
const opened = await app.context.runDirectories.open({
|
|
1558
|
+
startedAt,
|
|
1559
|
+
keep: RUN_DIRECTORIES_KEPT,
|
|
1560
|
+
run: runRecordText(record)
|
|
1561
|
+
});
|
|
1562
|
+
const directory = opened.ok ? opened.directory : void 0;
|
|
1563
|
+
const collector = runCollector(directory);
|
|
1564
|
+
const observers = [collector.observer, view.observer];
|
|
1565
|
+
if (directory !== void 0) observers.push(runDirectoryObserver(directory));
|
|
1566
|
+
const observer = observeAll(...observers);
|
|
1567
|
+
const terminal = teeTerminal(view.runnerTerminal, directory);
|
|
1568
|
+
let outcome;
|
|
1569
|
+
try {
|
|
1570
|
+
const ended = await executeRun(
|
|
1571
|
+
RESOURCES,
|
|
1572
|
+
{ ...app.context, runnerTerminal: secrets.length === 0 ? terminal : redactingTerminal(terminal, redact) },
|
|
1573
|
+
app.worlds,
|
|
1574
|
+
run.runner === void 0 && directory !== void 0 ? { ...run, testEvents: testEventsPath(directory.path) } : run,
|
|
1575
|
+
{ signal, terminate: terminate.signal },
|
|
1576
|
+
timedProgress(app.context.clock, secrets.length === 0 ? observer : redactingObserver(observer, redact))
|
|
1577
|
+
);
|
|
1578
|
+
outcome = secrets.length === 0 ? ended : redactStrings(ended, redact);
|
|
1579
|
+
} catch (error) {
|
|
1580
|
+
await view.finish([]);
|
|
1581
|
+
await directory?.close();
|
|
1582
|
+
throw error;
|
|
1583
|
+
}
|
|
1584
|
+
signal.removeEventListener("abort", forward);
|
|
1585
|
+
const ran = await summarize(app, {
|
|
1586
|
+
command: spec.name,
|
|
1587
|
+
view,
|
|
1588
|
+
collector,
|
|
1589
|
+
opened,
|
|
1590
|
+
redact,
|
|
1591
|
+
record,
|
|
1592
|
+
outcome
|
|
1593
|
+
});
|
|
1594
|
+
switch (outcome.kind) {
|
|
1595
|
+
case "ran": {
|
|
1596
|
+
app.exit.status = commandExitStatus(outcome.command);
|
|
1597
|
+
const { command } = outcome;
|
|
1598
|
+
return spec.ran(
|
|
1599
|
+
{
|
|
1600
|
+
version: app.version,
|
|
1601
|
+
commit: app.commit,
|
|
1602
|
+
configFile,
|
|
1603
|
+
resources: RESOURCE_REPORTS.ranFacts(outcome.resources),
|
|
1604
|
+
cleanup: RUN_CLEANUP.facts(outcome),
|
|
1605
|
+
command: command.kind === "exited" ? { exitCode: command.code, signal: null } : command.kind === "signaled" ? { exitCode: null, signal: command.signal } : { exitCode: null, signal: null },
|
|
1606
|
+
runner: outcome.runner === void 0 ? null : {
|
|
1607
|
+
snapshotId: outcome.runner.snapshotId,
|
|
1608
|
+
base: outcome.runner.base,
|
|
1609
|
+
snapshotBranch: outcome.runner.snapshotBranch,
|
|
1610
|
+
snapshotHead: outcome.runner.snapshotHead,
|
|
1611
|
+
built: outcome.runner.built,
|
|
1612
|
+
vcpus: outcome.runner.vcpus,
|
|
1613
|
+
region: outcome.runner.region,
|
|
1614
|
+
runtime: outcome.runner.runtime,
|
|
1615
|
+
buildMs: outcome.runner.buildMs,
|
|
1616
|
+
save: outcome.runner.save
|
|
1617
|
+
},
|
|
1618
|
+
timeline: ran,
|
|
1619
|
+
runId: directory?.id ?? null
|
|
1620
|
+
},
|
|
1621
|
+
{ testPlan, options: planOptions }
|
|
1622
|
+
);
|
|
1623
|
+
}
|
|
1624
|
+
case "resource-refused":
|
|
1625
|
+
return resourceRefused(outcome, RUN_CLEANUP.facts(outcome));
|
|
1626
|
+
// The run's mint: in a sandboxed run for the runner sandbox, in an unsandboxed run for a resource that needed it:
|
|
1627
|
+
// its `acquireForRun` answered `mintFailed`, which the launcher owns.
|
|
1628
|
+
case "mint-failed":
|
|
1629
|
+
return mintFailedErrors.mintFailed({
|
|
1630
|
+
...outcome.target,
|
|
1631
|
+
...describeMintFailure(outcome.failure, outcome.target),
|
|
1632
|
+
runner: outcome.runner,
|
|
1633
|
+
cleanup: RUN_CLEANUP.facts(outcome)
|
|
1634
|
+
});
|
|
1635
|
+
case "spawn-failed":
|
|
1636
|
+
return runErrors.spawnFailed({
|
|
1637
|
+
executable: outcome.executable,
|
|
1638
|
+
message: outcome.message,
|
|
1639
|
+
// Only an unsandboxed run spawns its command on this machine, so it holds no runner sandbox.
|
|
1640
|
+
cleanup: RUN_CLEANUP.facts({ runnerCleanup: null, resourceCleanup: outcome.resourceCleanup })
|
|
1641
|
+
});
|
|
1642
|
+
case "canceled":
|
|
1643
|
+
return outcomes.canceled({ changed: canceledChanges(outcome) });
|
|
1644
|
+
case "runner-failed":
|
|
1645
|
+
return runErrors.runnerFailed({
|
|
1646
|
+
failure: runnerFailureFacts(outcome.failure),
|
|
1647
|
+
cleanup: RUN_CLEANUP.facts(outcome)
|
|
1648
|
+
});
|
|
1649
|
+
case "snapshot-gone":
|
|
1650
|
+
return runErrors.snapshotGone({
|
|
1651
|
+
snapshotId: outcome.entry.snapshotId,
|
|
1652
|
+
base: outcome.entry.base,
|
|
1653
|
+
removal: outcome.removal === void 0 ? null : { ...outcome.removal },
|
|
1654
|
+
cleanup: RUN_CLEANUP.facts(outcome)
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
function runProblems(request) {
|
|
1659
|
+
const { credential, unsandboxed, rebuildSnapshot, saveSnapshot, showOutput, keepSandbox } = request;
|
|
1660
|
+
return [
|
|
1661
|
+
...resourceFlagProblems(request),
|
|
1662
|
+
...rebuildSnapshot && unsandboxed ? [
|
|
1663
|
+
{
|
|
1664
|
+
field: "rebuildSnapshot",
|
|
1665
|
+
message: "--rebuild-snapshot builds a runner snapshot; drop it or --unsandboxed."
|
|
1666
|
+
}
|
|
1667
|
+
] : [],
|
|
1668
|
+
...!unsandboxed && credential === "github-actions" ? [
|
|
1669
|
+
{
|
|
1670
|
+
field: "credential",
|
|
1671
|
+
message: "A sandboxed run needs the mint: the runner sandbox uses a minted Vercel token. Add --unsandboxed, or drop --credential github-actions."
|
|
1672
|
+
}
|
|
1673
|
+
] : [],
|
|
1674
|
+
...showOutput && unsandboxed ? [
|
|
1675
|
+
{
|
|
1676
|
+
field: "showOutput",
|
|
1677
|
+
message: "--show-output prints a sandboxed run's step output; drop it or --unsandboxed."
|
|
1678
|
+
}
|
|
1679
|
+
] : [],
|
|
1680
|
+
...keepSandbox !== void 0 && parseKeepTime(keepSandbox) === void 0 ? [
|
|
1681
|
+
{
|
|
1682
|
+
field: "keepSandbox",
|
|
1683
|
+
message: `--keep-sandbox takes 0, or a whole number of minutes or hours up to 5h, such as 30m or 2h, not ${JSON.stringify(keepSandbox)}.`
|
|
1684
|
+
}
|
|
1685
|
+
] : [],
|
|
1686
|
+
...keepSandbox !== void 0 && unsandboxed ? [
|
|
1687
|
+
{
|
|
1688
|
+
field: "keepSandbox",
|
|
1689
|
+
message: "--keep-sandbox keeps a sandboxed run's runner sandbox; drop it or --unsandboxed."
|
|
1690
|
+
}
|
|
1691
|
+
] : [],
|
|
1692
|
+
...saveSnapshot && unsandboxed ? [
|
|
1693
|
+
{
|
|
1694
|
+
field: "saveSnapshot",
|
|
1695
|
+
message: "--save-snapshot saves a sandboxed run's runner sandbox; drop it or --unsandboxed."
|
|
1696
|
+
}
|
|
1697
|
+
] : [],
|
|
1698
|
+
...saveSnapshot && keepSandbox !== void 0 && (parseKeepTime(keepSandbox) ?? 0) > 0 ? [
|
|
1699
|
+
{
|
|
1700
|
+
field: "saveSnapshot",
|
|
1701
|
+
message: "--save-snapshot saves the runner sandbox instead of keeping it; drop --keep-sandbox or set it to 0."
|
|
1702
|
+
}
|
|
1703
|
+
] : []
|
|
1704
|
+
];
|
|
1705
|
+
}
|
|
1706
|
+
async function runRequestFor(app, options) {
|
|
1707
|
+
const { where, used, base, request, configFile } = options;
|
|
1708
|
+
if (where.kind === "unsandboxed") {
|
|
1709
|
+
const run2 = {
|
|
1710
|
+
...base,
|
|
1711
|
+
resources: used.requests,
|
|
1712
|
+
skipped: used.skipped,
|
|
1713
|
+
...where.credential === void 0 ? {} : { credential: where.credential }
|
|
1714
|
+
};
|
|
1715
|
+
return { ok: true, run: run2 };
|
|
1716
|
+
}
|
|
1717
|
+
const prepared = await prepareRunner(app.context, {
|
|
1718
|
+
cwd: app.cwd,
|
|
1719
|
+
recipe: where.recipe,
|
|
1720
|
+
// The recipe's `vcpus` reads each of the run's resources by its definition: one its `beforeRun` skipped isn't.
|
|
1721
|
+
vcpusRun: recipeRun(recipeResources(used.requests)),
|
|
1722
|
+
rebuild: request.rebuildSnapshot,
|
|
1723
|
+
saveSnapshot: request.saveSnapshot
|
|
1724
|
+
});
|
|
1725
|
+
if (prepared.kind !== "ok") {
|
|
1726
|
+
const refusal = prepareRefusal(prepared, configFile);
|
|
1727
|
+
const secrets = [...used.secrets, ...Object.values(where.secrets)];
|
|
1728
|
+
return {
|
|
1729
|
+
ok: false,
|
|
1730
|
+
refusal: secrets.length === 0 ? refusal : redactStrings(refusal, redactor(secrets))
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1733
|
+
const { save } = prepared.prepared;
|
|
1734
|
+
const run = {
|
|
1735
|
+
...base,
|
|
1736
|
+
resources: used.requests,
|
|
1737
|
+
skipped: used.skipped,
|
|
1738
|
+
runner: {
|
|
1739
|
+
prepared: prepared.prepared,
|
|
1740
|
+
target: where.target,
|
|
1741
|
+
user: app.user,
|
|
1742
|
+
secrets: where.secrets,
|
|
1743
|
+
sandbox: save?.kind === "branch" ? { kind: "save", branch: save.branch } : { kind: "keep", ms: keepSandboxMinutes(request.keepSandbox, where.recipe, app.env) * 6e4 }
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1746
|
+
return { ok: true, run };
|
|
1747
|
+
}
|
|
1748
|
+
function prepareRefusal(prepared, configFile) {
|
|
1749
|
+
switch (prepared.kind) {
|
|
1750
|
+
case "no-base-ref":
|
|
1751
|
+
return runErrors.noBaseRef({ refs: prepared.refs.map(({ ref, reason }) => ({ ref, reason })) });
|
|
1752
|
+
case "submodules":
|
|
1753
|
+
return runErrors.submodulesRefused({ paths: [...prepared.paths] });
|
|
1754
|
+
case "invalid-recipe":
|
|
1755
|
+
return invalidConfig(configFile ?? "", [
|
|
1756
|
+
{ key: ["runner", ...prepared.path].join("."), location: null, problem: prepared.problem }
|
|
1757
|
+
]);
|
|
1758
|
+
case "checkout-failed":
|
|
1759
|
+
return checkoutFailedRefusal(prepared.failure);
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
function checkoutFailedRefusal(failure) {
|
|
1763
|
+
return runErrors.runnerFailed({
|
|
1764
|
+
failure: runnerFailureFacts({ kind: "checkout-failed", failure }),
|
|
1765
|
+
cleanup: RUN_CLEANUP.facts(NOTHING_RELEASED)
|
|
1766
|
+
});
|
|
1767
|
+
}
|
|
1768
|
+
async function summarize(app, run) {
|
|
1769
|
+
const { view, opened } = run;
|
|
1770
|
+
const directory = opened.ok ? opened.directory : void 0;
|
|
1771
|
+
if (directory !== void 0) await run.collector.readStaged(directory, run.redact);
|
|
1772
|
+
const collected = run.collector.finish();
|
|
1773
|
+
const { state, tests } = collected;
|
|
1774
|
+
const ran = stormTimeline(state);
|
|
1775
|
+
const timeline = timelineFacts(ran);
|
|
1776
|
+
directory?.publishTestEvents();
|
|
1777
|
+
directory?.writeTimeline(JSON.stringify(timeline, null, 2));
|
|
1778
|
+
directory?.writeRun(
|
|
1779
|
+
runRecordText({
|
|
1780
|
+
...run.record,
|
|
1781
|
+
where: endedWhere(
|
|
1782
|
+
run.record.where,
|
|
1783
|
+
state.runner,
|
|
1784
|
+
run.outcome.kind === "ran" ? run.outcome.runner?.save ?? null : null
|
|
1785
|
+
),
|
|
1786
|
+
ended: runEnd(run.outcome, state.command, tests)
|
|
1787
|
+
})
|
|
1788
|
+
);
|
|
1789
|
+
const writeFailure = await directory?.close();
|
|
1790
|
+
const failed = tests.events.some((event) => event.kind === "test-result" && event.state === "fail");
|
|
1791
|
+
const testsLines = testsSummaryLines(tests.events, tests.unreadable, tests.incomplete);
|
|
1792
|
+
const stepLogs = failedStepLogs(ran, directory?.path, app.env);
|
|
1793
|
+
const clock = workerClock(ran, collected);
|
|
1794
|
+
const charted = clock === void 0 ? void 0 : testsChart(tests.events, tests.unreadable, clock, tests.incomplete);
|
|
1795
|
+
const summarized = await app.context.jobSummary.appendJobSummary(
|
|
1796
|
+
jobSummaryMarkdown(timeline, {
|
|
1797
|
+
command: run.command,
|
|
1798
|
+
logs: directory?.path,
|
|
1799
|
+
details: [...testsLines, ...stepLogs]
|
|
1800
|
+
})
|
|
1801
|
+
);
|
|
1802
|
+
await view.finish(
|
|
1803
|
+
waterfallLines(timeline, {
|
|
1804
|
+
width: view.width,
|
|
1805
|
+
paint: view.paint,
|
|
1806
|
+
logs: logsText(opened, writeFailure, app.env, failed),
|
|
1807
|
+
...charted === void 0 ? {} : { workers: charted.lanes },
|
|
1808
|
+
details: [
|
|
1809
|
+
...charted?.notes ?? testsLines,
|
|
1810
|
+
...stepLogs,
|
|
1811
|
+
...summarized.kind === "failed" ? [` couldn't append to the job summary at ${summarized.failure.path}: ${summarized.failure.message}`] : []
|
|
1812
|
+
]
|
|
1813
|
+
})
|
|
1814
|
+
);
|
|
1815
|
+
return timeline;
|
|
1816
|
+
}
|
|
1817
|
+
function workerClock(ran, collected) {
|
|
1818
|
+
const tests = ran.rows.find((row) => row.name === "tests");
|
|
1819
|
+
if (tests === void 0) return void 0;
|
|
1820
|
+
return { runStartedAt: Date.parse(ran.startedAt), offsetMs: collected.workerOffsetMs, tests };
|
|
1821
|
+
}
|
|
1822
|
+
function teeTerminal(terminal, directory) {
|
|
1823
|
+
if (directory === void 0) return terminal;
|
|
1824
|
+
return {
|
|
1825
|
+
color: terminal.color,
|
|
1826
|
+
writeStdout: (text) => {
|
|
1827
|
+
directory.appendCommandOutput(text);
|
|
1828
|
+
terminal.writeStdout(text);
|
|
1829
|
+
},
|
|
1830
|
+
writeStderr: (text) => {
|
|
1831
|
+
directory.appendCommandOutput(text);
|
|
1832
|
+
terminal.writeStderr(text);
|
|
1833
|
+
}
|
|
1834
|
+
};
|
|
1835
|
+
}
|
|
1836
|
+
function displayPath(path, env) {
|
|
1837
|
+
const home = env["HOME"];
|
|
1838
|
+
if (home === void 0 || home === "" || !path.startsWith(`${home}/`)) return path;
|
|
1839
|
+
return `~${path.slice(home.length)}`;
|
|
1840
|
+
}
|
|
1841
|
+
function logsText(opened, writeFailure, env, failed) {
|
|
1842
|
+
if (!opened.ok) return `none: couldn't make ${opened.failure.path}: ${opened.failure.message}`;
|
|
1843
|
+
const path = `${displayPath(opened.directory.path, env)}/`;
|
|
1844
|
+
const problems = [
|
|
1845
|
+
...writeFailure === void 0 ? [] : [`couldn't write ${writeFailure.path}: ${writeFailure.message}`],
|
|
1846
|
+
...opened.pruneFailures.slice(0, 1).map((failure) => `couldn't remove ${failure.path}: ${failure.message}`)
|
|
1847
|
+
];
|
|
1848
|
+
const show = `storm runs show ${opened.directory.id}${failed ? " --failed" : ""}`;
|
|
1849
|
+
return `${problems.length === 0 ? path : `${path} (${problems.join("; ")})`} \xB7 ${show}`;
|
|
1850
|
+
}
|
|
1851
|
+
function runEnd(outcome, ran, tests) {
|
|
1852
|
+
const command = outcome.kind === "ran" ? outcome.command : void 0;
|
|
1853
|
+
const ranRecords = outcome.kind === "ran" ? outcome.resources : void 0;
|
|
1854
|
+
const ms = ran?.outcome === void 0 || ran.outcome === "stopped" || ran.endedAt === void 0 ? null : ran.endedAt - ran.startedAt;
|
|
1855
|
+
return {
|
|
1856
|
+
outcome: outcome.kind,
|
|
1857
|
+
exitCode: command === void 0 ? null : commandExitStatus(command),
|
|
1858
|
+
signal: command?.kind === "signaled" ? command.signal : null,
|
|
1859
|
+
ms,
|
|
1860
|
+
tests: testTotals(tests.events),
|
|
1861
|
+
testsIncomplete: tests.incomplete ?? null,
|
|
1862
|
+
resources: ranRecords === void 0 ? null : RESOURCE_REPORTS.ranFacts(ranRecords),
|
|
1863
|
+
resourceRows: ranRecords === void 0 ? [] : RESOURCE_REPORTS.ranRows(ranRecords)
|
|
1864
|
+
};
|
|
1865
|
+
}
|
|
1866
|
+
async function checkoutGit(checkout, cwd) {
|
|
1867
|
+
const root = await checkout.repositoryRoot({ cwd });
|
|
1868
|
+
if (!root.ok) return null;
|
|
1869
|
+
const head = await checkout.head({ repoRoot: root.value });
|
|
1870
|
+
return head.ok ? { ...head.value } : null;
|
|
1871
|
+
}
|
|
1872
|
+
function recipeResources(requests) {
|
|
1873
|
+
return Object.fromEntries(
|
|
1874
|
+
Object.entries(requests).map(([key, { definition, options }]) => {
|
|
1875
|
+
if (typeof options !== "object" || options === null) throw new Error(`${key}'s options are not an object`);
|
|
1876
|
+
return [key, { definition, options }];
|
|
1877
|
+
})
|
|
1878
|
+
);
|
|
1879
|
+
}
|
|
1880
|
+
var DEFAULT_KEEP_SANDBOX_MINUTES = 30;
|
|
1881
|
+
function keepSandboxMinutes(flag, recipe, env) {
|
|
1882
|
+
const fromFlag = flag === void 0 ? void 0 : parseKeepTime(flag);
|
|
1883
|
+
return fromFlag ?? recipe.keepSandboxMinutes ?? (isCi(env) ? 0 : DEFAULT_KEEP_SANDBOX_MINUTES);
|
|
1884
|
+
}
|
|
1885
|
+
function isCi(env) {
|
|
1886
|
+
const ci = env["CI"];
|
|
1887
|
+
return ci !== void 0 && ci !== "" && ci !== "0" && ci.toLowerCase() !== "false";
|
|
1888
|
+
}
|
|
1889
|
+
function startedWhere(run) {
|
|
1890
|
+
if (run.runner === void 0) return { kind: "unsandboxed" };
|
|
1891
|
+
const { prepared, target } = run.runner;
|
|
1892
|
+
return {
|
|
1893
|
+
kind: "runner",
|
|
1894
|
+
team: target.team,
|
|
1895
|
+
project: target.project,
|
|
1896
|
+
region: prepared.recipe.region,
|
|
1897
|
+
runtime: prepared.recipe.runtime,
|
|
1898
|
+
vcpus: prepared.vcpus,
|
|
1899
|
+
base: prepared.base,
|
|
1900
|
+
baseRef: prepared.baseRef,
|
|
1901
|
+
sandbox: null,
|
|
1902
|
+
snapshot: null,
|
|
1903
|
+
keptUntil: null,
|
|
1904
|
+
save: null
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
function endedWhere(where, runner, save) {
|
|
1908
|
+
if (where.kind === "unsandboxed") return where;
|
|
1909
|
+
const snapshot = runner?.snapshot;
|
|
1910
|
+
return {
|
|
1911
|
+
...where,
|
|
1912
|
+
sandbox: runner?.sandbox?.name ?? null,
|
|
1913
|
+
snapshot: snapshot === void 0 || snapshot.kind === "building" ? null : {
|
|
1914
|
+
id: snapshot.id,
|
|
1915
|
+
base: snapshot.base,
|
|
1916
|
+
built: snapshot.kind === "built",
|
|
1917
|
+
branch: snapshot.branch,
|
|
1918
|
+
head: snapshot.head
|
|
1919
|
+
},
|
|
1920
|
+
keptUntil: runner?.kept?.stopsAt ?? null,
|
|
1921
|
+
save
|
|
1922
|
+
};
|
|
1923
|
+
}
|
|
1924
|
+
function failedStepLogs(ran, directory, env) {
|
|
1925
|
+
if (directory === void 0) return [];
|
|
1926
|
+
const runner = ran.rows.find((row) => row.name === "runner");
|
|
1927
|
+
return (runner?.steps ?? []).filter((step) => step.outcome === "failed").flatMap((step) => {
|
|
1928
|
+
const log = stepLog(directory, step.name);
|
|
1929
|
+
return log === void 0 ? [] : [` failed ${step.name}, whole output: ${displayPath(log, env)}`];
|
|
1930
|
+
});
|
|
1931
|
+
}
|
|
1932
|
+
function runnerFailureFacts(failure) {
|
|
1933
|
+
switch (failure.kind) {
|
|
1934
|
+
case "snapshot-build-step-failed":
|
|
1935
|
+
case "apply-failed":
|
|
1936
|
+
case "install-failed":
|
|
1937
|
+
case "build-failed":
|
|
1938
|
+
return { kind: failure.kind, label: failure.label, exitCode: failure.exitCode, tail: [...failure.tail] };
|
|
1939
|
+
case "sandbox-api-failed":
|
|
1940
|
+
return { kind: failure.kind, operation: failure.operation, status: failure.status, message: failure.message };
|
|
1941
|
+
case "checkout-failed":
|
|
1942
|
+
return { kind: failure.kind, message: failure.failure.message, command: failure.failure.displayCommand ?? null };
|
|
1943
|
+
case "credential-claims-missing":
|
|
1944
|
+
return { kind: failure.kind, ...failure.target };
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
var NOTHING_RELEASED = { runnerCleanup: null, resourceCleanup: {} };
|
|
1948
|
+
function canceledChanges(outcome) {
|
|
1949
|
+
const { commandStopped } = outcome;
|
|
1950
|
+
const lines = [
|
|
1951
|
+
commandStopped === true ? "The command was stopped in the runner sandbox." : "The command didn't run."
|
|
1952
|
+
];
|
|
1953
|
+
const cleanup = RUN_CLEANUP.facts(outcome).runner;
|
|
1954
|
+
if (cleanup !== null) lines.push(...runnerCleanupLines(cleanup));
|
|
1955
|
+
lines.push(...RESOURCE_REPORTS.canceledLines(outcome.resourceCleanup));
|
|
1956
|
+
return lines.join("\n");
|
|
1957
|
+
}
|
|
1958
|
+
function runnerCleanupLines({ kept, notKept, notStopped, notDeleted }) {
|
|
1959
|
+
const problems = [
|
|
1960
|
+
...notKept === null ? [] : [notKeptText(notKept)],
|
|
1961
|
+
...notStopped.map(notStoppedText),
|
|
1962
|
+
...notDeleted.map(notDeletedText)
|
|
1963
|
+
];
|
|
1964
|
+
if (kept === null)
|
|
1965
|
+
return problems.length === 0 ? ["Every sandbox the runner started is stopped and deleted."] : problems;
|
|
1966
|
+
return [
|
|
1967
|
+
keptText(kept),
|
|
1968
|
+
...problems.length === 0 ? ["Every other sandbox the runner started is stopped and deleted."] : problems
|
|
1969
|
+
];
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
// src/commands/exec/run-metadata.ts
|
|
1973
|
+
var RUN_USAGE_FLAGS = `${RESOURCE_USAGE_FLAGS} [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>] [--unsandboxed | [--rebuild-snapshot] [--save-snapshot] [--show-output] [--keep-sandbox <DURATION>]] [--verbose]`;
|
|
1974
|
+
var OWN_RUN_FIELDS2 = {
|
|
1975
|
+
credential: {
|
|
1976
|
+
valueLabel: "SOURCE",
|
|
1977
|
+
description: "The credential source: mint, the default, mints one with the vercel CLI for --scope and --project; github-actions requests a GitHub Actions OIDC token, in a GitHub Actions job with permissions id-token: write, anew once it is 4 minutes old, and needs no --scope or --project. Only --unsandboxed takes it: a sandboxed run needs the mint. Only a run with a resource that takes a credential takes it, as that resource's options decide; otherwise it is credential_unused. No config key."
|
|
1978
|
+
},
|
|
1979
|
+
unsandboxed: {
|
|
1980
|
+
description: "Run the command on this machine, with no isolation: it sees this machine's files and environment, less the variables the resources drop. Without it, the command runs in a Vercel Sandbox started from a runner snapshot of the base, with this checkout's changes applied, installed and built, from the runner key of storm.config.ts, and its output streams back with paths rewritten to this checkout's. No config key."
|
|
1981
|
+
},
|
|
1982
|
+
rebuildSnapshot: {
|
|
1983
|
+
description: "Build a runner snapshot of the base whatever the runner snapshot cache holds, replacing an entry for the same base, and drop this branch's saved branch snapshots from the cache. Not with --unsandboxed. No config key."
|
|
1984
|
+
},
|
|
1985
|
+
saveSnapshot: {
|
|
1986
|
+
description: "Once the command ends on its own after a successful install and build, save the runner sandbox as this branch's runner snapshot, so the next run on the branch starts from this run's install and build outputs. The run resets the working tree to the snapshot's base, keeps .git and ignored files such as node_modules and build outputs, and empties /tmp; the snapshot keeps whatever the command wrote there and to $HOME, a resource's token included. A run with it on a branch keeps no runner sandbox, even when it fails or stops before the save. With a detached HEAD it says so as it starts and keeps the runner sandbox as without the flag. Not with --unsandboxed, or with --keep-sandbox above 0. No config key."
|
|
1987
|
+
},
|
|
1988
|
+
keepSandbox: {
|
|
1989
|
+
valueLabel: "DURATION",
|
|
1990
|
+
description: "How long the runner sandbox keeps running once the run ends, however it ends, so you can connect to it from its page in the Vercel dashboard: 0, which stops and deletes it with the run's other sandboxes, or a whole number of minutes or hours up to 5h (30m, 2h). The run asks Vercel Sandbox to extend the runner sandbox's timeout when it would stop sooner; it never shortens it, so the sandbox may run past the keep time until its own timeout. The run says until when it runs, and storm runs show and runs list say so too. Default: keepSandbox in the runner recipe, else 30m, or 0 when CI is set. Not with --unsandboxed."
|
|
1991
|
+
},
|
|
1992
|
+
showOutput: {
|
|
1993
|
+
description: "In a sandboxed run on a terminal, print the runner's step output (a snapshot build, the install, the build) above the live view instead of keeping only each step's last line there. Plain output always prints it. Either way, the run directory keeps it whole. Not with --unsandboxed. No config key."
|
|
1994
|
+
},
|
|
1995
|
+
verbose: {
|
|
1996
|
+
description: "Print more as it happens: each resource's detailed progress, the runner's step output as with --show-output, and verbose in the run payload, which has the Vitest adapter's reporters print each test as it finishes and its fixtures print each container start, proxied request and vercel invocation, for passing tests too. No config key."
|
|
1997
|
+
},
|
|
1998
|
+
scope: {
|
|
1999
|
+
valueLabel: "TEAM",
|
|
2000
|
+
description: "The control plane team: the Vercel team whose project the credential is minted for and a sandboxed run's sandboxes run in. Required, from this flag or scope in storm.config.ts, unless an unsandboxed run has no resource that takes a credential or takes --credential github-actions."
|
|
2001
|
+
},
|
|
2002
|
+
project: {
|
|
2003
|
+
valueLabel: "PROJECT",
|
|
2004
|
+
description: "The control plane project: the Vercel project, within the team, to mint the credential for. Required, from this flag or project in storm.config.ts, unless an unsandboxed run has no resource that takes a credential or takes --credential github-actions."
|
|
2005
|
+
}
|
|
2006
|
+
};
|
|
2007
|
+
var RUN_FIELDS = { ...RESOURCE_FLAG_HELP, ...OWN_RUN_FIELDS2 };
|
|
2008
|
+
|
|
2009
|
+
export {
|
|
2010
|
+
ranSchema,
|
|
2011
|
+
RAN_DESCRIPTION,
|
|
2012
|
+
renderRan,
|
|
2013
|
+
RUN_ERRORS,
|
|
2014
|
+
outcomes,
|
|
2015
|
+
canceledBeforeStart,
|
|
2016
|
+
RUN_REQUEST_FIELDS,
|
|
2017
|
+
RUN_CLI_OPTIONS,
|
|
2018
|
+
runCommand,
|
|
2019
|
+
runProblems,
|
|
2020
|
+
checkoutFailedRefusal,
|
|
2021
|
+
RUN_USAGE_FLAGS,
|
|
2022
|
+
RUN_FIELDS
|
|
2023
|
+
};
|