@cnc-tools/storm 0.5.0 → 0.7.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/build-info.js +1 -1
- package/dist/combine-errors.js +2 -2
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/{run → exec}/cleanup.d.ts +1 -1
- package/dist/commands/{run → exec}/cleanup.js +1 -1
- package/dist/commands/{run/outcomes.d.ts → exec/command.d.ts} +103 -112
- package/dist/commands/exec/command.js +23 -0
- package/dist/commands/{run → exec}/job-summary.d.ts +5 -1
- package/dist/commands/{run → exec}/job-summary.js +5 -2
- package/dist/commands/{run → exec}/live-view.js +29 -13
- package/dist/commands/exec/metadata.d.ts +69 -0
- package/dist/commands/exec/metadata.js +55 -0
- package/dist/commands/{run → exec}/mint-failed.js +4 -4
- package/dist/commands/exec/outcomes.d.ts +664 -0
- package/dist/commands/exec/outcomes.js +347 -0
- package/dist/commands/{run → exec}/progress.d.ts +14 -2
- package/dist/commands/{run → exec}/progress.js +54 -9
- package/dist/commands/exec/run-command.d.ts +227 -0
- package/dist/commands/exec/run-command.js +696 -0
- package/dist/commands/exec/run-metadata.d.ts +59 -0
- package/dist/commands/exec/run-metadata.js +61 -0
- package/dist/commands/{run → exec}/run-record.d.ts +110 -5
- package/dist/commands/{run → exec}/run-record.js +57 -1
- package/dist/commands/exec/testserver-flags.d.ts +48 -0
- package/dist/commands/exec/testserver-flags.js +80 -0
- package/dist/commands/{run → exec}/view.js +36 -4
- package/dist/commands/runs/facts.d.ts +25 -0
- package/dist/commands/runs/facts.js +38 -5
- package/dist/commands/runs/list/command.d.ts +25 -0
- package/dist/commands/runs/list/outcomes.d.ts +25 -0
- package/dist/commands/runs/logs/metadata.js +1 -1
- package/dist/commands/runs/logs/outcomes.js +4 -1
- package/dist/commands/runs/past-run.d.ts +2 -2
- package/dist/commands/runs/past-run.js +2 -2
- package/dist/commands/runs/show/command.d.ts +25 -0
- package/dist/commands/runs/show/metadata.js +2 -2
- package/dist/commands/runs/show/outcomes.d.ts +25 -0
- package/dist/commands/runs/show/outcomes.js +37 -5
- package/dist/commands/vitest/command.d.ts +325 -0
- package/dist/commands/vitest/command.js +138 -0
- package/dist/commands/vitest/metadata.d.ts +69 -0
- package/dist/commands/vitest/metadata.js +35 -0
- package/dist/commands/vitest/outcomes.d.ts +298 -0
- package/dist/commands/vitest/outcomes.js +77 -0
- package/dist/config/index.d.ts +2 -1
- package/dist/config/index.js +1 -0
- package/dist/config/resolve.d.ts +3 -3
- package/dist/config/resolve.js +3 -3
- package/dist/config/resource-config.d.ts +2 -2
- package/dist/config/schema.d.ts +1 -1
- package/dist/config/set.d.ts +15 -4
- package/dist/config/set.js +28 -12
- package/dist/config-file/define.d.ts +8 -6
- package/dist/context.d.ts +6 -3
- package/dist/context.js +4 -2
- package/dist/core/command-provider.d.ts +1 -1
- package/dist/core/events.d.ts +9 -7
- package/dist/core/presentation.js +1 -1
- package/dist/core/presentations.js +1 -1
- package/dist/core/run-state.d.ts +30 -6
- package/dist/core/run-state.js +19 -4
- package/dist/core/run.d.ts +17 -4
- package/dist/core/run.js +61 -25
- package/dist/resources/testserver/command.d.ts +1 -1
- package/dist/resources/testserver/command.js +1 -1
- package/dist/resources/testserver/config.d.ts +1 -1
- package/dist/resources/testserver/config.js +3 -2
- package/dist/resources/testserver/credential-facts.js +1 -1
- package/dist/resources/testserver/resource.d.ts +2 -2
- package/dist/resources/testserver/sandbox/create.d.ts +2 -2
- package/dist/resources/testserver/sandbox/create.js +2 -2
- package/dist/resources.d.ts +9 -6
- package/dist/resources.js +3 -3
- package/dist/runner/events.d.ts +64 -1
- package/dist/runner/gateways.d.ts +17 -6
- package/dist/runner/index.d.ts +5 -4
- package/dist/runner/index.js +4 -3
- package/dist/runner/live/snapshot-records.js +18 -4
- package/dist/runner/prepare.d.ts +23 -4
- package/dist/runner/prepare.js +13 -3
- package/dist/runner/ready.d.ts +7 -3
- package/dist/runner/ready.js +11 -5
- package/dist/runner/scope.d.ts +17 -1
- package/dist/runner/scope.js +4 -0
- package/dist/runner/snapshot-build.d.ts +3 -1
- package/dist/runner/snapshot-build.js +12 -2
- package/dist/runner/snapshot-cache.d.ts +46 -8
- package/dist/runner/snapshot-cache.js +60 -11
- package/dist/runner/snapshot-key.d.ts +12 -1
- package/dist/runner/snapshot-key.js +17 -1
- package/dist/runner/snapshot-save.d.ts +53 -0
- package/dist/runner/snapshot-save.js +148 -0
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/payload/payload.d.ts +2 -2
- package/dist/sdk/payload/payload.js +2 -2
- package/dist/story/align.d.ts +1 -1
- package/dist/story/align.js +1 -1
- package/dist/story/definition.d.ts +22 -15
- package/dist/story/definition.js +2 -2
- package/dist/story/errors.js +1 -1
- package/dist/story/gateways.d.ts +45 -25
- package/dist/story/gateways.js +2 -2
- package/dist/story/host.d.ts +11 -8
- package/dist/story/host.js +37 -37
- package/dist/story/index.d.ts +1 -1
- package/dist/story/index.js +4 -4
- package/dist/story/json.d.ts +1 -1
- package/dist/story/json.js +2 -2
- package/dist/story/live/recording-gateway.d.ts +2 -0
- package/dist/story/live/{artifact-gateway.js → recording-gateway.js} +33 -12
- package/dist/story/mode.d.ts +2 -2
- package/dist/story/mode.js +1 -1
- package/dist/story/orphans.d.ts +23 -5
- package/dist/story/orphans.js +44 -8
- package/dist/story/recording.d.ts +62 -0
- package/dist/story/{artifact.js → recording.js} +31 -27
- package/dist/story/report.d.ts +21 -9
- package/dist/story/report.js +37 -25
- package/dist/story/settle.d.ts +23 -21
- package/dist/story/settle.js +17 -16
- package/dist/story/{run.d.ts → start.d.ts} +18 -17
- package/dist/story/{run.js → start.js} +66 -43
- package/dist/vercel-cli/driver.d.ts +1 -1
- package/dist/vercel-cli/entry.d.ts +1 -1
- package/dist/vercel-cli/entry.js +1 -1
- package/dist/vercel-cli/verbose.d.ts +2 -2
- package/dist/vercel-cli/verbose.js +2 -2
- package/dist/vitest/config.d.ts +5 -5
- package/dist/vitest/config.js +5 -5
- package/dist/vitest/find-vitest.d.ts +7 -0
- package/dist/vitest/find-vitest.js +28 -0
- package/dist/vitest/fixtures.d.ts +2 -2
- package/dist/vitest/fixtures.js +3 -3
- package/dist/vitest/gateways.d.ts +37 -6
- package/dist/vitest/gateways.js +3 -2
- package/dist/vitest/live/list-gateway.d.ts +7 -3
- package/dist/vitest/live/list-gateway.js +55 -8
- package/dist/vitest/plan.d.ts +41 -8
- package/dist/vitest/plan.js +47 -16
- package/dist/vitest/sandbox.d.ts +1 -1
- package/dist/vitest/sandbox.js +1 -1
- package/dist/vitest/test-events.d.ts +2 -2
- package/dist/vitest/test-events.js +3 -3
- package/dist/vitest/test-results.d.ts +1 -1
- package/dist/vitest/test-results.js +1 -1
- package/dist/vitest/types.d.ts +1 -1
- package/package.json +2 -2
- package/skills/overview.md +5 -4
- package/skills/read-run-output.md +1 -1
- package/dist/commands/run/command.d.ts +0 -327
- package/dist/commands/run/command.js +0 -620
- package/dist/commands/run/metadata.d.ts +0 -47
- package/dist/commands/run/metadata.js +0 -83
- package/dist/commands/run/outcomes.js +0 -332
- package/dist/story/artifact.d.ts +0 -60
- package/dist/story/live/artifact-gateway.d.ts +0 -2
- /package/dist/commands/{run → exec}/live-view.d.ts +0 -0
- /package/dist/commands/{run → exec}/mint-failed.d.ts +0 -0
- /package/dist/commands/{run → exec}/redaction.d.ts +0 -0
- /package/dist/commands/{run → exec}/redaction.js +0 -0
- /package/dist/commands/{run → exec}/run-collector.d.ts +0 -0
- /package/dist/commands/{run → exec}/run-collector.js +0 -0
- /package/dist/commands/{run → exec}/tests-summary.d.ts +0 -0
- /package/dist/commands/{run → exec}/tests-summary.js +0 -0
- /package/dist/commands/{run → exec}/text.d.ts +0 -0
- /package/dist/commands/{run → exec}/text.js +0 -0
- /package/dist/commands/{run → exec}/view.d.ts +0 -0
- /package/dist/commands/{run → exec}/waterfall.d.ts +0 -0
- /package/dist/commands/{run → exec}/waterfall.js +0 -0
- /package/dist/commands/{run → exec}/worker-chart.d.ts +0 -0
- /package/dist/commands/{run → exec}/worker-chart.js +0 -0
|
@@ -4,7 +4,7 @@ import { muted } from "@cnc-tools/cli-kit/clinkr";
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { RESOURCE_REPORTS } from "../../resources.js";
|
|
6
6
|
import { sandboxPage, snapshotPage } from "../dashboard.js";
|
|
7
|
-
import { isoSecondsText, seconds, short } from "../
|
|
7
|
+
import { isoSecondsText, seconds, short } from "../exec/text.js";
|
|
8
8
|
/**
|
|
9
9
|
* The run logs `runs logs` prints and `runs show` names: the command log (`command`), then each step's, in the order a
|
|
10
10
|
* person looks for them.
|
|
@@ -69,8 +69,40 @@ export const runFactsSchema = z.object({
|
|
|
69
69
|
keptUntil: z.string().nullable(),
|
|
70
70
|
/** How many whole minutes are left until keptUntil, as of reading the run, 0 once it has passed; null when keptUntil is. */
|
|
71
71
|
keptMinutesLeft: z.number().nullable(),
|
|
72
|
-
/** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, and its page in the Vercel dashboard. Null until known. */
|
|
73
|
-
snapshot: z
|
|
72
|
+
/** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, for a branch snapshot the branch and HEAD commit of the run that saved it (each null for a base snapshot), and its page in the Vercel dashboard. Null until known. */
|
|
73
|
+
snapshot: z
|
|
74
|
+
.object({
|
|
75
|
+
id: z.string(),
|
|
76
|
+
base: z.string(),
|
|
77
|
+
built: z.boolean(),
|
|
78
|
+
branch: z.string().nullable(),
|
|
79
|
+
head: z.string().nullable(),
|
|
80
|
+
url: z.string(),
|
|
81
|
+
})
|
|
82
|
+
.nullable(),
|
|
83
|
+
/** How saving the runner sandbox as a branch snapshot ended (--save-snapshot), as the run's ran result's runner.save says, with the saved snapshot's page in the Vercel dashboard (`url`, null unless saved); null without the flag. */
|
|
84
|
+
save: z
|
|
85
|
+
.discriminatedUnion("kind", [
|
|
86
|
+
z.object({
|
|
87
|
+
kind: z.literal("saved"),
|
|
88
|
+
snapshotId: z.string(),
|
|
89
|
+
base: z.string(),
|
|
90
|
+
branch: z.string(),
|
|
91
|
+
head: z.string(),
|
|
92
|
+
ms: z.number(),
|
|
93
|
+
sizeBytes: z.number(),
|
|
94
|
+
entryWritten: z.boolean(),
|
|
95
|
+
url: z.string(),
|
|
96
|
+
}),
|
|
97
|
+
z.object({ kind: z.literal("skipped"), reason: z.literal("detached-head") }),
|
|
98
|
+
z.object({
|
|
99
|
+
kind: z.literal("failed"),
|
|
100
|
+
step: z.enum(["scrub", "save-snapshot"]),
|
|
101
|
+
message: z.string(),
|
|
102
|
+
}),
|
|
103
|
+
z.object({ kind: z.literal("stopped") }),
|
|
104
|
+
])
|
|
105
|
+
.nullable(),
|
|
74
106
|
}),
|
|
75
107
|
])
|
|
76
108
|
.nullable(),
|
|
@@ -91,7 +123,7 @@ export const runFactsSchema = z.object({
|
|
|
91
123
|
tests: z.object({ passed: z.number(), failed: z.number(), skipped: z.number() }).nullable(),
|
|
92
124
|
/** Why its test results may be incomplete: a runner run's read of its test events file, once the command ended, failed with this message; null otherwise. */
|
|
93
125
|
testsIncomplete: z.string().nullable(),
|
|
94
|
-
/** What each resource it acquired reported, as a
|
|
126
|
+
/** What each resource it acquired reported, as a run's `ran` result's `resources`, such as the Testserver sandboxes and their log viewer URLs; null unless its command ran, or when unknown. */
|
|
95
127
|
resources: RESOURCE_REPORTS.ranSchema.nullable(),
|
|
96
128
|
})
|
|
97
129
|
.nullable(),
|
|
@@ -124,12 +156,13 @@ export function runFacts(run, now) {
|
|
|
124
156
|
function whereFacts(where, now) {
|
|
125
157
|
if (where.kind === "local")
|
|
126
158
|
return { kind: "local" };
|
|
127
|
-
const { sandbox, snapshot, keptUntil } = where;
|
|
159
|
+
const { sandbox, snapshot, keptUntil, save } = where;
|
|
128
160
|
return {
|
|
129
161
|
...where,
|
|
130
162
|
keptMinutesLeft: keptUntil === null ? null : Math.max(0, Math.floor((Date.parse(keptUntil) - now.getTime()) / 60_000)),
|
|
131
163
|
sandboxUrl: sandbox === null ? null : sandboxPage(where, sandbox),
|
|
132
164
|
snapshot: snapshot === null ? null : { ...snapshot, url: snapshotPage(where, snapshot.id) },
|
|
165
|
+
save: save?.kind === "saved" ? { ...save, url: snapshotPage(where, save.snapshotId) } : save,
|
|
133
166
|
};
|
|
134
167
|
}
|
|
135
168
|
/** `scope` as the result reports it. */
|
|
@@ -53,8 +53,33 @@ export declare function command(cmd: CommandBuilder<StormApp>): import("@vercel/
|
|
|
53
53
|
id: z.ZodString;
|
|
54
54
|
base: z.ZodString;
|
|
55
55
|
built: z.ZodBoolean;
|
|
56
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
57
|
+
head: z.ZodNullable<z.ZodString>;
|
|
56
58
|
url: z.ZodString;
|
|
57
59
|
}, z.core.$strip>>;
|
|
60
|
+
save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
61
|
+
kind: z.ZodLiteral<"saved">;
|
|
62
|
+
snapshotId: z.ZodString;
|
|
63
|
+
base: z.ZodString;
|
|
64
|
+
branch: z.ZodString;
|
|
65
|
+
head: z.ZodString;
|
|
66
|
+
ms: z.ZodNumber;
|
|
67
|
+
sizeBytes: z.ZodNumber;
|
|
68
|
+
entryWritten: z.ZodBoolean;
|
|
69
|
+
url: z.ZodString;
|
|
70
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
+
kind: z.ZodLiteral<"skipped">;
|
|
72
|
+
reason: z.ZodLiteral<"detached-head">;
|
|
73
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
74
|
+
kind: z.ZodLiteral<"failed">;
|
|
75
|
+
step: z.ZodEnum<{
|
|
76
|
+
"save-snapshot": "save-snapshot";
|
|
77
|
+
scrub: "scrub";
|
|
78
|
+
}>;
|
|
79
|
+
message: z.ZodString;
|
|
80
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
81
|
+
kind: z.ZodLiteral<"stopped">;
|
|
82
|
+
}, z.core.$strip>], "kind">>;
|
|
58
83
|
}, z.core.$strip>], "kind">>;
|
|
59
84
|
git: z.ZodNullable<z.ZodObject<{
|
|
60
85
|
branch: z.ZodNullable<z.ZodString>;
|
|
@@ -41,8 +41,33 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
41
41
|
id: z.ZodString;
|
|
42
42
|
base: z.ZodString;
|
|
43
43
|
built: z.ZodBoolean;
|
|
44
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
45
|
+
head: z.ZodNullable<z.ZodString>;
|
|
44
46
|
url: z.ZodString;
|
|
45
47
|
}, z.core.$strip>>;
|
|
48
|
+
save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
49
|
+
kind: z.ZodLiteral<"saved">;
|
|
50
|
+
snapshotId: z.ZodString;
|
|
51
|
+
base: z.ZodString;
|
|
52
|
+
branch: z.ZodString;
|
|
53
|
+
head: z.ZodString;
|
|
54
|
+
ms: z.ZodNumber;
|
|
55
|
+
sizeBytes: z.ZodNumber;
|
|
56
|
+
entryWritten: z.ZodBoolean;
|
|
57
|
+
url: z.ZodString;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
kind: z.ZodLiteral<"skipped">;
|
|
60
|
+
reason: z.ZodLiteral<"detached-head">;
|
|
61
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
62
|
+
kind: z.ZodLiteral<"failed">;
|
|
63
|
+
step: z.ZodEnum<{
|
|
64
|
+
"save-snapshot": "save-snapshot";
|
|
65
|
+
scrub: "scrub";
|
|
66
|
+
}>;
|
|
67
|
+
message: z.ZodString;
|
|
68
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
+
kind: z.ZodLiteral<"stopped">;
|
|
70
|
+
}, z.core.$strip>], "kind">>;
|
|
46
71
|
}, z.core.$strip>], "kind">>;
|
|
47
72
|
git: z.ZodNullable<z.ZodObject<{
|
|
48
73
|
branch: z.ZodNullable<z.ZodString>;
|
|
@@ -5,7 +5,7 @@ export const metadata = {
|
|
|
5
5
|
fields: {
|
|
6
6
|
id: {
|
|
7
7
|
valueLabel: "id",
|
|
8
|
-
description: "The run id, such as 20261103T192655-8277, which `storm
|
|
8
|
+
description: "The run id, such as 20261103T192655-8277, which `storm vitest`, `storm exec` and `storm runs list` print.",
|
|
9
9
|
},
|
|
10
10
|
step: {
|
|
11
11
|
valueLabel: "STEP",
|
|
@@ -43,7 +43,10 @@ export const outcomes = defineOutcomes({
|
|
|
43
43
|
},
|
|
44
44
|
],
|
|
45
45
|
}
|
|
46
|
-
: {
|
|
46
|
+
: {
|
|
47
|
+
message: "Couldn't find a run.",
|
|
48
|
+
next: [{ type: "text", text: "Start one with storm vitest or storm exec." }],
|
|
49
|
+
},
|
|
47
50
|
},
|
|
48
51
|
logNotFound: {
|
|
49
52
|
exitCode: 1,
|
|
@@ -2,8 +2,8 @@ import type { z } from "zod";
|
|
|
2
2
|
import type { ListedRunDirectory, PastRunDirectory } from "../../core/index.ts";
|
|
3
3
|
import type { StormTimeline } from "../../resources.ts";
|
|
4
4
|
import { type TestEvent, type TestResultEvent } from "../../sdk/index.ts";
|
|
5
|
-
import { timelineSchema } from "../
|
|
6
|
-
import { type RunRecord } from "../
|
|
5
|
+
import { timelineSchema } from "../exec/outcomes.ts";
|
|
6
|
+
import { type RunRecord } from "../exec/run-record.ts";
|
|
7
7
|
/**
|
|
8
8
|
* Which runs a command sees: those of the config file `storm.config.ts` the working directory finds, or every run,
|
|
9
9
|
* by `--all` or because no config file was found.
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// what the run directory gateway read. Files it can't read, or from an older storm, leave facts unknown, never
|
|
4
4
|
// an error.
|
|
5
5
|
import { parseTestEvent } from "../../sdk/index.js";
|
|
6
|
-
import { timelineSchema } from "../
|
|
7
|
-
import { parseRunRecord } from "../
|
|
6
|
+
import { timelineSchema } from "../exec/outcomes.js";
|
|
7
|
+
import { parseRunRecord } from "../exec/run-record.js";
|
|
8
8
|
/** The scope for `--all` and the config file found from the working directory, if any. */
|
|
9
9
|
export function runScope(all, configFile) {
|
|
10
10
|
if (all)
|
|
@@ -40,8 +40,33 @@ export declare function command(cmd: CommandBuilder<StormApp>): import("@vercel/
|
|
|
40
40
|
id: z.ZodString;
|
|
41
41
|
base: z.ZodString;
|
|
42
42
|
built: z.ZodBoolean;
|
|
43
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
44
|
+
head: z.ZodNullable<z.ZodString>;
|
|
43
45
|
url: z.ZodString;
|
|
44
46
|
}, z.core.$strip>>;
|
|
47
|
+
save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
48
|
+
kind: z.ZodLiteral<"saved">;
|
|
49
|
+
snapshotId: z.ZodString;
|
|
50
|
+
base: z.ZodString;
|
|
51
|
+
branch: z.ZodString;
|
|
52
|
+
head: z.ZodString;
|
|
53
|
+
ms: z.ZodNumber;
|
|
54
|
+
sizeBytes: z.ZodNumber;
|
|
55
|
+
entryWritten: z.ZodBoolean;
|
|
56
|
+
url: z.ZodString;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
kind: z.ZodLiteral<"skipped">;
|
|
59
|
+
reason: z.ZodLiteral<"detached-head">;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
+
kind: z.ZodLiteral<"failed">;
|
|
62
|
+
step: z.ZodEnum<{
|
|
63
|
+
"save-snapshot": "save-snapshot";
|
|
64
|
+
scrub: "scrub";
|
|
65
|
+
}>;
|
|
66
|
+
message: z.ZodString;
|
|
67
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
+
kind: z.ZodLiteral<"stopped">;
|
|
69
|
+
}, z.core.$strip>], "kind">>;
|
|
45
70
|
}, z.core.$strip>], "kind">>;
|
|
46
71
|
git: z.ZodNullable<z.ZodObject<{
|
|
47
72
|
branch: z.ZodNullable<z.ZodString>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export const metadata = {
|
|
2
|
-
description: "Show a past run from its run directory: its command, config file, working directory, the branch and commit it started from, start, how long it took and how it ended; where its command ran, on this machine or in a runner sandbox, with the sandbox's name, region, vCPUs, runtime and page in the Vercel dashboard, until when the run kept it running, with its Connect page while it runs, its control plane team and project, the run's base and the runner snapshot it started from, with its page; each Testserver sandbox it used, with its log viewer URL; the run logs it has, each with the storm runs logs command that prints it; its waterfall; and each test's final result, in color on a terminal that takes it. With --failed or --test, only the selected tests, how many of all they are, and each one's errors and test output, the last 8 MiB of what it printed, failure reports included. Without an id, the newest finished run of the storm.config.ts found from the working directory, or of every config with --all; pass the id `storm
|
|
2
|
+
description: "Show a past run from its run directory: its command, config file, working directory, the branch and commit it started from, start, how long it took and how it ended; where its command ran, on this machine or in a runner sandbox, with the sandbox's name, region, vCPUs, runtime and page in the Vercel dashboard, until when the run kept it running, with its Connect page while it runs, its control plane team and project, the run's base and the runner snapshot it started from, with a branch snapshot's branch and commit, and its page, and the branch snapshot the run saved, with its page, or why it saved none; each Testserver sandbox it used, with its log viewer URL; the run logs it has, each with the storm runs logs command that prints it; its waterfall; and each test's final result, in color on a terminal that takes it. With --failed or --test, only the selected tests, how many of all they are, and each one's errors and test output, the last 8 MiB of what it printed, failure reports included. Without an id, the newest finished run of the storm.config.ts found from the working directory, or of every config with --all; pass the id `storm vitest` or `storm exec` printed when another run may have finished since. A run's test results are saved once it finishes. Changes nothing.",
|
|
3
3
|
summary: "Show a past run and its tests.",
|
|
4
4
|
usages: ["[<id>] [--failed] [--test <TEXT>] [--all]"],
|
|
5
5
|
fields: {
|
|
6
6
|
id: {
|
|
7
7
|
valueLabel: "id",
|
|
8
|
-
description: "The run id, such as 20261103T192655-8277, which `storm
|
|
8
|
+
description: "The run id, such as 20261103T192655-8277, which `storm vitest`, `storm exec` and `storm runs list` print.",
|
|
9
9
|
},
|
|
10
10
|
failed: { description: "Show each failed test's errors and test output." },
|
|
11
11
|
test: {
|
|
@@ -28,8 +28,33 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
28
28
|
id: z.ZodString;
|
|
29
29
|
base: z.ZodString;
|
|
30
30
|
built: z.ZodBoolean;
|
|
31
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
32
|
+
head: z.ZodNullable<z.ZodString>;
|
|
31
33
|
url: z.ZodString;
|
|
32
34
|
}, z.core.$strip>>;
|
|
35
|
+
save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
36
|
+
kind: z.ZodLiteral<"saved">;
|
|
37
|
+
snapshotId: z.ZodString;
|
|
38
|
+
base: z.ZodString;
|
|
39
|
+
branch: z.ZodString;
|
|
40
|
+
head: z.ZodString;
|
|
41
|
+
ms: z.ZodNumber;
|
|
42
|
+
sizeBytes: z.ZodNumber;
|
|
43
|
+
entryWritten: z.ZodBoolean;
|
|
44
|
+
url: z.ZodString;
|
|
45
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
46
|
+
kind: z.ZodLiteral<"skipped">;
|
|
47
|
+
reason: z.ZodLiteral<"detached-head">;
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
kind: z.ZodLiteral<"failed">;
|
|
50
|
+
step: z.ZodEnum<{
|
|
51
|
+
"save-snapshot": "save-snapshot";
|
|
52
|
+
scrub: "scrub";
|
|
53
|
+
}>;
|
|
54
|
+
message: z.ZodString;
|
|
55
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
+
kind: z.ZodLiteral<"stopped">;
|
|
57
|
+
}, z.core.$strip>], "kind">>;
|
|
33
58
|
}, z.core.$strip>], "kind">>;
|
|
34
59
|
git: z.ZodNullable<z.ZodObject<{
|
|
35
60
|
branch: z.ZodNullable<z.ZodString>;
|
|
@@ -3,9 +3,9 @@ import { bold, paint } from "@cnc-tools/cli-kit/theme";
|
|
|
3
3
|
import { defineOutcomes } from "@vercel/clinkr";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { RESOURCE_REPORTS } from "../../../resources.js";
|
|
6
|
-
import { timelineSchema } from "../../
|
|
7
|
-
import { short } from "../../
|
|
8
|
-
import { waterfallLines } from "../../
|
|
6
|
+
import { timelineSchema } from "../../exec/outcomes.js";
|
|
7
|
+
import { short } from "../../exec/text.js";
|
|
8
|
+
import { waterfallLines } from "../../exec/waterfall.js";
|
|
9
9
|
import { commandText, exitText, exitTone, gitText, keptText, LOG_STEPS, runFactsSchema, runNotFound, runsUnreadable, scopeSchema, startedText, tookText, totalsText, totalsTone, } from "../facts.js";
|
|
10
10
|
import { timelineFromFacts } from "../past-run.js";
|
|
11
11
|
const testSchema = z.object({
|
|
@@ -75,7 +75,10 @@ export const outcomes = defineOutcomes({
|
|
|
75
75
|
},
|
|
76
76
|
],
|
|
77
77
|
}
|
|
78
|
-
: {
|
|
78
|
+
: {
|
|
79
|
+
message: "Couldn't find a finished run.",
|
|
80
|
+
next: [{ type: "text", text: "Start one with storm vitest or storm exec." }],
|
|
81
|
+
},
|
|
79
82
|
},
|
|
80
83
|
},
|
|
81
84
|
});
|
|
@@ -228,11 +231,40 @@ function whereRows(shown) {
|
|
|
228
231
|
: [
|
|
229
232
|
[
|
|
230
233
|
"Snapshot",
|
|
231
|
-
[
|
|
234
|
+
[
|
|
235
|
+
`${snapshot.id} of ${short(snapshot.base)}, ${snapshot.built ? "built" : "reused"}${snapshot.branch === null || snapshot.head === null ? "" : `, branch ${snapshot.branch} at ${short(snapshot.head)}`}`,
|
|
236
|
+
` ${snapshot.url}`,
|
|
237
|
+
],
|
|
232
238
|
],
|
|
233
239
|
]),
|
|
240
|
+
...saveRows(where.save),
|
|
234
241
|
];
|
|
235
242
|
}
|
|
243
|
+
/** Each step of a branch snapshot's save, as a person names it. */
|
|
244
|
+
const SAVE_STEPS = { scrub: "scrub", "save-snapshot": "save" };
|
|
245
|
+
/** The row for the branch snapshot the run saved the runner sandbox as, or why it didn't; none without the flag. */
|
|
246
|
+
function saveRows(save) {
|
|
247
|
+
if (save === null)
|
|
248
|
+
return [];
|
|
249
|
+
switch (save.kind) {
|
|
250
|
+
case "saved":
|
|
251
|
+
return [
|
|
252
|
+
[
|
|
253
|
+
"Saved",
|
|
254
|
+
[
|
|
255
|
+
`${save.snapshotId} of ${short(save.base)}, branch ${save.branch} at ${short(save.head)}${save.entryWritten ? "" : ", not in the cache"}`,
|
|
256
|
+
` ${save.url}`,
|
|
257
|
+
],
|
|
258
|
+
],
|
|
259
|
+
];
|
|
260
|
+
case "skipped":
|
|
261
|
+
return [["Saved", { text: "nothing: HEAD was detached", tone: "muted" }]];
|
|
262
|
+
case "failed":
|
|
263
|
+
return [["Saved", { text: `nothing: the ${SAVE_STEPS[save.step]} failed: ${save.message}`, tone: "muted" }]];
|
|
264
|
+
case "stopped":
|
|
265
|
+
return [["Saved", { text: "nothing: the run stopped", tone: "muted" }]];
|
|
266
|
+
}
|
|
267
|
+
}
|
|
236
268
|
/**
|
|
237
269
|
* The row for the runner sandbox the run kept running, if it did: until when, in success while it still runs, with its
|
|
238
270
|
* Connect page in the Vercel dashboard, or muted once it has stopped.
|