@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,50 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PROJECT_FIELDS,
|
|
3
|
+
SNAPSHOT_ACCESS_CLI,
|
|
4
|
+
SNAPSHOT_ACCESS_FIELDS,
|
|
5
|
+
projectDisplayText,
|
|
6
|
+
settleSnapshotAccess,
|
|
7
|
+
sharedListFailedError
|
|
8
|
+
} from "../../../chunks/chunk-HP3CURSZ.js";
|
|
1
9
|
import {
|
|
2
10
|
suiteNotFoundErrors
|
|
3
|
-
} from "../../../chunks/chunk-
|
|
11
|
+
} from "../../../chunks/chunk-7DZE67QM.js";
|
|
12
|
+
import {
|
|
13
|
+
runErrors
|
|
14
|
+
} from "../../../chunks/chunk-2VP4GRJM.js";
|
|
4
15
|
import {
|
|
5
16
|
redactor
|
|
6
|
-
} from "../../../chunks/chunk-
|
|
17
|
+
} from "../../../chunks/chunk-FNBB6V4R.js";
|
|
7
18
|
import {
|
|
8
19
|
REJECTIONS_SHOWN,
|
|
9
20
|
REJECTION_REASONS,
|
|
10
21
|
builtAtText,
|
|
11
22
|
rejectionText
|
|
12
|
-
} from "../../../chunks/chunk-
|
|
23
|
+
} from "../../../chunks/chunk-M7EKRGVD.js";
|
|
24
|
+
import "../../../chunks/chunk-F4MOYHRY.js";
|
|
25
|
+
import "../../../chunks/chunk-HWIQ2S7K.js";
|
|
26
|
+
import "../../../chunks/chunk-EEENLQHE.js";
|
|
27
|
+
import "../../../chunks/chunk-72ZFEMAW.js";
|
|
28
|
+
import "../../../chunks/chunk-D27KILIA.js";
|
|
29
|
+
import "../../../chunks/chunk-2RNDPDTJ.js";
|
|
13
30
|
import {
|
|
14
31
|
path,
|
|
15
32
|
renderOutcome
|
|
16
|
-
} from "../../../chunks/chunk-
|
|
33
|
+
} from "../../../chunks/chunk-LKTZ5OXS.js";
|
|
17
34
|
import {
|
|
18
35
|
short
|
|
19
|
-
} from "../../../chunks/chunk-
|
|
36
|
+
} from "../../../chunks/chunk-GRT3UIBV.js";
|
|
37
|
+
import "../../../chunks/chunk-4O5C2XGJ.js";
|
|
20
38
|
import "../../../chunks/chunk-F6N34UWB.js";
|
|
21
|
-
import "../../../chunks/chunk-
|
|
39
|
+
import "../../../chunks/chunk-YEPFSLQR.js";
|
|
22
40
|
import {
|
|
23
41
|
configErrors,
|
|
42
|
+
credentialErrors,
|
|
43
|
+
credentialSourceErrors,
|
|
24
44
|
declaredSecretValues,
|
|
25
45
|
effectiveConfig,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
fileSettings,
|
|
47
|
+
inspectLocalSnapshotIndex,
|
|
48
|
+
invalidConfig,
|
|
49
|
+
listSharedSnapshots,
|
|
50
|
+
pickSnapshotAcrossIndexes
|
|
51
|
+
} from "../../../chunks/chunk-RNAS7JHE.js";
|
|
52
|
+
import "../../../chunks/chunk-XBDRVFEV.js";
|
|
30
53
|
import {
|
|
31
54
|
stormCommands
|
|
32
|
-
} from "../../../chunks/chunk-
|
|
55
|
+
} from "../../../chunks/chunk-WV3DP6NR.js";
|
|
33
56
|
import {
|
|
34
57
|
defineOutcomes
|
|
35
|
-
} from "../../../chunks/chunk-
|
|
58
|
+
} from "../../../chunks/chunk-4WAMTUWZ.js";
|
|
36
59
|
|
|
37
60
|
// src/commands/snapshots/list/command.ts
|
|
38
61
|
import { z as z2 } from "zod";
|
|
39
62
|
|
|
40
63
|
// src/commands/snapshots/list/outcomes.ts
|
|
41
64
|
import { z } from "zod";
|
|
42
|
-
var reasonSchema = z.enum([...REJECTION_REASONS, "other-
|
|
65
|
+
var reasonSchema = z.enum([...REJECTION_REASONS, "other-runner"]);
|
|
43
66
|
var snapshotSchema = z.object({
|
|
44
67
|
/** The snapshot's id in Vercel Sandbox. */
|
|
45
68
|
snapshotId: z.string(),
|
|
46
|
-
/** The runner
|
|
47
|
-
|
|
69
|
+
/** The Vercel Sandbox runner's name, region, and runtime it was built for. */
|
|
70
|
+
runner: z.string(),
|
|
48
71
|
region: z.string(),
|
|
49
72
|
runtime: z.string(),
|
|
50
73
|
/** The team and project ids it was built for. */
|
|
@@ -59,42 +82,114 @@ var snapshotSchema = z.object({
|
|
|
59
82
|
/** When it was created and when it expires, as ISO times. */
|
|
60
83
|
createdAt: z.string(),
|
|
61
84
|
expiresAt: z.string(),
|
|
62
|
-
/** Whether it had expired when storm read the
|
|
85
|
+
/** Whether it had expired when storm read the local snapshot index. */
|
|
63
86
|
expired: z.boolean(),
|
|
64
87
|
/** Whether a run here, with a credential for its team and project, starts from it. */
|
|
65
88
|
picked: z.boolean(),
|
|
66
|
-
/** Why a run here doesn't start from it; null for a picked one, and when storm picked for no
|
|
89
|
+
/** Why a run here doesn't start from it; null for a picked one, and when storm picked for no runner. */
|
|
67
90
|
reason: reasonSchema.nullable()
|
|
68
91
|
});
|
|
92
|
+
var sharedEntrySchema = z.object({
|
|
93
|
+
/** The stopped named sandbox that holds the entry in the Vercel project. */
|
|
94
|
+
sandboxName: z.string(),
|
|
95
|
+
/** Its base, the commit it was built at, a full SHA. */
|
|
96
|
+
base: z.string(),
|
|
97
|
+
/**
|
|
98
|
+
* What storm verified of it: `ready` (its snapshot exists, is created, and has more than an hour left),
|
|
99
|
+
* `expires-soon` (its snapshot is created and unexpired, but has an hour or less left), `unknown-expiry` (its
|
|
100
|
+
* snapshot is created, but neither the snapshot nor the sandbox tag carries a valid expiry timestamp), `building`
|
|
101
|
+
* (a build still owns the sandbox), `expired` (its snapshot is created, but expired), `missing` (its snapshot is not
|
|
102
|
+
* found or not created), `no-snapshot` (the sandbox holds no snapshot), or `failed` (the build sandbox ended failed
|
|
103
|
+
* or aborted).
|
|
104
|
+
*/
|
|
105
|
+
status: z.enum([
|
|
106
|
+
"ready",
|
|
107
|
+
"expires-soon",
|
|
108
|
+
"unknown-expiry",
|
|
109
|
+
"building",
|
|
110
|
+
"expired",
|
|
111
|
+
"missing",
|
|
112
|
+
"no-snapshot",
|
|
113
|
+
"failed"
|
|
114
|
+
]),
|
|
115
|
+
/** The sandbox's own status, such as `stopped`, `running`, or `snapshotting`. */
|
|
116
|
+
sandboxStatus: z.string(),
|
|
117
|
+
/** The snapshot's id and status in Vercel Sandbox; null when the sandbox holds none or storm didn't read it. */
|
|
118
|
+
snapshotId: z.string().nullable(),
|
|
119
|
+
snapshotStatus: z.string().nullable(),
|
|
120
|
+
/** When it was created, and when it expires, as ISO times; `expiresAt` is null when storm doesn't know. */
|
|
121
|
+
createdAt: z.string(),
|
|
122
|
+
expiresAt: z.string().nullable(),
|
|
123
|
+
/** Whether it had expired when storm read the index. */
|
|
124
|
+
expired: z.boolean(),
|
|
125
|
+
/** Whether a run here starts from this shared entry (beating or filling in for the local snapshot index). */
|
|
126
|
+
picked: z.boolean(),
|
|
127
|
+
/** How many commits HEAD has that this entry's base lacks, when the entry is ready and at or behind the merge-base; else null. */
|
|
128
|
+
builtBehind: z.number().nullable()
|
|
129
|
+
});
|
|
130
|
+
var sharedSchema = z.discriminatedUnion("kind", [
|
|
131
|
+
z.object({
|
|
132
|
+
kind: z.literal("listed"),
|
|
133
|
+
/** The Vercel project whose shared snapshot index it read. */
|
|
134
|
+
...PROJECT_FIELDS,
|
|
135
|
+
/** The runner's bucket: 16 hex characters in each entry's sandbox name. */
|
|
136
|
+
bucket: z.string(),
|
|
137
|
+
/** The bucket's entries, as the Sandbox API listed them. */
|
|
138
|
+
entries: z.array(sharedEntrySchema)
|
|
139
|
+
}),
|
|
140
|
+
z.object({
|
|
141
|
+
kind: z.literal("not-listed"),
|
|
142
|
+
/** Why storm has no bucket to read: no Git checkout, no Vercel Sandbox runner, or no base ref that shares history with HEAD. */
|
|
143
|
+
why: z.enum(["no-checkout", "no-runner", "no-base"])
|
|
144
|
+
})
|
|
145
|
+
]);
|
|
146
|
+
function sharedEntryFacts(selection) {
|
|
147
|
+
const { entry } = selection;
|
|
148
|
+
return {
|
|
149
|
+
sandboxName: entry.sandboxName,
|
|
150
|
+
base: entry.base,
|
|
151
|
+
status: entry.status,
|
|
152
|
+
sandboxStatus: entry.sandboxStatus,
|
|
153
|
+
snapshotId: entry.snapshotId ?? null,
|
|
154
|
+
snapshotStatus: entry.snapshotStatus ?? null,
|
|
155
|
+
createdAt: entry.createdAt,
|
|
156
|
+
expiresAt: entry.expiresAt ?? null,
|
|
157
|
+
expired: entry.expired,
|
|
158
|
+
picked: selection.picked,
|
|
159
|
+
builtBehind: selection.builtBehind
|
|
160
|
+
};
|
|
161
|
+
}
|
|
69
162
|
var listedSchema = z.object({
|
|
70
|
-
/** Where the
|
|
163
|
+
/** Where the local snapshot index lives. */
|
|
71
164
|
directory: z.string(),
|
|
72
|
-
/** The config file whose runner
|
|
165
|
+
/** The config file whose Vercel Sandbox runner storm picked for; null when none applies. */
|
|
73
166
|
configFile: z.string().nullable(),
|
|
74
|
-
/** The
|
|
167
|
+
/** The runner a run here uses, when storm marked what it starts from; else why it marked nothing: the directory is in no Git checkout, no Vercel Sandbox runner applies, or no base ref of the runner shares history with HEAD. */
|
|
75
168
|
picking: z.discriminatedUnion("kind", [
|
|
76
|
-
z.object({ kind: z.literal("
|
|
77
|
-
z.object({ kind: z.literal("none"), why: z.enum(["no-checkout", "no-
|
|
169
|
+
z.object({ kind: z.literal("runner"), runner: z.string() }),
|
|
170
|
+
z.object({ kind: z.literal("none"), why: z.enum(["no-checkout", "no-runner", "no-base"]) })
|
|
78
171
|
]),
|
|
79
|
-
/** Whether --all asked for other
|
|
172
|
+
/** Whether --all asked for other runners' snapshots too. */
|
|
80
173
|
all: z.boolean(),
|
|
81
174
|
/** HEAD's commit, a full SHA; null outside a Git checkout. */
|
|
82
175
|
head: z.string().nullable(),
|
|
83
|
-
/** HEAD's merge-base with a base ref of the
|
|
176
|
+
/** HEAD's merge-base with a base ref of the runner, a full SHA, and that ref; null when storm picked for no runner. */
|
|
84
177
|
mergeBase: z.string().nullable(),
|
|
85
178
|
mergeBaseRef: z.string().nullable(),
|
|
86
|
-
/** When storm read the
|
|
179
|
+
/** When storm read the local snapshot index, as an ISO time: what "ago" and "in" count from. */
|
|
87
180
|
readAt: z.string(),
|
|
88
|
-
/** The
|
|
89
|
-
|
|
90
|
-
/** The
|
|
91
|
-
unreadable: z.array(z.object({ file: z.string(), reason: z.string() }))
|
|
181
|
+
/** The local snapshot index entries, in the table's order. */
|
|
182
|
+
local: z.array(snapshotSchema),
|
|
183
|
+
/** The local snapshot index files storm can't read, each with why. */
|
|
184
|
+
unreadable: z.array(z.object({ file: z.string(), reason: z.string() })),
|
|
185
|
+
/** With --shared, what the shared snapshot index of the Vercel project holds for the runner; null without --shared. */
|
|
186
|
+
shared: sharedSchema.nullable()
|
|
92
187
|
});
|
|
93
188
|
function snapshotFacts(snapshot) {
|
|
94
189
|
const { entry } = snapshot;
|
|
95
190
|
return {
|
|
96
191
|
snapshotId: entry.snapshotId,
|
|
97
|
-
|
|
192
|
+
runner: entry.runnerName,
|
|
98
193
|
region: entry.region,
|
|
99
194
|
runtime: entry.runtime,
|
|
100
195
|
teamId: entry.teamId,
|
|
@@ -126,43 +221,116 @@ function baseCell(snapshot) {
|
|
|
126
221
|
}
|
|
127
222
|
function tableOf(listed) {
|
|
128
223
|
const now = Date.parse(listed.readAt);
|
|
129
|
-
const
|
|
224
|
+
const runnerColumn = listed.all || listed.picking.kind === "none";
|
|
130
225
|
return {
|
|
131
|
-
columns: ["", "BASE", "CREATED", "EXPIRES", ...
|
|
132
|
-
rows: listed.
|
|
226
|
+
columns: ["", "BASE", "CREATED", "EXPIRES", ...runnerColumn ? ["RUNNER"] : [], "ID"],
|
|
227
|
+
rows: listed.local.map((snapshot) => [
|
|
133
228
|
snapshot.picked ? "\u25B8" : "",
|
|
134
229
|
baseCell(snapshot),
|
|
135
230
|
`${spanText(now - Date.parse(snapshot.createdAt))} ago`,
|
|
136
231
|
snapshot.expired ? "expired" : `in ${spanText(Date.parse(snapshot.expiresAt) - now)}`,
|
|
137
|
-
...
|
|
232
|
+
...runnerColumn ? [snapshot.runner] : [],
|
|
138
233
|
snapshot.snapshotId
|
|
139
234
|
])
|
|
140
235
|
};
|
|
141
236
|
}
|
|
237
|
+
function sharedStatusText(entry) {
|
|
238
|
+
switch (entry.status) {
|
|
239
|
+
case "ready":
|
|
240
|
+
return "ready";
|
|
241
|
+
case "expires-soon":
|
|
242
|
+
return "expires soon";
|
|
243
|
+
case "unknown-expiry":
|
|
244
|
+
return "expiry unknown";
|
|
245
|
+
case "building":
|
|
246
|
+
return `building (${entry.sandboxStatus})`;
|
|
247
|
+
case "expired":
|
|
248
|
+
return "expired";
|
|
249
|
+
case "missing":
|
|
250
|
+
return "missing";
|
|
251
|
+
case "no-snapshot":
|
|
252
|
+
return "no snapshot";
|
|
253
|
+
case "failed":
|
|
254
|
+
return entry.sandboxStatus === "aborted" ? "aborted" : "failed";
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function sharedExpiresText(entry, now) {
|
|
258
|
+
if (entry.expiresAt === null || Number.isNaN(Date.parse(entry.expiresAt))) return "expiry unknown";
|
|
259
|
+
return `expires in ${spanText(Date.parse(entry.expiresAt) - now)}`;
|
|
260
|
+
}
|
|
261
|
+
function sharedSections(listed) {
|
|
262
|
+
const { shared } = listed;
|
|
263
|
+
if (shared === null) return [];
|
|
264
|
+
const local = listed.local.length === 0 ? [] : [
|
|
265
|
+
{
|
|
266
|
+
heading: "Local index",
|
|
267
|
+
rows: [["Snapshots", `${listed.local.length}, in the table below`]]
|
|
268
|
+
}
|
|
269
|
+
];
|
|
270
|
+
if (shared.kind === "not-listed")
|
|
271
|
+
return [{ heading: "Shared snapshot index", rows: [["Not listed", UNPICKED_TEXT[shared.why]]] }, ...local];
|
|
272
|
+
const now = Date.parse(listed.readAt);
|
|
273
|
+
const entries = shared.entries.toSorted(
|
|
274
|
+
(a, b) => Date.parse(b.createdAt) - Date.parse(a.createdAt) || a.sandboxName.localeCompare(b.sandboxName)
|
|
275
|
+
);
|
|
276
|
+
return [
|
|
277
|
+
{
|
|
278
|
+
heading: "Shared snapshot index",
|
|
279
|
+
rows: [
|
|
280
|
+
["Project", projectDisplayText(shared)],
|
|
281
|
+
...entries.length === 0 ? [["Entries", "none"]] : entries.map(
|
|
282
|
+
(entry) => [
|
|
283
|
+
`${entry.picked ? "\u25B8 " : ""}${short(entry.base)}`,
|
|
284
|
+
[
|
|
285
|
+
sharedStatusText(entry),
|
|
286
|
+
`created ${spanText(now - Date.parse(entry.createdAt))} ago`,
|
|
287
|
+
...entry.status === "ready" || entry.status === "expires-soon" ? [sharedExpiresText(entry, now)] : [],
|
|
288
|
+
...entry.snapshotId === null ? [] : [`snapshot ${entry.snapshotId}`]
|
|
289
|
+
].join(", ")
|
|
290
|
+
]
|
|
291
|
+
)
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
...local
|
|
295
|
+
];
|
|
296
|
+
}
|
|
142
297
|
var UNPICKED_TEXT = {
|
|
143
298
|
"no-checkout": "This directory is in no Git checkout, so storm can't say which snapshot a run starts from.",
|
|
144
|
-
"no-
|
|
145
|
-
"no-base": "No base ref of the runner
|
|
299
|
+
"no-runner": "No Vercel Sandbox runner applies here, so no run here starts from one of them.",
|
|
300
|
+
"no-base": "No base ref of the runner shares history with HEAD, so a run here can't pick a base."
|
|
146
301
|
};
|
|
147
302
|
function explanationOf(listed) {
|
|
148
303
|
if (listed.picking.kind === "none") return UNPICKED_TEXT[listed.picking.why];
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
-
const
|
|
304
|
+
const ofRunner = listed.local.filter((snapshot) => snapshot.reason !== "other-runner");
|
|
305
|
+
const sharedListed = listed.shared?.kind === "listed" ? listed.shared : null;
|
|
306
|
+
const sharedOwner = sharedListed === null ? null : `${sharedListed.teamId}/${sharedListed.projectId}`;
|
|
307
|
+
const sharedPick = sharedListed?.entries.find((entry) => entry.picked) ?? null;
|
|
308
|
+
const owners = [...new Set(ofRunner.map(({ teamId, projectId }) => `${teamId}/${projectId}`))];
|
|
309
|
+
if (sharedOwner !== null && sharedPick !== null && !owners.includes(sharedOwner)) owners.push(sharedOwner);
|
|
310
|
+
const building = listed.mergeBase === null ? "builds a runner snapshot" : `builds a runner snapshot at the merge-base (${short(listed.mergeBase)})`;
|
|
152
311
|
const lines = [];
|
|
153
|
-
if (owners.length === 0)
|
|
154
|
-
lines.push(
|
|
312
|
+
if (owners.length === 0) {
|
|
313
|
+
lines.push(
|
|
314
|
+
sharedListed === null ? `A run here ${building}: the local snapshot index holds no snapshot of runner ${listed.picking.runner}.` : `A run here ${building}: neither the local snapshot index nor the shared snapshot index holds a fitting snapshot of runner ${listed.picking.runner}.`
|
|
315
|
+
);
|
|
316
|
+
}
|
|
155
317
|
for (const owner of owners) {
|
|
156
318
|
const who = owners.length === 1 ? "A run here" : `A run here for team and project ${owner}`;
|
|
157
|
-
|
|
319
|
+
if (owner === sharedOwner && sharedPick !== null && sharedPick.snapshotId !== null) {
|
|
320
|
+
lines.push(
|
|
321
|
+
`${who} starts from ${sharedPick.snapshotId}, ${builtAtText({ base: sharedPick.base, builtBehind: sharedPick.builtBehind, mergeBase: listed.mergeBase ?? void 0 })}, from the shared snapshot index.`
|
|
322
|
+
);
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
const owned = ofRunner.filter((snapshot) => `${snapshot.teamId}/${snapshot.projectId}` === owner);
|
|
158
326
|
const pick = owned.find((snapshot) => snapshot.picked);
|
|
159
327
|
lines.push(
|
|
160
|
-
pick !== void 0 ? `${who} starts from ${pick.snapshotId}, ${builtAtText({ base: pick.base, builtBehind: pick.builtBehind, mergeBase: listed.mergeBase ?? void 0 })}.` : `${who} ${building}: no
|
|
328
|
+
pick !== void 0 ? `${who} starts from ${pick.snapshotId}, ${builtAtText({ base: pick.base, builtBehind: pick.builtBehind, mergeBase: listed.mergeBase ?? void 0 })}.` : `${who} ${building}: no snapshot fits.`
|
|
161
329
|
);
|
|
162
330
|
}
|
|
163
331
|
if (owners.length > 1) lines.push("The run's credential decides the team and project.");
|
|
164
|
-
const others =
|
|
165
|
-
(snapshot) => !snapshot.picked && snapshot.reason !== null && snapshot.reason !== "other-
|
|
332
|
+
const others = ofRunner.filter(
|
|
333
|
+
(snapshot) => !snapshot.picked && snapshot.reason !== null && snapshot.reason !== "other-runner"
|
|
166
334
|
);
|
|
167
335
|
for (const snapshot of others.slice(0, REJECTIONS_SHOWN))
|
|
168
336
|
lines.push(` ${snapshot.snapshotId}: ${rejectionText(snapshot.reason, snapshot)}`);
|
|
@@ -174,25 +342,26 @@ var outcomes = defineOutcomes({
|
|
|
174
342
|
results: {
|
|
175
343
|
listed: {
|
|
176
344
|
schema: listedSchema,
|
|
177
|
-
description: "The
|
|
345
|
+
description: "The runner snapshots in the local snapshot index (and, with --shared, the shared snapshot index), with the one a run here starts from marked; none is an empty list.",
|
|
178
346
|
render: (listed) => renderOutcome({
|
|
179
347
|
rows: [
|
|
180
|
-
["
|
|
181
|
-
...listed.picking.kind === "
|
|
348
|
+
["Local index", path(listed.directory)],
|
|
349
|
+
...listed.picking.kind === "runner" ? [["Runner", listed.picking.runner]] : [],
|
|
182
350
|
...listed.configFile === null ? [] : [["Config", path(listed.configFile)]]
|
|
183
351
|
],
|
|
184
|
-
...listed.
|
|
185
|
-
|
|
352
|
+
...listed.shared === null ? {} : { sections: sharedSections(listed) },
|
|
353
|
+
...listed.local.length === 0 ? {} : { table: tableOf(listed) },
|
|
354
|
+
message: listed.local.length === 0 && listed.picking.kind === "none" ? `No runner snapshots are in the local snapshot index. ${UNPICKED_TEXT[listed.picking.why]}` : explanationOf(listed),
|
|
186
355
|
...listed.unreadable.length === 0 ? {} : {
|
|
187
356
|
warnings: listed.unreadable.map(({ file, reason }) => ({
|
|
188
357
|
reason: "snapshot_file_unreadable",
|
|
189
|
-
message: `storm can't read the
|
|
358
|
+
message: `storm can't read the local snapshot index file ${file}: ${reason}. No run starts from it.`
|
|
190
359
|
}))
|
|
191
360
|
},
|
|
192
361
|
next: [
|
|
193
362
|
{
|
|
194
363
|
type: "text",
|
|
195
|
-
text: "storm snapshots build builds a
|
|
364
|
+
text: "storm snapshots build builds a runner snapshot at the merge-base without a test run."
|
|
196
365
|
}
|
|
197
366
|
]
|
|
198
367
|
})
|
|
@@ -201,6 +370,14 @@ var outcomes = defineOutcomes({
|
|
|
201
370
|
errors: {
|
|
202
371
|
invalidConfig: configErrors.invalidConfig,
|
|
203
372
|
...suiteNotFoundErrors,
|
|
373
|
+
missingTarget: credentialErrors.missingTarget,
|
|
374
|
+
...credentialSourceErrors,
|
|
375
|
+
runnerFailed: runErrors.runnerFailed,
|
|
376
|
+
sharedListFailed: sharedListFailedError({
|
|
377
|
+
description: "With --shared, the Vercel Sandbox API failed while storm listed the shared snapshot index.",
|
|
378
|
+
consequence: "",
|
|
379
|
+
next: "Run again, or drop --shared to list only the local snapshot index."
|
|
380
|
+
}),
|
|
204
381
|
launchMachineHasNoSnapshot: {
|
|
205
382
|
exitCode: 2,
|
|
206
383
|
description: "The effective runner is the launch machine, which has no runner snapshot.",
|
|
@@ -220,9 +397,9 @@ var outcomes = defineOutcomes({
|
|
|
220
397
|
]
|
|
221
398
|
})
|
|
222
399
|
},
|
|
223
|
-
|
|
400
|
+
localIndexUnreadable: {
|
|
224
401
|
exitCode: 1,
|
|
225
|
-
description: "storm couldn't read the
|
|
402
|
+
description: "storm couldn't read the local snapshot index directory.",
|
|
226
403
|
schema: z.object({
|
|
227
404
|
/** The directory the read failed on. */
|
|
228
405
|
path: z.string(),
|
|
@@ -230,13 +407,13 @@ var outcomes = defineOutcomes({
|
|
|
230
407
|
message: z.string()
|
|
231
408
|
}),
|
|
232
409
|
render: ({ path: where, message }) => ({
|
|
233
|
-
message: `Couldn't read the
|
|
410
|
+
message: `Couldn't read the local snapshot index: ${message}`,
|
|
234
411
|
rows: [["Path", where]]
|
|
235
412
|
})
|
|
236
413
|
},
|
|
237
414
|
checkoutFailed: {
|
|
238
415
|
exitCode: 1,
|
|
239
|
-
description: "git failed while storm checked the checkout or
|
|
416
|
+
description: "git failed while storm checked the checkout or an indexed snapshot's base, as a run here would refuse.",
|
|
240
417
|
schema: z.object({
|
|
241
418
|
/** What git said. */
|
|
242
419
|
message: z.string()
|
|
@@ -253,10 +430,13 @@ var outcomes = defineOutcomes({
|
|
|
253
430
|
var command_default = stormCommands.define({
|
|
254
431
|
requestSchema: z2.object({
|
|
255
432
|
suite: z2.string().min(1).optional(),
|
|
256
|
-
all: z2.boolean().default(false)
|
|
433
|
+
all: z2.boolean().default(false),
|
|
434
|
+
shared: z2.boolean().default(false),
|
|
435
|
+
...SNAPSHOT_ACCESS_FIELDS
|
|
257
436
|
}),
|
|
437
|
+
cli: SNAPSHOT_ACCESS_CLI,
|
|
258
438
|
response: outcomes,
|
|
259
|
-
handler: async ({ app }, request) => {
|
|
439
|
+
handler: async ({ app, ui, signal }, request) => {
|
|
260
440
|
const file = await app.config.loadFile();
|
|
261
441
|
if (!file.ok) return file.refusal;
|
|
262
442
|
if (request.suite !== void 0) {
|
|
@@ -270,19 +450,68 @@ var command_default = stormCommands.define({
|
|
|
270
450
|
if (runner?.kind === "launch-machine") {
|
|
271
451
|
return outcomes.launchMachineHasNoSnapshot({ suite: request.suite ?? null, configFile: file.path });
|
|
272
452
|
}
|
|
273
|
-
const
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
453
|
+
const settings = fileSettings(effective, request);
|
|
454
|
+
const chosen = request.shared ? settleSnapshotAccess(app, request.credential, settings, ui.progress) : null;
|
|
455
|
+
if (chosen !== null && !chosen.ok) return chosen.refusal;
|
|
456
|
+
const options = runner?.options;
|
|
457
|
+
const redact = redactor(declaredSecretValues(options, app.env));
|
|
458
|
+
const inspected = await inspectLocalSnapshotIndex(app.context, { cwd: app.cwd, options, all: request.all });
|
|
459
|
+
if (inspected.kind === "local-index-unreadable")
|
|
460
|
+
return outcomes.localIndexUnreadable({ path: inspected.path, message: inspected.message });
|
|
278
461
|
if (inspected.kind === "checkout-failed") return outcomes.checkoutFailed({ message: inspected.failure.message });
|
|
279
|
-
if (inspected.kind === "invalid-
|
|
462
|
+
if (inspected.kind === "invalid-runner") {
|
|
280
463
|
const prefix = request.suite === void 0 ? ["runner"] : ["suites", request.suite, "runner"];
|
|
281
464
|
return invalidConfig(file.path ?? "", [
|
|
282
465
|
{ key: [...prefix, ...inspected.path].join("."), location: null, problem: redact(inspected.problem) }
|
|
283
466
|
]);
|
|
284
467
|
}
|
|
285
468
|
const { inspection } = inspected;
|
|
469
|
+
let local = inspection.snapshots;
|
|
470
|
+
let shared = null;
|
|
471
|
+
if (chosen !== null) {
|
|
472
|
+
if (inspection.picking.kind === "none" || options === void 0 || inspection.snapshotKey === null || inspection.checkout === null || inspection.checkout.mergeBase === null) {
|
|
473
|
+
shared = {
|
|
474
|
+
kind: "not-listed",
|
|
475
|
+
why: inspection.picking.kind === "none" ? inspection.picking.why : "no-runner"
|
|
476
|
+
};
|
|
477
|
+
} else {
|
|
478
|
+
const obtained = await chosen.settled.obtain();
|
|
479
|
+
if (!obtained.ok) return obtained.refusal;
|
|
480
|
+
const { access, teamId, projectId, team, project } = obtained;
|
|
481
|
+
const listed = await listSharedSnapshots(
|
|
482
|
+
app.context,
|
|
483
|
+
{
|
|
484
|
+
access,
|
|
485
|
+
runner: options,
|
|
486
|
+
snapshotKey: inspection.snapshotKey
|
|
487
|
+
},
|
|
488
|
+
signal
|
|
489
|
+
);
|
|
490
|
+
if (listed.kind === "aborted")
|
|
491
|
+
return outcomes.canceled({ changed: "Nothing was changed: the list only reads the shared snapshot index." });
|
|
492
|
+
if (listed.kind === "failed")
|
|
493
|
+
return outcomes.sharedListFailed({ teamId, projectId, team, project, message: listed.message });
|
|
494
|
+
const picked = await pickSnapshotAcrossIndexes(app.context, {
|
|
495
|
+
repoRoot: inspection.checkout.repoRoot,
|
|
496
|
+
mergeBase: inspection.checkout.mergeBase.commit,
|
|
497
|
+
commitsAfterBase: inspection.checkout.mergeBase.commitsAfterBase,
|
|
498
|
+
owner: { teamId, projectId },
|
|
499
|
+
local: inspection.snapshots,
|
|
500
|
+
entries: listed.entries
|
|
501
|
+
});
|
|
502
|
+
if (picked.kind === "checkout-failed") return outcomes.checkoutFailed({ message: picked.failure.message });
|
|
503
|
+
local = picked.local;
|
|
504
|
+
shared = {
|
|
505
|
+
kind: "listed",
|
|
506
|
+
teamId,
|
|
507
|
+
projectId,
|
|
508
|
+
team,
|
|
509
|
+
project,
|
|
510
|
+
bucket: listed.bucket,
|
|
511
|
+
entries: picked.shared.map(sharedEntryFacts)
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
}
|
|
286
515
|
return outcomes.listed({
|
|
287
516
|
directory: inspection.directory,
|
|
288
517
|
configFile: file.path,
|
|
@@ -292,8 +521,9 @@ var command_default = stormCommands.define({
|
|
|
292
521
|
mergeBase: inspection.checkout?.mergeBase?.commit ?? null,
|
|
293
522
|
mergeBaseRef: inspection.checkout?.mergeBase?.ref ?? null,
|
|
294
523
|
readAt: app.context.clock.now().toISOString(),
|
|
295
|
-
|
|
296
|
-
unreadable: inspection.unreadable.map(({ file: name, reason }) => ({ file: name, reason }))
|
|
524
|
+
local: inTableOrder(local.map(snapshotFacts)),
|
|
525
|
+
unreadable: inspection.unreadable.map(({ file: name, reason }) => ({ file: name, reason })),
|
|
526
|
+
shared
|
|
297
527
|
});
|
|
298
528
|
}
|
|
299
529
|
});
|
|
@@ -3,6 +3,7 @@ export declare const metadata: {
|
|
|
3
3
|
summary: string;
|
|
4
4
|
aliases: string[];
|
|
5
5
|
help: {
|
|
6
|
+
usages: string[];
|
|
6
7
|
fields: {
|
|
7
8
|
suite: {
|
|
8
9
|
valueLabel: string;
|
|
@@ -11,6 +12,21 @@ export declare const metadata: {
|
|
|
11
12
|
all: {
|
|
12
13
|
description: string;
|
|
13
14
|
};
|
|
15
|
+
shared: {
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
credential: {
|
|
19
|
+
valueLabel: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
scope: {
|
|
23
|
+
valueLabel: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
project: {
|
|
27
|
+
valueLabel: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
14
30
|
};
|
|
15
31
|
examples: {
|
|
16
32
|
argv: string;
|
|
@@ -1,21 +1,44 @@
|
|
|
1
1
|
// src/commands/snapshots/list/metadata.ts
|
|
2
2
|
var metadata = {
|
|
3
|
-
description: "List the runner snapshots
|
|
4
|
-
summary: "List the
|
|
3
|
+
description: "List the runner snapshots in the local snapshot index on this machine, under ${XDG_STATE_HOME:-~/.local/state}/storm/runner/snapshots/, and mark the one a run here starts from. A runner snapshot is built at a base commit by the Vercel Sandbox runner's toolchain and prebuild steps: a run builds one at HEAD's merge-base with a base ref when nothing fits, and storm snapshots build builds one without a run. A run starts from the closest snapshot whose base is its merge-base or an ancestor of its merge-base, a commit behind it on the base ref, and whose snapshot steps and declared base files match the runner's at the merge-base; it never starts from one at a branch commit. By default it lists the snapshots of the Vercel Sandbox runner in the storm.config.ts found from the working directory; without one it lists every snapshot and marks none. Each row gives the snapshot's base (with HEAD when it is HEAD's commit, and not in history when HEAD's history doesn't hold it, as after an amend or a rebase), when it was created, when it expires, and its id. The lines after the table say why a run here starts from the marked one, or why it builds a runner snapshot, and why it starts from none of the others. It reads the local snapshot index, Git, and the runner's declared base files at the merge-base, as a run does: it mints no credential, starts nothing, and changes nothing. A git failure or an unreadable declared base file at the merge-base ends it with an error, as it would end a run here. With --shared it also obtains a credential, as storm snapshots build does, and lists the runner's entries in the shared snapshot index of the Vercel project under a Shared snapshot index heading: each entry's base, status, when it was created, when it expires, and its snapshot id, marking the winning snapshot across both the local snapshot index and the shared snapshot index. It changes nothing there.",
|
|
4
|
+
summary: "List runner snapshots in the local snapshot index (and optionally the shared snapshot index).",
|
|
5
5
|
aliases: ["ls"],
|
|
6
6
|
help: {
|
|
7
|
+
usages: ["[--suite <NAME>] [--all] [--shared [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>]]"],
|
|
7
8
|
fields: {
|
|
8
9
|
suite: {
|
|
9
10
|
valueLabel: "NAME",
|
|
10
|
-
description: "Inspect
|
|
11
|
+
description: "Inspect runner snapshots for the named suite's effective runner from storm.config.ts instead of the top-level runner."
|
|
11
12
|
},
|
|
12
13
|
all: {
|
|
13
|
-
description: "Also list the snapshots of other
|
|
14
|
+
description: "Also list the snapshots of other Vercel Sandbox runners, and of this runner's other regions and runtimes, with a RUNNER column. A run here starts from none of them."
|
|
15
|
+
},
|
|
16
|
+
shared: {
|
|
17
|
+
description: "Also list the runner's entries in the shared snapshot index of the Vercel project, which runs on every machine start from. It obtains a credential, reads the Vercel Sandbox API, and changes nothing there."
|
|
18
|
+
},
|
|
19
|
+
credential: {
|
|
20
|
+
valueLabel: "SOURCE",
|
|
21
|
+
description: "With --shared, the credential source: mint, the default, mints one with the vercel CLI for --scope and --project; vercel-oidc reads a pre-minted Vercel project OIDC token from VERCEL_OIDC_TOKEN and needs no --scope or --project. No config key."
|
|
22
|
+
},
|
|
23
|
+
scope: {
|
|
24
|
+
valueLabel: "TEAM",
|
|
25
|
+
description: "With --shared, the Vercel team whose project holds the shared snapshot index. Required with --credential mint, from this flag or scope in storm.config.ts; optional with --credential vercel-oidc."
|
|
26
|
+
},
|
|
27
|
+
project: {
|
|
28
|
+
valueLabel: "PROJECT",
|
|
29
|
+
description: "With --shared, the Vercel project, within the team, that holds the shared snapshot index. Required with --credential mint, from this flag or project in storm.config.ts; optional with --credential vercel-oidc."
|
|
14
30
|
}
|
|
15
31
|
},
|
|
16
32
|
examples: [
|
|
17
|
-
{
|
|
18
|
-
|
|
33
|
+
{
|
|
34
|
+
argv: "",
|
|
35
|
+
description: "List this runner's local snapshot index entries, and mark the one a run here starts from."
|
|
36
|
+
},
|
|
37
|
+
{ argv: "--all", description: "List every runner snapshot in the local snapshot index on this machine." },
|
|
38
|
+
{
|
|
39
|
+
argv: "--shared",
|
|
40
|
+
description: "Also list the runner's entries in the shared snapshot index of the Vercel project."
|
|
41
|
+
},
|
|
19
42
|
{
|
|
20
43
|
argv: "--json",
|
|
21
44
|
description: "List the snapshots as JSON, each with its commits and why a run here doesn't start from it."
|