@cnc-tools/storm 0.9.1 → 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 -2
- package/dist/application.d.ts +5 -5
- package/dist/application.js +11 -9
- package/dist/bin/storm.js +24 -20
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-AGWW3HDT.js +2559 -0
- package/dist/chunks/{chunk-RRQ2ZGSE.js → chunk-AKKNF3WZ.js} +847 -336
- package/dist/chunks/chunk-H2VCSNVU.js +351 -0
- package/dist/chunks/chunk-J6ZNYUDV.js +21 -0
- package/dist/chunks/{chunk-WV6WQFC6.js → chunk-JQ2HK4RN.js} +15 -26
- 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-X3PW2W42.js → live-app-RIJM3QFD.js} +30 -22
- 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 +58 -25
- 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 +2 -61
- 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 +38 -32
- package/dist/commands/runs/list/metadata.d.ts +16 -14
- package/dist/commands/runs/list/metadata.js +17 -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 +44 -41
- package/dist/commands/runs/logs/metadata.d.ts +17 -15
- package/dist/commands/runs/logs/metadata.js +20 -18
- 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 +87 -79
- package/dist/commands/runs/show/metadata.d.ts +20 -18
- package/dist/commands/runs/show/metadata.js +20 -18
- 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 +71 -94
- package/dist/commands/vitest/metadata.d.ts +0 -65
- package/dist/commands/vitest/metadata.js +2 -41
- 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/{resources/testserver/commands → extensions/testserver/commands/pool}/create/command.js +105 -140
- 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/{resources/testserver/commands → extensions/testserver/commands/pool}/list/command.js +30 -28
- package/dist/extensions/testserver/commands/pool/list/metadata.d.ts +11 -0
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/metadata.js +7 -5
- 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 +25 -14
- package/dist/{vitest → extensions/testserver/vitest}/container-scope.js +55 -17
- 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 +66 -29
- package/dist/{vitest → extensions/testserver/vitest}/diagnostics.js +146 -50
- package/dist/{vitest → extensions/testserver/vitest}/fixtures.d.ts +5 -5
- package/dist/{vitest → extensions/testserver/vitest}/fixtures.js +33 -21
- 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.js +11 -7
- 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/vitest/config.d.ts +2 -28
- package/dist/vitest/config.js +6 -36
- 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 +52 -23
- package/skills/overview.md +9 -9
- package/skills/read-run-output.md +25 -2
- package/skills/testserver-builds.md +8 -8
- package/dist/chunks/chunk-5CQCRX2L.js +0 -5768
- package/dist/chunks/chunk-5U5Q6VZR.js +0 -556
- package/dist/chunks/chunk-7O6UN63H.js +0 -63
- package/dist/chunks/chunk-NX55IJ5S.js +0 -1842
- package/dist/chunks/chunk-OCZJE5XV.js +0 -910
- package/dist/chunks/chunk-S5NAIZYS.js +0 -13
- package/dist/chunks/chunk-UHO5OCEX.js +0 -360
- package/dist/chunks/chunk-WBIHJM7D.js +0 -188
- 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 -79
- package/dist/core/provider.js +0 -5
- package/dist/resource-commands.d.ts +0 -13
- package/dist/resource-commands.js +0 -22
- 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-tree.d.ts +0 -4
- package/dist/resources/testserver/command-tree.js +0 -12
- 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/metadata.d.ts +0 -31
- package/dist/resources/testserver/commands/create/metadata.js +0 -53
- package/dist/resources/testserver/commands/list/metadata.d.ts +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 -32
- 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 -702
- package/dist/resources.js +0 -83
- 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/host.d.ts +0 -2
- package/dist/sdk/host.js +0 -7
- 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 -22
- package/dist/vitest/sandbox.js +0 -41
- /package/dist/{credential/settle.js → config/credential-settle.js} +0 -0
- /package/dist/{resources → extensions}/github/gateways.d.ts +0 -0
- /package/dist/{resources → extensions}/github/gateways.js +0 -0
- /package/dist/{resources → extensions}/github/live/fixture-repo-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/github/live/fixture-repo-gateway.js +0 -0
- /package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/outcomes.d.ts +0 -0
- /package/dist/{core → extensions/testserver}/limit.d.ts +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/build-reference.d.ts +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/build-reference.js +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/channels.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/gateways.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/gateways.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/host.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/host.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/inspect.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/lease.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/live/pool-records.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/live/pool-records.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/staleness.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/staleness.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/index.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/github-rest.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/github-rest.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/pull-request-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/pull-request-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/testserver-workflow-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/testserver-workflow-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/create-failure.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/create-failure.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/gateways.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/builds-response.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/builds-response.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/control-plane-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/control-plane-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/create-response.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/create-response.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/fetch-failure.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/fetch-failure.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/health-check-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/health-check-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/sse.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/sse.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/ansi.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/ansi.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/arguments.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/auth-config.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/auth-config.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/clock.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/clock.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/config-files.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/config-files.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/context.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/driver.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/entry.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/entry.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/environment.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/environment.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/errors.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/errors.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/gateways.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/index.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/keys.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/keys.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/config-files.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/config-files.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/process-gateway.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/process-gateway.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/redaction.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/verbose.d.ts +0 -0
- /package/dist/{vitest → extensions/testserver/vitest}/types.js +0 -0
- /package/dist/sdk/{payload → run}/test-events.d.ts +0 -0
- /package/dist/sdk/{payload → run}/test-events.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/feature-flags.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/feature-flags.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/gateways.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/factories/gateways.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/faulted-exchange.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/faults.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/index.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/proxy.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/proxy.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/body.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/body.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/records.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/index.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/seed.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/seed.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/clock.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/clock.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/live/connect-failure.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/live/connect-failure.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/test-id.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/test-id.js +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Testserver pool resource's definition, for `resources.testserverPool` in `storm.config.ts`: the Testserver
|
|
3
|
+
* sandboxes a run leases or creates for its command. Its presence gives a run the Testserver pool; `testserverPool()`
|
|
4
|
+
* takes every default. `storm vitest` and `storm exec` override each option with its own flag, `--testserver-<option>`,
|
|
5
|
+
* and `pool create` reads `build` and `ttl`. Its checks across options:
|
|
6
|
+
*
|
|
7
|
+
* - with `create` false, which creates no Testserver sandbox, a `ttl` from a flag is refused, and the file's is unused;
|
|
8
|
+
* - otherwise the `ttl` must be longer than `minTimeLeft`, or no Testserver sandbox the run created would have the time
|
|
9
|
+
* left the run asks for.
|
|
10
|
+
*
|
|
11
|
+
* What its release gives back is the leases its acquire took; what releasing it couldn't do is the leases it couldn't
|
|
12
|
+
* release. A stale Testserver variable from the launcher could point the command at other Testserver sandboxes than the
|
|
13
|
+
* run payload names, so its `beforeRun` hides each from the command. A command reads what the run hands it of it with
|
|
14
|
+
* `readRunPayload().get(testserverConnection)`: the Testserver connection, each Testserver sandbox by its Testserver
|
|
15
|
+
* URL.
|
|
16
|
+
*/
|
|
17
|
+
export declare const testserverPoolDefinition: import("../../sdk/extension/resource-definition.ts").ResourceDefinition<"testserverPool", {
|
|
18
|
+
readonly sandboxes: {
|
|
19
|
+
readonly schema: import("zod").ZodNumber;
|
|
20
|
+
readonly default: ({ testPlan }: import("../../sdk/extension/resource-definition.ts").PlannedRun) => number;
|
|
21
|
+
readonly flag: {
|
|
22
|
+
readonly valueLabel: "N";
|
|
23
|
+
readonly description: "How many Testserver sandboxes the command gets, 1 to 32, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1, or with storm vitest one per 4 test files vitest list counted, at most 8. Gives the run the Testserver pool.";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly build: {
|
|
27
|
+
readonly schema: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
28
|
+
readonly default: "stable";
|
|
29
|
+
readonly flag: {
|
|
30
|
+
readonly valueLabel: "BUILD";
|
|
31
|
+
readonly description: "The build the Testserver sandboxes run: a build name, the build channel stable or latest_main, or a vercel/api pull request as pr:<N> or its URL, overriding resources.testserverPool.build in storm.config.ts; default stable. A pull request runs 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. Gives the run the Testserver pool.";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
readonly minTimeLeft: {
|
|
35
|
+
readonly schema: import("zod").ZodString;
|
|
36
|
+
readonly default: "30m";
|
|
37
|
+
readonly flag: {
|
|
38
|
+
readonly valueLabel: "DURATION";
|
|
39
|
+
readonly description: "The least time left a Testserver sandbox from the pool needs, in whole minutes or hours (30m, 2h), overriding resources.testserverPool.minTimeLeft in storm.config.ts; default 30m. Gives the run the Testserver pool.";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly ttl: {
|
|
43
|
+
readonly schema: import("zod").ZodString;
|
|
44
|
+
readonly default: "5h";
|
|
45
|
+
readonly flag: {
|
|
46
|
+
readonly valueLabel: "DURATION";
|
|
47
|
+
readonly description: "How long each Testserver sandbox the run creates lives, 10m to 5h and longer than minTimeLeft, overriding resources.testserverPool.ttl in storm.config.ts; default 5h. Not with create false. Gives the run the Testserver pool.";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly create: {
|
|
51
|
+
readonly schema: import("zod").ZodBoolean;
|
|
52
|
+
readonly default: true;
|
|
53
|
+
readonly flag: {
|
|
54
|
+
readonly description: "Whether the run may create Testserver sandboxes, overriding resources.testserverPool.create in storm.config.ts; default true. --testserver-create=false runs only on Testserver sandboxes already in the pool, never minting for Testserver or creating: it needs no --scope or --project with --unsandboxed, and takes no --testserver-ttl. --testserver-create turns creating on over the file's create: false. Gives the run the Testserver pool.";
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}, import("./run/connection.ts").TestserverConnection, import("./world.ts").TestserverWorld>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// The Testserver pool resource's definition: one `defineResource` call that holds its section
|
|
2
|
+
// `resources.testserverPool` in `storm.config.ts`, with its option rules (`options/rules.ts`), the checks across its
|
|
3
|
+
// options, its payload contract, its world, its lifecycle and its progress (its lifecycle words its refusals in
|
|
4
|
+
// `refusals.ts` and its result in `result.ts`). A config file makes its resource with its resource factory,
|
|
5
|
+
// `testserverPool({ … })` (`resource.ts`, `@vercel/storm/testserver`). `config` loads and merges against it, and the
|
|
6
|
+
// launcher makes `exec`'s and `vitest`'s flags and their help from it. Its name and its payload contract are the SDK's
|
|
7
|
+
// Testserver connection (`src/sdk/testserver/connection.ts`), which a command and the Vitest adapter read the run
|
|
8
|
+
// payload's section through. It loads no Clinkr: the Testserver extension (`extension.ts`) joins it with its commands.
|
|
9
|
+
import { defineResource, optionKeyPath } from "../../sdk/extension/index.js";
|
|
10
|
+
import { TESTSERVER_POOL_NAME, testserverConnection } from "./run/connection.js";
|
|
11
|
+
import { testserverPoolLifecycle } from "./lifecycle.js";
|
|
12
|
+
import { liveTestserverWorld } from "./live/world.js";
|
|
13
|
+
import { minTimeLeftMinutes, testserverPoolRules, ttlMinutes } from "./options/index.js";
|
|
14
|
+
import { testserverPoolProgress } from "./progress.js";
|
|
15
|
+
/** The resource's name, its key under `resources`: the Testserver connection's. */
|
|
16
|
+
const NAME = TESTSERVER_POOL_NAME;
|
|
17
|
+
/**
|
|
18
|
+
* The Testserver pool resource's definition, for `resources.testserverPool` in `storm.config.ts`: the Testserver
|
|
19
|
+
* sandboxes a run leases or creates for its command. Its presence gives a run the Testserver pool; `testserverPool()`
|
|
20
|
+
* takes every default. `storm vitest` and `storm exec` override each option with its own flag, `--testserver-<option>`,
|
|
21
|
+
* and `pool create` reads `build` and `ttl`. Its checks across options:
|
|
22
|
+
*
|
|
23
|
+
* - with `create` false, which creates no Testserver sandbox, a `ttl` from a flag is refused, and the file's is unused;
|
|
24
|
+
* - otherwise the `ttl` must be longer than `minTimeLeft`, or no Testserver sandbox the run created would have the time
|
|
25
|
+
* left the run asks for.
|
|
26
|
+
*
|
|
27
|
+
* What its release gives back is the leases its acquire took; what releasing it couldn't do is the leases it couldn't
|
|
28
|
+
* release. A stale Testserver variable from the launcher could point the command at other Testserver sandboxes than the
|
|
29
|
+
* run payload names, so its `beforeRun` hides each from the command. A command reads what the run hands it of it with
|
|
30
|
+
* `readRunPayload().get(testserverConnection)`: the Testserver connection, each Testserver sandbox by its Testserver
|
|
31
|
+
* URL.
|
|
32
|
+
*/
|
|
33
|
+
export const testserverPoolDefinition = defineResource({
|
|
34
|
+
name: NAME,
|
|
35
|
+
flagPrefix: "testserver",
|
|
36
|
+
options: testserverPoolRules,
|
|
37
|
+
check: ({ minTimeLeft, ttl, create }) => {
|
|
38
|
+
if (!create.value)
|
|
39
|
+
return ttl.source === "flag"
|
|
40
|
+
? [
|
|
41
|
+
{
|
|
42
|
+
option: "ttl",
|
|
43
|
+
problem: `doesn't apply with ${optionKeyPath(NAME, "create")}=false, which creates no Testserver sandbox`,
|
|
44
|
+
involves: ["ttl", "create"],
|
|
45
|
+
},
|
|
46
|
+
]
|
|
47
|
+
: [];
|
|
48
|
+
if (ttlMinutes({ ttl: ttl.value }) > minTimeLeftMinutes({ minTimeLeft: minTimeLeft.value }))
|
|
49
|
+
return [];
|
|
50
|
+
// Name the value that was given over the other's default: a file's or a flag's `minTimeLeft` against the default
|
|
51
|
+
// `ttl` is the `minTimeLeft` that is too long.
|
|
52
|
+
const problem = ttl.source === "default" && minTimeLeft.source !== "default"
|
|
53
|
+
? {
|
|
54
|
+
option: "minTimeLeft",
|
|
55
|
+
problem: `must be shorter than ${optionKeyPath(NAME, "ttl")} (${ttl.value}), not ${minTimeLeft.value}`,
|
|
56
|
+
involves: ["minTimeLeft", "ttl"],
|
|
57
|
+
}
|
|
58
|
+
: {
|
|
59
|
+
option: "ttl",
|
|
60
|
+
problem: `must be longer than ${optionKeyPath(NAME, "minTimeLeft")} (${minTimeLeft.value}), not ${ttl.value}`,
|
|
61
|
+
involves: ["ttl", "minTimeLeft"],
|
|
62
|
+
};
|
|
63
|
+
return [problem];
|
|
64
|
+
},
|
|
65
|
+
// Not the extension's own: the SDK's Testserver connection (`src/sdk/testserver/connection.ts`), its name and payload
|
|
66
|
+
// check, which the Vitest adapter reads too. Every other value here is the extension's (`ResourceSpec`).
|
|
67
|
+
payload: testserverConnection,
|
|
68
|
+
world: liveTestserverWorld,
|
|
69
|
+
lifecycle: testserverPoolLifecycle,
|
|
70
|
+
progress: testserverPoolProgress,
|
|
71
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BuildMatch, LeaseReport, PooledCreateOutcome, UnresolvedChannelReason } from "./pool/index.ts";
|
|
2
|
+
import type { BuildChannel } from "./options/index.ts";
|
|
2
3
|
import type { RunSandbox } from "./run-sandbox.ts";
|
|
3
|
-
import type { BuildChannel } from "./sandbox/index.ts";
|
|
4
4
|
/**
|
|
5
5
|
* What a run's Testserver pool did.
|
|
6
6
|
*
|
|
7
7
|
* - `build-unresolved`: the `build` setting named a build channel that couldn't be resolved, so the run matches pool
|
|
8
8
|
* entries on the channel as written.
|
|
9
|
-
* - `old-channel-resolution`:
|
|
9
|
+
* - `old-channel-resolution`: with `create` false, a build channel resolved from a channel resolution `ageMinutes`
|
|
10
10
|
* old, past the hour a run trusts one for.
|
|
11
11
|
* - `pr-build-resolved`: the `build` setting was the PR build reference `pr:<pr>`, and the run resolved it to `build`,
|
|
12
12
|
* a PR build made from the vercel/api pull request's head commit `headSha`, found on the newest matching pool entry
|
|
@@ -19,7 +19,8 @@ import type { BuildChannel } from "./sandbox/index.ts";
|
|
|
19
19
|
* - `create-started` and `create-finished`: create `index` (from 0) of `count`.
|
|
20
20
|
* - `create-progress`: a progress message the Testserver control plane sent for create `index`, such as
|
|
21
21
|
* `✓ Sandboxes restored in 1.7s`.
|
|
22
|
-
* - `
|
|
22
|
+
* - `acquired`: its acquire's `announce`, which the launcher emits right after it says the run acquired the pool: the
|
|
23
|
+
* Testserver sandboxes the run uses, reused first, the sandbox list.
|
|
23
24
|
*/
|
|
24
25
|
export type TestserverPoolEvent = {
|
|
25
26
|
readonly kind: "build-unresolved";
|
|
@@ -65,6 +66,6 @@ export type TestserverPoolEvent = {
|
|
|
65
66
|
readonly count: number;
|
|
66
67
|
readonly outcome: PooledCreateOutcome;
|
|
67
68
|
} | {
|
|
68
|
-
readonly kind: "
|
|
69
|
+
readonly kind: "acquired";
|
|
69
70
|
readonly sandboxes: readonly RunSandbox[];
|
|
70
71
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// What a run reports about its Testserver pool as it goes: its progress events. The core nests each one in a
|
|
2
|
+
// `resource` run event, and its progress (`progress.ts`) applies them to its lane state. A credential's events, the
|
|
3
|
+
// run's mint and a GitHub Actions OIDC token request, stay the run's own (`CredentialEvent`).
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Testserver extension. Its one resource is the Testserver pool, `resources.testserverPool`. Its commands
|
|
3
|
+
* (`command-tree.ts`) take `TestserverCommandApp`, which their mount projects from the launcher's app. Its run examples
|
|
4
|
+
* show the Testserver pool's `--testserver-<option>` flags.
|
|
5
|
+
*/
|
|
6
|
+
export declare const testserverExtension: import("../../sdk/extension/commands.ts").Extension<"testserver", readonly [import("../../sdk/extension/resource-definition.ts").ResourceDefinition<"testserverPool", {
|
|
7
|
+
readonly sandboxes: {
|
|
8
|
+
readonly schema: import("zod").ZodNumber;
|
|
9
|
+
readonly default: ({ testPlan }: import("../../sdk/extension/resource-definition.ts").PlannedRun) => number;
|
|
10
|
+
readonly flag: {
|
|
11
|
+
readonly valueLabel: "N";
|
|
12
|
+
readonly description: "How many Testserver sandboxes the command gets, 1 to 32, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1, or with storm vitest one per 4 test files vitest list counted, at most 8. Gives the run the Testserver pool.";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly build: {
|
|
16
|
+
readonly schema: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
|
|
17
|
+
readonly default: "stable";
|
|
18
|
+
readonly flag: {
|
|
19
|
+
readonly valueLabel: "BUILD";
|
|
20
|
+
readonly description: "The build the Testserver sandboxes run: a build name, the build channel stable or latest_main, or a vercel/api pull request as pr:<N> or its URL, overriding resources.testserverPool.build in storm.config.ts; default stable. A pull request runs 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. Gives the run the Testserver pool.";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly minTimeLeft: {
|
|
24
|
+
readonly schema: import("zod").ZodString;
|
|
25
|
+
readonly default: "30m";
|
|
26
|
+
readonly flag: {
|
|
27
|
+
readonly valueLabel: "DURATION";
|
|
28
|
+
readonly description: "The least time left a Testserver sandbox from the pool needs, in whole minutes or hours (30m, 2h), overriding resources.testserverPool.minTimeLeft in storm.config.ts; default 30m. Gives the run the Testserver pool.";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
readonly ttl: {
|
|
32
|
+
readonly schema: import("zod").ZodString;
|
|
33
|
+
readonly default: "5h";
|
|
34
|
+
readonly flag: {
|
|
35
|
+
readonly valueLabel: "DURATION";
|
|
36
|
+
readonly description: "How long each Testserver sandbox the run creates lives, 10m to 5h and longer than minTimeLeft, overriding resources.testserverPool.ttl in storm.config.ts; default 5h. Not with create false. Gives the run the Testserver pool.";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly create: {
|
|
40
|
+
readonly schema: import("zod").ZodBoolean;
|
|
41
|
+
readonly default: true;
|
|
42
|
+
readonly flag: {
|
|
43
|
+
readonly description: "Whether the run may create Testserver sandboxes, overriding resources.testserverPool.create in storm.config.ts; default true. --testserver-create=false runs only on Testserver sandboxes already in the pool, never minting for Testserver or creating: it needs no --scope or --project with --unsandboxed, and takes no --testserver-ttl. --testserver-create turns creating on over the file's create: false. Gives the run the Testserver pool.";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}, import("./run/connection.ts").TestserverConnection, import("./world.ts").TestserverWorld>], import("./commands/app.ts").TestserverLauncherApp>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// The Testserver extension: the Testserver pool resource's definition (`definition.ts`) joined with its own commands,
|
|
2
|
+
// `pool create` and `pool list`, mounted as `storm ext testserver`, and the run examples its flags bring to `exec`'s
|
|
3
|
+
// and `vitest`'s help. The one value the folder hands the registry (`src/extensions.ts`). It imports every part
|
|
4
|
+
// statically: a config file loads only `resource.ts` and its definition, which load no Clinkr, and the registry loads
|
|
5
|
+
// this when a command runs.
|
|
6
|
+
import { defineExtension } from "../../sdk/extension/commands.js";
|
|
7
|
+
import { testserverExtensionCommands } from "./command-tree.js";
|
|
8
|
+
import { testserverPoolDefinition } from "./definition.js";
|
|
9
|
+
/**
|
|
10
|
+
* The Testserver extension. Its one resource is the Testserver pool, `resources.testserverPool`. Its commands
|
|
11
|
+
* (`command-tree.ts`) take `TestserverCommandApp`, which their mount projects from the launcher's app. Its run examples
|
|
12
|
+
* show the Testserver pool's `--testserver-<option>` flags.
|
|
13
|
+
*/
|
|
14
|
+
export const testserverExtension = defineExtension({
|
|
15
|
+
name: "testserver",
|
|
16
|
+
resources: [testserverPoolDefinition],
|
|
17
|
+
commands: testserverExtensionCommands,
|
|
18
|
+
examples: {
|
|
19
|
+
exec: [
|
|
20
|
+
{
|
|
21
|
+
argv: "--testserver-sandboxes 4 -- pnpm test:testserver",
|
|
22
|
+
description: "Run a script in a runner sandbox against 4 Testserver sandboxes.",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
argv: "--unsandboxed --testserver-sandboxes 4 --scope vercel --project vercel -- pnpm test",
|
|
26
|
+
description: "Run the tests on this machine against 4 Testserver sandboxes on the stable build channel.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
argv: "--unsandboxed --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
|
|
30
|
+
description: "Create Testserver sandboxes that live 30 minutes, with team and project from storm.config.ts.",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
argv: "--unsandboxed --testserver-build pr:104196 -- pnpm test",
|
|
34
|
+
description: "Run the tests on this machine against the Testserver build of vercel/api pull request 104196's head commit.",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
argv: "--unsandboxed --testserver-create=false --testserver-sandboxes 4 -- pnpm test",
|
|
38
|
+
description: "Run only on Testserver sandboxes already in the pool, never minting.",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
argv: "--unsandboxed --verbose --testserver-sandboxes 2 -- pnpm test",
|
|
42
|
+
description: "Run the tests, printing each create's progress and, through the Vitest adapter, each test as it ends.",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
argv: "--unsandboxed --credential github-actions --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
|
|
46
|
+
description: "In a GitHub Actions job, create Testserver sandboxes with a GitHub Actions OIDC token.",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
argv: "--unsandboxed --testserver-build latest_main --testserver-min-time-left 75m --scope vercel --project vercel -- pnpm test",
|
|
50
|
+
description: "Run them on the newest main build, with Testserver sandboxes that live at least 75 more minutes.",
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
vitest: [
|
|
54
|
+
{
|
|
55
|
+
argv: "--testserver-build pr:104196",
|
|
56
|
+
description: "Run every test against the Testserver build of vercel/api pull request 104196's head commit.",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
argv: "--unsandboxed --testserver-create=false",
|
|
60
|
+
description: "Run on this machine, on Testserver sandboxes already in the pool, never minting.",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
argv: "--testserver-sandboxes 6 -- --project testserver",
|
|
64
|
+
description: "Run vitest's testserver project against 6 Testserver sandboxes, whatever the test count.",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { testserverPoolReleased, testserverPoolReleasedText, testserverPoolReleaseWarnings } from "./release.ts";
|
|
2
|
+
export { testserverCanceledLines } from "./canceled.ts";
|
|
3
|
+
export { credentialRejected, noSandboxes, noUsableSandboxes, poolUnavailable, poolUnreadable, tokenRequestFailed, } from "./refusals.ts";
|
|
4
|
+
export { prBuildRefusal } from "./pr-build-facts.ts";
|
|
5
|
+
export { testserverPoolLifecycle } from "./lifecycle.ts";
|
|
6
|
+
export { testserverExtension } from "./extension.ts";
|
|
7
|
+
export { liveTestserverWorld, TESTSERVER_ORIGIN } from "./live/world.ts";
|
|
8
|
+
export { type TestserverPoolResult, type TestserverPoolResultFacts, testserverPoolResult, testserverPoolResultWarnings, } from "./result.ts";
|
|
9
|
+
export { testserverPoolDrawing } from "./presentation.ts";
|
|
10
|
+
export { credentialOriginRows, credentialOriginSchema, rejectedCredentialFacts, rejectedCredentialShape, rejectedCredentialText, } from "./credential-facts.ts";
|
|
11
|
+
export type { TestserverPoolEvent } from "./events.ts";
|
|
12
|
+
export { type TestserverLaneState, type TestserverLaneStep, testserverPoolProgress } from "./progress.ts";
|
|
13
|
+
export { type BuildChannel, CREATE_CONCURRENCY, DEFAULT_TTL_MINUTES, describeTtl, FILES_PER_SANDBOX, invalidTtlMessage, MAX_SANDBOXES, MIN_SANDBOXES, minTimeLeftMinutes, MOST_SANDBOXES_FROM_TESTS, sandboxesForTests, type TestserverPoolOptions, testserverPoolRules, type TestserverPoolSources, ttlMinutes, } from "./options/index.ts";
|
|
14
|
+
export { type BuildMatch, createPooledSandbox, type InspectedEntry, inspectPool, type LeaseReport, livePoolStoreGateway, type PooledCreateOutcome, type PoolStoreGateway, unavailablePoolStoreGateway, type UnresolvedChannelReason, } from "./pool/index.ts";
|
|
15
|
+
export { type FailedCreate, type RejectedCreate, type TestserverCanceledFacts, testserverCanceledFacts, type TestserverFacts, type TestserverRefusal, type UnpooledSandbox, } from "./provision.ts";
|
|
16
|
+
export { testserverPoolDefinition } from "./definition.ts";
|
|
17
|
+
export { testserverPool, type TestserverPoolEntry } from "./resource.ts";
|
|
18
|
+
export { type RunSandbox, type SandboxOrigin, testserverConnectionOf } from "./run-sandbox.ts";
|
|
19
|
+
export { type ControlPlaneGateway, CREATE_ATTEMPTS, type CreateFailure, describeCreateFailure, type HealthCheckGateway, liveControlPlaneGateway, liveHealthCheckGateway, mayLeaveSandbox, } from "./sandbox/index.ts";
|
|
20
|
+
export type { TestserverWorld } from "./world.ts";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// The Testserver pool resource's folder: what its options are written in and size (`options/`), the Testserver control
|
|
2
|
+
// plane and health check (`sandbox/`), the pool of Testserver sandboxes (`pool/`), a vercel/api pull request's head
|
|
3
|
+
// commit and PR builds from GitHub and the launcher's GitHub token (`pull-request/`), how it provisions a run and what
|
|
4
|
+
// that took (`provision.ts`), its events and its progress with how it draws, its definition (`definition.ts`) and its
|
|
5
|
+
// resource factory (`resource.ts`, `@vercel/storm/testserver`), its lifecycle with how it refuses (`refusals.ts`), what
|
|
6
|
+
// a canceled run says acquiring it changed (`canceled.ts`), its result (`result.ts`) and what releasing it reports
|
|
7
|
+
// (`release.ts`), its world (`world.ts`) and live world, how its refusals and `pool create` report a credential
|
|
8
|
+
// source's failures, and the Testserver sandboxes a run uses. The Testserver extension (`extension.ts`) joins the
|
|
9
|
+
// definition with its own commands
|
|
10
|
+
// for the registry (`src/extensions.ts`), the one place outside this folder that takes it. `options/`, `sandbox/`,
|
|
11
|
+
// `pool/` and `pull-request/` keep their own `index.ts` for the files in this folder; everything outside it imports
|
|
12
|
+
// only this file: the registry. Its own commands, `pool create` and `pool list`, are `commands/pool/`, which
|
|
13
|
+
// `src/extension-commands.ts` mounts as `storm ext testserver`. The rest of what it exports is for tests.
|
|
14
|
+
export { testserverPoolReleased, testserverPoolReleasedText, testserverPoolReleaseWarnings } from "./release.js";
|
|
15
|
+
export { testserverCanceledLines } from "./canceled.js";
|
|
16
|
+
export { credentialRejected, noSandboxes, noUsableSandboxes, poolUnavailable, poolUnreadable, tokenRequestFailed, } from "./refusals.js";
|
|
17
|
+
export { prBuildRefusal } from "./pr-build-facts.js";
|
|
18
|
+
export { testserverPoolLifecycle } from "./lifecycle.js";
|
|
19
|
+
export { testserverExtension } from "./extension.js";
|
|
20
|
+
export { liveTestserverWorld, TESTSERVER_ORIGIN } from "./live/world.js";
|
|
21
|
+
export { testserverPoolResult, testserverPoolResultWarnings, } from "./result.js";
|
|
22
|
+
export { testserverPoolDrawing } from "./presentation.js";
|
|
23
|
+
export { credentialOriginRows, credentialOriginSchema, rejectedCredentialFacts, rejectedCredentialShape, rejectedCredentialText, } from "./credential-facts.js";
|
|
24
|
+
export { testserverPoolProgress } from "./progress.js";
|
|
25
|
+
export { CREATE_CONCURRENCY, DEFAULT_TTL_MINUTES, describeTtl, FILES_PER_SANDBOX, invalidTtlMessage, MAX_SANDBOXES, MIN_SANDBOXES, minTimeLeftMinutes, MOST_SANDBOXES_FROM_TESTS, sandboxesForTests, testserverPoolRules, ttlMinutes, } from "./options/index.js";
|
|
26
|
+
export { createPooledSandbox, inspectPool, livePoolStoreGateway, unavailablePoolStoreGateway, } from "./pool/index.js";
|
|
27
|
+
export { testserverCanceledFacts, } from "./provision.js";
|
|
28
|
+
export { testserverPoolDefinition } from "./definition.js";
|
|
29
|
+
export { testserverPool } from "./resource.js";
|
|
30
|
+
export { testserverConnectionOf } from "./run-sandbox.js";
|
|
31
|
+
export { CREATE_ATTEMPTS, describeCreateFailure, liveControlPlaneGateway, liveHealthCheckGateway, mayLeaveSandbox, } from "./sandbox/index.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AcquireForRunAnswer, AcquireForRunInput, BeforeRunAnswer, BeforeRunInput, NoSecrets, ReleaseAfterRunAnswer, ReleaseAfterRunInput } from "../../sdk/extension/index.ts";
|
|
2
|
+
import type { TestserverConnection } from "./run/connection.ts";
|
|
3
|
+
import type { TestserverPoolEvent } from "./events.ts";
|
|
4
|
+
import type { TestserverPoolOptions, TestserverPoolSources } from "./options/index.ts";
|
|
5
|
+
import { type TestserverPoolResult } from "./result.ts";
|
|
6
|
+
import type { TestserverWorld } from "./world.ts";
|
|
7
|
+
/**
|
|
8
|
+
* The Testserver pool's lifecycle over `world`. Its acquire takes the hosts it leases.
|
|
9
|
+
*
|
|
10
|
+
* - `acquireForRun` provisions (`provision`): it resolves the build (a PR build reference from GitHub on the launch
|
|
11
|
+
* machine, its GitHub token going nowhere else), leases, and creates the rest with the run's credential source: the
|
|
12
|
+
* one its credential choice names, or the one mint it shares with the runner sandbox. It hands each host to `take` as
|
|
13
|
+
* it is leased, reports its progress events, and hands the command the Testserver connection: each Testserver
|
|
14
|
+
* sandbox's Testserver URL, once. Acquired, it reports each thing it couldn't do as a warning, answers its result,
|
|
15
|
+
* announces the sandbox list, and says what a canceled run changed: the Testserver sandboxes it created. A mint that
|
|
16
|
+
* fails with no Testserver sandbox in hand answers `mintFailed`, which ends the run as the run's own `mint_failed`.
|
|
17
|
+
* - `releaseAfterRun` releases every lease, reports how many it released and each release that failed as a warning,
|
|
18
|
+
* and answers, when none failed, that the run holds no lease.
|
|
19
|
+
*/
|
|
20
|
+
export declare function testserverPoolLifecycle(world: TestserverWorld): {
|
|
21
|
+
beforeRun: ({ options, }: BeforeRunInput<TestserverPoolOptions, TestserverPoolSources>) => Promise<BeforeRunAnswer<NoSecrets>>;
|
|
22
|
+
acquireForRun: ({ options, credential, take, report, signal, }: AcquireForRunInput<TestserverPoolOptions, NoSecrets, string, TestserverPoolEvent>) => Promise<AcquireForRunAnswer<TestserverConnection, TestserverPoolResult, TestserverPoolEvent>>;
|
|
23
|
+
releaseAfterRun: ({ taken, report, }: ReleaseAfterRunInput<string, TestserverPoolEvent>) => Promise<ReleaseAfterRunAnswer>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// The Testserver pool resource's lifecycle, over its world. Before the run starts it prepares the pool's files, and a
|
|
2
|
+
// pool it couldn't prepare refuses the run (`pool_unavailable`, `refusals.ts`). A pool that may create Testserver
|
|
3
|
+
// sandboxes needs the Vercel credential. It hides the launcher's stale Testserver variables from the command
|
|
4
|
+
// (`STALE_TESTSERVER_VARIABLES`). It hands the run no secret, so it has no `secrets`. Acquiring it provisions
|
|
5
|
+
// the run's Testserver sandboxes (`provision`), turning its options' `ttl` and `minTimeLeft` into minutes; releasing it
|
|
6
|
+
// releases every lease.
|
|
7
|
+
import { testserverCanceledLines } from "./canceled.js";
|
|
8
|
+
import { releaseLeases } from "./pool/index.js";
|
|
9
|
+
import { prBuildRefusal } from "./pr-build-facts.js";
|
|
10
|
+
import { createWith, failedCreateFacts, provision, testserverCanceledFacts, unpooledFacts, } from "./provision.js";
|
|
11
|
+
import { credentialRejected, noSandboxes, noUsableSandboxes, poolUnavailable, poolUnreadable, tokenRequestFailed, } from "./refusals.js";
|
|
12
|
+
import { testserverPoolReleased, testserverPoolReleasedText, testserverPoolReleaseWarnings } from "./release.js";
|
|
13
|
+
import { testserverPoolResult, testserverPoolResultWarnings } from "./result.js";
|
|
14
|
+
import { STALE_TESTSERVER_VARIABLES, testserverConnectionOf } from "./run-sandbox.js";
|
|
15
|
+
import { mayLeaveSandbox } from "./sandbox/index.js";
|
|
16
|
+
/**
|
|
17
|
+
* The Testserver pool's lifecycle over `world`. Its acquire takes the hosts it leases.
|
|
18
|
+
*
|
|
19
|
+
* - `acquireForRun` provisions (`provision`): it resolves the build (a PR build reference from GitHub on the launch
|
|
20
|
+
* machine, its GitHub token going nowhere else), leases, and creates the rest with the run's credential source: the
|
|
21
|
+
* one its credential choice names, or the one mint it shares with the runner sandbox. It hands each host to `take` as
|
|
22
|
+
* it is leased, reports its progress events, and hands the command the Testserver connection: each Testserver
|
|
23
|
+
* sandbox's Testserver URL, once. Acquired, it reports each thing it couldn't do as a warning, answers its result,
|
|
24
|
+
* announces the sandbox list, and says what a canceled run changed: the Testserver sandboxes it created. A mint that
|
|
25
|
+
* fails with no Testserver sandbox in hand answers `mintFailed`, which ends the run as the run's own `mint_failed`.
|
|
26
|
+
* - `releaseAfterRun` releases every lease, reports how many it released and each release that failed as a warning,
|
|
27
|
+
* and answers, when none failed, that the run holds no lease.
|
|
28
|
+
*/
|
|
29
|
+
export function testserverPoolLifecycle(world) {
|
|
30
|
+
return {
|
|
31
|
+
beforeRun: async ({ options, }) => {
|
|
32
|
+
const prepared = await world.pool.prepare();
|
|
33
|
+
if (!prepared.ok)
|
|
34
|
+
return poolUnavailable(prepared.failure);
|
|
35
|
+
return {
|
|
36
|
+
use: { secrets: {}, needsVercelCredential: options.create, hiddenVariables: STALE_TESTSERVER_VARIABLES },
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
acquireForRun: async ({ options, credential, take, report, signal, }) => {
|
|
40
|
+
const provisioned = await provision(world, options, createWith(options, credential), signal, report, take);
|
|
41
|
+
if (provisioned.kind === "canceled") {
|
|
42
|
+
const { kind: _kind, ...facts } = provisioned;
|
|
43
|
+
return { canceled: testserverCanceledLines(facts) };
|
|
44
|
+
}
|
|
45
|
+
if (provisioned.kind === "mint-failed")
|
|
46
|
+
return { mintFailed: provisioned.failed };
|
|
47
|
+
if (provisioned.kind !== "provisioned")
|
|
48
|
+
return acquireRefusal(provisioned);
|
|
49
|
+
const { kind: _kind, ...facts } = provisioned;
|
|
50
|
+
const sandboxes = facts.sandboxes.map(({ testserverUrl, logViewerUrl, origin }) => ({
|
|
51
|
+
testserverUrl,
|
|
52
|
+
logViewerUrl,
|
|
53
|
+
origin,
|
|
54
|
+
}));
|
|
55
|
+
const result = testserverPoolResult(facts, options);
|
|
56
|
+
for (const { reason, message } of testserverPoolResultWarnings(result.facts))
|
|
57
|
+
await report.warning(reason, message);
|
|
58
|
+
return {
|
|
59
|
+
acquired: {
|
|
60
|
+
payload: testserverConnectionOf(facts.sandboxes),
|
|
61
|
+
result,
|
|
62
|
+
announce: { kind: "acquired", sandboxes },
|
|
63
|
+
canceled: testserverCanceledLines(testserverCanceledFacts(options, facts)),
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
releaseAfterRun: async ({ taken, report, }) => {
|
|
68
|
+
const releaseFailures = await releaseLeases(world, taken);
|
|
69
|
+
const released = testserverPoolReleasedText(taken, releaseFailures);
|
|
70
|
+
if (released !== undefined)
|
|
71
|
+
await report.cleanup(released);
|
|
72
|
+
for (const { reason, message } of testserverPoolReleaseWarnings(releaseFailures))
|
|
73
|
+
await report.warning(reason, message);
|
|
74
|
+
return testserverPoolReleased(releaseFailures);
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** How the Testserver pool's acquire refuses a run it couldn't provision. */
|
|
79
|
+
function acquireRefusal(refusal) {
|
|
80
|
+
switch (refusal.kind) {
|
|
81
|
+
case "pool-unreadable":
|
|
82
|
+
return poolUnreadable(refusal.failure);
|
|
83
|
+
case "token-request-failed":
|
|
84
|
+
return tokenRequestFailed(refusal.failure, {
|
|
85
|
+
ttlMinutes: refusal.ttlMinutes,
|
|
86
|
+
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
87
|
+
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox),
|
|
88
|
+
});
|
|
89
|
+
case "credential-rejected":
|
|
90
|
+
return credentialRejected(refusal.origin, {
|
|
91
|
+
status: refusal.failure.status,
|
|
92
|
+
vercelId: refusal.failure.vercelId ?? null,
|
|
93
|
+
ttlMinutes: refusal.ttlMinutes,
|
|
94
|
+
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
95
|
+
unpooled: unpooledFacts(refusal.unpooled),
|
|
96
|
+
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox),
|
|
97
|
+
});
|
|
98
|
+
case "no-sandboxes":
|
|
99
|
+
return noSandboxes({
|
|
100
|
+
requested: refusal.requested,
|
|
101
|
+
ttlMinutes: refusal.ttlMinutes,
|
|
102
|
+
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
103
|
+
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox),
|
|
104
|
+
});
|
|
105
|
+
case "no-usable-sandboxes":
|
|
106
|
+
return noUsableSandboxes({
|
|
107
|
+
requested: refusal.requested,
|
|
108
|
+
build: "resolvedBuild" in refusal.match ? refusal.match.resolvedBuild : refusal.match.requestedBuild,
|
|
109
|
+
});
|
|
110
|
+
case "pull-request-unreadable":
|
|
111
|
+
case "pr-builds-unlisted":
|
|
112
|
+
case "pr-build-not-ready":
|
|
113
|
+
case "pr-build-expired":
|
|
114
|
+
return prBuildRefusal(refusal, "The command didn't run.");
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// The Testserver pool's concurrency limit for its creates: `provision` runs them at most `CREATE_CONCURRENCY` at a time.
|
|
1
2
|
/**
|
|
2
3
|
* Runs `task` for indexes `0` to `count - 1`, at most `limit` at a time, in index order. Before starting each
|
|
3
4
|
* task it asks `proceed`; once that says no, no further task starts, and the ones in flight still finish. The
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LauncherSupplies } from "../../../sdk/extension/index.ts";
|
|
2
|
+
import type { TestserverWorld } from "../world.ts";
|
|
3
|
+
/** The Testserver control plane's origin. */
|
|
4
|
+
export declare const TESTSERVER_ORIGIN = "https://testserver.vercel.sh";
|
|
5
|
+
/** GitHub's REST API origin. */
|
|
6
|
+
export declare const GITHUB_API_ORIGIN = "https://api.github.com";
|
|
7
|
+
/** The Testserver pool's world, live, from what the launcher supplies (`supplies`). */
|
|
8
|
+
export declare function liveTestserverWorld(supplies: LauncherSupplies): TestserverWorld;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// The Testserver pool resource's live world, built from the launcher: the Testserver control plane at
|
|
2
|
+
// `testserver.vercel.sh`, with a 3-minute create and a 10-second `GET /builds`; 5-second health checks; the pool in the
|
|
3
|
+
// resource's state directory, which the launcher resolves under its `XDG_STATE_HOME` or `HOME`, or, when the launcher
|
|
4
|
+
// names no place for it, a pool whose every operation fails and says why; GitHub's REST API at `api.github.com`, with a
|
|
5
|
+
// 10-second call and a 30-second job log download, for a pull request's head commit and the PR builds vercel/api's
|
|
6
|
+
// `Testserver` workflow published for it; the launcher environment's GitHub token, from its `GITHUB_TOKEN`, `GH_TOKEN`
|
|
7
|
+
// or `gh auth token`; the launcher's timer, which a create's retries wait on; and the launcher's clock.
|
|
8
|
+
import { livePoolStoreGateway, unavailablePoolStoreGateway } from "../pool/index.js";
|
|
9
|
+
import { liveGitHubTokenGateway, livePullRequestGateway, liveTestserverWorkflowGateway, } from "../pull-request/index.js";
|
|
10
|
+
import { liveControlPlaneGateway, liveHealthCheckGateway } from "../sandbox/index.js";
|
|
11
|
+
/** The Testserver control plane's origin. */
|
|
12
|
+
export const TESTSERVER_ORIGIN = "https://testserver.vercel.sh";
|
|
13
|
+
/** GitHub's REST API origin. */
|
|
14
|
+
export const GITHUB_API_ORIGIN = "https://api.github.com";
|
|
15
|
+
/** The Testserver pool's world, live, from what the launcher supplies (`supplies`). */
|
|
16
|
+
export function liveTestserverWorld(supplies) {
|
|
17
|
+
const { stateDirectory } = supplies;
|
|
18
|
+
return {
|
|
19
|
+
controlPlane: liveControlPlaneGateway({
|
|
20
|
+
origin: TESTSERVER_ORIGIN,
|
|
21
|
+
streamTimeoutMs: 180_000,
|
|
22
|
+
buildsTimeoutMs: 10_000,
|
|
23
|
+
}),
|
|
24
|
+
healthChecks: liveHealthCheckGateway({ timeoutMs: 5_000 }),
|
|
25
|
+
pool: stateDirectory.ok
|
|
26
|
+
? livePoolStoreGateway({ directory: stateDirectory.directory })
|
|
27
|
+
: unavailablePoolStoreGateway(stateDirectory.pattern, stateDirectory.reason),
|
|
28
|
+
pullRequests: livePullRequestGateway({ origin: GITHUB_API_ORIGIN, timeoutMs: 10_000 }),
|
|
29
|
+
testserverWorkflow: liveTestserverWorkflowGateway({
|
|
30
|
+
origin: GITHUB_API_ORIGIN,
|
|
31
|
+
timeoutMs: 10_000,
|
|
32
|
+
logTimeoutMs: 30_000,
|
|
33
|
+
}),
|
|
34
|
+
githubToken: liveGitHubTokenGateway({ env: supplies.env }),
|
|
35
|
+
timer: supplies.timer,
|
|
36
|
+
clock: supplies.clock,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Builds } from "
|
|
1
|
+
import type { Builds } from "../sandbox/index.ts";
|
|
2
2
|
/** The build channels: moving names the Testserver control plane resolves to a build. */
|
|
3
3
|
export declare const BUILD_CHANNELS: readonly ["stable", "latest_main"];
|
|
4
4
|
export type BuildChannel = (typeof BUILD_CHANNELS)[number];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type BuildReference, buildReferenceText, parseBuildReference, shortSha, TESTSERVER_REPO, } from "./build-reference.ts";
|
|
2
|
+
export { BUILD_CHANNELS, type BuildChannel, isBuildChannel, resolveChannel } from "./channels.ts";
|
|
3
|
+
export { CREATE_CONCURRENCY, FILES_PER_SANDBOX, MAX_SANDBOXES, MIN_SANDBOXES, minTimeLeftMinutes, MOST_SANDBOXES_FROM_TESTS, sandboxesForTests, ttlMinutes, } from "./sandboxes.ts";
|
|
4
|
+
export { DEFAULT_TTL_MINUTES, describeTtl, invalidTtlMessage, MAX_TTL_MINUTES, MIN_TTL_MINUTES, parseDuration, parseTtl, } from "./ttl.ts";
|
|
5
|
+
export { type TestserverPoolOptions, testserverPoolRules, type TestserverPoolSources } from "./rules.ts";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// The Testserver folder's `options/` barrel: what the Testserver pool's options are written in, a build reference
|
|
2
|
+
// (`build-reference.ts`), a build channel (`channels.ts`) and a duration or TTL (`ttl.ts`), and what its lifecycle
|
|
3
|
+
// sizes from them, its sandbox counts and minutes (`sandboxes.ts`), and its option rules with the types its lifecycle
|
|
4
|
+
// reads its options by (`rules.ts`). It loads nothing at run time but itself, zod and the extension API's entry: no
|
|
5
|
+
// gateway, no control plane call and no pool. Code outside `extensions/testserver/` imports
|
|
6
|
+
// `extensions/testserver/index.ts` instead.
|
|
7
|
+
export { buildReferenceText, parseBuildReference, shortSha, TESTSERVER_REPO, } from "./build-reference.js";
|
|
8
|
+
export { BUILD_CHANNELS, isBuildChannel, resolveChannel } from "./channels.js";
|
|
9
|
+
export { CREATE_CONCURRENCY, FILES_PER_SANDBOX, MAX_SANDBOXES, MIN_SANDBOXES, minTimeLeftMinutes, MOST_SANDBOXES_FROM_TESTS, sandboxesForTests, ttlMinutes, } from "./sandboxes.js";
|
|
10
|
+
export { DEFAULT_TTL_MINUTES, describeTtl, invalidTtlMessage, MAX_TTL_MINUTES, MIN_TTL_MINUTES, parseDuration, parseTtl, } from "./ttl.js";
|
|
11
|
+
export { testserverPoolRules } from "./rules.js";
|