@cnc-tools/storm 0.0.0-stage → 0.5.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/node-version.js +24 -0
- package/bin/storm.js +16 -0
- package/dist/application.d.ts +13 -0
- package/dist/application.js +23 -0
- package/dist/bin/storm.d.ts +1 -0
- package/dist/bin/storm.js +45 -0
- package/dist/build-info.js +3 -0
- package/dist/closed-terminal.d.ts +7 -0
- package/dist/closed-terminal.js +18 -0
- package/dist/combine-errors.d.ts +11 -0
- package/dist/combine-errors.js +19 -0
- package/dist/commands/dashboard.d.ts +11 -0
- package/dist/commands/dashboard.js +18 -0
- package/dist/commands/run/cleanup.d.ts +135 -0
- package/dist/commands/run/cleanup.js +171 -0
- package/dist/commands/run/command.d.ts +327 -0
- package/dist/commands/run/command.js +620 -0
- package/dist/commands/run/job-summary.d.ts +6 -0
- package/dist/commands/run/job-summary.js +31 -0
- package/dist/commands/run/live-view.d.ts +22 -0
- package/dist/commands/run/live-view.js +395 -0
- package/dist/commands/run/metadata.d.ts +47 -0
- package/dist/commands/run/metadata.js +83 -0
- package/dist/commands/run/mint-failed.d.ts +11 -0
- package/dist/commands/run/mint-failed.js +33 -0
- package/dist/commands/run/outcomes.d.ts +307 -0
- package/dist/commands/run/outcomes.js +332 -0
- package/dist/commands/run/progress.d.ts +44 -0
- package/dist/commands/run/progress.js +277 -0
- package/dist/commands/run/redaction.d.ts +15 -0
- package/dist/commands/run/redaction.js +40 -0
- package/dist/commands/run/run-collector.d.ts +30 -0
- package/dist/commands/run/run-collector.js +73 -0
- package/dist/commands/run/run-record.d.ts +144 -0
- package/dist/commands/run/run-record.js +96 -0
- package/dist/commands/run/tests-summary.d.ts +34 -0
- package/dist/commands/run/tests-summary.js +141 -0
- package/dist/commands/run/text.d.ts +22 -0
- package/dist/commands/run/text.js +74 -0
- package/dist/commands/run/view.d.ts +35 -0
- package/dist/commands/run/view.js +163 -0
- package/dist/commands/run/waterfall.d.ts +25 -0
- package/dist/commands/run/waterfall.js +108 -0
- package/dist/commands/run/worker-chart.d.ts +79 -0
- package/dist/commands/run/worker-chart.js +313 -0
- package/dist/commands/runs/facts.d.ts +150 -0
- package/dist/commands/runs/facts.js +292 -0
- package/dist/commands/runs/list/command.d.ts +86 -0
- package/dist/commands/runs/list/command.js +36 -0
- package/dist/commands/runs/list/metadata.d.ts +22 -0
- package/dist/commands/runs/list/metadata.js +19 -0
- package/dist/commands/runs/list/outcomes.d.ts +74 -0
- package/dist/commands/runs/list/outcomes.js +89 -0
- package/dist/commands/runs/logs/command.d.ts +72 -0
- package/dist/commands/runs/logs/command.js +51 -0
- package/dist/commands/runs/logs/metadata.d.ts +22 -0
- package/dist/commands/runs/logs/metadata.js +22 -0
- package/dist/commands/runs/logs/outcomes.d.ts +55 -0
- package/dist/commands/runs/logs/outcomes.js +77 -0
- package/dist/commands/runs/metadata.d.ts +3 -0
- package/dist/commands/runs/metadata.js +3 -0
- package/dist/commands/runs/past-run.d.ts +72 -0
- package/dist/commands/runs/past-run.js +99 -0
- package/dist/commands/runs/show/command.d.ts +176 -0
- package/dist/commands/runs/show/command.js +76 -0
- package/dist/commands/runs/show/metadata.d.ts +25 -0
- package/dist/commands/runs/show/metadata.js +22 -0
- package/dist/commands/runs/show/outcomes.d.ts +164 -0
- package/dist/commands/runs/show/outcomes.js +317 -0
- package/dist/config/by-name.d.ts +24 -0
- package/dist/config/by-name.js +26 -0
- package/dist/config/errors.d.ts +58 -0
- package/dist/config/errors.js +101 -0
- package/dist/config/gateways.d.ts +32 -0
- package/dist/config/gateways.js +1 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.js +12 -0
- package/dist/config/live/config-gateway.d.ts +6 -0
- package/dist/config/live/config-gateway.js +71 -0
- package/dist/config/load.d.ts +54 -0
- package/dist/config/load.js +175 -0
- package/dist/config/resolve.d.ts +49 -0
- package/dist/config/resolve.js +94 -0
- package/dist/config/resource-config.d.ts +132 -0
- package/dist/config/resource-config.js +19 -0
- package/dist/config/schema.d.ts +64 -0
- package/dist/config/schema.js +57 -0
- package/dist/config/set.d.ts +16 -0
- package/dist/config/set.js +55 -0
- package/dist/config/settings-file.d.ts +41 -0
- package/dist/config/settings-file.js +72 -0
- package/dist/config-file/define.d.ts +37 -0
- package/dist/config-file/define.js +9 -0
- package/dist/config-file/toolchain.d.ts +9 -0
- package/dist/config-file/toolchain.js +41 -0
- package/dist/context.d.ts +86 -0
- package/dist/context.js +43 -0
- package/dist/core/command-provider.d.ts +126 -0
- package/dist/core/command-provider.js +13 -0
- package/dist/core/command-slots.d.ts +67 -0
- package/dist/core/command-slots.js +136 -0
- package/dist/core/events.d.ts +128 -0
- package/dist/core/events.js +15 -0
- package/dist/core/gateways.d.ts +249 -0
- package/dist/core/gateways.js +1 -0
- package/dist/core/index.d.ts +20 -0
- package/dist/core/index.js +18 -0
- package/dist/core/keyed.d.ts +12 -0
- package/dist/core/keyed.js +24 -0
- package/dist/core/lane.d.ts +46 -0
- package/dist/core/lane.js +5 -0
- package/dist/core/limit.d.ts +9 -0
- package/dist/core/limit.js +29 -0
- package/dist/core/live/command-gateway.d.ts +11 -0
- package/dist/core/live/command-gateway.js +83 -0
- package/dist/core/live/job-summary-gateway.d.ts +5 -0
- package/dist/core/live/job-summary-gateway.js +20 -0
- package/dist/core/live/progress-terminal.d.ts +20 -0
- package/dist/core/live/progress-terminal.js +173 -0
- package/dist/core/live/run-directory-gateway.d.ts +24 -0
- package/dist/core/live/run-directory-gateway.js +437 -0
- package/dist/core/mint.d.ts +10 -0
- package/dist/core/mint.js +14 -0
- package/dist/core/payload.d.ts +26 -0
- package/dist/core/payload.js +33 -0
- package/dist/core/presentation.d.ts +87 -0
- package/dist/core/presentation.js +5 -0
- package/dist/core/presentations.d.ts +56 -0
- package/dist/core/presentations.js +66 -0
- package/dist/core/provider.d.ts +69 -0
- package/dist/core/provider.js +5 -0
- package/dist/core/resource.d.ts +262 -0
- package/dist/core/resource.js +6 -0
- package/dist/core/resources.d.ts +131 -0
- package/dist/core/resources.js +254 -0
- package/dist/core/run-directory.d.ts +69 -0
- package/dist/core/run-directory.js +94 -0
- package/dist/core/run-state.d.ts +152 -0
- package/dist/core/run-state.js +313 -0
- package/dist/core/run.d.ts +187 -0
- package/dist/core/run.js +321 -0
- package/dist/core/state-directory.d.ts +19 -0
- package/dist/core/state-directory.js +29 -0
- package/dist/core/timeline.d.ts +63 -0
- package/dist/core/timeline.js +97 -0
- package/dist/core/timing.d.ts +22 -0
- package/dist/core/timing.js +26 -0
- package/dist/credential/credential.d.ts +46 -0
- package/dist/credential/credential.js +80 -0
- package/dist/credential/diagnosis.d.ts +18 -0
- package/dist/credential/diagnosis.js +99 -0
- package/dist/credential/gateways.d.ts +109 -0
- package/dist/credential/gateways.js +1 -0
- package/dist/credential/index.d.ts +7 -0
- package/dist/credential/index.js +7 -0
- package/dist/credential/live/github-actions-token-gateway.d.ts +15 -0
- package/dist/credential/live/github-actions-token-gateway.js +43 -0
- package/dist/credential/live/github-actions-token-response.d.ts +19 -0
- package/dist/credential/live/github-actions-token-response.js +49 -0
- package/dist/credential/live/vercel-cli-gateway.d.ts +9 -0
- package/dist/credential/live/vercel-cli-gateway.js +64 -0
- package/dist/credential/live/vercel-output.d.ts +60 -0
- package/dist/credential/live/vercel-output.js +122 -0
- package/dist/credential/live/vercel-process.d.ts +14 -0
- package/dist/credential/live/vercel-process.js +3 -0
- package/dist/credential/settle.d.ts +31 -0
- package/dist/credential/settle.js +49 -0
- package/dist/credential/source.d.ts +110 -0
- package/dist/credential/source.js +114 -0
- package/dist/help-logo.d.ts +11 -0
- package/dist/help-logo.js +56 -0
- package/dist/presentation.d.ts +26 -0
- package/dist/presentation.js +21 -0
- package/dist/resources/github/cleanup.d.ts +23 -0
- package/dist/resources/github/cleanup.js +39 -0
- package/dist/resources/github/command.d.ts +74 -0
- package/dist/resources/github/command.js +117 -0
- package/dist/resources/github/config.d.ts +16 -0
- package/dist/resources/github/config.js +37 -0
- package/dist/resources/github/events.d.ts +26 -0
- package/dist/resources/github/events.js +2 -0
- package/dist/resources/github/fixture-repo.d.ts +69 -0
- package/dist/resources/github/fixture-repo.js +60 -0
- package/dist/resources/github/gateways.d.ts +62 -0
- package/dist/resources/github/gateways.js +1 -0
- package/dist/resources/github/index.d.ts +12 -0
- package/dist/resources/github/index.js +15 -0
- package/dist/resources/github/live/fixture-repo-gateway.d.ts +12 -0
- package/dist/resources/github/live/fixture-repo-gateway.js +92 -0
- package/dist/resources/github/live/gateways.d.ts +6 -0
- package/dist/resources/github/live/gateways.js +13 -0
- package/dist/resources/github/presentation.d.ts +13 -0
- package/dist/resources/github/presentation.js +43 -0
- package/dist/resources/github/provider.d.ts +66 -0
- package/dist/resources/github/provider.js +58 -0
- package/dist/resources/github/resource-provider.d.ts +6 -0
- package/dist/resources/github/resource-provider.js +20 -0
- package/dist/resources/github/resource.d.ts +33 -0
- package/dist/resources/github/resource.js +12 -0
- package/dist/resources/testserver/cleanup.d.ts +14 -0
- package/dist/resources/testserver/cleanup.js +22 -0
- package/dist/resources/testserver/command.d.ts +322 -0
- package/dist/resources/testserver/command.js +245 -0
- package/dist/resources/testserver/commands/app.d.ts +18 -0
- package/dist/resources/testserver/commands/app.js +3 -0
- package/dist/resources/testserver/commands/create/command.d.ts +136 -0
- package/dist/resources/testserver/commands/create/command.js +158 -0
- package/dist/resources/testserver/commands/create/metadata.d.ts +31 -0
- package/dist/resources/testserver/commands/create/metadata.js +45 -0
- package/dist/resources/testserver/commands/create/outcomes.d.ts +111 -0
- package/dist/resources/testserver/commands/create/outcomes.js +172 -0
- package/dist/resources/testserver/commands/list/command.d.ts +60 -0
- package/dist/resources/testserver/commands/list/command.js +56 -0
- package/dist/resources/testserver/commands/list/metadata.d.ts +9 -0
- package/dist/resources/testserver/commands/list/metadata.js +9 -0
- package/dist/resources/testserver/commands/list/outcomes.d.ts +54 -0
- package/dist/resources/testserver/commands/list/outcomes.js +152 -0
- package/dist/resources/testserver/config.d.ts +18 -0
- package/dist/resources/testserver/config.js +77 -0
- package/dist/resources/testserver/credential-facts.d.ts +80 -0
- package/dist/resources/testserver/credential-facts.js +83 -0
- package/dist/resources/testserver/events.d.ts +59 -0
- package/dist/resources/testserver/events.js +4 -0
- package/dist/resources/testserver/index.d.ts +16 -0
- package/dist/resources/testserver/index.js +24 -0
- package/dist/resources/testserver/lane.d.ts +28 -0
- package/dist/resources/testserver/lane.js +139 -0
- package/dist/resources/testserver/live/gateways.d.ts +6 -0
- package/dist/resources/testserver/live/gateways.js +26 -0
- package/dist/resources/testserver/options.d.ts +5 -0
- package/dist/resources/testserver/options.js +5 -0
- package/dist/resources/testserver/pool/channels.d.ts +80 -0
- package/dist/resources/testserver/pool/channels.js +48 -0
- package/dist/resources/testserver/pool/create.d.ts +48 -0
- package/dist/resources/testserver/pool/create.js +45 -0
- package/dist/resources/testserver/pool/directory.d.ts +4 -0
- package/dist/resources/testserver/pool/directory.js +5 -0
- package/dist/resources/testserver/pool/gateways.d.ts +190 -0
- package/dist/resources/testserver/pool/gateways.js +1 -0
- package/dist/resources/testserver/pool/host.d.ts +8 -0
- package/dist/resources/testserver/pool/host.js +21 -0
- package/dist/resources/testserver/pool/index.d.ts +9 -0
- package/dist/resources/testserver/pool/index.js +10 -0
- package/dist/resources/testserver/pool/inspect.d.ts +53 -0
- package/dist/resources/testserver/pool/inspect.js +45 -0
- package/dist/resources/testserver/pool/lease.d.ts +84 -0
- package/dist/resources/testserver/pool/lease.js +125 -0
- package/dist/resources/testserver/pool/live/pool-records.d.ts +17 -0
- package/dist/resources/testserver/pool/live/pool-records.js +70 -0
- package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +12 -0
- package/dist/resources/testserver/pool/live/pool-store-gateway.js +435 -0
- package/dist/resources/testserver/pool/staleness.d.ts +16 -0
- package/dist/resources/testserver/pool/staleness.js +27 -0
- package/dist/resources/testserver/presentation.d.ts +9 -0
- package/dist/resources/testserver/presentation.js +217 -0
- package/dist/resources/testserver/provider.d.ts +177 -0
- package/dist/resources/testserver/provider.js +254 -0
- package/dist/resources/testserver/ran.d.ts +87 -0
- package/dist/resources/testserver/ran.js +140 -0
- package/dist/resources/testserver/resource-provider.d.ts +12 -0
- package/dist/resources/testserver/resource-provider.js +38 -0
- package/dist/resources/testserver/resource.d.ts +32 -0
- package/dist/resources/testserver/resource.js +10 -0
- package/dist/resources/testserver/run-sandbox.d.ts +13 -0
- package/dist/resources/testserver/run-sandbox.js +6 -0
- package/dist/resources/testserver/sandbox/channels.d.ts +12 -0
- package/dist/resources/testserver/sandbox/channels.js +21 -0
- package/dist/resources/testserver/sandbox/create-failure.d.ts +35 -0
- package/dist/resources/testserver/sandbox/create-failure.js +65 -0
- package/dist/resources/testserver/sandbox/create.d.ts +29 -0
- package/dist/resources/testserver/sandbox/create.js +37 -0
- package/dist/resources/testserver/sandbox/gateways.d.ts +150 -0
- package/dist/resources/testserver/sandbox/gateways.js +1 -0
- package/dist/resources/testserver/sandbox/index.d.ts +6 -0
- package/dist/resources/testserver/sandbox/index.js +7 -0
- package/dist/resources/testserver/sandbox/live/builds-response.d.ts +9 -0
- package/dist/resources/testserver/sandbox/live/builds-response.js +27 -0
- package/dist/resources/testserver/sandbox/live/control-plane-gateway.d.ts +17 -0
- package/dist/resources/testserver/sandbox/live/control-plane-gateway.js +133 -0
- package/dist/resources/testserver/sandbox/live/create-response.d.ts +35 -0
- package/dist/resources/testserver/sandbox/live/create-response.js +78 -0
- package/dist/resources/testserver/sandbox/live/fetch-failure.d.ts +24 -0
- package/dist/resources/testserver/sandbox/live/fetch-failure.js +45 -0
- package/dist/resources/testserver/sandbox/live/health-check-gateway.d.ts +11 -0
- package/dist/resources/testserver/sandbox/live/health-check-gateway.js +36 -0
- package/dist/resources/testserver/sandbox/live/sse.d.ts +12 -0
- package/dist/resources/testserver/sandbox/live/sse.js +32 -0
- package/dist/resources.d.ts +452 -0
- package/dist/resources.js +88 -0
- package/dist/runner/base.d.ts +40 -0
- package/dist/runner/base.js +52 -0
- package/dist/runner/context.d.ts +13 -0
- package/dist/runner/context.js +9 -0
- package/dist/runner/events.d.ts +179 -0
- package/dist/runner/events.js +16 -0
- package/dist/runner/gateways.d.ts +351 -0
- package/dist/runner/gateways.js +3 -0
- package/dist/runner/index.d.ts +19 -0
- package/dist/runner/index.js +18 -0
- package/dist/runner/live/checkout-gateway.d.ts +3 -0
- package/dist/runner/live/checkout-gateway.js +206 -0
- package/dist/runner/live/git-output.d.ts +14 -0
- package/dist/runner/live/git-output.js +32 -0
- package/dist/runner/live/sandbox-errors.d.ts +7 -0
- package/dist/runner/live/sandbox-errors.js +21 -0
- package/dist/runner/live/sandbox-gateway.d.ts +7 -0
- package/dist/runner/live/sandbox-gateway.js +427 -0
- package/dist/runner/live/snapshot-cache-gateway.d.ts +12 -0
- package/dist/runner/live/snapshot-cache-gateway.js +104 -0
- package/dist/runner/live/snapshot-records.d.ts +11 -0
- package/dist/runner/live/snapshot-records.js +57 -0
- package/dist/runner/live/terminal.d.ts +16 -0
- package/dist/runner/live/terminal.js +37 -0
- package/dist/runner/live/user.d.ts +2 -0
- package/dist/runner/live/user.js +11 -0
- package/dist/runner/output.d.ts +23 -0
- package/dist/runner/output.js +58 -0
- package/dist/runner/prepare.d.ts +67 -0
- package/dist/runner/prepare.js +59 -0
- package/dist/runner/ready.d.ts +68 -0
- package/dist/runner/ready.js +159 -0
- package/dist/runner/recipe.d.ts +126 -0
- package/dist/runner/recipe.js +302 -0
- package/dist/runner/remote-command.d.ts +77 -0
- package/dist/runner/remote-command.js +127 -0
- package/dist/runner/scope.d.ts +58 -0
- package/dist/runner/scope.js +117 -0
- package/dist/runner/snapshot-build.d.ts +33 -0
- package/dist/runner/snapshot-build.js +112 -0
- package/dist/runner/snapshot-cache.d.ts +84 -0
- package/dist/runner/snapshot-cache.js +126 -0
- package/dist/runner/snapshot-key.d.ts +52 -0
- package/dist/runner/snapshot-key.js +91 -0
- package/dist/runner/steps.d.ts +41 -0
- package/dist/runner/steps.js +49 -0
- package/dist/sdk/container/api-request.d.ts +32 -0
- package/dist/sdk/container/api-request.js +46 -0
- package/dist/sdk/container/container.d.ts +144 -0
- package/dist/sdk/container/container.js +346 -0
- package/dist/sdk/container/feature-flags.d.ts +37 -0
- package/dist/sdk/container/feature-flags.js +118 -0
- package/dist/sdk/container/gateways.d.ts +108 -0
- package/dist/sdk/container/gateways.js +1 -0
- package/dist/sdk/container/index.d.ts +5 -0
- package/dist/sdk/container/index.js +5 -0
- package/dist/sdk/container/live/container-gateway.d.ts +17 -0
- package/dist/sdk/container/live/container-gateway.js +114 -0
- package/dist/sdk/factories/build.d.ts +66 -0
- package/dist/sdk/factories/build.js +98 -0
- package/dist/sdk/factories/definition.d.ts +28 -0
- package/dist/sdk/factories/definition.js +16 -0
- package/dist/sdk/factories/definitions.d.ts +166 -0
- package/dist/sdk/factories/definitions.js +235 -0
- package/dist/sdk/factories/gateways.d.ts +25 -0
- package/dist/sdk/factories/gateways.js +1 -0
- package/dist/sdk/factories/index.d.ts +5 -0
- package/dist/sdk/factories/index.js +5 -0
- package/dist/sdk/factories/live/factory-gateway.d.ts +10 -0
- package/dist/sdk/factories/live/factory-gateway.js +29 -0
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/index.js +15 -0
- package/dist/sdk/payload/index.d.ts +2 -0
- package/dist/sdk/payload/index.js +4 -0
- package/dist/sdk/payload/payload.d.ts +47 -0
- package/dist/sdk/payload/payload.js +74 -0
- package/dist/sdk/payload/test-events.d.ts +102 -0
- package/dist/sdk/payload/test-events.js +59 -0
- package/dist/sdk/proxy/exchange.d.ts +58 -0
- package/dist/sdk/proxy/exchange.js +173 -0
- package/dist/sdk/proxy/faulted-exchange.d.ts +10 -0
- package/dist/sdk/proxy/faulted-exchange.js +106 -0
- package/dist/sdk/proxy/faults.d.ts +133 -0
- package/dist/sdk/proxy/faults.js +147 -0
- package/dist/sdk/proxy/index.d.ts +3 -0
- package/dist/sdk/proxy/index.js +3 -0
- package/dist/sdk/proxy/proxy.d.ts +93 -0
- package/dist/sdk/proxy/proxy.js +99 -0
- package/dist/sdk/proxy/records.d.ts +56 -0
- package/dist/sdk/proxy/records.js +56 -0
- package/dist/sdk/records/body.d.ts +89 -0
- package/dist/sdk/records/body.js +236 -0
- package/dist/sdk/records/index.d.ts +2 -0
- package/dist/sdk/records/index.js +4 -0
- package/dist/sdk/records/records.d.ts +49 -0
- package/dist/sdk/records/records.js +16 -0
- package/dist/sdk/seed/index.d.ts +1 -0
- package/dist/sdk/seed/index.js +3 -0
- package/dist/sdk/seed/seed.d.ts +221 -0
- package/dist/sdk/seed/seed.js +171 -0
- package/dist/sdk/testserver/clock.d.ts +8 -0
- package/dist/sdk/testserver/clock.js +10 -0
- package/dist/sdk/testserver/failure.d.ts +73 -0
- package/dist/sdk/testserver/failure.js +61 -0
- package/dist/sdk/testserver/index.d.ts +5 -0
- package/dist/sdk/testserver/index.js +8 -0
- package/dist/sdk/testserver/live/connect-failure.d.ts +7 -0
- package/dist/sdk/testserver/live/connect-failure.js +30 -0
- package/dist/sdk/testserver/live/request.d.ts +69 -0
- package/dist/sdk/testserver/live/request.js +89 -0
- package/dist/sdk/testserver/service-ids.d.ts +19 -0
- package/dist/sdk/testserver/service-ids.js +77 -0
- package/dist/sdk/testserver/test-id.d.ts +15 -0
- package/dist/sdk/testserver/test-id.js +28 -0
- package/dist/story/align.d.ts +37 -0
- package/dist/story/align.js +39 -0
- package/dist/story/artifact.d.ts +60 -0
- package/dist/story/artifact.js +93 -0
- package/dist/story/definition.d.ts +52 -0
- package/dist/story/definition.js +9 -0
- package/dist/story/diff.d.ts +9 -0
- package/dist/story/diff.js +97 -0
- package/dist/story/errors.d.ts +14 -0
- package/dist/story/errors.js +21 -0
- package/dist/story/gateways.d.ts +74 -0
- package/dist/story/gateways.js +3 -0
- package/dist/story/host.d.ts +27 -0
- package/dist/story/host.js +97 -0
- package/dist/story/index.d.ts +7 -0
- package/dist/story/index.js +9 -0
- package/dist/story/json.d.ts +16 -0
- package/dist/story/json.js +59 -0
- package/dist/story/live/artifact-gateway.d.ts +2 -0
- package/dist/story/live/artifact-gateway.js +82 -0
- package/dist/story/mode.d.ts +17 -0
- package/dist/story/mode.js +21 -0
- package/dist/story/orphans.d.ts +17 -0
- package/dist/story/orphans.js +15 -0
- package/dist/story/report.d.ts +30 -0
- package/dist/story/report.js +118 -0
- package/dist/story/run.d.ts +49 -0
- package/dist/story/run.js +160 -0
- package/dist/story/sequence.d.ts +30 -0
- package/dist/story/sequence.js +74 -0
- package/dist/story/settle.d.ts +94 -0
- package/dist/story/settle.js +70 -0
- package/dist/time/duration.d.ts +19 -0
- package/dist/time/duration.js +37 -0
- package/dist/time/index.d.ts +2 -0
- package/dist/time/index.js +4 -0
- package/dist/time/time.d.ts +15 -0
- package/dist/time/time.js +23 -0
- package/dist/vercel-cli/ansi.d.ts +13 -0
- package/dist/vercel-cli/ansi.js +32 -0
- package/dist/vercel-cli/arguments.d.ts +25 -0
- package/dist/vercel-cli/arguments.js +78 -0
- package/dist/vercel-cli/auth-config.d.ts +43 -0
- package/dist/vercel-cli/auth-config.js +36 -0
- package/dist/vercel-cli/clock.d.ts +9 -0
- package/dist/vercel-cli/clock.js +10 -0
- package/dist/vercel-cli/config-files.d.ts +24 -0
- package/dist/vercel-cli/config-files.js +40 -0
- package/dist/vercel-cli/context.d.ts +12 -0
- package/dist/vercel-cli/context.js +12 -0
- package/dist/vercel-cli/driver.d.ts +218 -0
- package/dist/vercel-cli/driver.js +364 -0
- package/dist/vercel-cli/entry.d.ts +8 -0
- package/dist/vercel-cli/entry.js +13 -0
- package/dist/vercel-cli/environment.d.ts +33 -0
- package/dist/vercel-cli/environment.js +72 -0
- package/dist/vercel-cli/errors.d.ts +8 -0
- package/dist/vercel-cli/errors.js +8 -0
- package/dist/vercel-cli/gateways.d.ts +103 -0
- package/dist/vercel-cli/gateways.js +4 -0
- package/dist/vercel-cli/index.d.ts +10 -0
- package/dist/vercel-cli/index.js +15 -0
- package/dist/vercel-cli/invocation.d.ts +234 -0
- package/dist/vercel-cli/invocation.js +397 -0
- package/dist/vercel-cli/keys.d.ts +14 -0
- package/dist/vercel-cli/keys.js +12 -0
- package/dist/vercel-cli/live/config-files.d.ts +28 -0
- package/dist/vercel-cli/live/config-files.js +66 -0
- package/dist/vercel-cli/live/process-gateway.d.ts +14 -0
- package/dist/vercel-cli/live/process-gateway.js +178 -0
- package/dist/vercel-cli/redaction.d.ts +13 -0
- package/dist/vercel-cli/redaction.js +22 -0
- package/dist/vercel-cli/report.d.ts +22 -0
- package/dist/vercel-cli/report.js +110 -0
- package/dist/vercel-cli/verbose.d.ts +7 -0
- package/dist/vercel-cli/verbose.js +24 -0
- package/dist/version.d.ts +20 -0
- package/dist/version.js +57 -0
- package/dist/vitest/config.d.ts +51 -0
- package/dist/vitest/config.js +61 -0
- package/dist/vitest/container-scope.d.ts +108 -0
- package/dist/vitest/container-scope.js +234 -0
- package/dist/vitest/diagnostics.d.ts +146 -0
- package/dist/vitest/diagnostics.js +306 -0
- package/dist/vitest/fixtures.d.ts +64 -0
- package/dist/vitest/fixtures.js +172 -0
- package/dist/vitest/gateways.d.ts +47 -0
- package/dist/vitest/gateways.js +3 -0
- package/dist/vitest/index.d.ts +3 -0
- package/dist/vitest/index.js +9 -0
- package/dist/vitest/list-output.d.ts +3 -0
- package/dist/vitest/list-output.js +19 -0
- package/dist/vitest/live/list-gateway.d.ts +7 -0
- package/dist/vitest/live/list-gateway.js +60 -0
- package/dist/vitest/ownership.d.ts +29 -0
- package/dist/vitest/ownership.js +68 -0
- package/dist/vitest/plan.d.ts +33 -0
- package/dist/vitest/plan.js +73 -0
- package/dist/vitest/sandbox.d.ts +16 -0
- package/dist/vitest/sandbox.js +35 -0
- package/dist/vitest/test-events.d.ts +41 -0
- package/dist/vitest/test-events.js +92 -0
- package/dist/vitest/test-results.d.ts +84 -0
- package/dist/vitest/test-results.js +160 -0
- package/dist/vitest/types.d.ts +68 -0
- package/dist/vitest/types.js +4 -0
- package/package.json +123 -4
- package/skills/overview.md +32 -0
- package/skills/read-run-output.md +65 -0
- package/README.md +0 -3
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type RanCommand } from "../../core/index.ts";
|
|
2
|
+
import { type StormRunLane, type StormRunObserver, type StormTimedRunEvent } from "../../resources.ts";
|
|
3
|
+
import type { RunnerSnapshotCacheFailure, SnapshotCacheNote } from "../../runner/index.ts";
|
|
4
|
+
/** The lane a plain progress line names after its elapsed time: what part of the run it is about. */
|
|
5
|
+
export type ProgressLane = "run" | "mint" | StormRunLane | "command" | "cleanup";
|
|
6
|
+
/**
|
|
7
|
+
* How plain progress shows: as plain lines, or for GitHub Actions with each step's output in a fold; and whether the
|
|
8
|
+
* run is verbose, which shows the control plane's progress messages for each create.
|
|
9
|
+
*/
|
|
10
|
+
export interface LineProgressOptions {
|
|
11
|
+
readonly github: boolean;
|
|
12
|
+
readonly verbose?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A run's progress as plain lines through `write`, one call per line. Each of storm's own lines starts with the
|
|
16
|
+
* time since the run started and its lane: `[+4.2s] testserver leased 2 of 2 …`. Lanes that run at once say so: the
|
|
17
|
+
* run says when the resources' lanes and the runner start together, and each says when it is ready and how long it
|
|
18
|
+
* waits for the others. A runner run without a resource lane readies the runner alone. A resource's own events print
|
|
19
|
+
* as its presentation says (`RESOURCE_PRESENTATIONS`), the Testserver pool's create progress messages only when the
|
|
20
|
+
* run is `verbose`. A step's output (a snapshot build's, applying the changes, the install, the build) streams in
|
|
21
|
+
* full, unprefixed, between its start and end lines; under GitHub Actions (`github`) it is folded in a
|
|
22
|
+
* `::group::`, closed before a failed step's end line, so the failure shows outside the fold. The command's output
|
|
23
|
+
* isn't progress: it reaches the terminal directly, unfolded, between the command's start and end lines.
|
|
24
|
+
*
|
|
25
|
+
* Once a write fails, as one does with EIO after SIGHUP closes the terminal, later lines are dropped and `observe`
|
|
26
|
+
* still resolves: a progress line must never keep a run from stopping and deleting its sandboxes and releasing its
|
|
27
|
+
* resources.
|
|
28
|
+
*/
|
|
29
|
+
export declare function lineProgress(write: (line: string) => Promise<void>, options?: LineProgressOptions): StormRunObserver;
|
|
30
|
+
/** A renderer that turns each timed event into its plain lines, remembering what it needs across events. */
|
|
31
|
+
export declare function plainRenderer(options: LineProgressOptions): (timed: StormTimedRunEvent) => readonly string[];
|
|
32
|
+
/** A plain progress line: `[+4.2s] testserver <text>`, `elapsedMs` since the run started, in lane `lane`. */
|
|
33
|
+
export declare function progressLine(elapsedMs: number, lane: ProgressLane, text: string): string;
|
|
34
|
+
/** The widest lane a plain line names: `command`, `cleanup`, or a resource's lane, such as `testserver`. */
|
|
35
|
+
export declare const LANE_WIDTH: number;
|
|
36
|
+
/** How a command ended, as its end line and the live view say. */
|
|
37
|
+
export declare function commandEnd(outcome: RanCommand): string;
|
|
38
|
+
/** In a runner run, what the local checks noticed: nested Git repositories left out, and the cache read's notes. */
|
|
39
|
+
export declare function preparedNoteTexts(prepared: {
|
|
40
|
+
readonly nestedRepositories: readonly string[];
|
|
41
|
+
readonly notes: readonly SnapshotCacheNote[];
|
|
42
|
+
}): string[];
|
|
43
|
+
/** The runner snapshot cache couldn't record a runner snapshot the run built. */
|
|
44
|
+
export declare function cacheWriteFailureText(failure: RunnerSnapshotCacheFailure): string;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { megabytesText, secondsOf, secondsText } from "../../core/index.js";
|
|
2
|
+
import { RESOURCE_PRESENTATIONS, RESOURCE_REPORTS, } from "../../resources.js";
|
|
3
|
+
import { versionText } from "../../version.js";
|
|
4
|
+
import { isoSecondsText, keepTimeText, seconds, short } from "./text.js";
|
|
5
|
+
/**
|
|
6
|
+
* A run's progress as plain lines through `write`, one call per line. Each of storm's own lines starts with the
|
|
7
|
+
* time since the run started and its lane: `[+4.2s] testserver leased 2 of 2 …`. Lanes that run at once say so: the
|
|
8
|
+
* run says when the resources' lanes and the runner start together, and each says when it is ready and how long it
|
|
9
|
+
* waits for the others. A runner run without a resource lane readies the runner alone. A resource's own events print
|
|
10
|
+
* as its presentation says (`RESOURCE_PRESENTATIONS`), the Testserver pool's create progress messages only when the
|
|
11
|
+
* run is `verbose`. A step's output (a snapshot build's, applying the changes, the install, the build) streams in
|
|
12
|
+
* full, unprefixed, between its start and end lines; under GitHub Actions (`github`) it is folded in a
|
|
13
|
+
* `::group::`, closed before a failed step's end line, so the failure shows outside the fold. The command's output
|
|
14
|
+
* isn't progress: it reaches the terminal directly, unfolded, between the command's start and end lines.
|
|
15
|
+
*
|
|
16
|
+
* Once a write fails, as one does with EIO after SIGHUP closes the terminal, later lines are dropped and `observe`
|
|
17
|
+
* still resolves: a progress line must never keep a run from stopping and deleting its sandboxes and releasing its
|
|
18
|
+
* resources.
|
|
19
|
+
*/
|
|
20
|
+
export function lineProgress(write, options = { github: false }) {
|
|
21
|
+
let failed = false;
|
|
22
|
+
const render = plainRenderer(options);
|
|
23
|
+
return {
|
|
24
|
+
observe: async (timed) => {
|
|
25
|
+
for (const line of render(timed)) {
|
|
26
|
+
if (failed)
|
|
27
|
+
return;
|
|
28
|
+
try {
|
|
29
|
+
await write(line);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
failed = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** A renderer that turns each timed event into its plain lines, remembering what it needs across events. */
|
|
39
|
+
export function plainRenderer(options) {
|
|
40
|
+
const state = {
|
|
41
|
+
origin: undefined,
|
|
42
|
+
resourceLanes: RESOURCE_PRESENTATIONS.lanes.map(({ lane }) => lane),
|
|
43
|
+
heldResources: [],
|
|
44
|
+
mintStartedAt: undefined,
|
|
45
|
+
lanesStartedAt: undefined,
|
|
46
|
+
readyAt: {},
|
|
47
|
+
cleanupStartedAt: undefined,
|
|
48
|
+
folded: false,
|
|
49
|
+
};
|
|
50
|
+
const resources = RESOURCE_PRESENTATIONS.plain({ verbose: options.verbose === true });
|
|
51
|
+
return ({ event, at }) => {
|
|
52
|
+
const now = at.getTime();
|
|
53
|
+
state.origin ??= now;
|
|
54
|
+
const origin = state.origin;
|
|
55
|
+
const line = (lane, text) => progressLine(now - origin, lane, text);
|
|
56
|
+
if (event.kind === "resource")
|
|
57
|
+
return resources(event, now).map(({ lane, text }) => line(lane, text));
|
|
58
|
+
return eventLines(event, now, state, line, options);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** A plain progress line: `[+4.2s] testserver <text>`, `elapsedMs` since the run started, in lane `lane`. */
|
|
62
|
+
export function progressLine(elapsedMs, lane, text) {
|
|
63
|
+
return `[+${secondsText(secondsOf(elapsedMs))}] ${lane.padEnd(LANE_WIDTH)} ${text}`;
|
|
64
|
+
}
|
|
65
|
+
/** The widest lane a plain line names: `command`, `cleanup`, or a resource's lane, such as `testserver`. */
|
|
66
|
+
export const LANE_WIDTH = Math.max(...["run", "mint", "runner", "command", "cleanup", ...RESOURCE_PRESENTATIONS.lanes.map(({ lane }) => lane)].map((lane) => lane.length));
|
|
67
|
+
function eventLines(event, now, state, line, options) {
|
|
68
|
+
const since = (start) => seconds(now - (start ?? now));
|
|
69
|
+
switch (event.kind) {
|
|
70
|
+
case "started":
|
|
71
|
+
state.resourceLanes = event.lanes;
|
|
72
|
+
state.heldResources = event.resources;
|
|
73
|
+
return [
|
|
74
|
+
line("run", `storm ${versionText(event.version, event.commit)}`),
|
|
75
|
+
...(event.configFile === null ? [] : [line("run", `config ${event.configFile}`)]),
|
|
76
|
+
];
|
|
77
|
+
case "minting":
|
|
78
|
+
state.mintStartedAt = now;
|
|
79
|
+
return [line("mint", `credential for ${targetText(event.target)}…`)];
|
|
80
|
+
case "minted":
|
|
81
|
+
return [
|
|
82
|
+
line("mint", `${event.ok ? "credential" : "no credential"} for ${targetText(event.target)} (${since(state.mintStartedAt)})`),
|
|
83
|
+
];
|
|
84
|
+
case "requesting-token":
|
|
85
|
+
return [line("mint", "requesting a GitHub Actions OIDC token…")];
|
|
86
|
+
case "lanes-started":
|
|
87
|
+
state.lanesStartedAt = now;
|
|
88
|
+
// Without a resource lane the runner's own lines say it started.
|
|
89
|
+
return state.resourceLanes.length === 0
|
|
90
|
+
? []
|
|
91
|
+
: [line("run", `${[...state.resourceLanes, "runner"].join(" ‖ ")} start together`)];
|
|
92
|
+
case "lane-ended": {
|
|
93
|
+
// A lane runs from the lanes' start in a runner run; locally a resource lane runs from the run's start.
|
|
94
|
+
const ran = since(state.lanesStartedAt ?? state.origin);
|
|
95
|
+
if (event.outcome !== "ready")
|
|
96
|
+
return [line(event.lane, `${event.outcome} (${ran})`)];
|
|
97
|
+
// Locally the resource's own lines say its lane is ready.
|
|
98
|
+
if (state.lanesStartedAt === undefined)
|
|
99
|
+
return [];
|
|
100
|
+
state.readyAt[event.lane] = now;
|
|
101
|
+
const ready = `ready (${ran})`;
|
|
102
|
+
if (state.resourceLanes.length === 0)
|
|
103
|
+
return [line(event.lane, ready)];
|
|
104
|
+
// A resource lane waits for the runner; the runner, for the resource lanes.
|
|
105
|
+
const others = event.lane === "runner" ? state.resourceLanes : ["runner"];
|
|
106
|
+
const waiting = others.filter((other) => state.readyAt[other] === undefined);
|
|
107
|
+
if (waiting.length > 0)
|
|
108
|
+
return [line(event.lane, `${ready}; waiting for ${waiting.join(", ")}`)];
|
|
109
|
+
const waited = others.map((other) => `${other} waited ${seconds(now - (state.readyAt[other] ?? now))}`);
|
|
110
|
+
return [line(event.lane, `${ready}; ${waited.join(", ")}`)];
|
|
111
|
+
}
|
|
112
|
+
// A resource lane's start shows in its first line of its own.
|
|
113
|
+
case "lane-started":
|
|
114
|
+
return [];
|
|
115
|
+
case "command-started":
|
|
116
|
+
return [line("command", `running ${event.argv.join(" ")}`)];
|
|
117
|
+
case "command-ended":
|
|
118
|
+
return [line("command", `${event.command} ${commandEnd(event.outcome)} after ${seconds(event.ms)}`)];
|
|
119
|
+
case "cleanup-started":
|
|
120
|
+
state.cleanupStartedAt = now;
|
|
121
|
+
return [
|
|
122
|
+
line("cleanup", cleanupText(event.runner, event.keepSandboxMs, RESOURCE_PRESENTATIONS.releaseTexts(event.holdings, "doing"))),
|
|
123
|
+
];
|
|
124
|
+
case "cleanup-finished": {
|
|
125
|
+
const problems = [
|
|
126
|
+
...(event.notStopped === 0 ? [] : [`${event.notStopped} not stopped`]),
|
|
127
|
+
...(event.notDeleted === 0 ? [] : [`${event.notDeleted} not deleted`]),
|
|
128
|
+
...RESOURCE_REPORTS.failuresTexts(event.resourceFailures),
|
|
129
|
+
];
|
|
130
|
+
return [
|
|
131
|
+
line("cleanup", `${problems.length === 0 ? "done" : `done: ${problems.join(", ")}`} (${since(state.cleanupStartedAt)})`),
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
case "runner-prepared":
|
|
135
|
+
return [
|
|
136
|
+
line("runner", `base ${short(event.base)}, HEAD's merge-base with ${event.baseRef}`),
|
|
137
|
+
...preparedNoteTexts(event).map((text) => line("runner", text)),
|
|
138
|
+
];
|
|
139
|
+
// The command's own output carries its tests' results; the summary counts them.
|
|
140
|
+
// The summary says when the test results may be incomplete.
|
|
141
|
+
case "test":
|
|
142
|
+
case "test-event-unreadable":
|
|
143
|
+
case "test-events-incomplete":
|
|
144
|
+
return [];
|
|
145
|
+
case "runner":
|
|
146
|
+
return runnerLines(event.event, state, line, options);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/** A runner event's lines. */
|
|
150
|
+
function runnerLines(event, state, line, options) {
|
|
151
|
+
switch (event.kind) {
|
|
152
|
+
case "snapshot-reused":
|
|
153
|
+
return [line("runner", `reusing runner snapshot ${event.snapshotId} of base ${short(event.base)}`)];
|
|
154
|
+
case "snapshot-build-started":
|
|
155
|
+
return [
|
|
156
|
+
line("runner", `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}`),
|
|
157
|
+
];
|
|
158
|
+
case "runner-sandbox-starting":
|
|
159
|
+
return [];
|
|
160
|
+
case "sandbox-started":
|
|
161
|
+
return [
|
|
162
|
+
line("runner", `started the ${event.role === "runner" ? "runner" : "build"} sandbox ${event.name} in ${event.region}, ${event.vcpus} vCPUs (${seconds(event.ms)})`),
|
|
163
|
+
];
|
|
164
|
+
case "output-started":
|
|
165
|
+
return [];
|
|
166
|
+
case "output-ended":
|
|
167
|
+
return event.outcome === "finished"
|
|
168
|
+
? []
|
|
169
|
+
: [...closeFold(state), line("runner", `${event.section} ${event.outcome}`)];
|
|
170
|
+
case "step-started": {
|
|
171
|
+
const text = `${event.phase}: ${event.label}`;
|
|
172
|
+
if (!options.github)
|
|
173
|
+
return [line("runner", text)];
|
|
174
|
+
state.folded = true;
|
|
175
|
+
return [`::group::${line("runner", text)}`];
|
|
176
|
+
}
|
|
177
|
+
case "step-output":
|
|
178
|
+
return [event.line];
|
|
179
|
+
case "step-finished":
|
|
180
|
+
return [...closeFold(state), line("runner", `${event.phase}: ${event.label}, done in ${seconds(event.ms)}`)];
|
|
181
|
+
case "snapshot-saving":
|
|
182
|
+
return [line("runner", "saving the build sandbox as a runner snapshot…")];
|
|
183
|
+
case "snapshot-built":
|
|
184
|
+
return [
|
|
185
|
+
line("runner", `built runner snapshot ${event.snapshotId} of base ${short(event.base)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`),
|
|
186
|
+
];
|
|
187
|
+
case "snapshot-entry-not-written":
|
|
188
|
+
return [line("runner", cacheWriteFailureText(event.failure))];
|
|
189
|
+
case "uploading":
|
|
190
|
+
return [];
|
|
191
|
+
case "uploaded":
|
|
192
|
+
return [line("runner", `uploaded your changes, ${megabytesText(event.bytes)} (${seconds(event.ms)})`)];
|
|
193
|
+
case "command-output-started":
|
|
194
|
+
return [line("command", `in the runner sandbox ${event.sandbox} (${event.region})`)];
|
|
195
|
+
case "command-stopped":
|
|
196
|
+
return [line("command", `${event.command} stopped`)];
|
|
197
|
+
case "stopping":
|
|
198
|
+
return [
|
|
199
|
+
line("cleanup", `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.heldResources)}…`),
|
|
200
|
+
];
|
|
201
|
+
case "waiting-for-snapshot":
|
|
202
|
+
return [
|
|
203
|
+
line("cleanup", `waiting up to ${Math.round(event.settleMs / 60_000)} minutes for the runner snapshot still saving…`),
|
|
204
|
+
];
|
|
205
|
+
case "sandbox-kept":
|
|
206
|
+
return [line("cleanup", `kept the runner sandbox ${event.name} running until ${isoSecondsText(event.stopsAt)}`)];
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/** What a stopping run says it releases of the resources it holds, such as ` and releasing the leases`. */
|
|
210
|
+
function releasingText(held) {
|
|
211
|
+
return RESOURCE_PRESENTATIONS.stoppingTexts(held)
|
|
212
|
+
.map((text) => ` and ${text}`)
|
|
213
|
+
.join("");
|
|
214
|
+
}
|
|
215
|
+
/** The line that closes an open step fold, if one is open. */
|
|
216
|
+
function closeFold(state) {
|
|
217
|
+
if (!state.folded)
|
|
218
|
+
return [];
|
|
219
|
+
state.folded = false;
|
|
220
|
+
return ["::endgroup::"];
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* What cleaning up does, as its first line says: in a runner run, keeping the runner sandbox running `keepMs` when that
|
|
224
|
+
* is above 0, else stopping and deleting the runner's sandboxes; then what releasing each resource does (`releases`).
|
|
225
|
+
*/
|
|
226
|
+
function cleanupText(runner, keepMs, releases) {
|
|
227
|
+
const release = releases.length === 0 ? undefined : releases.join(", ");
|
|
228
|
+
if (!runner)
|
|
229
|
+
return release === undefined ? "nothing to release" : `${release}…`;
|
|
230
|
+
const sandboxes = keepMs > 0
|
|
231
|
+
? `keeping the runner sandbox running ${keepTimeText(keepMs)}`
|
|
232
|
+
: "stopping and deleting the runner's sandboxes";
|
|
233
|
+
return `${sandboxes}${release === undefined ? "" : `, then ${release}`}…`;
|
|
234
|
+
}
|
|
235
|
+
/** How a command ended, as its end line and the live view say. */
|
|
236
|
+
export function commandEnd(outcome) {
|
|
237
|
+
switch (outcome.kind) {
|
|
238
|
+
case "exited":
|
|
239
|
+
return `exited ${outcome.code}`;
|
|
240
|
+
case "signaled":
|
|
241
|
+
return `ended on ${outcome.signal}`;
|
|
242
|
+
case "no-exit-code":
|
|
243
|
+
return "ended without an exit code";
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** What the runner snapshot cache read noticed, as a line. */
|
|
247
|
+
function noteText(note) {
|
|
248
|
+
switch (note.kind) {
|
|
249
|
+
case "cache-unreadable":
|
|
250
|
+
return `couldn't read the runner snapshot cache at ${note.failure.path}: ${note.failure.message}; treating it as empty`;
|
|
251
|
+
case "expired-entry-not-removed":
|
|
252
|
+
return `couldn't remove the expired cache entry for runner snapshot ${note.entry.snapshotId} at ${note.failure.path}: ${note.failure.message}`;
|
|
253
|
+
case "candidate-steps-failed":
|
|
254
|
+
return `not reusing cached runner snapshots of base ${short(note.base)}: runner.${note.path.join(".")} ${note.problem.replace(/\.$/, "")}`;
|
|
255
|
+
case "candidate-check-failed":
|
|
256
|
+
return `not reusing cached runner snapshots of base ${short(note.base)}: ${note.failure.message.replace(/\.$/, "")}`;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
function targetText(target) {
|
|
260
|
+
return `${target.team}/${target.project}`;
|
|
261
|
+
}
|
|
262
|
+
// The notices: what a run reports that the live view's phases can't hold, so it prints them above the live region
|
|
263
|
+
// as plain lines, and plain progress prints among its other lines. Each builder answers the lines' text, which the
|
|
264
|
+
// caller prefixes with the time and the lane (`progressLine`). A resource's own notices are its presentation's.
|
|
265
|
+
/** In a runner run, what the local checks noticed: nested Git repositories left out, and the cache read's notes. */
|
|
266
|
+
export function preparedNoteTexts(prepared) {
|
|
267
|
+
return [
|
|
268
|
+
...(prepared.nestedRepositories.length === 0
|
|
269
|
+
? []
|
|
270
|
+
: [`leaving out untracked nested Git repositories: ${prepared.nestedRepositories.join(", ")}`]),
|
|
271
|
+
...prepared.notes.map(noteText),
|
|
272
|
+
];
|
|
273
|
+
}
|
|
274
|
+
/** The runner snapshot cache couldn't record a runner snapshot the run built. */
|
|
275
|
+
export function cacheWriteFailureText(failure) {
|
|
276
|
+
return `couldn't record the runner snapshot in the cache at ${failure.path}: ${failure.message}; later runs won't reuse it`;
|
|
277
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StormRunObserver } from "../../resources.ts";
|
|
2
|
+
import type { RunnerTerminal } from "../../runner/index.ts";
|
|
3
|
+
/** Text with each secret replaced by `<token>`; the identity when there is none. */
|
|
4
|
+
export type Redact = (text: string) => string;
|
|
5
|
+
/** A redaction of `secrets`, each replaced by `<token>` wherever it appears. */
|
|
6
|
+
export declare function redactor(secrets: readonly string[]): Redact;
|
|
7
|
+
/** `value` with `redact` applied to every string in it, through arrays and plain objects; anything else as it is. */
|
|
8
|
+
export declare function redactStrings<T>(value: T, redact: Redact): T;
|
|
9
|
+
/** `observer`, hearing each event with every string in it redacted. */
|
|
10
|
+
export declare function redactingObserver(observer: StormRunObserver, redact: Redact): StormRunObserver;
|
|
11
|
+
/**
|
|
12
|
+
* `terminal`, writing the remote command's output redacted. The output arrives a whole line at a time, so a secret
|
|
13
|
+
* never splits across two writes.
|
|
14
|
+
*/
|
|
15
|
+
export declare function redactingTerminal(terminal: RunnerTerminal, redact: Redact): RunnerTerminal;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Hiding a run's secrets, such as the GitHub fixture repository's token, in what the run prints and writes: its
|
|
2
|
+
// events (which feed progress, the run directory's `events.jsonl`, the timeline, the job summary and the outcome), the
|
|
3
|
+
// remote command's output (the terminal and `command.log`), and the test events a local command appended.
|
|
4
|
+
import { redactSecrets } from "../../sdk/index.js";
|
|
5
|
+
/** A redaction of `secrets`, each replaced by `<token>` wherever it appears. */
|
|
6
|
+
export function redactor(secrets) {
|
|
7
|
+
const kept = secrets.filter((secret) => secret !== "");
|
|
8
|
+
return kept.length === 0 ? (text) => text : (text) => redactSecrets(text, kept);
|
|
9
|
+
}
|
|
10
|
+
/** `value` with `redact` applied to every string in it, through arrays and plain objects; anything else as it is. */
|
|
11
|
+
export function redactStrings(value, redact) {
|
|
12
|
+
if (typeof value === "string")
|
|
13
|
+
return redact(value);
|
|
14
|
+
if (Array.isArray(value))
|
|
15
|
+
return value.map((each) => redactStrings(each, redact));
|
|
16
|
+
if (typeof value === "object" && value !== null) {
|
|
17
|
+
const prototype = Object.getPrototypeOf(value);
|
|
18
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
19
|
+
return value;
|
|
20
|
+
return Object.fromEntries(Object.entries(value).map(([key, each]) => [key, redactStrings(each, redact)]));
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
/** `observer`, hearing each event with every string in it redacted. */
|
|
25
|
+
export function redactingObserver(observer, redact) {
|
|
26
|
+
return {
|
|
27
|
+
observe: async (timed) => await observer.observe({ event: redactStrings(timed.event, redact), at: timed.at }),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* `terminal`, writing the remote command's output redacted. The output arrives a whole line at a time, so a secret
|
|
32
|
+
* never splits across two writes.
|
|
33
|
+
*/
|
|
34
|
+
export function redactingTerminal(terminal, redact) {
|
|
35
|
+
return {
|
|
36
|
+
color: terminal.color,
|
|
37
|
+
writeStdout: (text) => terminal.writeStdout(redact(text)),
|
|
38
|
+
writeStderr: (text) => terminal.writeStderr(redact(text)),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type RunDirectory } from "../../core/index.ts";
|
|
2
|
+
import { type StormRunObserver, type StormRunState } from "../../resources.ts";
|
|
3
|
+
import { type TestEvent } from "../../sdk/index.ts";
|
|
4
|
+
import { type Redact } from "./redaction.ts";
|
|
5
|
+
/** The test events the summary reads, how many lines held none, and why they may be incomplete, when they may. */
|
|
6
|
+
export interface RunTestEvents {
|
|
7
|
+
readonly events: readonly TestEvent[];
|
|
8
|
+
readonly unreadable: number;
|
|
9
|
+
readonly incomplete: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
/** What a run collected once its events and any local test events have been read. */
|
|
12
|
+
export interface CollectedRun {
|
|
13
|
+
readonly state: StormRunState;
|
|
14
|
+
readonly tests: RunTestEvents;
|
|
15
|
+
/** What to add to a runner run's worker clock to read the run's; 0 for a local run or without worker events. */
|
|
16
|
+
readonly workerOffsetMs: number;
|
|
17
|
+
}
|
|
18
|
+
/** A run's collector: one observer for the run's events, and the local test event file's reader. */
|
|
19
|
+
export interface RunCollector {
|
|
20
|
+
readonly observer: StormRunObserver;
|
|
21
|
+
/** Reads a local command's staged test events once, redacting each event before it is kept or written. */
|
|
22
|
+
readLocal(directory: RunDirectory, redact: Redact): Promise<void>;
|
|
23
|
+
finish(): CollectedRun;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A collector that folds every event but a runner step's output into the run's state. Each test event it hears or
|
|
27
|
+
* reads is appended whole to `directory`'s private test events file, when there is one, and kept for the summary
|
|
28
|
+
* without a final result's errors and test output.
|
|
29
|
+
*/
|
|
30
|
+
export declare function runCollector(directory: RunDirectory | undefined): RunCollector;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// What a run keeps while it goes: its folded state, compact test events for the summary, and the facts needed to read
|
|
2
|
+
// workers' times. Full redacted test events stream to the run directory's private partial file as they arrive, so a
|
|
3
|
+
// run keeps no test output or test errors in memory after it has handed them on.
|
|
4
|
+
import { EMPTY_RUN_STATE } from "../../core/index.js";
|
|
5
|
+
import { applyStormRunEvent } from "../../resources.js";
|
|
6
|
+
import { parseTestEvent, testEventLine } from "../../sdk/index.js";
|
|
7
|
+
import { redactStrings } from "./redaction.js";
|
|
8
|
+
/**
|
|
9
|
+
* A collector that folds every event but a runner step's output into the run's state. Each test event it hears or
|
|
10
|
+
* reads is appended whole to `directory`'s private test events file, when there is one, and kept for the summary
|
|
11
|
+
* without a final result's errors and test output.
|
|
12
|
+
*/
|
|
13
|
+
export function runCollector(directory) {
|
|
14
|
+
let state = EMPTY_RUN_STATE;
|
|
15
|
+
const events = [];
|
|
16
|
+
let unreadable = 0;
|
|
17
|
+
let incomplete;
|
|
18
|
+
let workerOffsetMs = Infinity;
|
|
19
|
+
const collect = (event) => {
|
|
20
|
+
directory?.appendTestEvent(testEventLine(event));
|
|
21
|
+
events.push(summaryEvent(event));
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
observer: {
|
|
25
|
+
observe: async (timed) => {
|
|
26
|
+
const { event } = timed;
|
|
27
|
+
if (event.kind === "runner" && event.event.kind === "step-output")
|
|
28
|
+
return;
|
|
29
|
+
state = applyStormRunEvent(state, timed);
|
|
30
|
+
if (event.kind === "test") {
|
|
31
|
+
collect(event.event);
|
|
32
|
+
if (event.event.kind !== "test-result")
|
|
33
|
+
workerOffsetMs = Math.min(workerOffsetMs, timed.at.getTime() - event.event.at);
|
|
34
|
+
}
|
|
35
|
+
else if (event.kind === "test-event-unreadable")
|
|
36
|
+
unreadable += 1;
|
|
37
|
+
else if (event.kind === "test-events-incomplete")
|
|
38
|
+
incomplete ??= event.message;
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
readLocal: async (localDirectory, redact) => {
|
|
42
|
+
const read = await localDirectory.readTestEvents((line) => {
|
|
43
|
+
const event = parseTestEvent(line);
|
|
44
|
+
if (event === undefined)
|
|
45
|
+
unreadable += 1;
|
|
46
|
+
else
|
|
47
|
+
collect(redactStrings(event, redact));
|
|
48
|
+
});
|
|
49
|
+
if (!read.ok)
|
|
50
|
+
incomplete ??= read.failure.message;
|
|
51
|
+
},
|
|
52
|
+
finish: () => ({
|
|
53
|
+
state,
|
|
54
|
+
tests: { events, unreadable, incomplete },
|
|
55
|
+
workerOffsetMs: workerOffsetMs === Infinity ? 0 : workerOffsetMs,
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** `event` as the summary needs it: a final result without its errors and test output, which only the file keeps. */
|
|
60
|
+
function summaryEvent(event) {
|
|
61
|
+
if (event.kind !== "test-result")
|
|
62
|
+
return event;
|
|
63
|
+
return {
|
|
64
|
+
kind: event.kind,
|
|
65
|
+
id: event.id,
|
|
66
|
+
file: event.file,
|
|
67
|
+
test: event.test,
|
|
68
|
+
state: event.state,
|
|
69
|
+
retryCount: event.retryCount,
|
|
70
|
+
flaky: event.flaky,
|
|
71
|
+
at: event.at,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type StormResourceRanFacts } from "../../resources.ts";
|
|
3
|
+
import type { TestEvent } from "../../sdk/index.ts";
|
|
4
|
+
declare const testTotalsSchema: z.ZodObject<{
|
|
5
|
+
passed: z.ZodNumber;
|
|
6
|
+
failed: z.ZodNumber;
|
|
7
|
+
skipped: z.ZodNumber;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
/** How many of a run's tests passed, failed and were skipped, by their final results. */
|
|
10
|
+
export type RunTestTotals = Readonly<z.output<typeof testTotalsSchema>>;
|
|
11
|
+
declare const endedSchema: z.ZodObject<{
|
|
12
|
+
outcome: z.ZodString;
|
|
13
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
14
|
+
signal: z.ZodNullable<z.ZodString>;
|
|
15
|
+
ms: z.ZodNullable<z.ZodNumber>;
|
|
16
|
+
tests: z.ZodNullable<z.ZodObject<{
|
|
17
|
+
passed: z.ZodNumber;
|
|
18
|
+
failed: z.ZodNumber;
|
|
19
|
+
skipped: z.ZodNumber;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
testsIncomplete: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
resources: z.ZodUnknown;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
/**
|
|
25
|
+
* How a run ended: its outcome's kind (`ran`, `canceled`, `spawn-failed`, …), the status storm exited with and
|
|
26
|
+
* the signal that ended the command, for a run whose command ran (null otherwise), how long the command took (null
|
|
27
|
+
* when it never ended), its tests' totals (null without a final result), why those may be incomplete (null unless a
|
|
28
|
+
* runner run's final read of its test events file failed), and what each resource it acquired reports
|
|
29
|
+
* of itself, as a `ran` outcome does, such as the Testserver sandboxes and their log viewer URLs (null for any other
|
|
30
|
+
* outcome).
|
|
31
|
+
*/
|
|
32
|
+
export type RunRecordEnd = Readonly<Omit<z.output<typeof endedSchema>, "resources"> & {
|
|
33
|
+
readonly resources: StormResourceRanFacts | null;
|
|
34
|
+
}>;
|
|
35
|
+
declare const snapshotSchema: z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
base: z.ZodString;
|
|
38
|
+
built: z.ZodBoolean;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
/**
|
|
41
|
+
* The runner snapshot a runner sandbox started from: its id, the base it is of, which the run's changes were uploaded
|
|
42
|
+
* on top of, and whether the run built it or reused a cached one.
|
|
43
|
+
*/
|
|
44
|
+
export type RunRecordSnapshot = Readonly<z.output<typeof snapshotSchema>>;
|
|
45
|
+
declare const whereSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
46
|
+
kind: z.ZodLiteral<"local">;
|
|
47
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
+
kind: z.ZodLiteral<"runner">;
|
|
49
|
+
team: z.ZodString;
|
|
50
|
+
project: z.ZodString;
|
|
51
|
+
region: z.ZodString;
|
|
52
|
+
runtime: z.ZodString;
|
|
53
|
+
vcpus: z.ZodNumber;
|
|
54
|
+
base: z.ZodString;
|
|
55
|
+
baseRef: z.ZodString;
|
|
56
|
+
sandbox: z.ZodNullable<z.ZodString>;
|
|
57
|
+
snapshot: z.ZodNullable<z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
base: z.ZodString;
|
|
60
|
+
built: z.ZodBoolean;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
keptUntil: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
63
|
+
}, z.core.$strip>], "kind">;
|
|
64
|
+
/**
|
|
65
|
+
* Where a run's command ran: on this machine (`local`, with `--local`), or in a runner sandbox (`runner`): the control
|
|
66
|
+
* plane team and project it runs in, its region, runtime and vCPUs, and the run's base, HEAD's merge-base with
|
|
67
|
+
* `baseRef`, all known as the run starts; then, once the run is over, the runner sandbox's name and the runner snapshot
|
|
68
|
+
* it started from, each null when the run stopped before it, and when the runner sandbox's timeout stops it, as an ISO
|
|
69
|
+
* time, when the run kept it running (null when it stopped and deleted it). A reused runner snapshot can be of an
|
|
70
|
+
* older base.
|
|
71
|
+
*/
|
|
72
|
+
export type RunRecordWhere = Readonly<z.output<typeof whereSchema>>;
|
|
73
|
+
declare const gitSchema: z.ZodObject<{
|
|
74
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
75
|
+
commit: z.ZodString;
|
|
76
|
+
dirty: z.ZodBoolean;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
/**
|
|
79
|
+
* Where the checkout the run started from was: HEAD's branch (null when detached), its commit, and whether the working
|
|
80
|
+
* tree had uncommitted changes or untracked files.
|
|
81
|
+
*/
|
|
82
|
+
export type RunRecordGit = Readonly<z.output<typeof gitSchema>>;
|
|
83
|
+
declare const runRecordSchema: z.ZodObject<{
|
|
84
|
+
version: z.ZodLiteral<1>;
|
|
85
|
+
startedAt: z.ZodString;
|
|
86
|
+
cwd: z.ZodString;
|
|
87
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
88
|
+
argv: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
89
|
+
where: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"local">;
|
|
91
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
92
|
+
kind: z.ZodLiteral<"runner">;
|
|
93
|
+
team: z.ZodString;
|
|
94
|
+
project: z.ZodString;
|
|
95
|
+
region: z.ZodString;
|
|
96
|
+
runtime: z.ZodString;
|
|
97
|
+
vcpus: z.ZodNumber;
|
|
98
|
+
base: z.ZodString;
|
|
99
|
+
baseRef: z.ZodString;
|
|
100
|
+
sandbox: z.ZodNullable<z.ZodString>;
|
|
101
|
+
snapshot: z.ZodNullable<z.ZodObject<{
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
base: z.ZodString;
|
|
104
|
+
built: z.ZodBoolean;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
keptUntil: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
107
|
+
}, z.core.$strip>], "kind">;
|
|
108
|
+
git: z.ZodNullable<z.ZodObject<{
|
|
109
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
110
|
+
commit: z.ZodString;
|
|
111
|
+
dirty: z.ZodBoolean;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
ended: z.ZodExactOptional<z.ZodObject<{
|
|
114
|
+
outcome: z.ZodString;
|
|
115
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
116
|
+
signal: z.ZodNullable<z.ZodString>;
|
|
117
|
+
ms: z.ZodNullable<z.ZodNumber>;
|
|
118
|
+
tests: z.ZodNullable<z.ZodObject<{
|
|
119
|
+
passed: z.ZodNumber;
|
|
120
|
+
failed: z.ZodNumber;
|
|
121
|
+
skipped: z.ZodNumber;
|
|
122
|
+
}, z.core.$strip>>;
|
|
123
|
+
testsIncomplete: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
124
|
+
resources: z.ZodUnknown;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
/**
|
|
128
|
+
* A run as `run.json` records it: when it started, the working directory and config file it ran with (null when
|
|
129
|
+
* none applied), the command after `--`, where its command ran, the Git checkout it started from (null outside one,
|
|
130
|
+
* or when git couldn't say), and, once it is over, how it ended.
|
|
131
|
+
*/
|
|
132
|
+
export type RunRecord = Readonly<Omit<z.output<typeof runRecordSchema>, "ended"> & {
|
|
133
|
+
readonly ended?: RunRecordEnd;
|
|
134
|
+
}>;
|
|
135
|
+
/** `run.json`'s text for `record`. */
|
|
136
|
+
export declare function runRecordText(record: RunRecord): string;
|
|
137
|
+
/**
|
|
138
|
+
* The run `text` records; undefined when there is no text, or it isn't a version 1 `run.json`. Resources' facts it
|
|
139
|
+
* can't read, such as another storm's, read as null.
|
|
140
|
+
*/
|
|
141
|
+
export declare function parseRunRecord(text: string | undefined): RunRecord | undefined;
|
|
142
|
+
/** The totals of `events`' final results; null without one. */
|
|
143
|
+
export declare function testTotals(events: readonly TestEvent[]): RunTestTotals | null;
|
|
144
|
+
export {};
|