@cnc-tools/storm 0.15.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application.d.ts +22 -13
- package/dist/application.js +21 -10
- package/dist/bin/run.d.ts +18 -0
- package/dist/bin/run.js +31 -0
- package/dist/bin/storm.js +42 -26
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-5CCP36QQ.js → chunk-2RNDPDTJ.js} +2 -2
- package/dist/chunks/chunk-2VP4GRJM.js +1219 -0
- package/dist/chunks/{chunk-SZEURWRS.js → chunk-4O5C2XGJ.js} +18 -15
- package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-4WAMTUWZ.js} +419 -340
- package/dist/chunks/{chunk-QVS7HRU7.js → chunk-6UHIJXZG.js} +3 -3
- package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
- package/dist/chunks/{chunk-4U4DZ7VG.js → chunk-7DZE67QM.js} +2 -2
- package/dist/chunks/{chunk-VUPZH7J2.js → chunk-BCBKYOHW.js} +1 -1
- package/dist/chunks/{chunk-QUHY6FGN.js → chunk-CKGZA25H.js} +1 -18
- package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-D27KILIA.js} +1 -1
- package/dist/chunks/{chunk-KC4KDJ5K.js → chunk-DADEYJDW.js} +174 -153
- package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
- package/dist/chunks/chunk-F4MOYHRY.js +198 -0
- package/dist/chunks/{chunk-CXAT7ZKP.js → chunk-FNBB6V4R.js} +1 -1
- package/dist/chunks/{chunk-OX7X4B2L.js → chunk-GRT3UIBV.js} +18 -1
- package/dist/chunks/chunk-HP3CURSZ.js +88 -0
- package/dist/chunks/{chunk-PN5ULTTH.js → chunk-HWIQ2S7K.js} +5 -5
- package/dist/chunks/chunk-JN3YY6ZH.js +2166 -0
- package/dist/chunks/{chunk-TJNFVNKR.js → chunk-LKTZ5OXS.js} +1 -1
- package/dist/chunks/{chunk-XEVHP5ZW.js → chunk-M7EKRGVD.js} +8 -8
- package/dist/chunks/chunk-MR77L2GK.js +340 -0
- package/dist/chunks/{chunk-L36GBUBB.js → chunk-RNAS7JHE.js} +1755 -522
- package/dist/chunks/{chunk-5GBMR4HM.js → chunk-RWIXDDCK.js} +4 -192
- package/dist/chunks/{chunk-5VXBKPW6.js → chunk-WV3DP6NR.js} +1 -1
- package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
- package/dist/chunks/{chunk-YV7GE6EV.js → chunk-YEPFSLQR.js} +480 -375
- package/dist/chunks/{live-app-PI3BAN6Y.js → live-app-R76JQXZL.js} +15 -13
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +1 -1
- package/dist/commands/exec/across-sandboxes-outcomes.js +4 -3
- package/dist/commands/exec/before-run.d.ts +123 -0
- package/dist/commands/exec/before-run.js +105 -0
- package/dist/commands/exec/command.d.ts +39 -4
- package/dist/commands/exec/command.js +31 -95
- package/dist/commands/exec/driver-plan.d.ts +9 -4
- package/dist/commands/exec/driver-plan.js +8 -8
- package/dist/commands/exec/exec-words.js +1 -1
- package/dist/commands/exec/execute-run.d.ts +39 -0
- package/dist/commands/exec/execute-run.js +325 -0
- package/dist/commands/exec/live-view.d.ts +3 -3
- package/dist/commands/exec/live-view.js +16 -15
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/mint-failed.d.ts +38 -0
- package/dist/commands/exec/mint-failed.js +27 -4
- package/dist/commands/exec/outcomes.d.ts +38 -9
- package/dist/commands/exec/outcomes.js +32 -25
- package/dist/commands/exec/plan-run.d.ts +58 -150
- package/dist/commands/exec/plan-run.js +232 -88
- package/dist/commands/exec/planned-outcome.js +8 -1
- package/dist/commands/exec/progress.d.ts +10 -6
- package/dist/commands/exec/progress.js +38 -25
- package/dist/commands/exec/run-bin.d.ts +11 -11
- package/dist/commands/exec/run-bin.js +9 -9
- package/dist/commands/exec/run-flags.d.ts +69 -0
- package/dist/commands/exec/run-flags.js +58 -0
- package/dist/commands/exec/run-metadata.js +5 -5
- package/dist/commands/exec/run-summary.d.ts +58 -0
- package/dist/commands/exec/run-summary.js +205 -0
- package/dist/commands/exec/runner-refusals.d.ts +82 -0
- package/dist/commands/exec/runner-refusals.js +71 -0
- package/dist/commands/exec/sandbox-progress.js +3 -0
- package/dist/commands/exec/stopped-outcome.d.ts +12 -0
- package/dist/commands/exec/stopped-outcome.js +77 -0
- package/dist/commands/exec/view.d.ts +20 -11
- package/dist/commands/exec/view.js +103 -47
- package/dist/commands/runs/facts.d.ts +9 -4
- package/dist/commands/runs/facts.js +28 -11
- package/dist/commands/runs/list/command.d.ts +16 -6
- package/dist/commands/runs/list/command.js +10 -10
- package/dist/commands/runs/list/outcomes.d.ts +8 -3
- package/dist/commands/runs/logs/command.d.ts +6 -2
- package/dist/commands/runs/logs/command.js +10 -10
- package/dist/commands/runs/logs/outcomes.d.ts +3 -1
- package/dist/commands/runs/past-run.d.ts +14 -5
- package/dist/commands/runs/past-run.js +16 -5
- package/dist/commands/runs/show/command.d.ts +20 -8
- package/dist/commands/runs/show/command.js +30 -28
- package/dist/commands/runs/show/outcomes.d.ts +10 -4
- package/dist/commands/runs/show/outcomes.js +7 -5
- package/dist/commands/snapshots/access.d.ts +111 -0
- package/dist/commands/snapshots/access.js +96 -0
- package/dist/commands/snapshots/build/command.d.ts +360 -93
- package/dist/commands/snapshots/build/command.js +446 -150
- package/dist/commands/snapshots/build/metadata.d.ts +10 -0
- package/dist/commands/snapshots/build/metadata.js +31 -11
- package/dist/commands/snapshots/build/outcomes.d.ts +234 -43
- package/dist/commands/snapshots/build/outcomes.js +200 -36
- package/dist/commands/snapshots/list/command.d.ts +368 -27
- package/dist/commands/snapshots/list/command.js +296 -66
- package/dist/commands/snapshots/list/metadata.d.ts +16 -0
- package/dist/commands/snapshots/list/metadata.js +29 -6
- package/dist/commands/snapshots/list/outcomes.d.ts +245 -13
- package/dist/commands/snapshots/list/outcomes.js +221 -50
- package/dist/commands/snapshots/metadata.js +1 -1
- package/dist/commands/snapshots/prune/command.d.ts +430 -0
- package/dist/commands/snapshots/prune/command.js +161 -0
- package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
- package/dist/commands/snapshots/prune/metadata.js +39 -0
- package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
- package/dist/commands/snapshots/prune/outcomes.js +78 -0
- package/dist/commands/suites/list/command.js +19 -18
- package/dist/commands/suites/list/outcomes.js +4 -4
- package/dist/commands/test/command.d.ts +39 -4
- package/dist/commands/test/command.js +50 -255
- package/dist/commands/test/metadata.js +1 -1
- package/dist/commands/test/outcomes.d.ts +19 -2
- package/dist/commands/test/outcomes.js +2 -2
- package/dist/config/check-runner.d.ts +5 -3
- package/dist/config/check-runner.js +33 -7
- package/dist/config/check-suites.js +1 -0
- package/dist/config/credential-resolver.d.ts +50 -5
- package/dist/config/credential-resolver.js +51 -19
- package/dist/config/credential-settle.d.ts +6 -2
- package/dist/config/credential-settle.js +11 -5
- package/dist/config/gateways.d.ts +7 -3
- package/dist/config/index.d.ts +4 -5
- package/dist/config/index.js +3 -4
- package/dist/config/live/config-gateway.js +5 -2
- package/dist/config/load.d.ts +21 -4
- package/dist/config/load.js +129 -15
- package/dist/config/runner.d.ts +7 -8
- package/dist/config/runner.js +1 -1
- package/dist/config/schema.d.ts +17 -5
- package/dist/config/schema.js +11 -3
- package/dist/config/typed-options.d.ts +1 -6
- package/dist/config/typed-options.js +2 -10
- package/dist/config-file/define.d.ts +1 -11
- package/dist/config-file/define.js +3 -3
- package/dist/config-file/runner.d.ts +5 -6
- package/dist/config-file/toolchain.d.ts +13 -7
- package/dist/config-file/toolchain.js +53 -37
- package/dist/context.d.ts +8 -6
- package/dist/context.js +7 -6
- package/dist/core/across-sandboxes.d.ts +7 -6
- package/dist/core/across-sandboxes.js +123 -152
- package/dist/core/coordinator.d.ts +166 -0
- package/dist/core/coordinator.js +233 -0
- package/dist/core/events.d.ts +2 -2
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +1 -1
- package/dist/core/outcomes.d.ts +148 -0
- package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
- package/dist/core/resources.d.ts +31 -53
- package/dist/core/resources.js +32 -70
- package/dist/core/run-state.d.ts +7 -1
- package/dist/core/run-state.js +2 -0
- package/dist/core/run.d.ts +32 -236
- package/dist/core/run.js +106 -266
- package/dist/core/state-directory.d.ts +1 -1
- package/dist/core/state-directory.js +2 -2
- package/dist/credential/gateways.d.ts +15 -1
- package/dist/credential/index.d.ts +4 -3
- package/dist/credential/index.js +3 -2
- package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
- package/dist/credential/live/vercel-cli-gateway.js +1 -1
- package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
- package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
- package/dist/credential/source.d.ts +73 -6
- package/dist/credential/source.js +55 -2
- package/dist/extension-commands.d.ts +6 -1
- package/dist/extension-commands.js +15 -1
- package/dist/extensions/github/resource.d.ts +1 -1
- package/dist/extensions/github/resource.js +1 -1
- package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
- package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
- package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
- package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/credential-facts.d.ts +6 -2
- package/dist/extensions/testserver/credential-facts.js +29 -11
- package/dist/extensions/testserver/lifecycle.js +7 -1
- package/dist/extensions/testserver/limit.d.ts +3 -0
- package/dist/extensions/testserver/limit.js +3 -0
- package/dist/extensions/testserver/provision.d.ts +8 -1
- package/dist/extensions/testserver/provision.js +8 -3
- package/dist/extensions/testserver/refusals.d.ts +6 -1
- package/dist/extensions/testserver/refusals.js +16 -1
- package/dist/extensions/testserver/resource.d.ts +2 -2
- package/dist/extensions/testserver/resource.js +2 -2
- package/dist/extensions/testserver/result.d.ts +1 -1
- package/dist/extensions/testserver/result.js +9 -4
- package/dist/planning/driver-file-lists.d.ts +0 -15
- package/dist/planning/driver-file-lists.js +2 -21
- package/dist/planning/plan-only.d.ts +7 -15
- package/dist/planning/plan-only.js +16 -22
- package/dist/planning/run-kind-flags.js +2 -2
- package/dist/planning/run-plan.d.ts +45 -13
- package/dist/planning/run-plan.js +4 -3
- package/dist/planning/suites.d.ts +1 -1
- package/dist/planning/suites.js +2 -2
- package/dist/planning/test-plan.d.ts +9 -0
- package/dist/planning/test-plan.js +10 -2
- package/dist/run-directory/recording.js +2 -2
- package/dist/run-directory/run-record.d.ts +21 -6
- package/dist/run-directory/run-record.js +12 -9
- package/dist/runner/base.d.ts +0 -6
- package/dist/runner/base.js +1 -16
- package/dist/runner/build-snapshots.d.ts +55 -29
- package/dist/runner/build-snapshots.js +135 -35
- package/dist/runner/context.d.ts +15 -7
- package/dist/runner/context.js +19 -6
- package/dist/runner/events.d.ts +16 -10
- package/dist/runner/gateways.d.ts +92 -21
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/index.d.ts +11 -7
- package/dist/runner/index.js +9 -4
- package/dist/runner/live/sandbox-errors.d.ts +2 -0
- package/dist/runner/live/sandbox-errors.js +4 -0
- package/dist/runner/live/sandbox-gateway.js +141 -3
- package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
- package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
- package/dist/runner/live/snapshot-records.js +6 -7
- package/dist/runner/local-snapshot-index.d.ts +199 -0
- package/dist/runner/local-snapshot-index.js +211 -0
- package/dist/runner/network-policy.d.ts +6 -6
- package/dist/runner/network-policy.js +7 -7
- package/dist/runner/policy-writes.d.ts +1 -1
- package/dist/runner/policy-writes.js +1 -1
- package/dist/runner/prepare.d.ts +25 -24
- package/dist/runner/prepare.js +28 -20
- package/dist/runner/ready.d.ts +18 -10
- package/dist/runner/ready.js +104 -33
- package/dist/runner/sandboxed-command.d.ts +3 -3
- package/dist/runner/sandboxed-command.js +3 -3
- package/dist/runner/scope.d.ts +10 -6
- package/dist/runner/scope.js +10 -3
- package/dist/runner/secrets.d.ts +13 -13
- package/dist/runner/secrets.js +18 -15
- package/dist/runner/session.d.ts +8 -8
- package/dist/runner/session.js +3 -3
- package/dist/runner/shared-snapshot-entry.d.ts +92 -0
- package/dist/runner/shared-snapshot-entry.js +168 -0
- package/dist/runner/shared-snapshot-list.d.ts +81 -0
- package/dist/runner/shared-snapshot-list.js +155 -0
- package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
- package/dist/runner/shared-snapshot-lookup.js +118 -0
- package/dist/runner/shared-snapshot-prune.d.ts +58 -0
- package/dist/runner/shared-snapshot-prune.js +133 -0
- package/dist/runner/snapshot-build.d.ts +42 -14
- package/dist/runner/snapshot-build.js +38 -28
- package/dist/runner/snapshot-choice.js +1 -1
- package/dist/runner/snapshot-inspect.d.ts +39 -40
- package/dist/runner/snapshot-inspect.js +58 -38
- package/dist/runner/snapshot-key.d.ts +30 -21
- package/dist/runner/snapshot-key.js +49 -29
- package/dist/runner/steps.d.ts +1 -1
- package/dist/runner/steps.js +1 -1
- package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +2 -2
- package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +3 -2
- package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +82 -82
- package/dist/runner/vercel-sandbox-options.js +510 -0
- package/dist/runner/{recipe-secrets.d.ts → vercel-sandbox-secrets.d.ts} +6 -6
- package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +20 -20
- package/dist/sdk/extension/commands.d.ts +8 -3
- package/dist/sdk/extension/commands.js +3 -1
- package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
- package/dist/sdk/extension/credential-diagnosis.js +25 -5
- package/dist/sdk/extension/credential-source.d.ts +20 -3
- package/dist/sdk/extension/credential-source.js +4 -4
- package/dist/sdk/extension/index.d.ts +3 -2
- package/dist/sdk/extension/index.js +2 -1
- package/dist/sdk/extension/resource-definition.d.ts +4 -3
- package/dist/sdk/extension/resource-definition.js +3 -2
- package/dist/sdk/extension/resource-factory.js +3 -4
- package/dist/sdk/extension/secret-source.d.ts +1 -1
- package/dist/sdk/extension/secret-source.js +1 -1
- package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
- package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
- package/dist/sdk/run/present.d.ts +3 -3
- package/dist/sdk/run/present.js +1 -3
- package/dist/shared/cleanup.d.ts +3 -3
- package/dist/shared/cleanup.js +15 -5
- package/dist/shared/snapshot-text.d.ts +4 -4
- package/dist/shared/snapshot-text.js +11 -11
- package/dist/time/duration.js +1 -1
- package/package.json +3 -2
- package/skills/overview.md +6 -4
- package/skills/plan-runs.md +2 -2
- package/skills/read-run-output.md +6 -6
- package/dist/chunks/chunk-E4PJNZVG.js +0 -783
- package/dist/chunks/chunk-RAQEXKL6.js +0 -2591
- package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
- package/dist/commands/exec/across-sandboxes-run.js +0 -339
- package/dist/commands/exec/plan-only.d.ts +0 -10
- package/dist/commands/exec/plan-only.js +0 -46
- package/dist/commands/exec/run-command.d.ts +0 -476
- package/dist/commands/exec/run-command.js +0 -604
- package/dist/commands/exec/run-planned.d.ts +0 -20
- package/dist/commands/exec/run-planned.js +0 -22
- package/dist/commands/exec/sandbox-view.d.ts +0 -19
- package/dist/commands/exec/sandbox-view.js +0 -72
- package/dist/commands/test/plan.d.ts +0 -92
- package/dist/commands/test/plan.js +0 -128
- package/dist/config/recipe-run.d.ts +0 -33
- package/dist/config/recipe-run.js +0 -28
- package/dist/core/sandbox-end.d.ts +0 -64
- package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
- package/dist/runner/recipe.js +0 -425
- package/dist/runner/snapshot-cache.d.ts +0 -148
- package/dist/runner/snapshot-cache.js +0 -126
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
import type { RunTestPlan } from "../sdk/extension/index.ts";
|
|
2
|
-
import { type CredentialDeclaration, credentialSourceIds, type UnsafeSecretEnvVar } from "./
|
|
2
|
+
import { type CredentialDeclaration, credentialSourceIds, type UnsafeSecretEnvVar } from "./vercel-sandbox-secrets.ts";
|
|
3
3
|
export { type CredentialDeclaration, credentialSourceIds, type UnsafeSecretEnvVar };
|
|
4
4
|
/** A bash script, run with `bash -lc` in the repository's root, and the label that names it in progress and errors. */
|
|
5
5
|
export interface RunnerStep {
|
|
6
6
|
readonly label: string;
|
|
7
7
|
readonly script: string;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
/**
|
|
10
|
+
* A toolchain step in `snapshot.toolchains`: a step that runs before the base's files are committed in the build
|
|
11
|
+
* sandbox, with optional `baseFiles` — repository-relative paths that storm reads at the base, places in
|
|
12
|
+
* `/vercel/sandbox/<path>` before the first toolchain step runs, and hashes into the snapshot key.
|
|
13
|
+
*/
|
|
14
|
+
export interface ToolchainStep extends RunnerStep {
|
|
15
|
+
readonly baseFiles?: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A declared scaling rule for `runner.vcpus`: reads numeric option `option` from resource `resource` (by its resource
|
|
19
|
+
* key), divides it across the run's runner sandboxes (`Math.ceil(value / run.sandboxes)`), multiplies by `per`, and
|
|
20
|
+
* clamps the result between `min` and `max`. When the resource is absent from the run, `min` is used.
|
|
21
|
+
*/
|
|
22
|
+
export interface RunnerVcpuRule {
|
|
23
|
+
readonly resource: string;
|
|
24
|
+
readonly option: string;
|
|
25
|
+
readonly per: number;
|
|
26
|
+
readonly min: number;
|
|
27
|
+
readonly max: number;
|
|
15
28
|
}
|
|
16
|
-
/**
|
|
17
|
-
export type
|
|
29
|
+
/** `runner.vcpus`: a positive whole number of vCPUs, or a declared resource-scaling rule (`RunnerVcpuRule`). */
|
|
30
|
+
export type RunnerVcpuCount = number | RunnerVcpuRule;
|
|
18
31
|
/**
|
|
19
|
-
* What a repository declares about its runner snapshot and what each run does on top of it.
|
|
20
|
-
* function is called with, which the module that calls it declares (`config`'s `RecipeRun`); the default, `never`,
|
|
21
|
-
* takes a recipe whatever its `vcpus` function takes, for code that never calls it.
|
|
32
|
+
* What a repository declares about its runner snapshot and what each run does on top of it.
|
|
22
33
|
*/
|
|
23
|
-
export interface
|
|
24
|
-
/** Lowercase letters, digits and dashes. Names the
|
|
34
|
+
export interface VercelSandboxOptions {
|
|
35
|
+
/** Lowercase letters, digits and dashes. Names the runner's sandboxes (`storm-runner-<name>`) and cache entries. */
|
|
25
36
|
readonly name: string;
|
|
26
37
|
readonly snapshot: {
|
|
27
38
|
/** The build sandbox's vCPUs. */
|
|
@@ -29,12 +40,12 @@ export interface RunnerRecipe<Run = never> {
|
|
|
29
40
|
/** A few words on what a snapshot build does; by default the steps' labels. */
|
|
30
41
|
readonly summary?: string;
|
|
31
42
|
/** Steps run before the base's files are committed in the build sandbox. They must put `git` on `PATH`. */
|
|
32
|
-
readonly toolchains:
|
|
43
|
+
readonly toolchains: readonly ToolchainStep[];
|
|
33
44
|
/**
|
|
34
45
|
* Steps run after the base's files are committed, such as a frozen install and a full build, saved in the runner
|
|
35
46
|
* snapshot so each run's install and build have little left to do.
|
|
36
47
|
*/
|
|
37
|
-
readonly prebuild:
|
|
48
|
+
readonly prebuild: readonly RunnerStep[];
|
|
38
49
|
};
|
|
39
50
|
readonly run: {
|
|
40
51
|
/** Installs dependencies on every run. */
|
|
@@ -44,13 +55,13 @@ export interface RunnerRecipe<Run = never> {
|
|
|
44
55
|
};
|
|
45
56
|
/** The command's directory, relative to the repository's root, without `..`; `"."` by default. */
|
|
46
57
|
readonly cwd?: string;
|
|
47
|
-
/** The runner sandbox's vCPUs, or a
|
|
48
|
-
readonly vcpus:
|
|
58
|
+
/** The runner sandbox's vCPUs: a positive whole number, or a declared resource-scaling rule (`RunnerVcpuRule`). */
|
|
59
|
+
readonly vcpus: RunnerVcpuCount;
|
|
49
60
|
/**
|
|
50
61
|
* Extra environment variables for the command. It can't set `STORM_RUN`. When it sets neither `FORCE_COLOR` nor
|
|
51
62
|
* `NO_COLOR`, storm sets `FORCE_COLOR=1` when the local terminal asks for color (a TTY or `FORCE_COLOR`),
|
|
52
63
|
* `NO_COLOR=1` when the launcher explicitly opted out (`--no-color` or a non-empty `NO_COLOR`), and neither on a
|
|
53
|
-
* plain non-TTY launcher; when the
|
|
64
|
+
* plain non-TTY launcher; when the runner options set either, storm sets neither.
|
|
54
65
|
*/
|
|
55
66
|
readonly env?: Readonly<Record<string, string>>;
|
|
56
67
|
/**
|
|
@@ -111,7 +122,7 @@ export interface RunnerRecipe<Run = never> {
|
|
|
111
122
|
readonly sandboxes?: RunnerSandboxCount;
|
|
112
123
|
}
|
|
113
124
|
/**
|
|
114
|
-
* How many runner sandboxes a run can have, the runner
|
|
125
|
+
* How many runner sandboxes a run can have, the Vercel Sandbox runner options' `sandboxes` key: `max`, the limit, a whole number from
|
|
115
126
|
* 1 to `MAX_RUNNER_SANDBOXES`, and `default`, the number of runner sandboxes of a run with no `--sandboxes` or
|
|
116
127
|
* `--file-lists`. No run from the config file has more runner sandboxes than `max`.
|
|
117
128
|
*/
|
|
@@ -123,43 +134,45 @@ export interface RunnerSandboxCount {
|
|
|
123
134
|
readonly max: number;
|
|
124
135
|
/**
|
|
125
136
|
* The number of runner sandboxes of a run with a runner and no `--sandboxes` or `--file-lists`, of a run command that
|
|
126
|
-
* makes file lists, such as `storm
|
|
127
|
-
*
|
|
128
|
-
* line says so. With it, every run of such a command with a runner
|
|
129
|
-
* runner sandbox. `storm exec` and a run with no runner ignore it.
|
|
130
|
-
* with `--sandboxes` or `--file-lists`.
|
|
137
|
+
* makes file lists, such as `storm test`: a whole number from 1 to 32, or a declared rule
|
|
138
|
+
* (`SandboxCountDefaultRule`) giving how many test files go to each runner sandbox with an optional limit. A number
|
|
139
|
+
* above `max` is lowered to it, and the run's plan line says so. With it, every run of such a command with a runner
|
|
140
|
+
* is a run across runner sandboxes, also with one runner sandbox. `storm exec` and a run with no runner ignore it.
|
|
141
|
+
* Without it, a run is across runner sandboxes only with `--sandboxes` or `--file-lists`.
|
|
131
142
|
*/
|
|
132
143
|
readonly default?: SandboxCountDefault;
|
|
133
144
|
}
|
|
134
145
|
/**
|
|
135
|
-
* `runner.sandboxes.default`:
|
|
136
|
-
*
|
|
146
|
+
* A declared rule for `runner.sandboxes.default`: assigns one runner sandbox per `filesPerSandbox` test files
|
|
147
|
+
* (`Math.max(1, Math.min(max, Math.ceil(testPlan.files / filesPerSandbox)))`), or `1` when the test plan counted
|
|
148
|
+
* nothing.
|
|
137
149
|
*/
|
|
138
|
-
export
|
|
150
|
+
export interface SandboxCountDefaultRule {
|
|
151
|
+
/** Positive whole number of test files per runner sandbox. */
|
|
152
|
+
readonly filesPerSandbox: number;
|
|
153
|
+
/** Optional ceiling on the default sandbox count, from 1 to `MAX_RUNNER_SANDBOXES`. */
|
|
154
|
+
readonly max?: number;
|
|
155
|
+
}
|
|
139
156
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* config file, so its test plan is `counted`, with `files`, the number of test files, and `tests` when the run counted
|
|
143
|
-
* each test too. storm calls the function once for the run, before it mints, acquires, or starts anything.
|
|
157
|
+
* `runner.sandboxes.default`: a whole number of runner sandboxes, or a declared rule (`SandboxCountDefaultRule`), such
|
|
158
|
+
* as `{ filesPerSandbox: 50, max: 4 }`.
|
|
144
159
|
*/
|
|
145
|
-
export
|
|
146
|
-
readonly testPlan: RunTestPlan;
|
|
147
|
-
}
|
|
160
|
+
export type SandboxCountDefault = number | SandboxCountDefaultRule;
|
|
148
161
|
/**
|
|
149
162
|
* storm's own limit on the number of runner sandboxes, which `runner.sandboxes.max` can't pass: a guard against a
|
|
150
163
|
* typing mistake that would start hundreds of runner sandboxes, not a claim about what Vercel Sandbox holds.
|
|
151
164
|
*/
|
|
152
165
|
export declare const MAX_RUNNER_SANDBOXES = 32;
|
|
153
|
-
/** The defaults of a
|
|
154
|
-
export declare const
|
|
166
|
+
/** The defaults of a runner's optional keys. */
|
|
167
|
+
export declare const VERCEL_SANDBOX_DEFAULTS: {
|
|
155
168
|
readonly cwd: ".";
|
|
156
169
|
readonly timeout: "60m";
|
|
157
170
|
readonly baseRefs: readonly ["main", "origin/main"];
|
|
158
171
|
readonly region: "iad1";
|
|
159
172
|
readonly runtime: "node22";
|
|
160
173
|
};
|
|
161
|
-
/**
|
|
162
|
-
export interface
|
|
174
|
+
/** Vercel Sandbox runner options that passed `checkVercelSandboxOptions`, with every optional key's default filled in. */
|
|
175
|
+
export interface CheckedVercelSandboxOptions extends VercelSandboxOptions {
|
|
163
176
|
readonly run: {
|
|
164
177
|
readonly install: RunnerStep;
|
|
165
178
|
readonly build: RunnerStep;
|
|
@@ -167,69 +180,63 @@ export interface CheckedRecipe<Run = never> extends RunnerRecipe<Run> {
|
|
|
167
180
|
readonly cwd: string;
|
|
168
181
|
readonly env: Readonly<Record<string, string>>;
|
|
169
182
|
/**
|
|
170
|
-
* The sandbox credentials, in the
|
|
183
|
+
* The sandbox credentials, in the runner's order, each header in lowercase and each `requests` given; empty when
|
|
171
184
|
* absent. `credentialSourceIds` gives their sorted, unique source identities.
|
|
172
185
|
*/
|
|
173
186
|
readonly credentials: readonly Required<CredentialDeclaration>[];
|
|
174
187
|
/**
|
|
175
|
-
* The unsafe secret environment variables passed into the command's environment, in the
|
|
188
|
+
* The unsafe secret environment variables passed into the command's environment, in the runner's order; empty when
|
|
176
189
|
* absent.
|
|
177
190
|
*/
|
|
178
191
|
readonly unsafeSecretEnvVars: readonly UnsafeSecretEnvVar[];
|
|
179
192
|
readonly timeout: string;
|
|
180
193
|
/** `timeout` in minutes. */
|
|
181
194
|
readonly timeoutMinutes: number;
|
|
182
|
-
/** `keepSandbox` in minutes; undefined when the
|
|
195
|
+
/** `keepSandbox` in minutes; undefined when the runner options don't set it. */
|
|
183
196
|
readonly keepSandboxMinutes: number | undefined;
|
|
184
197
|
readonly baseRefs: readonly string[];
|
|
185
198
|
readonly region: string;
|
|
186
199
|
readonly runtime: string;
|
|
187
200
|
}
|
|
188
201
|
/**
|
|
189
|
-
* One thing wrong with
|
|
190
|
-
* itself), and what is wrong, worded to follow the key (`must be …, not …`).
|
|
202
|
+
* One thing wrong with Vercel Sandbox runner options: the key path inside them (`["snapshot", "vcpus"]`; empty for
|
|
203
|
+
* the options object itself), and what is wrong, worded to follow the key (`must be …, not …`).
|
|
191
204
|
*/
|
|
192
|
-
export interface
|
|
205
|
+
export interface VercelSandboxOptionProblem {
|
|
193
206
|
readonly path: readonly string[];
|
|
194
207
|
readonly problem: string;
|
|
195
208
|
}
|
|
196
|
-
export type
|
|
209
|
+
export type VercelSandboxOptionsCheck = {
|
|
197
210
|
readonly ok: true;
|
|
198
|
-
readonly value:
|
|
211
|
+
readonly value: CheckedVercelSandboxOptions;
|
|
199
212
|
} | {
|
|
200
213
|
readonly ok: false;
|
|
201
|
-
readonly problems: readonly
|
|
214
|
+
readonly problems: readonly VercelSandboxOptionProblem[];
|
|
202
215
|
};
|
|
203
216
|
/**
|
|
204
|
-
* Checks
|
|
205
|
-
*
|
|
206
|
-
*
|
|
217
|
+
* Checks Vercel Sandbox runner options against their static rules: the keys they may hold and each value's shape.
|
|
218
|
+
* Every value must be plain
|
|
219
|
+
* data; functions are refused with the declared form to use instead. Every problem is reported.
|
|
207
220
|
*/
|
|
208
|
-
export declare function
|
|
209
|
-
/**
|
|
210
|
-
|
|
211
|
-
* function that throws or rejects, or returns anything but a list of steps, is a problem worded to follow the key.
|
|
212
|
-
*/
|
|
213
|
-
export declare function resolveSteps(steps: RunnerStepList, context: RunnerStepContext): Promise<{
|
|
214
|
-
readonly ok: true;
|
|
215
|
-
readonly steps: readonly RunnerStep[];
|
|
216
|
-
} | {
|
|
217
|
-
readonly ok: false;
|
|
218
|
-
readonly problem: string;
|
|
219
|
-
}>;
|
|
221
|
+
export declare function checkVercelSandboxOptions(value: unknown): VercelSandboxOptionsCheck;
|
|
222
|
+
/** The sorted, unique repository-relative base file paths declared across `toolchains`. */
|
|
223
|
+
export declare function declaredBaseFilePaths(toolchains: readonly ToolchainStep[]): readonly string[];
|
|
220
224
|
/**
|
|
221
|
-
* What
|
|
222
|
-
*
|
|
225
|
+
* What `resolveVcpus` reads about a run: each present resource's resolved options by resource key, and the run's
|
|
226
|
+
* number of runner sandboxes.
|
|
223
227
|
*/
|
|
224
|
-
export interface
|
|
225
|
-
readonly
|
|
226
|
-
|
|
228
|
+
export interface VcpuRun {
|
|
229
|
+
readonly resources: {
|
|
230
|
+
readonly [key: string]: Readonly<Record<string, unknown>>;
|
|
231
|
+
};
|
|
232
|
+
readonly sandboxes: number;
|
|
227
233
|
}
|
|
228
234
|
/**
|
|
229
|
-
* The runner sandbox's vCPUs for `run`: the
|
|
230
|
-
*
|
|
235
|
+
* The runner sandbox's vCPUs for `run`: the runner's number, or the declared resource-scaling rule evaluated against
|
|
236
|
+
* `run.resources` and `run.sandboxes`. When the named resource is absent from the run, `min` is used. When the named
|
|
237
|
+
* resource is present and its named option is missing or not a non-negative finite number, returns a problem.
|
|
231
238
|
*/
|
|
232
|
-
export declare function resolveVcpus
|
|
239
|
+
export declare function resolveVcpus(options: Pick<VercelSandboxOptions, "vcpus">, run: VcpuRun): {
|
|
233
240
|
readonly ok: true;
|
|
234
241
|
readonly vcpus: number;
|
|
235
242
|
} | {
|
|
@@ -237,15 +244,8 @@ export declare function resolveVcpus<Run>(recipe: Pick<RunnerRecipe<Run>, "vcpus
|
|
|
237
244
|
readonly problem: string;
|
|
238
245
|
};
|
|
239
246
|
/**
|
|
240
|
-
* The number of runner sandboxes `runner.sandboxes.default` gives a run with test plan `testPlan`: the
|
|
241
|
-
* or
|
|
242
|
-
* a problem here: the run lowers it to `max` and says so.
|
|
243
|
-
* problem worded to follow the key, which names the test plan.
|
|
247
|
+
* The number of runner sandboxes `runner.sandboxes.default` gives a run with test plan `testPlan`: the runner's number,
|
|
248
|
+
* or the declared `{ filesPerSandbox, max? }` rule evaluated against `testPlan`. A number above `sandboxes.max` is not
|
|
249
|
+
* a problem here: the run lowers it to `sandboxes.max` and says so.
|
|
244
250
|
*/
|
|
245
|
-
export declare function resolveSandboxCountDefault(sandboxesDefault: SandboxCountDefault, testPlan: RunTestPlan):
|
|
246
|
-
readonly ok: true;
|
|
247
|
-
readonly sandboxes: number;
|
|
248
|
-
} | {
|
|
249
|
-
readonly ok: false;
|
|
250
|
-
readonly problem: string;
|
|
251
|
-
};
|
|
251
|
+
export declare function resolveSandboxCountDefault(sandboxesDefault: SandboxCountDefault, testPlan: RunTestPlan): number;
|