@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
|
@@ -9,7 +9,7 @@ import { testserverCanceledLines } from "./canceled.js";
|
|
|
9
9
|
import { dropLeasedEntries, releaseLeases } from "./pool/index.js";
|
|
10
10
|
import { prBuildRefusal } from "./pr-build-facts.js";
|
|
11
11
|
import { createWith, failedCreateFacts, provision, testserverCanceledFacts, unpooledFacts, } from "./provision.js";
|
|
12
|
-
import { credentialRejected, noSandboxes, noUsableSandboxes, poolUnavailable, poolUnreadable, tokenRequestFailed, } from "./refusals.js";
|
|
12
|
+
import { credentialRejected, noSandboxes, noUsableSandboxes, poolUnavailable, poolUnreadable, tokenRequestFailed, vercelOidcTokenFailed, } from "./refusals.js";
|
|
13
13
|
import { testserverPoolDropped, testserverPoolDroppedText, testserverPoolDropWarnings, testserverPoolReleased, testserverPoolReleasedText, testserverPoolReleaseWarnings, } from "./release.js";
|
|
14
14
|
import { testserverPoolResult, testserverPoolResultWarnings } from "./result.js";
|
|
15
15
|
import { STALE_TESTSERVER_VARIABLES, testserverConnectionOf } from "./run-sandbox.js";
|
|
@@ -110,6 +110,12 @@ function acquireRefusal(refusal) {
|
|
|
110
110
|
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
111
111
|
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox),
|
|
112
112
|
});
|
|
113
|
+
case "vercel-oidc-token-failed":
|
|
114
|
+
return vercelOidcTokenFailed(refusal.failure, {
|
|
115
|
+
ttlMinutes: refusal.ttlMinutes,
|
|
116
|
+
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
117
|
+
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox),
|
|
118
|
+
});
|
|
113
119
|
case "credential-rejected":
|
|
114
120
|
return credentialRejected(refusal.origin, {
|
|
115
121
|
status: refusal.failure.status,
|
|
@@ -5,5 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* When a task rejects, no further task starts; once every started task has settled, it rejects with the first
|
|
7
7
|
* rejection. So nothing it started is still running when it returns or rejects.
|
|
8
|
+
*
|
|
9
|
+
* Its twin is `runLimited` in `src/runner/shared-snapshot-entry.ts`, with the same body: an extension folder imports
|
|
10
|
+
* storm only through the extension API, so the two have no shared home. Change both together.
|
|
8
11
|
*/
|
|
9
12
|
export declare function runLimited<T>(count: number, limit: number, proceed: () => boolean, task: (index: number) => Promise<T>): Promise<readonly (T | undefined)[]>;
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* When a task rejects, no further task starts; once every started task has settled, it rejects with the first
|
|
8
8
|
* rejection. So nothing it started is still running when it returns or rejects.
|
|
9
|
+
*
|
|
10
|
+
* Its twin is `runLimited` in `src/runner/shared-snapshot-entry.ts`, with the same body: an extension folder imports
|
|
11
|
+
* storm only through the extension API, so the two have no shared home. Change both together.
|
|
9
12
|
*/
|
|
10
13
|
export async function runLimited(count, limit, proceed, task) {
|
|
11
14
|
const results = Array.from({ length: count }, () => undefined);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CredentialFailure, CredentialOrigin, CredentialSource, MintFailed, TokenRequestFailure } from "../../sdk/extension/index.ts";
|
|
1
|
+
import type { CredentialFailure, CredentialOrigin, CredentialSource, MintFailed, TokenRequestFailure, VercelOidcTokenFailure } from "../../sdk/extension/index.ts";
|
|
2
2
|
import type { TestserverPoolEvent } from "./events.ts";
|
|
3
3
|
import { type BuildMatch, type BuildResolution, type PoolStoreFailure, type PrBuildRefusal } from "./pool/index.ts";
|
|
4
4
|
import { type TestserverPoolOptions } from "./options/index.ts";
|
|
@@ -84,6 +84,13 @@ export type TestserverRefusal = {
|
|
|
84
84
|
readonly ttlMinutes: number;
|
|
85
85
|
/** The creates that failed before the token request failed. */
|
|
86
86
|
readonly failedCreates: readonly FailedCreate[];
|
|
87
|
+
} | {
|
|
88
|
+
readonly kind: "vercel-oidc-token-failed";
|
|
89
|
+
readonly failure: VercelOidcTokenFailure;
|
|
90
|
+
/** The TTL each create asked for, which any Testserver sandbox a failed create left lives. */
|
|
91
|
+
readonly ttlMinutes: number;
|
|
92
|
+
/** The creates that failed before reading `VERCEL_OIDC_TOKEN` failed. */
|
|
93
|
+
readonly failedCreates: readonly FailedCreate[];
|
|
87
94
|
} | {
|
|
88
95
|
readonly kind: "credential-rejected";
|
|
89
96
|
readonly failure: RejectedCreate;
|
|
@@ -41,9 +41,14 @@ export function createWith(options, credential) {
|
|
|
41
41
|
* failed: the run's own `mint_failed`, or `token-request-failed`, which reports the creates that failed before it.
|
|
42
42
|
*/
|
|
43
43
|
function credentialFailed(failure, ttlMinutes, failedCreates) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
switch (failure.source) {
|
|
45
|
+
case "mint":
|
|
46
|
+
return { kind: "mint-failed", failed: failure };
|
|
47
|
+
case "github-actions":
|
|
48
|
+
return { kind: "token-request-failed", failure: failure.failure, ttlMinutes, failedCreates };
|
|
49
|
+
case "vercel-oidc":
|
|
50
|
+
return { kind: "vercel-oidc-token-failed", failure: failure.failure, ttlMinutes, failedCreates };
|
|
51
|
+
}
|
|
47
52
|
}
|
|
48
53
|
/**
|
|
49
54
|
* What a canceled run says of the Testserver pool once it provisioned `facts`: what it created, pooled or not, with the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CredentialOrigin, type Refusal, type TokenRequestFailure } from "../../sdk/extension/index.ts";
|
|
1
|
+
import { type CredentialOrigin, type Refusal, type TokenRequestFailure, type VercelOidcTokenFailure } from "../../sdk/extension/index.ts";
|
|
2
2
|
import type { CreateFailureFacts, UnpooledFacts } from "./provision.ts";
|
|
3
3
|
/** Where the pool lives, or would, and what the OS said, or why there is no place for it. */
|
|
4
4
|
export interface PoolPathFailure {
|
|
@@ -26,6 +26,11 @@ export interface TokenRequestFailedData {
|
|
|
26
26
|
* before the request did, and says when one may have left a Testserver sandbox.
|
|
27
27
|
*/
|
|
28
28
|
export declare function tokenRequestFailed(failure: TokenRequestFailure, data: TokenRequestFailedData): Refusal;
|
|
29
|
+
/**
|
|
30
|
+
* With --credential vercel-oidc, reading `VERCEL_OIDC_TOKEN` failed (`failure`), and the run had no usable Testserver
|
|
31
|
+
* sandbox, from the pool or created, so the command didn't run.
|
|
32
|
+
*/
|
|
33
|
+
export declare function vercelOidcTokenFailed(failure: VercelOidcTokenFailure, data: TokenRequestFailedData): Refusal;
|
|
29
34
|
/** `credential_rejected`'s data beside where the credential came from. */
|
|
30
35
|
export interface CredentialRejectedData {
|
|
31
36
|
readonly status: number;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// resolved (`prBuildRefusal`, `pr-build-facts.ts`), which storm ends the run with as `resource_refused`, with the
|
|
6
6
|
// run's cleanup. A failed mint with no Testserver sandbox in hand isn't one of them: it ends the run as the run's own
|
|
7
7
|
// `mint_failed`.
|
|
8
|
-
import { optionKeyPath, tokenRequestFailureFacts, } from "../../sdk/extension/index.js";
|
|
8
|
+
import { optionKeyPath, tokenRequestFailureFacts, vercelOidcTokenFailureFacts, } from "../../sdk/extension/index.js";
|
|
9
9
|
import { credentialOriginRows, rejectedCredentialFacts, rejectedCredentialText } from "./credential-facts.js";
|
|
10
10
|
import { describeTtl } from "./options/index.js";
|
|
11
11
|
import { createFailureText } from "./sandbox/index.js";
|
|
@@ -67,6 +67,21 @@ export function tokenRequestFailed(failure, data) {
|
|
|
67
67
|
next: [{ type: "text", text: facts.fix }, ...mayExistSteps(mayExist, ttlMinutes)],
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* With --credential vercel-oidc, reading `VERCEL_OIDC_TOKEN` failed (`failure`), and the run had no usable Testserver
|
|
72
|
+
* sandbox, from the pool or created, so the command didn't run.
|
|
73
|
+
*/
|
|
74
|
+
export function vercelOidcTokenFailed(failure, data) {
|
|
75
|
+
const facts = vercelOidcTokenFailureFacts(failure);
|
|
76
|
+
const { ttlMinutes, failedCreates, sandboxMayExist: mayExist } = data;
|
|
77
|
+
return {
|
|
78
|
+
refused: "vercel_oidc_token_failed",
|
|
79
|
+
data: { ...facts, ...data },
|
|
80
|
+
message: `Couldn't use VERCEL_OIDC_TOKEN: ${facts.detail}. The pool had no usable Testserver sandbox, so the command didn't run.`,
|
|
81
|
+
rows: failedCreateRows(failedCreates),
|
|
82
|
+
next: [{ type: "text", text: facts.fix }, ...mayExistSteps(mayExist, ttlMinutes)],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
70
85
|
/**
|
|
71
86
|
* The Testserver control plane refused the credential, minted or a GitHub Actions OIDC token (a redirect to SSO, a 401
|
|
72
87
|
* or a 403), so the command didn't run. It lists the other creates that failed and the created Testserver sandboxes
|
|
@@ -9,8 +9,8 @@ export type { TestserverPoolOptions } from "./options/index.ts";
|
|
|
9
9
|
*
|
|
10
10
|
* Its presence gives a run the Testserver pool; `testserverPool()` takes every default. `storm test` and
|
|
11
11
|
* `storm exec` override each option with its own flag, `--testserver-<option>`, and `storm ext testserver pool create`
|
|
12
|
-
* reads `build` and `ttl`. A runner
|
|
13
|
-
* `
|
|
12
|
+
* reads `build` and `ttl`. A Vercel Sandbox runner's declared `vcpus` rule can scale from its options by resource key
|
|
13
|
+
* `"testserverPool"`, such as `option: "sandboxes"`.
|
|
14
14
|
*/
|
|
15
15
|
export declare const testserverPool: import("../../sdk/extension/resource-factory.ts").ResourceFactory<import("../../sdk/extension/resource-definition.ts").ResourceDefinition<"testserverPool", {
|
|
16
16
|
readonly sandboxes: {
|
|
@@ -13,7 +13,7 @@ import { testserverPoolDefinition } from "./definition.js";
|
|
|
13
13
|
*
|
|
14
14
|
* Its presence gives a run the Testserver pool; `testserverPool()` takes every default. `storm test` and
|
|
15
15
|
* `storm exec` override each option with its own flag, `--testserver-<option>`, and `storm ext testserver pool create`
|
|
16
|
-
* reads `build` and `ttl`. A runner
|
|
17
|
-
* `
|
|
16
|
+
* reads `build` and `ttl`. A Vercel Sandbox runner's declared `vcpus` rule can scale from its options by resource key
|
|
17
|
+
* `"testserverPool"`, such as `option: "sandboxes"`.
|
|
18
18
|
*/
|
|
19
19
|
export const testserverPool = resourceFactory(testserverPoolDefinition);
|
|
@@ -33,7 +33,7 @@ export interface TestserverPoolResultFacts {
|
|
|
33
33
|
/** When the credential source failed with some Testserver sandboxes in hand: how many more weren't created, which source failed, and why. */
|
|
34
34
|
readonly uncreated: {
|
|
35
35
|
readonly count: number;
|
|
36
|
-
readonly source: "mint" | "github-actions";
|
|
36
|
+
readonly source: "mint" | "github-actions" | "vercel-oidc";
|
|
37
37
|
readonly cause: string;
|
|
38
38
|
readonly fix: string;
|
|
39
39
|
} | null;
|
|
@@ -67,10 +67,15 @@ export function testserverPoolResultWarnings(facts) {
|
|
|
67
67
|
reason: "mint_failed",
|
|
68
68
|
message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't mint a credential: ${facts.uncreated.cause}. ${facts.uncreated.fix}`,
|
|
69
69
|
}
|
|
70
|
-
:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
: facts.uncreated.source === "vercel-oidc"
|
|
71
|
+
? {
|
|
72
|
+
reason: "vercel_oidc_token_failed",
|
|
73
|
+
message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't use VERCEL_OIDC_TOKEN: ${facts.uncreated.cause}. ${facts.uncreated.fix}`,
|
|
74
|
+
}
|
|
75
|
+
: {
|
|
76
|
+
reason: "token_request_failed",
|
|
77
|
+
message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't request a GitHub Actions OIDC token: ${facts.uncreated.cause}. ${facts.uncreated.fix}`,
|
|
78
|
+
},
|
|
74
79
|
]),
|
|
75
80
|
...(facts.notCreated === 0
|
|
76
81
|
? []
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
import type { ArgumentIssue } from "@vercel/clinkr";
|
|
2
|
-
import type { Driver } from "../sdk/extension/index.ts";
|
|
3
1
|
import type { PlannedSandboxesRun } from "./run-plan.ts";
|
|
4
2
|
import { type CallerFileList } from "./file-lists-file.ts";
|
|
5
|
-
/** What `driverSandboxesProblems` reads of a driver command's request. */
|
|
6
|
-
export interface DriverSandboxesRequest {
|
|
7
|
-
readonly sandboxes?: number | undefined;
|
|
8
|
-
readonly fileLists?: string | undefined;
|
|
9
|
-
readonly args: readonly string[];
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* What is wrong with a driver command's request for a run across runner sandboxes, as `validate` reports it: a number
|
|
13
|
-
* of runner sandboxes that is not a whole number from 1, and any argument problem reported by
|
|
14
|
-
* `driver.fileLists.validate`. Returns nothing without `--sandboxes` or `--file-lists`, or for a driver without
|
|
15
|
-
* `fileLists`.
|
|
16
|
-
*/
|
|
17
|
-
export declare function driverSandboxesProblems(driver: Driver, request: DriverSandboxesRequest): readonly ArgumentIssue[];
|
|
18
3
|
/**
|
|
19
4
|
* The number of runner sandboxes a driver run with storm's file lists asks for, and where it came from: `--sandboxes`
|
|
20
5
|
* (`flag`), or `runner.sandboxes.default` (`default`), with the number the default gave for the run, which may exceed
|
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
// Pure helpers that plan a driver command's run across runner sandboxes (`--sandboxes`, `--file-lists`, and
|
|
2
|
-
// `runner.sandboxes.default`).
|
|
3
|
-
//
|
|
4
|
-
// with their file list for `STORM_RUN`. Names no test runner.
|
|
2
|
+
// `runner.sandboxes.default`). Deals listed test files into file lists and builds `PlannedSandboxesRun` values whose
|
|
3
|
+
// runner sandboxes each run the run's argv unchanged, with their file list for `STORM_RUN`. Names no test runner.
|
|
5
4
|
import { resolveCallerFileLists } from "./file-lists-file.js";
|
|
6
5
|
import { dealFileLists } from "./file-lists.js";
|
|
7
|
-
/**
|
|
8
|
-
* What is wrong with a driver command's request for a run across runner sandboxes, as `validate` reports it: a number
|
|
9
|
-
* of runner sandboxes that is not a whole number from 1, and any argument problem reported by
|
|
10
|
-
* `driver.fileLists.validate`. Returns nothing without `--sandboxes` or `--file-lists`, or for a driver without
|
|
11
|
-
* `fileLists`.
|
|
12
|
-
*/
|
|
13
|
-
export function driverSandboxesProblems(driver, request) {
|
|
14
|
-
const { sandboxes, fileLists: listsPath, args } = request;
|
|
15
|
-
if ((sandboxes === undefined && listsPath === undefined) || driver.fileLists === undefined)
|
|
16
|
-
return [];
|
|
17
|
-
const checked = driver.fileLists.validate(args);
|
|
18
|
-
return [
|
|
19
|
-
...(sandboxes === undefined || (Number.isInteger(sandboxes) && sandboxes >= 1)
|
|
20
|
-
? []
|
|
21
|
-
: [{ field: "sandboxes", message: `--sandboxes takes a whole number from 1, not ${sandboxes}.` }]),
|
|
22
|
-
...(checked.ok ? [] : [{ field: "args", message: checked.problem }]),
|
|
23
|
-
];
|
|
24
|
-
}
|
|
25
6
|
/**
|
|
26
7
|
* Builds the planned runner sandboxes for a driver run that asks for `asked` runner sandboxes within `max`: deals
|
|
27
8
|
* `testFiles` into round-robin file lists and assigns each list to a runner sandbox running `argv` unchanged. A default
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { ResolvedResourceRecord } from "../config/index.ts";
|
|
3
3
|
import type { ResourceLifecycles } from "../core/index.ts";
|
|
4
|
-
import {
|
|
5
|
-
import { type RunTestPlan } from "../sdk/extension/index.ts";
|
|
6
|
-
import type { PlannedSandboxesRun, PlannedWhere } from "./run-plan.ts";
|
|
4
|
+
import type { PlannedRunner, RunPlan } from "./run-plan.ts";
|
|
7
5
|
/** What a `planned` outcome says of the planned run. No field carries the credential. */
|
|
8
6
|
export declare const plannedSchema: z.ZodObject<{
|
|
9
7
|
version: z.ZodString;
|
|
@@ -38,7 +36,10 @@ export declare const plannedSchema: z.ZodObject<{
|
|
|
38
36
|
testFiles: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
39
37
|
runnerSandboxes: z.ZodNullable<z.ZodObject<{
|
|
40
38
|
max: z.ZodNumber;
|
|
41
|
-
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.
|
|
39
|
+
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
40
|
+
filesPerSandbox: z.ZodNumber;
|
|
41
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
}, z.core.$strip>]>>;
|
|
42
43
|
}, z.core.$strip>>;
|
|
43
44
|
sandboxes: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
44
45
|
sandbox: z.ZodNumber;
|
|
@@ -59,23 +60,14 @@ export declare const plannedSchema: z.ZodObject<{
|
|
|
59
60
|
/** What a `planned` outcome holds. */
|
|
60
61
|
export type PlannedFacts = z.input<typeof plannedSchema>;
|
|
61
62
|
/** The secrets a planned run hides as `<token>`: runner secrets and each resource's pure `secrets`. */
|
|
62
|
-
export declare function plannedSecrets(lifecycles: ResourceLifecycles,
|
|
63
|
+
export declare function plannedSecrets(lifecycles: ResourceLifecycles, runner: PlannedRunner, resources: {
|
|
63
64
|
readonly [key: string]: ResolvedResourceRecord;
|
|
64
65
|
}): readonly string[];
|
|
65
66
|
/** Builds and redacts the `PlannedFacts` for a run, across runner sandboxes or not. */
|
|
66
67
|
export declare function buildPlannedFacts(input: {
|
|
67
68
|
readonly version: string;
|
|
68
69
|
readonly commit: string | null;
|
|
69
|
-
readonly
|
|
70
|
-
readonly argv: readonly string[];
|
|
71
|
-
readonly where: PlannedWhere;
|
|
72
|
-
readonly testPlan: RunTestPlan;
|
|
73
|
-
readonly planOptions: readonly PlanOption[];
|
|
74
|
-
readonly testFiles: readonly string[] | undefined;
|
|
75
|
-
readonly sandboxes: PlannedSandboxesRun | undefined;
|
|
76
|
-
readonly resources: {
|
|
77
|
-
readonly [key: string]: ResolvedResourceRecord;
|
|
78
|
-
};
|
|
70
|
+
readonly plan: RunPlan;
|
|
79
71
|
readonly lifecycles: ResourceLifecycles;
|
|
80
72
|
readonly vcpus: number | null;
|
|
81
73
|
}): PlannedFacts;
|
|
@@ -5,7 +5,7 @@ import { z } from "zod";
|
|
|
5
5
|
import { planSchema } from "../run-directory/index.js";
|
|
6
6
|
import { optionKeyPath } from "../sdk/extension/index.js";
|
|
7
7
|
import { redactor, redactStrings } from "./redaction.js";
|
|
8
|
-
import {
|
|
8
|
+
import { plannedTestPlan } from "./test-plan.js";
|
|
9
9
|
const plannedOptionSchema = z.object({
|
|
10
10
|
/** The option's key path, `resources.<key>.<option>`. */
|
|
11
11
|
path: z.string(),
|
|
@@ -23,7 +23,10 @@ export const plannedSchema = z.object({
|
|
|
23
23
|
plan: planSchema.nullable(),
|
|
24
24
|
testFiles: z.array(z.string()).nullable(),
|
|
25
25
|
runnerSandboxes: z
|
|
26
|
-
.object({
|
|
26
|
+
.object({
|
|
27
|
+
max: z.number(),
|
|
28
|
+
default: z.union([z.number(), z.object({ filesPerSandbox: z.number(), max: z.number().optional() })]).nullable(),
|
|
29
|
+
})
|
|
27
30
|
.nullable(),
|
|
28
31
|
sandboxes: z
|
|
29
32
|
.array(z.object({ sandbox: z.number(), argv: z.array(z.string()), files: z.array(z.string()).nullable() }))
|
|
@@ -32,35 +35,26 @@ export const plannedSchema = z.object({
|
|
|
32
35
|
vcpus: z.number().nullable(),
|
|
33
36
|
});
|
|
34
37
|
/** The secrets a planned run hides as `<token>`: runner secrets and each resource's pure `secrets`. */
|
|
35
|
-
export function plannedSecrets(lifecycles,
|
|
36
|
-
return [...lifecycles.secrets(resources), ...(
|
|
38
|
+
export function plannedSecrets(lifecycles, runner, resources) {
|
|
39
|
+
return [...lifecycles.secrets(resources), ...(runner.kind === "vercel-sandbox" ? runner.secrets : [])];
|
|
37
40
|
}
|
|
38
41
|
/** Builds and redacts the `PlannedFacts` for a run, across runner sandboxes or not. */
|
|
39
42
|
export function buildPlannedFacts(input) {
|
|
40
|
-
const {
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const plan = sandboxes !== undefined
|
|
44
|
-
? {
|
|
45
|
-
...(basePlan ?? { options: [] }),
|
|
46
|
-
options: (basePlan?.options ?? []).map((option) => ({ ...option })),
|
|
47
|
-
sandboxes: { ...sandboxes.count },
|
|
48
|
-
}
|
|
49
|
-
: basePlan === undefined
|
|
50
|
-
? null
|
|
51
|
-
: { ...basePlan, options: basePlan.options.map((option) => ({ ...option })) };
|
|
43
|
+
const { plan: runPlan, lifecycles } = input;
|
|
44
|
+
const { runner, sandboxes, resources } = runPlan;
|
|
45
|
+
const policy = runner.kind === "vercel-sandbox" ? runner.options.sandboxes : undefined;
|
|
52
46
|
const facts = {
|
|
53
47
|
version: input.version,
|
|
54
48
|
commit: input.commit,
|
|
55
|
-
configFile:
|
|
56
|
-
argv: [...
|
|
57
|
-
plan,
|
|
58
|
-
testFiles:
|
|
49
|
+
configFile: runPlan.configFile,
|
|
50
|
+
argv: [...runPlan.argv],
|
|
51
|
+
plan: plannedTestPlan(runPlan) ?? null,
|
|
52
|
+
testFiles: runPlan.testFiles === undefined ? null : [...runPlan.testFiles],
|
|
59
53
|
runnerSandboxes: policy === undefined
|
|
60
54
|
? null
|
|
61
55
|
: {
|
|
62
56
|
max: policy.max,
|
|
63
|
-
default: policy.default
|
|
57
|
+
default: policy.default ?? null,
|
|
64
58
|
},
|
|
65
59
|
sandboxes: sandboxes === undefined
|
|
66
60
|
? null
|
|
@@ -78,6 +72,6 @@ export function buildPlannedFacts(input) {
|
|
|
78
72
|
}))),
|
|
79
73
|
vcpus: input.vcpus,
|
|
80
74
|
};
|
|
81
|
-
const redact = redactor(plannedSecrets(lifecycles,
|
|
75
|
+
const redact = redactor(plannedSecrets(lifecycles, runner, resources));
|
|
82
76
|
return redactStrings(facts, redact);
|
|
83
77
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The run flags that fit only one runner kind: `--show-output`, `--keep-sandbox`, `--sandboxes`, and `--file-lists`
|
|
2
2
|
// fit the Vercel Sandbox runner, and `--credential github-actions` fits the launch machine runner, since the Vercel
|
|
3
|
-
// Sandbox runner needs
|
|
3
|
+
// Sandbox runner needs a Vercel credential (`mint` or `vercel-oidc`).
|
|
4
4
|
// `planRun` runs this rule once after the effective runner is settled (`conflicting_options`).
|
|
5
5
|
/**
|
|
6
6
|
* Each flag in `flags` that doesn't fit `runner`: `--credential github-actions` for `vercel-sandbox`, and
|
|
@@ -35,7 +35,7 @@ export function runKindFlagName(flag) {
|
|
|
35
35
|
export function runKindFlagMessage(flag) {
|
|
36
36
|
switch (flag) {
|
|
37
37
|
case "credential":
|
|
38
|
-
return "The Vercel Sandbox runner needs a
|
|
38
|
+
return "The Vercel Sandbox runner needs a Vercel credential (mint or vercel-oidc), so it can't use --credential github-actions.";
|
|
39
39
|
case "showOutput":
|
|
40
40
|
return "--show-output prints the Vercel Sandbox runner's step output, and this run uses the launch machine runner.";
|
|
41
41
|
case "keepSandbox":
|
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { MintTarget } from "../credential/index.ts";
|
|
3
|
-
import type { PlannedSandboxCount, RecordedSandboxStart } from "../run-directory/index.ts";
|
|
4
|
-
import type {
|
|
5
|
-
import type { SandboxCredential } from "../sdk/extension/index.ts";
|
|
1
|
+
import type { ResolvedResourceRecord, ResolvedSettings } from "../config/index.ts";
|
|
2
|
+
import type { CredentialSourceChoice, MintTarget } from "../credential/index.ts";
|
|
3
|
+
import type { PlanOption, PlannedSandboxCount, RecordedSandboxStart } from "../run-directory/index.ts";
|
|
4
|
+
import type { CheckedVercelSandboxOptions, UnsafeSecretEnvVarMap } from "../runner/index.ts";
|
|
5
|
+
import type { RunTestPlan, SandboxCredential } from "../sdk/extension/index.ts";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* The settled runner of a planned run: on the launch machine (`launch-machine`), or in a Vercel Sandbox
|
|
8
|
+
* (`vercel-sandbox`), with the checked runner options, the config file it comes from, the credential source (`mint` or
|
|
9
|
+
* `vercel-oidc`), the control plane team and project when given, the runner's credentials with their values, and its
|
|
10
|
+
* unsafe secret environment variables.
|
|
10
11
|
*/
|
|
11
|
-
export type
|
|
12
|
-
readonly kind: "
|
|
12
|
+
export type PlannedRunner = {
|
|
13
|
+
readonly kind: "launch-machine";
|
|
13
14
|
} | {
|
|
14
|
-
readonly kind: "
|
|
15
|
+
readonly kind: "vercel-sandbox";
|
|
15
16
|
readonly configFile: string;
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
17
|
+
readonly options: CheckedVercelSandboxOptions;
|
|
18
|
+
readonly credential: Extract<CredentialSourceChoice, {
|
|
19
|
+
readonly source: "mint" | "vercel-oidc";
|
|
20
|
+
}>;
|
|
21
|
+
readonly target: MintTarget | null;
|
|
18
22
|
readonly credentials: readonly Required<SandboxCredential>[];
|
|
19
23
|
readonly unsafeSecretEnvVars: UnsafeSecretEnvVarMap;
|
|
20
24
|
/** Every secret value the runner declared (credentials and unsafe secret environment variables), for redaction. */
|
|
21
25
|
readonly secrets: readonly string[];
|
|
22
26
|
};
|
|
27
|
+
/** A Vercel Sandbox planned runner (`PlannedRunner` narrowed to `"vercel-sandbox"`). */
|
|
28
|
+
export type VercelSandboxPlannedRunner = Extract<PlannedRunner, {
|
|
29
|
+
readonly kind: "vercel-sandbox";
|
|
30
|
+
}>;
|
|
23
31
|
/**
|
|
24
32
|
* The planned runner sandboxes of a run across runner sandboxes: their number, with where it came from, and each runner
|
|
25
33
|
* sandbox's argv and file list.
|
|
@@ -28,3 +36,27 @@ export interface PlannedSandboxesRun {
|
|
|
28
36
|
readonly count: PlannedSandboxCount;
|
|
29
37
|
readonly sandboxes: readonly RecordedSandboxStart[];
|
|
30
38
|
}
|
|
39
|
+
interface RunPlanBase {
|
|
40
|
+
readonly configFile: string | null;
|
|
41
|
+
readonly settings: ResolvedSettings;
|
|
42
|
+
readonly argv: readonly string[];
|
|
43
|
+
readonly testPlan: RunTestPlan;
|
|
44
|
+
readonly testFiles: readonly string[] | undefined;
|
|
45
|
+
readonly resources: {
|
|
46
|
+
readonly [key: string]: ResolvedResourceRecord;
|
|
47
|
+
};
|
|
48
|
+
readonly planOptions: readonly PlanOption[];
|
|
49
|
+
}
|
|
50
|
+
/** A planned single run: on the launch machine or in one Vercel Sandbox. */
|
|
51
|
+
export interface SingleRunPlan extends RunPlanBase {
|
|
52
|
+
readonly runner: PlannedRunner;
|
|
53
|
+
readonly sandboxes: undefined;
|
|
54
|
+
}
|
|
55
|
+
/** A planned run across runner sandboxes: always uses the Vercel Sandbox runner. */
|
|
56
|
+
export interface SandboxesRunPlan extends RunPlanBase {
|
|
57
|
+
readonly runner: VercelSandboxPlannedRunner;
|
|
58
|
+
readonly sandboxes: PlannedSandboxesRun;
|
|
59
|
+
}
|
|
60
|
+
/** A planned run, as `planRun` settles it before any resource `beforeRun` or execution starts. */
|
|
61
|
+
export type RunPlan = SingleRunPlan | SandboxesRunPlan;
|
|
62
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// What a run's plan says before anything is minted, acquired or started:
|
|
2
|
-
// when it has them
|
|
3
|
-
//
|
|
1
|
+
// What a run's plan says before anything is minted, acquired, or started: its peer runner (`PlannedRunner`), its
|
|
2
|
+
// runner sandboxes when it has them (`PlannedSandboxesRun`), and the settled run plan (`RunPlan`, discriminated so a
|
|
3
|
+
// run across runner sandboxes always carries a Vercel Sandbox runner). `planRun` (`commands/exec/plan-run.ts`) plans a
|
|
4
|
+
// run over the gateways and answers these; the pure planning modules here read them.
|
|
4
5
|
export {};
|
|
@@ -27,7 +27,7 @@ export declare function listResolvedSuites(file: SettingsFile, driverByName: (na
|
|
|
27
27
|
/** Formats a command argument list as a readable shell-like string for display. */
|
|
28
28
|
export declare function formatCommandLine(command: readonly string[]): string;
|
|
29
29
|
/**
|
|
30
|
-
* A redaction of each credential and unsafe secret environment variable value that `target`'s effective runner
|
|
30
|
+
* A redaction of each credential and unsafe secret environment variable value that `target`'s effective runner
|
|
31
31
|
* declares and `env` (the launcher environment) sets, since the config file's `args` can hold one. A launch machine
|
|
32
32
|
* runner, or none, declares no secret.
|
|
33
33
|
*/
|
package/dist/planning/suites.js
CHANGED
|
@@ -60,13 +60,13 @@ export function formatCommandLine(command) {
|
|
|
60
60
|
return command.map(quoteArg).join(" ");
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* A redaction of each credential and unsafe secret environment variable value that `target`'s effective runner
|
|
63
|
+
* A redaction of each credential and unsafe secret environment variable value that `target`'s effective runner
|
|
64
64
|
* declares and `env` (the launcher environment) sets, since the config file's `args` can hold one. A launch machine
|
|
65
65
|
* runner, or none, declares no secret.
|
|
66
66
|
*/
|
|
67
67
|
export function targetRedactor(target, env) {
|
|
68
68
|
const runner = target.settingsFile.values?.settings.runner;
|
|
69
|
-
return redactor(declaredSecretValues(runner?.kind === "vercel-sandbox" ? runner.
|
|
69
|
+
return redactor(declaredSecretValues(runner?.kind === "vercel-sandbox" ? runner.options : undefined, env));
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* The pre-run stderr line for `storm test`: `tests: <command>` or `suite <name>: <command>`, plus a count of
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import type { PlannedSandboxCount, PlanOption, TestPlanFacts } from "../run-directory/index.ts";
|
|
2
2
|
import { type RunTestPlan } from "../sdk/extension/index.ts";
|
|
3
|
+
import type { RunPlan, SandboxesRunPlan, SingleRunPlan } from "./run-plan.ts";
|
|
3
4
|
/** The plan a run records: with a counted test plan, its counts and `options`; none for a run that counted nothing. */
|
|
4
5
|
export declare function recordedPlan(testPlan: RunTestPlan, options: readonly PlanOption[]): TestPlanFacts | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* The plan facts a planned run records, prints before starting, and reports in `--plan-only`, `ran`, and
|
|
8
|
+
* `sandboxes_ran`: for a run across runner sandboxes, always present with `sandboxes`; for a single run, present only
|
|
9
|
+
* when counted.
|
|
10
|
+
*/
|
|
11
|
+
export declare function plannedTestPlan(plan: SandboxesRunPlan): TestPlanFacts;
|
|
12
|
+
export declare function plannedTestPlan(plan: SingleRunPlan): TestPlanFacts | undefined;
|
|
13
|
+
export declare function plannedTestPlan(plan: RunPlan): TestPlanFacts | undefined;
|
|
5
14
|
/**
|
|
6
15
|
* The plan as `vitest` and `playwright` say it before the run: `Running 65 tests in 19 files; resources.<key>.<option>
|
|
7
16
|
* 5 (default)`, each option with where its value came from, or `Running 65 tests in 19 files` without one, and
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// whose default is a function of the planned run, with its value and where that came from. Their `ran` outcomes,
|
|
3
3
|
// `run.json` and `runs show` share its shape, which the run directory module declares (`run-directory/plan.ts`), and
|
|
4
4
|
// their line before the run and `runs show`'s row its text.
|
|
5
|
-
import { CONFIG_FILE_NAME } from "../config/index.js";
|
|
6
5
|
import { optionKeyPath } from "../sdk/extension/index.js";
|
|
7
6
|
import { RESOURCE_FLAGS } from "./resource-flags.js";
|
|
8
7
|
/** The plan a run records: with a counted test plan, its counts and `options`; none for a run that counted nothing. */
|
|
@@ -15,6 +14,15 @@ export function recordedPlan(testPlan, options) {
|
|
|
15
14
|
}
|
|
16
15
|
: undefined;
|
|
17
16
|
}
|
|
17
|
+
export function plannedTestPlan(plan) {
|
|
18
|
+
const base = recordedPlan(plan.testPlan, plan.planOptions);
|
|
19
|
+
if (plan.sandboxes === undefined)
|
|
20
|
+
return base;
|
|
21
|
+
return {
|
|
22
|
+
...(base ?? { options: [] }),
|
|
23
|
+
sandboxes: { ...plan.sandboxes.count },
|
|
24
|
+
};
|
|
25
|
+
}
|
|
18
26
|
/**
|
|
19
27
|
* The plan as `vitest` and `playwright` say it before the run: `Running 65 tests in 19 files; resources.<key>.<option>
|
|
20
28
|
* 5 (default)`, each option with where its value came from, or `Running 65 tests in 19 files` without one, and
|
|
@@ -72,7 +80,7 @@ function fromText(path, from) {
|
|
|
72
80
|
case "flag":
|
|
73
81
|
return RESOURCE_FLAGS.find(({ resource, option }) => optionKeyPath(resource, option) === path)?.flag ?? "a flag";
|
|
74
82
|
case "file":
|
|
75
|
-
return
|
|
83
|
+
return "config file";
|
|
76
84
|
case "default":
|
|
77
85
|
return "default";
|
|
78
86
|
}
|
|
@@ -57,7 +57,7 @@ async function openRecording(gateway, start, extra) {
|
|
|
57
57
|
export async function recordRun(gateway, start) {
|
|
58
58
|
const { definitionSet } = start;
|
|
59
59
|
const { record, directory, opened, wallMs, abandon } = await openRecording(gateway, start, {
|
|
60
|
-
where: startedWhere(start.run),
|
|
60
|
+
where: startedWhere(start.run.runner),
|
|
61
61
|
});
|
|
62
62
|
const collector = runCollector(definitionSet, directory);
|
|
63
63
|
return {
|
|
@@ -103,7 +103,7 @@ export async function recordRun(gateway, start) {
|
|
|
103
103
|
export async function recordAcrossSandboxes(gateway, start) {
|
|
104
104
|
const { definitionSet, redact } = start;
|
|
105
105
|
const { startedAt, record, directory, opened, wallMs, abandon } = await openRecording(gateway, start, {
|
|
106
|
-
where: startedWhere({
|
|
106
|
+
where: startedWhere({ kind: "vercel-sandbox", session: start.runner }),
|
|
107
107
|
sandboxes: start.sandboxes.map((sandbox, index) => pendingSandboxRecord({ sandbox: index, argv: sandbox.argv, files: sandbox.files })),
|
|
108
108
|
});
|
|
109
109
|
const run = runCollector(definitionSet, undefined);
|