@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
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
// The Testserver pool resource's command half: its settle, whose request is its resolved options (`config.ts`) as they
|
|
2
|
-
// stand, and whether it takes the run's credential (it does unless `noCreate`); its errors, which a run it refused ends
|
|
3
|
-
// with; and what a canceled run says it changed. Its cleanup report is `cleanup.ts`, what a ran outcome says of it is
|
|
4
|
-
// `ran.ts`, and how it shows in a run's progress is `presentation.ts`.
|
|
5
|
-
import { defineErrors } from "@vercel/clinkr";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { optionKeyPath } from "../../config/index.js";
|
|
8
|
-
import { defineRefusals } from "../../core/index.js";
|
|
9
|
-
import { createFailureText, describeTtl, mayLeaveSandbox } from "./sandbox/index.js";
|
|
10
|
-
import { credentialOriginRows, rejectedCredentialFacts, rejectedCredentialShape, rejectedCredentialText, tokenRequestFailureFacts, tokenRequestFailureShape, } from "./credential-facts.js";
|
|
11
|
-
import { prBuildRefusalErrors, prBuildRefusalFacts } from "./pr-build-facts.js";
|
|
12
|
-
import { createFailureSchema, failedCreateFacts, unpooledFacts, unpooledSchema } from "./ran.js";
|
|
13
|
-
/** A row listing the created Testserver sandboxes the run couldn't add to the pool, when there are any. */
|
|
14
|
-
function unpooledRows(unpooled) {
|
|
15
|
-
return unpooled.length === 0
|
|
16
|
-
? []
|
|
17
|
-
: [
|
|
18
|
-
[
|
|
19
|
-
"Unpooled Testserver sandboxes",
|
|
20
|
-
unpooled.map(({ testserverUrl, message }) => `${testserverUrl}: ${message}`),
|
|
21
|
-
],
|
|
22
|
-
];
|
|
23
|
-
}
|
|
24
|
-
/** What a person reads when some failed create may have left a Testserver sandbox, which lives `ttlMinutes`. */
|
|
25
|
-
function sandboxMayExist(ttlMinutes) {
|
|
26
|
-
return `A create that reached the Testserver control plane may have left a Testserver sandbox anyway; nothing can delete it, and it expires within ${describeTtl(ttlMinutes)}.`;
|
|
27
|
-
}
|
|
28
|
-
/** What a canceled run says of the Testserver pool when it has no canceled facts of its own: it created nothing. */
|
|
29
|
-
const NOTHING_CANCELED = { pooled: 0, unpooled: [], failedCreates: [], ttlMinutes: undefined };
|
|
30
|
-
/**
|
|
31
|
-
* What a canceled run changed in the Testserver pool, for a person: the created Testserver sandboxes it added to the
|
|
32
|
-
* pool, those it couldn't, whether a failed create may have left a Testserver sandbox, and the leases it couldn't
|
|
33
|
-
* release. It calls pooled ones free only when every release succeeded, since a failed release names a lease file,
|
|
34
|
-
* not which Testserver sandbox stays held. A run without a Testserver side held no lease and created nothing, so it
|
|
35
|
-
* says nothing.
|
|
36
|
-
*/
|
|
37
|
-
export function testserverPoolCanceledLines(facts, cleanup) {
|
|
38
|
-
if (cleanup === undefined)
|
|
39
|
-
return [];
|
|
40
|
-
const { releaseFailures } = cleanup;
|
|
41
|
-
const { pooled, unpooled, failedCreates, ttlMinutes } = facts ?? NOTHING_CANCELED;
|
|
42
|
-
// Only a run that creates, with a TTL, can have created or failed creates to report.
|
|
43
|
-
const ttl = ttlMinutes === undefined ? "its TTL" : describeTtl(ttlMinutes);
|
|
44
|
-
const lines = [];
|
|
45
|
-
if (pooled > 0) {
|
|
46
|
-
const sandboxes = pooled === 1 ? "Testserver sandbox" : `${pooled} Testserver sandboxes`;
|
|
47
|
-
lines.push(releaseFailures.length === 0
|
|
48
|
-
? `The ${sandboxes} it created ${pooled === 1 ? "is" : "are"} free in the pool.`
|
|
49
|
-
: `It added the ${sandboxes} it created to the pool.`);
|
|
50
|
-
}
|
|
51
|
-
if (unpooled.length > 0) {
|
|
52
|
-
const one = unpooled.length === 1;
|
|
53
|
-
lines.push(`It couldn't add ${one ? "a" : unpooled.length} Testserver ${one ? "sandbox" : "sandboxes"} it created to the pool; ${one ? "it expires" : "they expire"} within ${ttl}:`, ...unpooled.map(({ testserverUrl, failure }) => ` ${testserverUrl}: ${failure.message}`));
|
|
54
|
-
}
|
|
55
|
-
if (failedCreates.some(mayLeaveSandbox))
|
|
56
|
-
lines.push(`A create that reached the Testserver control plane may have left a Testserver sandbox; nothing can delete it, and it expires within ${ttl}.`);
|
|
57
|
-
if (releaseFailures.length === 0)
|
|
58
|
-
lines.push("The run holds no lease.");
|
|
59
|
-
else {
|
|
60
|
-
const one = releaseFailures.length === 1;
|
|
61
|
-
lines.push(`It couldn't release ${one ? "a lease" : `${releaseFailures.length} leases`}; a later run reclaims ${one ? "it" : "each"} once this process has exited:`, ...releaseFailures.map(({ path, message }) => ` ${path}: ${message}`));
|
|
62
|
-
}
|
|
63
|
-
return lines;
|
|
64
|
-
}
|
|
65
|
-
/** The key path of the option that keeps a run to the Testserver sandboxes already in the pool. */
|
|
66
|
-
const NO_CREATE_KEY_PATH = optionKeyPath("testserverPool", "noCreate");
|
|
67
|
-
/** The error a run the Testserver pool refused before it held anything ends with: the pool couldn't be prepared. */
|
|
68
|
-
export const testserverPoolPrepareErrors = defineErrors({
|
|
69
|
-
poolUnavailable: {
|
|
70
|
-
exitCode: 1,
|
|
71
|
-
description: "storm couldn't use the pool, so it minted no credential and didn't run the command.",
|
|
72
|
-
schema: z.object({
|
|
73
|
-
/** The pool directory that couldn't be made, or where the pool would live. */
|
|
74
|
-
path: z.string(),
|
|
75
|
-
/** What the OS said, or why there is no place for the pool. */
|
|
76
|
-
message: z.string(),
|
|
77
|
-
}),
|
|
78
|
-
render: ({ path, message }) => ({
|
|
79
|
-
message: `Couldn't prepare the pool: ${message}`,
|
|
80
|
-
rows: [["Pool path", path]],
|
|
81
|
-
next: [{ type: "text", text: "Fix the pool path, then retry. The command didn't run." }],
|
|
82
|
-
}),
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
/**
|
|
86
|
-
* The definitions of the errors a run the Testserver pool refused, while the run acquired it, ends with; the host
|
|
87
|
-
* defines them with the run's cleanup beside their data.
|
|
88
|
-
*/
|
|
89
|
-
export const testserverPoolRefusalErrors = defineRefusals({
|
|
90
|
-
poolUnreadable: {
|
|
91
|
-
exitCode: 1,
|
|
92
|
-
description: "storm couldn't list the pool, so it didn't run the command.",
|
|
93
|
-
schema: z.object({ path: z.string(), message: z.string() }),
|
|
94
|
-
render: ({ path, message }) => ({
|
|
95
|
-
message: `Couldn't read the pool: ${message}`,
|
|
96
|
-
rows: [["Pool path", path]],
|
|
97
|
-
next: [{ type: "text", text: "Fix the pool path, then retry. The command didn't run." }],
|
|
98
|
-
}),
|
|
99
|
-
},
|
|
100
|
-
tokenRequestFailed: {
|
|
101
|
-
exitCode: 1,
|
|
102
|
-
description: "With --credential github-actions, the GitHub Actions OIDC token request failed, and the run had no usable Testserver sandbox, from the pool or created, so the command didn't run. It lists the creates that failed before the request did, and says when one may have left a Testserver sandbox.",
|
|
103
|
-
schema: z.object({
|
|
104
|
-
...tokenRequestFailureShape,
|
|
105
|
-
/** The TTL each create asked for, in minutes: how long a Testserver sandbox a failed create left lives. */
|
|
106
|
-
ttlMinutes: z.number(),
|
|
107
|
-
/** The creates that failed before the token request did. */
|
|
108
|
-
failedCreates: z.array(createFailureSchema),
|
|
109
|
-
/** Whether some failed create may have left a Testserver sandbox that nothing can delete. */
|
|
110
|
-
sandboxMayExist: z.boolean(),
|
|
111
|
-
}),
|
|
112
|
-
render: ({ detail, fix, ttlMinutes, failedCreates, sandboxMayExist: mayExist }) => ({
|
|
113
|
-
message: `Couldn't request a GitHub Actions OIDC token: ${detail}. The pool had no usable Testserver sandbox, so the command didn't run.`,
|
|
114
|
-
rows: failedCreates.length === 0 ? [] : [["Failed creates", failedCreates.map(createFailureText)]],
|
|
115
|
-
next: [
|
|
116
|
-
{ type: "text", text: fix },
|
|
117
|
-
...(mayExist ? [{ type: "text", text: sandboxMayExist(ttlMinutes) }] : []),
|
|
118
|
-
],
|
|
119
|
-
}),
|
|
120
|
-
},
|
|
121
|
-
credentialRejected: {
|
|
122
|
-
exitCode: 1,
|
|
123
|
-
description: "The Testserver control plane refused the credential, minted or a GitHub Actions OIDC token (a redirect to SSO, a 401 or a 403), so the command didn't run. It lists the other creates that failed and the created Testserver sandboxes it couldn't add to the pool, and says when some failed create may have left a Testserver sandbox.",
|
|
124
|
-
schema: z.object({
|
|
125
|
-
...rejectedCredentialShape,
|
|
126
|
-
status: z.number(),
|
|
127
|
-
vercelId: z.string().nullable(),
|
|
128
|
-
/** The TTL each create asked for, in minutes: how long a Testserver sandbox a failed create left lives. */
|
|
129
|
-
ttlMinutes: z.number(),
|
|
130
|
-
/** The other creates that failed before the creates in flight settled. */
|
|
131
|
-
failedCreates: z.array(createFailureSchema),
|
|
132
|
-
/** Created Testserver sandboxes the run couldn't add to the pool. Each expires when its TTL runs out. */
|
|
133
|
-
unpooled: z.array(unpooledSchema),
|
|
134
|
-
/** Whether some failed create may have left a Testserver sandbox that nothing can delete. */
|
|
135
|
-
sandboxMayExist: z.boolean(),
|
|
136
|
-
}),
|
|
137
|
-
render: ({ origin, fix, status, vercelId, ttlMinutes, failedCreates, unpooled, sandboxMayExist: mayExist }) => ({
|
|
138
|
-
message: `The Testserver control plane rejected ${rejectedCredentialText(origin)} (HTTP ${status}, x-vercel-id ${vercelId ?? "unknown"}). The command didn't run.`,
|
|
139
|
-
rows: [
|
|
140
|
-
...credentialOriginRows(origin),
|
|
141
|
-
...unpooledRows(unpooled),
|
|
142
|
-
...(failedCreates.length === 0 ? [] : [["Failed creates", failedCreates.map(createFailureText)]]),
|
|
143
|
-
],
|
|
144
|
-
next: [
|
|
145
|
-
{ type: "text", text: fix },
|
|
146
|
-
...(mayExist ? [{ type: "text", text: sandboxMayExist(ttlMinutes) }] : []),
|
|
147
|
-
],
|
|
148
|
-
}),
|
|
149
|
-
},
|
|
150
|
-
noSandboxes: {
|
|
151
|
-
exitCode: 1,
|
|
152
|
-
description: "The pool had no usable Testserver sandbox and every create failed, so the command didn't run. When some failed create may have left a Testserver sandbox, it says so.",
|
|
153
|
-
schema: z.object({
|
|
154
|
-
requested: z.number(),
|
|
155
|
-
/** The TTL each create asked for, in minutes: how long a Testserver sandbox a failed create left lives. */
|
|
156
|
-
ttlMinutes: z.number(),
|
|
157
|
-
failedCreates: z.array(createFailureSchema),
|
|
158
|
-
/** Whether some failed create may have left a Testserver sandbox that nothing can delete. */
|
|
159
|
-
sandboxMayExist: z.boolean(),
|
|
160
|
-
}),
|
|
161
|
-
render: ({ requested, ttlMinutes, failedCreates, sandboxMayExist: mayExist }) => ({
|
|
162
|
-
message: `Got none of the ${requested} Testserver sandboxes asked for: the pool had no usable one, and all ${failedCreates.length} creates failed. The command didn't run.`,
|
|
163
|
-
rows: [["Failed creates", failedCreates.map(createFailureText)]],
|
|
164
|
-
...(mayExist ? { next: [{ type: "text", text: sandboxMayExist(ttlMinutes) }] } : {}),
|
|
165
|
-
}),
|
|
166
|
-
},
|
|
167
|
-
noUsableSandboxes: {
|
|
168
|
-
exitCode: 1,
|
|
169
|
-
description: "Under noCreate, the pool had no usable Testserver sandbox on the build, so the command didn't run. noCreate never creates one.",
|
|
170
|
-
schema: z.object({
|
|
171
|
-
requested: z.number(),
|
|
172
|
-
/** The build the run matched pool entries on: the one the build setting resolved to, or a build channel as written. */
|
|
173
|
-
build: z.string(),
|
|
174
|
-
}),
|
|
175
|
-
render: ({ requested, build }) => ({
|
|
176
|
-
message: `${requested === 1 ? "Got no Testserver sandbox" : `Got none of the ${requested} Testserver sandboxes asked for`}: the pool has no usable one on ${build}, and noCreate creates none. The command didn't run.`,
|
|
177
|
-
next: [
|
|
178
|
-
{
|
|
179
|
-
type: "text",
|
|
180
|
-
text: `Set ${NO_CREATE_KEY_PATH} to false to create Testserver sandboxes, or check the pool with storm pool list.`,
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
}),
|
|
184
|
-
},
|
|
185
|
-
...prBuildRefusalErrors("The command didn't run."),
|
|
186
|
-
});
|
|
187
|
-
/**
|
|
188
|
-
* The Testserver pool resource's command half, `resources.testserverPool`, with its errors: its prepare's,
|
|
189
|
-
* `pool_unavailable`, and its refusal errors. A failed mint with no Testserver sandbox in hand ends the run as the
|
|
190
|
-
* run's own `mint_failed`, which `exec` and `vitest` define.
|
|
191
|
-
*/
|
|
192
|
-
export const testserverPoolCommand = {
|
|
193
|
-
errors: testserverPoolPrepareErrors,
|
|
194
|
-
refusalErrors: testserverPoolRefusalErrors,
|
|
195
|
-
// Its request is the resolved options as they stand; a pool that creates gets the run's credential source.
|
|
196
|
-
settle: ({ options }) => ({ ok: true, secrets: [], request: options }),
|
|
197
|
-
takesCredential: (options) => options.provisioning.kind === "create",
|
|
198
|
-
unpreparedError: ({ failure }) => testserverPoolPrepareErrors.poolUnavailable({ ...failure }),
|
|
199
|
-
refusalFacts: (refusal) => {
|
|
200
|
-
switch (refusal.kind) {
|
|
201
|
-
case "pool-unreadable":
|
|
202
|
-
return { key: "poolUnreadable", data: { ...refusal.failure } };
|
|
203
|
-
case "token-request-failed":
|
|
204
|
-
return {
|
|
205
|
-
key: "tokenRequestFailed",
|
|
206
|
-
data: {
|
|
207
|
-
...tokenRequestFailureFacts(refusal.failure),
|
|
208
|
-
ttlMinutes: refusal.ttlMinutes,
|
|
209
|
-
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
210
|
-
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox),
|
|
211
|
-
},
|
|
212
|
-
};
|
|
213
|
-
case "credential-rejected":
|
|
214
|
-
return {
|
|
215
|
-
key: "credentialRejected",
|
|
216
|
-
data: {
|
|
217
|
-
...rejectedCredentialFacts(refusal.origin),
|
|
218
|
-
ttlMinutes: refusal.ttlMinutes,
|
|
219
|
-
status: refusal.failure.status,
|
|
220
|
-
vercelId: refusal.failure.vercelId ?? null,
|
|
221
|
-
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
222
|
-
unpooled: unpooledFacts(refusal.unpooled),
|
|
223
|
-
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox),
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
case "no-sandboxes":
|
|
227
|
-
return {
|
|
228
|
-
key: "noSandboxes",
|
|
229
|
-
data: {
|
|
230
|
-
requested: refusal.requested,
|
|
231
|
-
ttlMinutes: refusal.ttlMinutes,
|
|
232
|
-
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
233
|
-
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox),
|
|
234
|
-
},
|
|
235
|
-
};
|
|
236
|
-
case "no-usable-sandboxes":
|
|
237
|
-
return {
|
|
238
|
-
key: "noUsableSandboxes",
|
|
239
|
-
data: {
|
|
240
|
-
requested: refusal.requested,
|
|
241
|
-
build: "resolvedBuild" in refusal.match ? refusal.match.resolvedBuild : refusal.match.requestedBuild,
|
|
242
|
-
},
|
|
243
|
-
};
|
|
244
|
-
case "pull-request-unreadable":
|
|
245
|
-
case "pr-builds-unlisted":
|
|
246
|
-
case "pr-build-not-ready":
|
|
247
|
-
case "pr-build-expired":
|
|
248
|
-
return prBuildRefusalFacts(refusal);
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
canceledLines: testserverPoolCanceledLines,
|
|
252
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { AnyResourceConfig, ConfigGateway } from "../../../config/index.ts";
|
|
2
|
-
import type { CredentialGateway, GitHubActionsTokenGateway } from "../../../credential/index.ts";
|
|
3
|
-
import type { Clock } from "../../../time/index.ts";
|
|
4
|
-
import type { TestserverPoolKind } from "../provider.ts";
|
|
5
|
-
/** What `pool create` and `pool list` use of the host's app. */
|
|
6
|
-
export interface TestserverCommandApp {
|
|
7
|
-
readonly context: TestserverPoolKind["gateways"] & {
|
|
8
|
-
readonly credentials: CredentialGateway;
|
|
9
|
-
/** GitHub Actions' OIDC token issuer, for `--credential github-actions`. */
|
|
10
|
-
readonly githubActionsTokens: GitHubActionsTokenGateway;
|
|
11
|
-
readonly config: ConfigGateway;
|
|
12
|
-
readonly clock: Clock;
|
|
13
|
-
};
|
|
14
|
-
/** The host's working directory, where the search for `storm.config.ts` starts. */
|
|
15
|
-
readonly cwd: string;
|
|
16
|
-
/** Every resource config the host checks `storm.config.ts` against, the Testserver pool's among them. */
|
|
17
|
-
readonly resourceConfigs: readonly AnyResourceConfig[];
|
|
18
|
-
}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { fileOptions, fileSettings, invalidResourceOptions, loadSettingsFile, mergeResourceOptions, } from "../../../../config/index.js";
|
|
3
|
-
import { credentialSourceFor, describeMintFailure, mintTargetText, settleCredential, } from "../../../../credential/index.js";
|
|
4
|
-
import { parseTtl } from "../../../../time/index.js";
|
|
5
|
-
import { testserverPoolConfig } from "../../config.js";
|
|
6
|
-
import { rejectedCredentialFacts, REQUESTING_TOKEN_LINE, tokenRequestFailureFacts } from "../../credential-facts.js";
|
|
7
|
-
import { createPooledSandbox, resolvePrBuild } from "../../pool/index.js";
|
|
8
|
-
import { prBuildRefusalFacts } from "../../pr-build-facts.js";
|
|
9
|
-
import { CREATE_ATTEMPTS, DEFAULT_TTL_MINUTES, invalidTtlMessage, mayLeaveSandbox, parseBuildReference, shortSha, TESTSERVER_REPO, } from "../../sandbox/index.js";
|
|
10
|
-
import { outcomes } from "./outcomes.js";
|
|
11
|
-
/**
|
|
12
|
-
* Makes sure the pool is usable, then gets a credential from the credential source `--credential` picks (no config
|
|
13
|
-
* key): by default it mints one for `--scope`/`--project`; with `github-actions` it requests one GitHub Actions OIDC
|
|
14
|
-
* token instead, and needs no `--scope` or `--project`. Then it creates one Testserver sandbox on `--build` living
|
|
15
|
-
* `--ttl` (5 hours by default), retrying only creates that never reached the Testserver control plane, and adds it to
|
|
16
|
-
* the pool, unleased. In text output it reports each step, and each progress message the control plane sends, indented,
|
|
17
|
-
* as it arrives.
|
|
18
|
-
*
|
|
19
|
-
* A PR build reference (`pr:<N>`, or the vercel/api pull request's URL) is resolved first, as a run resolves it, with
|
|
20
|
-
* the host's GitHub token: the pull request's head commit from GitHub, then the PR build of a pool entry created for
|
|
21
|
-
* `pr:<N>` on that commit, or else the newest PR build vercel/api's `Testserver` workflow published from it. The
|
|
22
|
-
* Testserver sandbox is created on that PR build, and its pool entry records `pr:<N>` as its requested build and the
|
|
23
|
-
* head commit, so a later run on that head finds the PR build in the pool. A PR build reference that can't be resolved
|
|
24
|
-
* refuses, and nothing is created.
|
|
25
|
-
*
|
|
26
|
-
* Each setting comes from its flag, else `storm.config.ts` (found from the working directory), else its built-in
|
|
27
|
-
* default; `--scope` and `--project` have none, so one of the two must give them. `pool create` only ever makes
|
|
28
|
-
* Testserver sandboxes, so it reads `build` and `ttl` through the Testserver pool resource's config, from the file's
|
|
29
|
-
* `resources.testserverPool` whether or not the file has one, with `--build` and `--ttl` over them. It checks the
|
|
30
|
-
* whole file, as every command that loads it does, but not the Testserver pool's checks across options, since
|
|
31
|
-
* `minTimeLeft` doesn't apply to a create.
|
|
32
|
-
*/
|
|
33
|
-
export function command(cmd) {
|
|
34
|
-
return cmd.define({
|
|
35
|
-
requestSchema: z.object({
|
|
36
|
-
scope: z.string().min(1).optional(),
|
|
37
|
-
project: z.string().min(1).optional(),
|
|
38
|
-
build: z.string().min(1).optional(),
|
|
39
|
-
ttl: z.string().optional(),
|
|
40
|
-
credential: z.enum(["mint", "github-actions"]).default("mint"),
|
|
41
|
-
}),
|
|
42
|
-
cli: { options: { project: { short: "p" } } },
|
|
43
|
-
response: outcomes,
|
|
44
|
-
validate: ({ ttl, build }) => [
|
|
45
|
-
...(ttl !== undefined && parseTtl(ttl) === undefined ? [{ field: "ttl", message: invalidTtlMessage(ttl) }] : []),
|
|
46
|
-
...(build === undefined ? [] : buildProblems(build)),
|
|
47
|
-
],
|
|
48
|
-
handler: async ({ app, ui }, request) => {
|
|
49
|
-
const { credential: source, scope, project } = request;
|
|
50
|
-
const file = await loadSettingsFile(app.context.config, app.cwd, app.resourceConfigs);
|
|
51
|
-
if (!file.ok)
|
|
52
|
-
return file.refusal;
|
|
53
|
-
const configFile = file.path;
|
|
54
|
-
const settings = fileSettings(file, { scope, project });
|
|
55
|
-
const pool = mergeResourceOptions(testserverPoolConfig, fileOptions(file, testserverPoolConfig), {
|
|
56
|
-
...(request.build === undefined ? {} : { build: settledBuild(request.build) }),
|
|
57
|
-
...(request.ttl === undefined ? {} : { ttl: request.ttl }),
|
|
58
|
-
});
|
|
59
|
-
if (!pool.ok)
|
|
60
|
-
return invalidResourceOptions(configFile, pool.problems);
|
|
61
|
-
const chosen = settleCredential(source, settings.scope, settings.project);
|
|
62
|
-
if (!chosen.ok)
|
|
63
|
-
return chosen.refusal;
|
|
64
|
-
const requestedBuild = pool.value.build.value;
|
|
65
|
-
const ttlMinutes = parseTtl(pool.value.ttl.value) ?? DEFAULT_TTL_MINUTES;
|
|
66
|
-
if (configFile !== null)
|
|
67
|
-
await ui.progress?.(`Config: ${configFile}`);
|
|
68
|
-
const { context } = app;
|
|
69
|
-
const prepared = await context.pool.prepare();
|
|
70
|
-
if (!prepared.ok)
|
|
71
|
-
return outcomes.poolUnavailable({ ...prepared.failure });
|
|
72
|
-
const credential = credentialSourceFor(chosen.credential, context, {
|
|
73
|
-
onMint: async (target) => {
|
|
74
|
-
await ui.progress?.(`Minting a credential for ${mintTargetText(target)}…`);
|
|
75
|
-
},
|
|
76
|
-
onRequest: async () => {
|
|
77
|
-
await ui.progress?.(REQUESTING_TOKEN_LINE);
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
let resolution;
|
|
81
|
-
const reference = parseBuildReference(requestedBuild);
|
|
82
|
-
if (reference.ok && reference.reference.kind === "pull-request") {
|
|
83
|
-
const resolved = await resolvePrBuild(context, { pr: reference.reference.number });
|
|
84
|
-
if (!resolved.ok) {
|
|
85
|
-
const { key, data } = prBuildRefusalFacts(resolved.refusal);
|
|
86
|
-
// Each key names one of the four errors, with that error's data.
|
|
87
|
-
switch (key) {
|
|
88
|
-
case "pullRequestUnreadable":
|
|
89
|
-
return outcomes.pullRequestUnreadable(data);
|
|
90
|
-
case "prBuildsUnlisted":
|
|
91
|
-
return outcomes.prBuildsUnlisted(data);
|
|
92
|
-
case "prBuildNotReady":
|
|
93
|
-
return outcomes.prBuildNotReady(data);
|
|
94
|
-
case "prBuildExpired":
|
|
95
|
-
return outcomes.prBuildExpired(data);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
resolution = resolved.resolution;
|
|
99
|
-
await ui.progress?.(`${TESTSERVER_REPO}#${resolution.pr} at ${shortSha(resolution.headSha)} → build ${resolution.build}${resolution.from === "pool" ? " (from the pool)" : ""}`);
|
|
100
|
-
}
|
|
101
|
-
const build = resolution?.build ?? requestedBuild;
|
|
102
|
-
const got = await credential.get();
|
|
103
|
-
if (!got.ok)
|
|
104
|
-
return credentialFailed(got.failure);
|
|
105
|
-
await ui.progress?.(`Creating a Testserver sandbox on ${build}…`);
|
|
106
|
-
const progress = ui.progress;
|
|
107
|
-
const created = await createPooledSandbox(app.context, {
|
|
108
|
-
credential: got.credential,
|
|
109
|
-
build,
|
|
110
|
-
requestedBuild,
|
|
111
|
-
...(resolution === undefined ? {} : { headSha: resolution.headSha }),
|
|
112
|
-
ttlMinutes,
|
|
113
|
-
lease: false,
|
|
114
|
-
}, progress === undefined ? {} : { onProgress: (message) => progress(` ${message}`) });
|
|
115
|
-
const pullRequest = resolution === undefined ? null : { repo: TESTSERVER_REPO, number: resolution.pr, headSha: resolution.headSha };
|
|
116
|
-
switch (created.kind) {
|
|
117
|
-
case "pooled":
|
|
118
|
-
return outcomes.created({ ...sandboxFacts(created.entry), pullRequest, configFile });
|
|
119
|
-
case "pool-write-failed":
|
|
120
|
-
return outcomes.poolWriteFailed({
|
|
121
|
-
...sandboxFacts(created.entry),
|
|
122
|
-
pullRequest,
|
|
123
|
-
configFile,
|
|
124
|
-
path: created.failure.path,
|
|
125
|
-
message: created.failure.message,
|
|
126
|
-
});
|
|
127
|
-
case "create-failed":
|
|
128
|
-
return createFailure(created.failure, credential.origin(got.credential), build, ttlMinutes);
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
/** The `--build` problems the Testserver pool's `build` rule finds, as `validate` reports them. */
|
|
134
|
-
function buildProblems(build) {
|
|
135
|
-
const checked = testserverPoolConfig.options.build.check(build);
|
|
136
|
-
return checked.ok ? [] : checked.problems.map(({ problem }) => ({ field: "build", message: `--build ${problem}.` }));
|
|
137
|
-
}
|
|
138
|
-
/** `--build` as the Testserver pool's `build` rule settles it: a PR build reference as `pr:<N>`. */
|
|
139
|
-
function settledBuild(build) {
|
|
140
|
-
const checked = testserverPoolConfig.options.build.check(build);
|
|
141
|
-
// `validate` refused every `--build` the rule refuses.
|
|
142
|
-
if (!checked.ok)
|
|
143
|
-
throw new Error(`--build ${build} should have been refused`);
|
|
144
|
-
return checked.value;
|
|
145
|
-
}
|
|
146
|
-
/** The outcome of a credential source that couldn't give a credential. */
|
|
147
|
-
function credentialFailed(failure) {
|
|
148
|
-
return failure.source === "mint"
|
|
149
|
-
? outcomes.mintFailed({ ...failure.target, ...describeMintFailure(failure.failure, failure.target) })
|
|
150
|
-
: outcomes.tokenRequestFailed(tokenRequestFailureFacts(failure.failure));
|
|
151
|
-
}
|
|
152
|
-
function sandboxFacts(entry) {
|
|
153
|
-
const { testserverUrl, logViewerUrl, requestedBuild, resolvedBuild, ttlMinutes } = entry;
|
|
154
|
-
return { testserverUrl, logViewerUrl, requestedBuild, resolvedBuild, ttlMinutes };
|
|
155
|
-
}
|
|
156
|
-
function createFailure(failure, origin, build, ttlMinutes) {
|
|
157
|
-
const facts = {
|
|
158
|
-
build,
|
|
159
|
-
ttlMinutes,
|
|
160
|
-
detail: null,
|
|
161
|
-
status: null,
|
|
162
|
-
seconds: null,
|
|
163
|
-
sandboxMayExist: mayLeaveSandbox(failure),
|
|
164
|
-
};
|
|
165
|
-
switch (failure.kind) {
|
|
166
|
-
case "connect-failed":
|
|
167
|
-
return outcomes.testserverUnreachable({ attempts: CREATE_ATTEMPTS, code: failure.code });
|
|
168
|
-
case "rejected":
|
|
169
|
-
return outcomes.credentialRejected({
|
|
170
|
-
...rejectedCredentialFacts(origin),
|
|
171
|
-
status: failure.status,
|
|
172
|
-
vercelId: failure.vercelId ?? null,
|
|
173
|
-
});
|
|
174
|
-
case "http-error":
|
|
175
|
-
return outcomes.createFailed({
|
|
176
|
-
...facts,
|
|
177
|
-
kind: failure.kind,
|
|
178
|
-
detail: failure.body,
|
|
179
|
-
status: failure.status,
|
|
180
|
-
});
|
|
181
|
-
case "stream-error":
|
|
182
|
-
return outcomes.createFailed({
|
|
183
|
-
...facts,
|
|
184
|
-
kind: failure.kind,
|
|
185
|
-
detail: failure.error,
|
|
186
|
-
});
|
|
187
|
-
case "stream-ended":
|
|
188
|
-
return outcomes.createFailed({ ...facts, kind: failure.kind });
|
|
189
|
-
case "dropped":
|
|
190
|
-
return outcomes.createFailed({
|
|
191
|
-
...facts,
|
|
192
|
-
kind: failure.kind,
|
|
193
|
-
detail: failure.message,
|
|
194
|
-
});
|
|
195
|
-
case "timeout":
|
|
196
|
-
return outcomes.createFailed({
|
|
197
|
-
...facts,
|
|
198
|
-
kind: failure.kind,
|
|
199
|
-
seconds: failure.seconds,
|
|
200
|
-
});
|
|
201
|
-
case "malformed":
|
|
202
|
-
return outcomes.createFailed({
|
|
203
|
-
...facts,
|
|
204
|
-
kind: failure.kind,
|
|
205
|
-
detail: failure.detail,
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare const metadata: {
|
|
2
|
-
description: string;
|
|
3
|
-
usages: string[];
|
|
4
|
-
summary: string;
|
|
5
|
-
fields: {
|
|
6
|
-
scope: {
|
|
7
|
-
valueLabel: string;
|
|
8
|
-
description: string;
|
|
9
|
-
};
|
|
10
|
-
project: {
|
|
11
|
-
valueLabel: string;
|
|
12
|
-
description: string;
|
|
13
|
-
};
|
|
14
|
-
build: {
|
|
15
|
-
valueLabel: string;
|
|
16
|
-
description: string;
|
|
17
|
-
};
|
|
18
|
-
ttl: {
|
|
19
|
-
valueLabel: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
credential: {
|
|
23
|
-
valueLabel: string;
|
|
24
|
-
description: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
examples: {
|
|
28
|
-
argv: string;
|
|
29
|
-
description: string;
|
|
30
|
-
}[];
|
|
31
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export const metadata = {
|
|
2
|
-
description: "Get a credential (mint one, or with --credential github-actions request a GitHub Actions OIDC token), create one Testserver sandbox with the TTL --ttl gives, and add it to the pool, unleased. Prints its Testserver URL, log viewer URL, and the build it resolved to; for a vercel/api pull request, also the head commit. A flag overrides storm.config.ts, found in the working directory or a parent up to the git worktree's root and checked whole, which overrides the built-in default.",
|
|
3
|
-
usages: ["[--build <BUILD>] [--ttl <DURATION>] [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>]"],
|
|
4
|
-
summary: "Create a Testserver sandbox and add it to the pool.",
|
|
5
|
-
fields: {
|
|
6
|
-
scope: {
|
|
7
|
-
valueLabel: "TEAM",
|
|
8
|
-
description: "The control plane team: the Vercel team whose project's development OIDC tokens the Testserver control plane trusts. Required with the mint, from this flag or scope in storm.config.ts; unused with --credential github-actions.",
|
|
9
|
-
},
|
|
10
|
-
project: {
|
|
11
|
-
valueLabel: "PROJECT",
|
|
12
|
-
description: "The control plane project: the Vercel project, within the team, to mint the credential for. Required with the mint, from this flag or project in storm.config.ts; unused with --credential github-actions.",
|
|
13
|
-
},
|
|
14
|
-
build: {
|
|
15
|
-
valueLabel: "BUILD",
|
|
16
|
-
description: "The build to create the Testserver sandbox on: a build name, the build channel stable or latest_main, or a vercel/api pull request as pr:<N> or its URL. A pull request creates on the newest build made from its head commit, which storm reads from GitHub with GITHUB_TOKEN, GH_TOKEN or gh auth token, or refuses. Default stable, or resources.testserverPool.build in storm.config.ts.",
|
|
17
|
-
},
|
|
18
|
-
ttl: {
|
|
19
|
-
valueLabel: "DURATION",
|
|
20
|
-
description: "How long the Testserver sandbox lives, in whole minutes or hours from 10m to 5h. Default 5h, or resources.testserverPool.ttl in storm.config.ts.",
|
|
21
|
-
},
|
|
22
|
-
credential: {
|
|
23
|
-
valueLabel: "SOURCE",
|
|
24
|
-
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, and needs no --scope or --project. No config key.",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
examples: [
|
|
28
|
-
{
|
|
29
|
-
argv: "--scope vercel --project vercel",
|
|
30
|
-
description: "Create a Testserver sandbox on the stable build channel and add it to the pool.",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
argv: "--scope vercel --project vercel --ttl 30m",
|
|
34
|
-
description: "Create one that lives 30 minutes.",
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
argv: "--scope vercel --project vercel --build latest_main --json",
|
|
38
|
-
description: "Create one on the newest main build and print its details as JSON.",
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
argv: "--scope vercel --project vercel --build pr:104196 --json",
|
|
42
|
-
description: "Create one on the Testserver build of vercel/api pull request 104196's head commit.",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
argv: "--credential github-actions --ttl 10m",
|
|
46
|
-
description: "In a GitHub Actions job, create one with a GitHub Actions OIDC token.",
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { inspectPool } from "../../pool/index.js";
|
|
3
|
-
import { outcomes } from "./outcomes.js";
|
|
4
|
-
/**
|
|
5
|
-
* Lists the pool: every pool entry, health-checked in parallel whether leased or not, with its lease state and
|
|
6
|
-
* time left, the entry files storm can't read, and the channel resolutions. It changes nothing and never
|
|
7
|
-
* mints.
|
|
8
|
-
*/
|
|
9
|
-
export function command(cmd) {
|
|
10
|
-
return cmd.define({
|
|
11
|
-
requestSchema: z.object({}).strict(),
|
|
12
|
-
response: outcomes,
|
|
13
|
-
handler: async ({ app }) => {
|
|
14
|
-
const inspected = await inspectPool(app.context);
|
|
15
|
-
if (!inspected.ok)
|
|
16
|
-
return outcomes.poolUnreadable({ ...inspected.failure });
|
|
17
|
-
const { directory, entries, unreadable, channels } = inspected.value;
|
|
18
|
-
return outcomes.listed({
|
|
19
|
-
poolPath: directory,
|
|
20
|
-
entries: entries.map(listedEntry),
|
|
21
|
-
unreadable: unreadable.map(({ file, reason }) => ({ file, reason })),
|
|
22
|
-
channels: channels.map(({ channel, build, learnedAt, ageMinutes }) => ({
|
|
23
|
-
channel,
|
|
24
|
-
build,
|
|
25
|
-
learnedAt,
|
|
26
|
-
ageMinutes,
|
|
27
|
-
})),
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function listedEntry(inspected) {
|
|
33
|
-
const { entry, lease, health } = inspected;
|
|
34
|
-
return {
|
|
35
|
-
testserverUrl: entry.testserverUrl,
|
|
36
|
-
logViewerUrl: entry.logViewerUrl,
|
|
37
|
-
requestedBuild: entry.requestedBuild,
|
|
38
|
-
resolvedBuild: entry.resolvedBuild,
|
|
39
|
-
createdAt: entry.createdAt,
|
|
40
|
-
ttlMinutes: entry.ttlMinutes,
|
|
41
|
-
minutesLeft: inspected.minutesLeft,
|
|
42
|
-
lease: lease.state === "free"
|
|
43
|
-
? { state: lease.state, pid: null, hostname: null, startedAt: null, holderAlive: null }
|
|
44
|
-
: {
|
|
45
|
-
state: lease.state,
|
|
46
|
-
pid: lease.holder?.pid ?? null,
|
|
47
|
-
hostname: lease.holder?.hostname ?? null,
|
|
48
|
-
startedAt: lease.startedAt,
|
|
49
|
-
holderAlive: lease.holder?.alive ?? null,
|
|
50
|
-
},
|
|
51
|
-
leaseGuard: inspected.leaseGuard,
|
|
52
|
-
health: health.kind === "failed"
|
|
53
|
-
? { kind: health.kind, status: null, detail: health.detail }
|
|
54
|
-
: { kind: health.kind, status: health.status, detail: null },
|
|
55
|
-
};
|
|
56
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export const metadata = {
|
|
2
|
-
description: "List every pool entry with its lease, the time it has left, and a fresh health check, along with the channel resolutions and any entry files storm can't read. Changes nothing: expired entries stay until a later run drops them, and stale leases until a later run reclaims them.",
|
|
3
|
-
summary: "List the pool's Testserver sandboxes.",
|
|
4
|
-
aliases: ["ls"],
|
|
5
|
-
examples: [
|
|
6
|
-
{ argv: "", description: "List the pool." },
|
|
7
|
-
{ argv: "--json", description: "List the pool as JSON, with each lease's holder." },
|
|
8
|
-
],
|
|
9
|
-
};
|