@cnc-tools/storm 0.16.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-P357TZAY.js → chunk-4O5C2XGJ.js} +18 -15
- package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-4WAMTUWZ.js} +419 -340
- package/dist/chunks/{chunk-OIY3DMF2.js → chunk-6UHIJXZG.js} +3 -3
- package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
- package/dist/chunks/{chunk-CK2GZEPK.js → chunk-7DZE67QM.js} +2 -2
- package/dist/chunks/{chunk-VUPZH7J2.js → chunk-BCBKYOHW.js} +1 -1
- package/dist/chunks/{chunk-2MAD5NKK.js → chunk-CKGZA25H.js} +1 -18
- package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-D27KILIA.js} +1 -1
- package/dist/chunks/{chunk-V4IKA3WI.js → chunk-DADEYJDW.js} +24 -17
- package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
- package/dist/chunks/chunk-F4MOYHRY.js +198 -0
- package/dist/chunks/{chunk-HVNK3I45.js → chunk-FNBB6V4R.js} +1 -1
- package/dist/chunks/{chunk-G3PHMXH5.js → chunk-GRT3UIBV.js} +18 -1
- package/dist/chunks/chunk-HP3CURSZ.js +88 -0
- package/dist/chunks/{chunk-DWEAHX4T.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-3L52KNQA.js → chunk-M7EKRGVD.js} +8 -8
- package/dist/chunks/chunk-MR77L2GK.js +340 -0
- package/dist/chunks/{chunk-DC2CDHNK.js → chunk-RNAS7JHE.js} +1438 -445
- package/dist/chunks/{chunk-FCQUJDA4.js → chunk-RWIXDDCK.js} +4 -189
- 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-FOZWA52V.js → chunk-YEPFSLQR.js} +480 -375
- package/dist/chunks/{live-app-WECQOQ4C.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 +2 -2
- 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 +31 -2
- 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 +34 -8
- package/dist/commands/exec/outcomes.js +30 -23
- package/dist/commands/exec/plan-run.d.ts +58 -150
- package/dist/commands/exec/plan-run.js +232 -88
- 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 +4 -4
- 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 +7 -3
- package/dist/commands/runs/facts.js +17 -8
- package/dist/commands/runs/list/command.d.ts +14 -6
- package/dist/commands/runs/list/command.js +10 -10
- package/dist/commands/runs/list/outcomes.d.ts +7 -3
- package/dist/commands/runs/logs/command.js +10 -10
- package/dist/commands/runs/show/command.d.ts +14 -6
- package/dist/commands/runs/show/command.js +30 -28
- package/dist/commands/runs/show/outcomes.d.ts +7 -3
- 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 +366 -25
- 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 +17 -17
- package/dist/commands/suites/list/outcomes.js +2 -2
- package/dist/commands/test/command.d.ts +31 -2
- package/dist/commands/test/command.js +49 -252
- package/dist/commands/test/outcomes.d.ts +15 -1
- package/dist/config/check-runner.d.ts +3 -3
- package/dist/config/check-runner.js +8 -7
- 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/index.d.ts +2 -2
- package/dist/config/index.js +1 -1
- package/dist/config/runner.d.ts +5 -5
- package/dist/config/runner.js +1 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/schema.js +1 -1
- package/dist/config-file/define.d.ts +1 -1
- package/dist/config-file/define.js +1 -1
- package/dist/config-file/runner.d.ts +5 -5
- package/dist/config-file/toolchain.d.ts +1 -1
- package/dist/config-file/toolchain.js +2 -2
- 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/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 +1 -1
- package/dist/extensions/testserver/resource.js +1 -1
- 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 +3 -14
- package/dist/planning/plan-only.js +11 -20
- package/dist/planning/run-kind-flags.js +2 -2
- package/dist/planning/run-plan.d.ts +45 -12
- 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 +9 -0
- 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.js +1 -1
- package/dist/runner/build-snapshots.d.ts +55 -29
- package/dist/runner/build-snapshots.js +130 -29
- 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 +87 -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 +129 -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 +14 -14
- package/dist/runner/prepare.js +20 -11
- 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 +32 -29
- package/dist/runner/snapshot-choice.js +1 -1
- package/dist/runner/snapshot-inspect.d.ts +39 -40
- package/dist/runner/snapshot-inspect.js +55 -35
- package/dist/runner/snapshot-key.d.ts +13 -12
- package/dist/runner/snapshot-key.js +13 -12
- 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} +24 -23
- package/dist/runner/{recipe.js → vercel-sandbox-options.js} +70 -69
- 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 +1 -1
- 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/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 +4 -4
- package/skills/plan-runs.md +1 -1
- package/skills/read-run-output.md +6 -6
- package/dist/chunks/chunk-7EENF73W.js +0 -782
- package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
- 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 -45
- package/dist/commands/exec/run-command.d.ts +0 -475
- package/dist/commands/exec/run-command.js +0 -603
- 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 -125
- package/dist/core/sandbox-end.d.ts +0 -64
- package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
- package/dist/runner/snapshot-cache.d.ts +0 -148
- package/dist/runner/snapshot-cache.js +0 -126
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// How a credential source's failure is worded for the person running storm: one cause and one fix, for a failed mint
|
|
2
|
-
//
|
|
1
|
+
// How a credential source's failure is worded for the person running storm: one cause and one fix, for a failed mint,
|
|
2
|
+
// a failed GitHub Actions OIDC token request, or an unreadable `VERCEL_OIDC_TOKEN`.
|
|
3
3
|
/** Names the cause of a failed mint and the one fix for it. */
|
|
4
4
|
export function describeMintFailure(failure, target) {
|
|
5
5
|
const loginStep = `\`vercel login\` with an account on the \`${target.team}\` team`;
|
|
@@ -79,11 +79,31 @@ export function describeTokenRequestFailure(failure) {
|
|
|
79
79
|
return { cause: `GitHub's answer to the token request held no token: ${last.said}`, fix };
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
+
/** Names the cause of a failed `VERCEL_OIDC_TOKEN` read and the one fix for it. */
|
|
83
|
+
export function describeVercelOidcTokenFailure(failure) {
|
|
84
|
+
switch (failure.kind) {
|
|
85
|
+
case "missing-token":
|
|
86
|
+
return {
|
|
87
|
+
cause: "`VERCEL_OIDC_TOKEN` is not set or is empty",
|
|
88
|
+
fix: "Set `VERCEL_OIDC_TOKEN` to a Vercel project OIDC token (for example, from `vercel project token` or Vercel OIDC in CI), or use `--credential mint`, then retry.",
|
|
89
|
+
};
|
|
90
|
+
case "invalid-token":
|
|
91
|
+
return {
|
|
92
|
+
cause: "`VERCEL_OIDC_TOKEN` is not a valid Vercel project OIDC token (expected a JWT with `owner_id` and `project_id` claims)",
|
|
93
|
+
fix: "Set `VERCEL_OIDC_TOKEN` to a Vercel project OIDC token from `vercel project token` or Vercel OIDC, then retry.",
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
82
97
|
/** Names the cause of a credential source's failure and the one fix for it, for whichever source it was. */
|
|
83
98
|
export function describeCredentialFailure(failure) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
99
|
+
switch (failure.source) {
|
|
100
|
+
case "mint":
|
|
101
|
+
return describeMintFailure(failure.failure, failure.target);
|
|
102
|
+
case "github-actions":
|
|
103
|
+
return describeTokenRequestFailure(failure.failure);
|
|
104
|
+
case "vercel-oidc":
|
|
105
|
+
return describeVercelOidcTokenFailure(failure.failure);
|
|
106
|
+
}
|
|
87
107
|
}
|
|
88
108
|
function variablesText(missing) {
|
|
89
109
|
return missing.map((name) => `\`${name}\``).join(" and ");
|
|
@@ -92,6 +92,18 @@ export type TokenRequestFailure = {
|
|
|
92
92
|
readonly kind: "variables-missing";
|
|
93
93
|
}>;
|
|
94
94
|
};
|
|
95
|
+
/**
|
|
96
|
+
* Why reading a Vercel OIDC token from `VERCEL_OIDC_TOKEN` failed. Never carries the raw token.
|
|
97
|
+
*
|
|
98
|
+
* - `missing-token`: `VERCEL_OIDC_TOKEN` is unset or empty.
|
|
99
|
+
* - `invalid-token`: `VERCEL_OIDC_TOKEN` is not a valid Vercel project OIDC token (a JWT with `owner_id` and
|
|
100
|
+
* `project_id` claims).
|
|
101
|
+
*/
|
|
102
|
+
export type VercelOidcTokenFailure = {
|
|
103
|
+
readonly kind: "missing-token";
|
|
104
|
+
} | {
|
|
105
|
+
readonly kind: "invalid-token";
|
|
106
|
+
};
|
|
95
107
|
/** Why a credential source couldn't give a credential, tagged by the source. */
|
|
96
108
|
export type CredentialFailure = {
|
|
97
109
|
readonly source: "mint";
|
|
@@ -100,6 +112,9 @@ export type CredentialFailure = {
|
|
|
100
112
|
} | {
|
|
101
113
|
readonly source: "github-actions";
|
|
102
114
|
readonly failure: TokenRequestFailure;
|
|
115
|
+
} | {
|
|
116
|
+
readonly source: "vercel-oidc";
|
|
117
|
+
readonly failure: VercelOidcTokenFailure;
|
|
103
118
|
};
|
|
104
119
|
export type CredentialOutcome = {
|
|
105
120
|
readonly ok: true;
|
|
@@ -109,9 +124,9 @@ export type CredentialOutcome = {
|
|
|
109
124
|
readonly failure: CredentialFailure;
|
|
110
125
|
};
|
|
111
126
|
/**
|
|
112
|
-
* Where a credential a service rejected came from: the mint, for `target
|
|
113
|
-
* claims a service's trust rules match on (`undefined` when they can't be read)
|
|
114
|
-
* from it.
|
|
127
|
+
* Where a credential a service rejected came from: the mint, for `target`; a GitHub Actions OIDC token, with the
|
|
128
|
+
* claims a service's trust rules match on (`undefined` when they can't be read); or `VERCEL_OIDC_TOKEN`. A resource
|
|
129
|
+
* words its own rejection from it.
|
|
115
130
|
*/
|
|
116
131
|
export type CredentialOrigin = {
|
|
117
132
|
readonly source: "mint";
|
|
@@ -119,6 +134,8 @@ export type CredentialOrigin = {
|
|
|
119
134
|
} | {
|
|
120
135
|
readonly source: "github-actions";
|
|
121
136
|
readonly claims: GitHubActionsClaims | undefined;
|
|
137
|
+
} | {
|
|
138
|
+
readonly source: "vercel-oidc";
|
|
122
139
|
};
|
|
123
140
|
/**
|
|
124
141
|
* Where a run gets its credential. A caller obtains one with `obtain()` right before each request that needs one, and
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// The credential a resource's acquire gets, and the declarations around it: where a credential source gets one (the
|
|
2
|
-
// for a target,
|
|
3
|
-
// extension API declares them, since its lifecycle hands them to a resource; the launcher's
|
|
4
|
-
// implements the sources over its gateways. Types only.
|
|
1
|
+
// The credential a resource's acquire gets, and the declarations around it: where a credential source gets one (the
|
|
2
|
+
// mint for a target, a GitHub Actions OIDC token request, or `VERCEL_OIDC_TOKEN`), why one failed, and where a
|
|
3
|
+
// credential came from. The extension API declares them, since its lifecycle hands them to a resource; the launcher's
|
|
4
|
+
// `credential` module implements the sources over its gateways. Types only.
|
|
5
5
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { Credential, type GitHubActionsClaims, type VercelProject } from "./credential.ts";
|
|
2
|
-
export { type CredentialDiagnosis, describeCredentialFailure, describeMintFailure, describeTokenRequestFailure, } from "./credential-diagnosis.ts";
|
|
3
|
-
export type { CredentialFailure, CredentialOrigin, CredentialOutcome, CredentialSource, MintFailure, MintStep, MintTarget, TokenAttemptFailure, TokenRequestFailure, TokenRequestVariable, } from "./credential-source.ts";
|
|
2
|
+
export { type CredentialDiagnosis, describeCredentialFailure, describeMintFailure, describeTokenRequestFailure, describeVercelOidcTokenFailure, } from "./credential-diagnosis.ts";
|
|
3
|
+
export type { CredentialFailure, CredentialOrigin, CredentialOutcome, CredentialSource, MintFailure, MintStep, MintTarget, TokenAttemptFailure, TokenRequestFailure, TokenRequestVariable, VercelOidcTokenFailure, } from "./credential-source.ts";
|
|
4
4
|
export { tokenRequestFailureFacts, tokenRequestFailureShape } from "./token-request-facts.ts";
|
|
5
|
+
export { vercelOidcTokenFailureFacts, vercelOidcTokenFailureShape } from "./vercel-oidc-facts.ts";
|
|
5
6
|
export type { Clock, Timer } from "./time.ts";
|
|
6
7
|
export { defineResource, type ResourceSpec } from "./resource.ts";
|
|
7
8
|
export { argsText, defineDriver, type Driver, DRIVER_PLAN_FAILURE_KINDS, type DriverHints, type DriverPlanAnswer, type DriverPlanFailureKind, type DriverPlanned, type DriverPlanRequest, type DriverRefusalWords, type DriverFileListSupport, type DriverFileListValidation, type DriverSpec, } from "./driver.ts";
|
|
@@ -36,8 +36,9 @@
|
|
|
36
36
|
// `commands.ts`, even for types, so its declarations reach no Clinkr either
|
|
37
37
|
// (`test/integration/package-types.integration.test.ts`).
|
|
38
38
|
export { Credential } from "./credential.js";
|
|
39
|
-
export { describeCredentialFailure, describeMintFailure, describeTokenRequestFailure, } from "./credential-diagnosis.js";
|
|
39
|
+
export { describeCredentialFailure, describeMintFailure, describeTokenRequestFailure, describeVercelOidcTokenFailure, } from "./credential-diagnosis.js";
|
|
40
40
|
export { tokenRequestFailureFacts, tokenRequestFailureShape } from "./token-request-facts.js";
|
|
41
|
+
export { vercelOidcTokenFailureFacts, vercelOidcTokenFailureShape } from "./vercel-oidc-facts.js";
|
|
41
42
|
export { defineResource } from "./resource.js";
|
|
42
43
|
export { argsText, defineDriver, DRIVER_PLAN_FAILURE_KINDS, } from "./driver.js";
|
|
43
44
|
export { defaultResourceKey, resourceCall, NOT_COUNTED, optionKeyPath, } from "./resource-definition.js";
|
|
@@ -106,7 +106,7 @@ type OptionValues<Rules> = {
|
|
|
106
106
|
export type WrittenOptions<Rules> = Pick<OptionInputs<Rules>, RequiredOption<Rules>> & Partial<Pick<OptionInputs<Rules>, Exclude<keyof Rules, RequiredOption<Rules>>>>;
|
|
107
107
|
/**
|
|
108
108
|
* A resource's options: the plain values, shaped as in the config file, once defaults, the file and the flags are
|
|
109
|
-
* merged. Its lifecycle,
|
|
109
|
+
* merged. Its lifecycle, the Vercel Sandbox runner options and the run payload all see these. An option with neither a default nor
|
|
110
110
|
* `required` may be absent.
|
|
111
111
|
*/
|
|
112
112
|
export type ResolvedOptions<Rules> = Pick<OptionValues<Rules>, PresentOption<Rules>> & Partial<Pick<OptionValues<Rules>, Exclude<keyof Rules, PresentOption<Rules>>>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/** An environment variable name: ASCII letters, digits, and underscores, not starting with a digit. */
|
|
3
3
|
export declare const ENV_VAR_NAME_PATTERN: RegExp;
|
|
4
|
-
/** The human-readable rule for an environment variable name, shared by Zod and
|
|
4
|
+
/** The human-readable rule for an environment variable name, shared by Zod and the runner options' checks. */
|
|
5
5
|
export declare const ENV_VAR_NAME_RULE = "an environment variable name, letters, digits, and underscores, not starting with a digit";
|
|
6
6
|
/**
|
|
7
7
|
* The fewest characters a secret value may have. The run replaces each value wherever it appears in what it prints and
|
|
@@ -5,7 +5,7 @@ import { z } from "zod";
|
|
|
5
5
|
import { mustBe } from "./rules.js";
|
|
6
6
|
/** An environment variable name: ASCII letters, digits, and underscores, not starting with a digit. */
|
|
7
7
|
export const ENV_VAR_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
8
|
-
/** The human-readable rule for an environment variable name, shared by Zod and
|
|
8
|
+
/** The human-readable rule for an environment variable name, shared by Zod and the runner options' checks. */
|
|
9
9
|
export const ENV_VAR_NAME_RULE = "an environment variable name, letters, digits, and underscores, not starting with a digit";
|
|
10
10
|
/**
|
|
11
11
|
* The fewest characters a secret value may have. The run replaces each value wherever it appears in what it prints and
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { VercelOidcTokenFailure } from "./credential-source.ts";
|
|
3
|
+
/** The facts of a failed `VERCEL_OIDC_TOKEN` read that `vercel_oidc_token_failed` carries. */
|
|
4
|
+
export declare const vercelOidcTokenFailureShape: {
|
|
5
|
+
/** Why reading `VERCEL_OIDC_TOKEN` failed: unset/empty, or not a valid Vercel project OIDC token. */
|
|
6
|
+
cause: z.ZodEnum<{
|
|
7
|
+
"invalid-token": "invalid-token";
|
|
8
|
+
"missing-token": "missing-token";
|
|
9
|
+
}>;
|
|
10
|
+
/** The cause, for a person. */
|
|
11
|
+
detail: z.ZodString;
|
|
12
|
+
/** The one fix. */
|
|
13
|
+
fix: z.ZodString;
|
|
14
|
+
};
|
|
15
|
+
/** A failed `VERCEL_OIDC_TOKEN` read as `vercel_oidc_token_failed` reports it. */
|
|
16
|
+
export declare function vercelOidcTokenFailureFacts(failure: VercelOidcTokenFailure): {
|
|
17
|
+
cause: "invalid-token" | "missing-token";
|
|
18
|
+
detail: string;
|
|
19
|
+
fix: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// A failed `VERCEL_OIDC_TOKEN` read as an error reports it: its facts (`vercelOidcTokenFailureShape`,
|
|
2
|
+
// `vercelOidcTokenFailureFacts`), which the credential launcher resolver's `vercel_oidc_token_failed` carries
|
|
3
|
+
// (`config/credential-resolver.ts`), a run's `vercel_oidc_token_failed` carries, and a resource's own errors reuse
|
|
4
|
+
// with theirs beside them. It loads no Clinkr.
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { describeVercelOidcTokenFailure } from "./credential-diagnosis.js";
|
|
7
|
+
/** The facts of a failed `VERCEL_OIDC_TOKEN` read that `vercel_oidc_token_failed` carries. */
|
|
8
|
+
export const vercelOidcTokenFailureShape = {
|
|
9
|
+
/** Why reading `VERCEL_OIDC_TOKEN` failed: unset/empty, or not a valid Vercel project OIDC token. */
|
|
10
|
+
cause: z.enum(["missing-token", "invalid-token"]),
|
|
11
|
+
/** The cause, for a person. */
|
|
12
|
+
detail: z.string(),
|
|
13
|
+
/** The one fix. */
|
|
14
|
+
fix: z.string(),
|
|
15
|
+
};
|
|
16
|
+
/** A failed `VERCEL_OIDC_TOKEN` read as `vercel_oidc_token_failed` reports it. */
|
|
17
|
+
export function vercelOidcTokenFailureFacts(failure) {
|
|
18
|
+
const { cause: detail, fix } = describeVercelOidcTokenFailure(failure);
|
|
19
|
+
return { cause: failure.kind, detail, fix };
|
|
20
|
+
}
|
package/dist/shared/cleanup.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare const notDeletedSchema: z.ZodObject<{
|
|
|
24
24
|
declare const keptSchema: z.ZodObject<{
|
|
25
25
|
name: z.ZodString;
|
|
26
26
|
stopsAt: z.ZodString;
|
|
27
|
-
url: z.ZodString
|
|
27
|
+
url: z.ZodNullable<z.ZodString>;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
29
|
/** The runner sandbox the run couldn't keep running, so it stopped and deleted it. */
|
|
30
30
|
declare const notKeptSchema: z.ZodObject<{
|
|
@@ -40,7 +40,7 @@ export declare const runnerCleanupSchema: z.ZodObject<{
|
|
|
40
40
|
kept: z.ZodNullable<z.ZodObject<{
|
|
41
41
|
name: z.ZodString;
|
|
42
42
|
stopsAt: z.ZodString;
|
|
43
|
-
url: z.ZodString
|
|
43
|
+
url: z.ZodNullable<z.ZodString>;
|
|
44
44
|
}, z.core.$strip>>;
|
|
45
45
|
notKept: z.ZodNullable<z.ZodObject<{
|
|
46
46
|
name: z.ZodString;
|
|
@@ -77,7 +77,7 @@ export declare function notKeptText(sandbox: z.infer<typeof notKeptSchema>): str
|
|
|
77
77
|
* Rows for the runner sandbox the run kept running, or couldn't keep, and the runner's sandboxes that couldn't be
|
|
78
78
|
* stopped or deleted, when there are any.
|
|
79
79
|
*/
|
|
80
|
-
export declare function runnerCleanupRows(cleanup: RunnerCleanup | null): (readonly ["Runner sandbox kept", readonly [`${string}, running until ${string}, with no network access`, string]] | readonly ["Runner sandbox not kept", string] | readonly ["Sandboxes not deleted", string[]] | readonly ["Sandboxes not stopped", string[]])[];
|
|
80
|
+
export declare function runnerCleanupRows(cleanup: RunnerCleanup | null): (readonly ["Runner sandbox kept", readonly [`${string}, running until ${string}, with no network access`, ...string[]]] | readonly ["Runner sandbox not kept", string] | readonly ["Sandboxes not deleted", string[]] | readonly ["Sandboxes not stopped", string[]])[];
|
|
81
81
|
/** Warnings for the runner sandbox the run couldn't keep running, and the sandboxes that couldn't be stopped or deleted. */
|
|
82
82
|
export declare function runnerCleanupWarnings(cleanup: RunnerCleanup | null): {
|
|
83
83
|
reason: string;
|
package/dist/shared/cleanup.js
CHANGED
|
@@ -29,8 +29,8 @@ const keptSchema = z.object({
|
|
|
29
29
|
name: z.string(),
|
|
30
30
|
/** When its timeout stops it, as an ISO time: the keep time from when the run ended, or later. */
|
|
31
31
|
stopsAt: z.string(),
|
|
32
|
-
/** Its Connect page in the Vercel dashboard, which says how to open a shell in it. */
|
|
33
|
-
url: z.string(),
|
|
32
|
+
/** Its Connect page in the Vercel dashboard, which says how to open a shell in it; null when team or project slug is unknown. */
|
|
33
|
+
url: z.string().nullable(),
|
|
34
34
|
});
|
|
35
35
|
/** The runner sandbox the run couldn't keep running, so it stopped and deleted it. */
|
|
36
36
|
const notKeptSchema = z.object({ name: z.string(), message: z.string() });
|
|
@@ -58,7 +58,8 @@ export function notDeletedText(sandbox) {
|
|
|
58
58
|
}
|
|
59
59
|
/** The runner sandbox a run kept running, as a sentence. */
|
|
60
60
|
export function keptText(kept) {
|
|
61
|
-
|
|
61
|
+
const suffix = kept.url === null ? "" : `: ${kept.url}`;
|
|
62
|
+
return `Kept the runner sandbox ${kept.name} running until ${isoSecondsText(kept.stopsAt)}, with no network access, so you can connect to it${suffix}`;
|
|
62
63
|
}
|
|
63
64
|
/** The runner sandbox a run couldn't keep running, as a sentence. */
|
|
64
65
|
export function notKeptText(sandbox) {
|
|
@@ -78,7 +79,10 @@ export function runnerCleanupRows(cleanup) {
|
|
|
78
79
|
: [
|
|
79
80
|
[
|
|
80
81
|
"Runner sandbox kept",
|
|
81
|
-
[
|
|
82
|
+
[
|
|
83
|
+
`${kept.name}, running until ${isoSecondsText(kept.stopsAt)}, with no network access`,
|
|
84
|
+
...(kept.url === null ? [] : [kept.url]),
|
|
85
|
+
],
|
|
82
86
|
],
|
|
83
87
|
]),
|
|
84
88
|
...(notKept === null ? [] : [["Runner sandbox not kept", notKeptText(notKept)]]),
|
|
@@ -133,7 +137,13 @@ function runnerCleanupOf(report) {
|
|
|
133
137
|
return null;
|
|
134
138
|
const { kept, target } = report;
|
|
135
139
|
return {
|
|
136
|
-
kept: kept === null
|
|
140
|
+
kept: kept === null
|
|
141
|
+
? null
|
|
142
|
+
: {
|
|
143
|
+
name: kept.name,
|
|
144
|
+
stopsAt: kept.stopsAt,
|
|
145
|
+
url: target === null ? null : sandboxConnectPage(target, kept.name),
|
|
146
|
+
},
|
|
137
147
|
notKept: report.notKept === null ? null : { ...report.notKept },
|
|
138
148
|
notStopped: report.notStopped.map(({ name, role, timeoutMinutes, message }) => ({
|
|
139
149
|
name,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RejectedSnapshot,
|
|
1
|
+
import type { RejectedSnapshot, SnapshotIndexNote, SnapshotRejectionReason } from "../runner/index.ts";
|
|
2
2
|
/** How many of the snapshots a run doesn't start from its build line lists, before it counts the rest. */
|
|
3
3
|
export declare const REJECTIONS_SHOWN = 5;
|
|
4
4
|
/** `count` commits, as text: `1 commit`, `24 commits`. */
|
|
@@ -18,14 +18,14 @@ export declare function rejectionText(reason: SnapshotRejectionReason, snapshot:
|
|
|
18
18
|
readonly base: string;
|
|
19
19
|
}): string;
|
|
20
20
|
/**
|
|
21
|
-
* The lines under a run's build line: why each cached snapshot of the
|
|
21
|
+
* The lines under a run's build line: why each cached snapshot of the runner doesn't fit, `REJECTIONS_SHOWN` of them
|
|
22
22
|
* at most, then how many more `storm snapshots list` shows.
|
|
23
23
|
*/
|
|
24
24
|
export declare function rejectionLines(rejected: readonly RejectedSnapshot[]): string[];
|
|
25
25
|
/** Every reason a run doesn't start from a cached snapshot, for a schema. */
|
|
26
26
|
export declare const REJECTION_REASONS: readonly ["expired", "expires-soon", "other-base", "steps-changed", "other-owner"];
|
|
27
27
|
/**
|
|
28
|
-
* What removing expired entries from the
|
|
28
|
+
* What removing expired entries from the local snapshot index noticed, as a run's and `storm snapshots build`'s
|
|
29
29
|
* progress line.
|
|
30
30
|
*/
|
|
31
|
-
export declare function
|
|
31
|
+
export declare function snapshotIndexNoteText(note: SnapshotIndexNote): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// What a run, `storm runs show
|
|
2
|
-
// commits a person knows, why a run doesn't start from one, and what the
|
|
3
|
-
// storm checked.
|
|
1
|
+
// What a run, `storm runs show`, and `storm snapshots list` say about a runner snapshot: where it was built, in
|
|
2
|
+
// commits a person knows, why a run doesn't start from one, and what reading the local snapshot index noticed. Each
|
|
3
|
+
// text says only what storm checked.
|
|
4
4
|
import { short } from "./text.js";
|
|
5
5
|
/** How many of the snapshots a run doesn't start from its build line lists, before it counts the rest. */
|
|
6
6
|
export const REJECTIONS_SHOWN = 5;
|
|
@@ -31,15 +31,15 @@ export function rejectionText(reason, snapshot) {
|
|
|
31
31
|
case "expires-soon":
|
|
32
32
|
return "expires within the hour";
|
|
33
33
|
case "other-base":
|
|
34
|
-
return `its base ${short(snapshot.base)} is
|
|
34
|
+
return `its base ${short(snapshot.base)} is neither the merge-base nor an ancestor of it`;
|
|
35
35
|
case "steps-changed":
|
|
36
|
-
return "the
|
|
36
|
+
return "the runner's snapshot steps changed since it was built";
|
|
37
37
|
case "other-owner":
|
|
38
38
|
return "built for another team or project";
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
* The lines under a run's build line: why each cached snapshot of the
|
|
42
|
+
* The lines under a run's build line: why each cached snapshot of the runner doesn't fit, `REJECTIONS_SHOWN` of them
|
|
43
43
|
* at most, then how many more `storm snapshots list` shows.
|
|
44
44
|
*/
|
|
45
45
|
export function rejectionLines(rejected) {
|
|
@@ -59,14 +59,14 @@ export const REJECTION_REASONS = [
|
|
|
59
59
|
"other-owner",
|
|
60
60
|
];
|
|
61
61
|
/**
|
|
62
|
-
* What removing expired entries from the
|
|
62
|
+
* What removing expired entries from the local snapshot index noticed, as a run's and `storm snapshots build`'s
|
|
63
63
|
* progress line.
|
|
64
64
|
*/
|
|
65
|
-
export function
|
|
65
|
+
export function snapshotIndexNoteText(note) {
|
|
66
66
|
switch (note.kind) {
|
|
67
|
-
case "
|
|
68
|
-
return `couldn't read the
|
|
67
|
+
case "local-index-unreadable":
|
|
68
|
+
return `couldn't read the local snapshot index at ${note.failure.path}: ${note.failure.message}; treating it as empty`;
|
|
69
69
|
case "expired-entry-not-removed":
|
|
70
|
-
return `couldn't remove the expired
|
|
70
|
+
return `couldn't remove the expired local snapshot index entry for runner snapshot ${note.entry.snapshotId} at ${note.failure.path}: ${note.failure.message}`;
|
|
71
71
|
}
|
|
72
72
|
}
|
package/dist/time/duration.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Durations as the runner's settings write them: a runner
|
|
1
|
+
// Durations as the runner's settings write them: a Vercel Sandbox runner's `timeout` and `keepSandbox` (and
|
|
2
2
|
// `--keep-sandbox`). A resource parses its own options' durations itself.
|
|
3
3
|
/** The shortest TTL storm gives a Vercel Sandbox: 10 minutes. */
|
|
4
4
|
export const MIN_TTL_MINUTES = 10;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cnc-tools/storm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "A test orchestrator: run your tests in the inner loop of development, in the cloud, in a test environment that you define",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -159,11 +159,12 @@
|
|
|
159
159
|
},
|
|
160
160
|
"scripts": {
|
|
161
161
|
"build": "tsc -p tsconfig.build.json && node scripts/embed-testserver-sdk.js && node scripts/bundle.js && node scripts/write-build-info.js",
|
|
162
|
+
"build:bun-entry": "node scripts/build-bun-entry.js",
|
|
162
163
|
"typecheck": "tsc --noEmit && tsc -p tsconfig.sdk.json",
|
|
163
164
|
"test": "pnpm run test:default && pnpm run test:integration",
|
|
164
165
|
"test:default": "vitest run --project default --project sanity",
|
|
165
166
|
"test:integration": "vitest run --project integration --passWithNoTests",
|
|
166
|
-
"test:testserver": "node bin/storm.js test --suite testserver",
|
|
167
|
+
"test:testserver": "node bin/storm.js test --suite testserver --scope vercel --project vercel",
|
|
167
168
|
"live:allowed-domains": "node scripts/live/allowed-domains-check.ts",
|
|
168
169
|
"live:credential": "node scripts/live/credential-check.ts",
|
|
169
170
|
"live:network-policy": "node scripts/live/network-policy-check.ts",
|
package/skills/overview.md
CHANGED
|
@@ -14,16 +14,16 @@ storm finds `storm.config.ts` in the working directory or the nearest parent up
|
|
|
14
14
|
- A **run** is one `storm test` or one `storm exec`. It runs one command: the driver's program with arguments from the command line and `storm.config.ts` for `storm test`, or the command after `--` for `storm exec`.
|
|
15
15
|
- The **project's tests** are the tests and test environment declared at the top level of `storm.config.ts` (`driver`, `args`, `runner`, and `resources`). `storm test` runs them when no `--suite` is given.
|
|
16
16
|
- A **suite** is a named variation of the project's tests declared under `suites` in `storm.config.ts`. A suite inherits every top-level setting it does not set, the runner included. Select it with `storm test --suite <name>`, or inspect all suites with `storm suites list`.
|
|
17
|
-
- A **runner** is where the command runs, declared under `runner` in `storm.config.ts` with one of two peer factories from `@vercel/storm/config`: `vercelSandbox({ … })` (the **Vercel Sandbox runner**, which readies a **runner sandbox**
|
|
17
|
+
- A **runner** is where the command runs, declared under `runner` in `storm.config.ts` with one of two peer factories from `@vercel/storm/config`: `vercelSandbox({ … })` (the **Vercel Sandbox runner**, which readies a **runner sandbox** and runs the command in it) or `launchMachine()` (the **launch machine runner**, which runs the command on this machine with no isolation). There is no built-in default runner: a run whose effective config declares no `runner` is refused with `missing_runner`. `storm test` has no runner flag; `storm exec` takes `--runner launch-machine` to run on the launch machine without a config file or ignoring the top-level runner.
|
|
18
18
|
- A **resource** is a thing that a run gets for its command, such as a set of test servers. Declare it under `resources` in `storm.config.ts`, under its resource key, or give one of its flags. The run acquires the resource before the command starts, gives the command what it needs of it in the run payload, and releases it after the command stops. Each resource adds its flags to the help of `storm test` and `storm exec`. Its own commands are under `storm ext`.
|
|
19
19
|
- A **run id** is the name of a run, such as `20261103T192655-8277`. It is the start time of the run in UTC and a short suffix. `storm test` and `storm exec` print it at the end, in the `logs` line. With `--json`, the result gives it as `runId`.
|
|
20
20
|
- A **run directory** is the directory where a run writes what it did, on the machine that started the run. This is true for every run, whether on the launch machine or in a runner sandbox. Its name is the run id. Do not read its files directly. Use the `runs` commands.
|
|
21
21
|
- A run is **active** while it goes on. A run is **finished** when it has ended and saved its test results. `runs show` shows test results only for a finished run.
|
|
22
22
|
- A **test result** is the final result of one test: `pass`, `fail`, or `skip`, with its errors. The command saves test results only with a storm reporter in the config of its test runner: `stormReporter` for vitest, `@vercel/storm/playwright/reporter` for Playwright. When the command of a `storm test` run exits 0 but reports no test result, the run warns `no_final_test_results`. The exit code does not change. Do the steps in its `next`: they name the config file and the code to add. Then run the same command again.
|
|
23
23
|
- **Test output** is what one test printed to the console, stdout and stderr together. storm keeps the last 8 MiB of the test output of each test. `droppedChars` counts the characters that storm did not keep.
|
|
24
|
-
- A **sandbox credential** is a secret that
|
|
25
|
-
- An **unsafe secret environment variable** is a secret declared in
|
|
26
|
-
- An **allowed domain** is a domain that
|
|
24
|
+
- A **sandbox credential** is a secret that `credentials` in `vercelSandbox({ … })` declares, such as a token for a private npm registry: `credentials: [{ domain: "registry.npmjs.org", source: { kind: "env", name: "NPM_AUTH" } }]`. `source` is a `SecretSource` plain object (`{ kind: "env", name }`) naming a variable in your environment that holds the whole header value, such as `Bearer …`. `header` is the name of the header, `authorization` by default. `requests` is `read`, the default, for `GET` and `HEAD` only, or `all`. A run in a runner sandbox reads the variable on the machine that starts the run. The run does not start, with `credentials_invalid`, when the variable is not set, is empty, holds a line break, or has fewer than 8 characters. The value never goes into a sandbox: the firewall of the sandbox adds the header to the requests to the domain. Vercel calls this "credentials brokering". The credentials are in place for the toolchain and prebuild steps of a snapshot build, and from before the install step of a run until the command has ended. The upload and the apply step do not get them. A resource can give credentials too, for the command only. With `read`, the firewall refuses every other request to the domain. Code that runs while a credential is in place, the command included, can send requests with the header to the domain, but it cannot read the value. Each install must find the registry configuration that names the domain: `npm --prefix <dir>` reads the `.npmrc` of that directory, not the project's. storm shows the value as `<token>` in all that it prints and writes, and does not write it to a file or a snapshot. A sandbox credential is not the credential that `--credential` picks, the Vercel OIDC token that storm uses for its own calls: the word has both uses until a rename.
|
|
25
|
+
- An **unsafe secret environment variable** is a secret declared in `unsafeSecretEnvVars` in `vercelSandbox({ … })` as `{ name, source: { kind: "env", name } }`, for a secret that cannot travel as an HTTPS header. A run in a runner sandbox reads `source` on the machine that starts the run and passes `name` into the command's environment alone, never into a step or a snapshot, and forbids keeping the runner sandbox. The run does not start, with `unsafe_secret_env_vars_invalid`, when the source variable is not set, is empty, holds a line break, or has fewer than 8 characters.
|
|
26
|
+
- An **allowed domain** is a domain that `allowedDomains` in `vercelSandbox({ … })` lists, such as `example.com` or `*.example.com`. With the list, the sandboxes of a run in a runner sandbox, every step and the command, reach only the allowed domains, and the domain of each sandbox credential while it is in place. A host outside them does not resolve: `curl` exits 6. A host that a resource gives the command must be in the list too. Without the list, every host is reachable.
|
|
27
27
|
- A **run log** is a log in the run directory. The **command log** (`command`) holds all the output of the command. It also holds output that no test owns: output from a `beforeAll`, a global setup, a raw `process.stdout.write`, or a child process. A **step log** (`install`, `build`, `apply`, `snapshot`) holds the output of one step of a run in a runner sandbox.
|
|
28
28
|
|
|
29
29
|
## Commands
|
package/skills/plan-runs.md
CHANGED
|
@@ -24,7 +24,7 @@ The parts are:
|
|
|
24
24
|
- `plan.sandboxes`: the number of runner sandboxes (`count`), where it came from (`from`: `flag` for `--sandboxes`, `file-lists` for `--file-lists`, `default` for `runner.sandboxes.default`), and its max (`max`). For `default`, `default` is the number that the default gave for this run. When that number is more than `max`, the run has `max` runner sandboxes. `requested` is the number asked for when the run has fewer test files than that. `leftOut` is the number of test files that your lists leave out.
|
|
25
25
|
- `sandboxes`: one item for each runner sandbox, with `sandbox` (the runner sandbox index, from 0), `argv` (the command of the runner sandbox, unchanged across runner sandboxes for `storm test`), and `files` (its file list, delivered in `STORM_RUN.sandbox.files`, or `null` for `storm exec`).
|
|
26
26
|
- `options`: each option of each resource, with its `value` and where the value came from (`from`: `flag`, `file`, or `default`). With `--sandboxes` or `--file-lists`, a default is the total for the whole run with that number of runner sandboxes, and each runner sandbox gets its own part of the resource.
|
|
27
|
-
- `vcpus`: the vCPUs of each runner sandbox, as the
|
|
27
|
+
- `vcpus`: the vCPUs of each runner sandbox, as the runner configures them for that number of runner sandboxes. It is `null` for a run on the launch machine runner.
|
|
28
28
|
4. A refusal that a run gets before it mints, `--plan-only` gets too. Read `reason` in the error document, as for a run.
|
|
29
29
|
|
|
30
30
|
## 2. Give your own file lists
|
|
@@ -47,21 +47,21 @@ With the Vercel Sandbox runner, storm installs and builds before it runs the com
|
|
|
47
47
|
|
|
48
48
|
## 6. Read why the setup was fast or slow
|
|
49
49
|
|
|
50
|
-
With the Vercel Sandbox runner, the runner sandbox starts from a runner snapshot
|
|
50
|
+
With the Vercel Sandbox runner, the runner sandbox starts from a runner snapshot at the run's merge-base or an ancestor of its merge-base, reused from the local snapshot index or the Vercel project's shared snapshot index, or built at the merge-base when none fits. The snapshot decides how much the run uploads, installs, and builds.
|
|
51
51
|
|
|
52
52
|
1. Run `storm runs show <run-id> --json`. Read `where.snapshot`.
|
|
53
53
|
2. Read `base`: the commit the snapshot was built at.
|
|
54
|
-
3. Read `builtBehind`: how many commits HEAD has after `base
|
|
54
|
+
3. Read `builtBehind`: how many commits HEAD has after `base`. A large number means more work for the install and build.
|
|
55
55
|
4. Read `where.uploadBytes`: how many bytes of changes the run uploaded on top of the snapshot's base. The run's merge-base is `where.base`.
|
|
56
|
-
5. Read `built`. If
|
|
57
|
-
6. To see which snapshot the next run here starts from, and why it does not start from each other one, run `storm snapshots list --json
|
|
58
|
-
7. To build a
|
|
56
|
+
5. Read `built` and `source`. If `built` is `true`, the run built a runner snapshot first, which takes a few minutes. If `built` is `false`, `source` says whether the reused snapshot came from `"local"` or `"shared"` (the shared snapshot index).
|
|
57
|
+
6. To see which snapshot the next run here starts from, and why it does not start from each other one, run `storm snapshots list --json` (add `--shared` to include the project's shared snapshot index). Read `local` (and `shared.entries` with `--shared`): the entry with `picked` `true` is the snapshot, and `reason` says why each other local entry is not. When none has `picked` `true`, a run here builds a runner snapshot at the merge-base. A snapshot with `reason` `other-base` has a base that is neither the merge-base nor an ancestor of it, so no run here starts from it: a run starts only from a snapshot at its merge-base or at a commit behind it on the base ref.
|
|
58
|
+
7. To build a runner snapshot before the next run, without a test run, run `storm snapshots build --json`. Read `outcome`: `built` or `up_to_date`.
|
|
59
59
|
|
|
60
60
|
A field is `null` when storm does not know it, such as in a run that an older storm recorded.
|
|
61
61
|
|
|
62
62
|
## 7. Run one test again in the runner sandbox
|
|
63
63
|
|
|
64
|
-
A run in a runner sandbox keeps its runner sandbox running after it ends only when you ask, with `--keep-sandbox` or
|
|
64
|
+
A run in a runner sandbox keeps its runner sandbox running after it ends only when you ask, with `--keep-sandbox` or `keepSandbox` in `vercelSandbox({ … })` (never when `runner.unsafeSecretEnvVars` is set). Without a request, the run stops and deletes it, also after a failure. A kept runner sandbox holds the checkout, the installed packages, and everything the command wrote, including test output. It holds no secret. Anyone who can update the Vercel project can connect to it. The kept runner sandbox has no network access, whether or not the run took a resource, so a test that needs the network can't run again in it.
|
|
65
65
|
|
|
66
66
|
1. Run `storm runs show <run-id> --json`.
|
|
67
67
|
2. Read `where.keptMinutesLeft`. If it is `null` or 0, the runner sandbox is not running. Start a new run with `storm test` or `storm exec`, and add `--keep-sandbox 30m`. With that flag, the run keeps its runner sandbox for 30 minutes.
|