@cnc-tools/storm 0.5.0 → 0.6.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} +77 -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/exec/metadata.d.ts +66 -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 +614 -0
- package/dist/commands/exec/outcomes.js +338 -0
- package/dist/commands/exec/run-command.d.ts +221 -0
- package/dist/commands/exec/run-command.js +663 -0
- package/dist/commands/exec/run-metadata.d.ts +56 -0
- package/dist/commands/exec/run-metadata.js +58 -0
- package/dist/commands/{run → exec}/run-record.d.ts +27 -1
- package/dist/commands/{run → exec}/run-record.js +8 -0
- package/dist/commands/exec/testserver-flags.d.ts +48 -0
- package/dist/commands/exec/testserver-flags.js +80 -0
- package/dist/commands/runs/facts.js +2 -2
- 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/metadata.js +2 -2
- package/dist/commands/runs/show/outcomes.js +7 -4
- package/dist/commands/vitest/command.d.ts +299 -0
- package/dist/commands/vitest/command.js +138 -0
- package/dist/commands/vitest/metadata.d.ts +66 -0
- package/dist/commands/vitest/metadata.js +35 -0
- package/dist/commands/vitest/outcomes.d.ts +273 -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/presentation.js +1 -1
- package/dist/core/presentations.js +1 -1
- 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/sdk/index.js +1 -1
- package/dist/sdk/payload/payload.d.ts +2 -2
- package/dist/sdk/payload/payload.js +2 -2
- 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/commands/{run → exec}/live-view.d.ts +0 -0
- /package/dist/commands/{run → exec}/live-view.js +0 -0
- /package/dist/commands/{run → exec}/mint-failed.d.ts +0 -0
- /package/dist/commands/{run → exec}/progress.d.ts +0 -0
- /package/dist/commands/{run → exec}/progress.js +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}/view.js +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
package/dist/build-info.js
CHANGED
package/dist/combine-errors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// One record of named errors, or of error definitions, from several, for a command's `defineOutcomes`:
|
|
2
|
-
//
|
|
1
|
+
// One record of named errors, or of error definitions, from several, for a command's `defineOutcomes`: `exec` and
|
|
2
|
+
// `vitest` list every resource's errors this way, and define every resource's refusal errors from their combined
|
|
3
3
|
// definitions. Spreading the records would keep the last of two errors with the same key without a word, so this
|
|
4
4
|
// refuses a key two records share. It moves into Clinkr once a second consumer needs it.
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The Vercel dashboard's pages for a runner run's sandboxes and snapshots, which
|
|
1
|
+
// The Vercel dashboard's pages for a runner run's sandboxes and snapshots, which a run and `storm runs`
|
|
2
2
|
// link to. Each URL takes the control plane team's slug, which `--scope` names, and the project's name.
|
|
3
3
|
/** The project's page in the Vercel dashboard. */
|
|
4
4
|
function projectPage({ team, project }) {
|
|
@@ -108,7 +108,7 @@ export type WithCleanup<R> = {
|
|
|
108
108
|
]>;
|
|
109
109
|
};
|
|
110
110
|
/**
|
|
111
|
-
* A resource's refusal errors, as
|
|
111
|
+
* A resource's refusal errors, as `exec` and `vitest` list and return them: each defined with the run's cleanup beside
|
|
112
112
|
* its own data (`errors`), and `build`, the one a refusal fact names, with the run's cleanup.
|
|
113
113
|
*/
|
|
114
114
|
export interface CleanupReporting<R> {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// run's sandboxes and releasing each resource the run held couldn't do. The run owns it, not a resource: every outcome
|
|
3
3
|
// after the run starts acquiring carries it as `cleanup`, with `runner` (the runner sandbox a runner run kept running
|
|
4
4
|
// or couldn't keep, and the sandboxes it couldn't stop or delete; null with --local) and
|
|
5
|
-
// `resources` (each held resource's cleanup facts, by name, from its cleanup report).
|
|
5
|
+
// `resources` (each held resource's cleanup facts, by name, from its cleanup report). A run's own outcomes
|
|
6
6
|
// declare `cleanup` in their schemas; a resource's refusal errors don't know it, so a resource hands their definitions,
|
|
7
7
|
// and the registry defines them through `withCleanup`, with `cleanup` beside each one's data, and builds the one a
|
|
8
8
|
// refusal names with the run's cleanup.
|
|
@@ -1,57 +1,30 @@
|
|
|
1
|
+
import type { CommandBuilder } from "@vercel/clinkr";
|
|
1
2
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
failed: "failed";
|
|
19
|
-
stopped: "stopped";
|
|
20
|
-
unfinished: "unfinished";
|
|
21
|
-
}>;
|
|
22
|
-
steps: z.ZodArray<z.ZodObject<{
|
|
23
|
-
name: z.ZodEnum<{
|
|
24
|
-
[x: string]: string;
|
|
25
|
-
}>;
|
|
26
|
-
startMs: z.ZodNumber;
|
|
27
|
-
endMs: z.ZodNumber;
|
|
28
|
-
outcome: z.ZodEnum<{
|
|
29
|
-
done: "done";
|
|
30
|
-
failed: "failed";
|
|
31
|
-
stopped: "stopped";
|
|
32
|
-
unfinished: "unfinished";
|
|
33
|
-
}>;
|
|
34
|
-
}, z.core.$strip>>;
|
|
35
|
-
idleMs: z.ZodNumber;
|
|
36
|
-
snapshot: z.ZodOptional<z.ZodEnum<{
|
|
37
|
-
built: "built";
|
|
38
|
-
reused: "reused";
|
|
39
|
-
}>>;
|
|
40
|
-
sandboxes: z.ZodOptional<z.ZodObject<{
|
|
41
|
-
reused: z.ZodNumber;
|
|
42
|
-
created: z.ZodNumber;
|
|
43
|
-
}, z.core.$strip>>;
|
|
44
|
-
}, z.core.$strip>>;
|
|
45
|
-
criticalPath: z.ZodArray<z.ZodEnum<{
|
|
46
|
-
cleanup: "cleanup";
|
|
3
|
+
import type { StormApp } from "../../context.ts";
|
|
4
|
+
/**
|
|
5
|
+
* `storm exec`: runs any command, the argument list after `--`, as it is, in a run (`runCommand`). It counts no
|
|
6
|
+
* tests and sizes nothing: `storm vitest` does both for vitest.
|
|
7
|
+
*/
|
|
8
|
+
export declare function command(cmd: CommandBuilder<StormApp>): import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
9
|
+
set: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
10
|
+
testserverSandboxes: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
testserverBuild: z.ZodOptional<z.ZodString>;
|
|
12
|
+
testserverMinTimeLeft: z.ZodOptional<z.ZodString>;
|
|
13
|
+
testserverTtl: z.ZodOptional<z.ZodString>;
|
|
14
|
+
testserverNoCreate: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
16
|
+
project: z.ZodOptional<z.ZodString>;
|
|
17
|
+
credential: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
"github-actions": "github-actions";
|
|
47
19
|
mint: "mint";
|
|
48
|
-
runner: "runner";
|
|
49
|
-
tests: "tests";
|
|
50
|
-
testserver: "testserver";
|
|
51
20
|
}>>;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
21
|
+
local: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
rebuildSnapshot: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
showOutput: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
keepSandbox: z.ZodOptional<z.ZodString>;
|
|
25
|
+
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
command: z.ZodArray<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>, import("@vercel/clinkr").Outcomes<{
|
|
55
28
|
ran: z.ZodObject<{
|
|
56
29
|
version: z.ZodString;
|
|
57
30
|
commit: z.ZodNullable<z.ZodString>;
|
|
@@ -125,66 +98,6 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
125
98
|
}, {
|
|
126
99
|
ran: unknown;
|
|
127
100
|
}, {
|
|
128
|
-
credentialUnused: z.ZodObject<{
|
|
129
|
-
flags: z.ZodArray<z.ZodString>;
|
|
130
|
-
configFile: z.ZodNullable<z.ZodString>;
|
|
131
|
-
}, z.core.$strip>;
|
|
132
|
-
missingRunner: z.ZodObject<{
|
|
133
|
-
configFile: z.ZodNullable<z.ZodString>;
|
|
134
|
-
}, z.core.$strip>;
|
|
135
|
-
noBaseRef: z.ZodObject<{
|
|
136
|
-
refs: z.ZodArray<z.ZodObject<{
|
|
137
|
-
ref: z.ZodString;
|
|
138
|
-
reason: z.ZodEnum<{
|
|
139
|
-
missing: "missing";
|
|
140
|
-
unrelated: "unrelated";
|
|
141
|
-
}>;
|
|
142
|
-
}, z.core.$strip>>;
|
|
143
|
-
}, z.core.$strip>;
|
|
144
|
-
submodulesRefused: z.ZodObject<{
|
|
145
|
-
paths: z.ZodArray<z.ZodString>;
|
|
146
|
-
}, z.core.$strip>;
|
|
147
|
-
snapshotGone: z.ZodObject<{
|
|
148
|
-
snapshotId: z.ZodString;
|
|
149
|
-
base: z.ZodString;
|
|
150
|
-
removal: z.ZodNullable<z.ZodObject<{
|
|
151
|
-
path: z.ZodString;
|
|
152
|
-
message: z.ZodString;
|
|
153
|
-
}, z.core.$strip>>;
|
|
154
|
-
cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
|
|
155
|
-
}, z.core.$strip>;
|
|
156
|
-
runnerFailed: z.ZodObject<{
|
|
157
|
-
failure: z.ZodUnion<readonly [z.ZodObject<{
|
|
158
|
-
kind: z.ZodEnum<{
|
|
159
|
-
"apply-failed": "apply-failed";
|
|
160
|
-
"build-failed": "build-failed";
|
|
161
|
-
"install-failed": "install-failed";
|
|
162
|
-
"snapshot-build-step-failed": "snapshot-build-step-failed";
|
|
163
|
-
}>;
|
|
164
|
-
label: z.ZodString;
|
|
165
|
-
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
166
|
-
tail: z.ZodArray<z.ZodString>;
|
|
167
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
168
|
-
kind: z.ZodLiteral<"sandbox-api-failed">;
|
|
169
|
-
operation: z.ZodString;
|
|
170
|
-
status: z.ZodNullable<z.ZodNumber>;
|
|
171
|
-
message: z.ZodString;
|
|
172
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
173
|
-
kind: z.ZodLiteral<"checkout-failed">;
|
|
174
|
-
message: z.ZodString;
|
|
175
|
-
command: z.ZodNullable<z.ZodString>;
|
|
176
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
177
|
-
kind: z.ZodLiteral<"credential-claims-missing">;
|
|
178
|
-
team: z.ZodString;
|
|
179
|
-
project: z.ZodString;
|
|
180
|
-
}, z.core.$strip>]>;
|
|
181
|
-
cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
|
|
182
|
-
}, z.core.$strip>;
|
|
183
|
-
spawnFailed: z.ZodObject<{
|
|
184
|
-
executable: z.ZodString;
|
|
185
|
-
message: z.ZodString;
|
|
186
|
-
cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
|
|
187
|
-
}, z.core.$strip>;
|
|
188
101
|
credentialRejected: import("@vercel/clinkr").SharedError<"credential_rejected", [{
|
|
189
102
|
origin: {
|
|
190
103
|
source: "mint";
|
|
@@ -214,6 +127,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
214
127
|
} & {
|
|
215
128
|
readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
|
|
216
129
|
}]>;
|
|
130
|
+
credentialUnused: import("@vercel/clinkr").SharedError<"credential_unused", [data: {
|
|
131
|
+
flags: string[];
|
|
132
|
+
configFile: string | null;
|
|
133
|
+
}]>;
|
|
217
134
|
githubFixtureRepoUnavailable: import("@vercel/clinkr").SharedError<"github_fixture_repo_unavailable", [{
|
|
218
135
|
repo: string;
|
|
219
136
|
status: number | null;
|
|
@@ -258,9 +175,18 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
258
175
|
runner: boolean;
|
|
259
176
|
cleanup: import("./cleanup.ts").StormCleanupFacts;
|
|
260
177
|
}]>;
|
|
178
|
+
missingRunner: import("@vercel/clinkr").SharedError<"missing_runner", [data: {
|
|
179
|
+
configFile: string | null;
|
|
180
|
+
}]>;
|
|
261
181
|
missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
|
|
262
182
|
missing: ("project" | "scope")[];
|
|
263
183
|
}]>;
|
|
184
|
+
noBaseRef: import("@vercel/clinkr").SharedError<"no_base_ref", [data: {
|
|
185
|
+
refs: {
|
|
186
|
+
ref: string;
|
|
187
|
+
reason: "missing" | "unrelated";
|
|
188
|
+
}[];
|
|
189
|
+
}]>;
|
|
264
190
|
noSandboxes: import("@vercel/clinkr").SharedError<"no_sandboxes", [{
|
|
265
191
|
requested: number;
|
|
266
192
|
ttlMinutes: number;
|
|
@@ -288,6 +214,45 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
288
214
|
} & {
|
|
289
215
|
readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
|
|
290
216
|
}]>;
|
|
217
|
+
runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
|
|
218
|
+
failure: {
|
|
219
|
+
kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
|
|
220
|
+
label: string;
|
|
221
|
+
exitCode: number | null;
|
|
222
|
+
tail: string[];
|
|
223
|
+
} | {
|
|
224
|
+
kind: "sandbox-api-failed";
|
|
225
|
+
operation: string;
|
|
226
|
+
status: number | null;
|
|
227
|
+
message: string;
|
|
228
|
+
} | {
|
|
229
|
+
kind: "checkout-failed";
|
|
230
|
+
message: string;
|
|
231
|
+
command: string | null;
|
|
232
|
+
} | {
|
|
233
|
+
kind: "credential-claims-missing";
|
|
234
|
+
team: string;
|
|
235
|
+
project: string;
|
|
236
|
+
};
|
|
237
|
+
cleanup: import("./cleanup.ts").StormCleanupFacts;
|
|
238
|
+
}]>;
|
|
239
|
+
snapshotGone: import("@vercel/clinkr").SharedError<"snapshot_gone", [data: {
|
|
240
|
+
snapshotId: string;
|
|
241
|
+
base: string;
|
|
242
|
+
removal: {
|
|
243
|
+
path: string;
|
|
244
|
+
message: string;
|
|
245
|
+
} | null;
|
|
246
|
+
cleanup: import("./cleanup.ts").StormCleanupFacts;
|
|
247
|
+
}]>;
|
|
248
|
+
spawnFailed: import("@vercel/clinkr").SharedError<"spawn_failed", [data: {
|
|
249
|
+
executable: string;
|
|
250
|
+
message: string;
|
|
251
|
+
cleanup: import("./cleanup.ts").StormCleanupFacts;
|
|
252
|
+
}]>;
|
|
253
|
+
submodulesRefused: import("@vercel/clinkr").SharedError<"submodules_refused", [data: {
|
|
254
|
+
paths: string[];
|
|
255
|
+
}]>;
|
|
291
256
|
tokenRequestFailed: import("@vercel/clinkr").SharedError<"token_request_failed", [{
|
|
292
257
|
cause: "request-failed" | "variables-missing";
|
|
293
258
|
missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
|
|
@@ -304,4 +269,4 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
304
269
|
} & {
|
|
305
270
|
readonly cleanup: import("./cleanup.ts").StormCleanupFacts;
|
|
306
271
|
}]>;
|
|
307
|
-
}>;
|
|
272
|
+
}>, StormApp, false>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { outcomes } from "./outcomes.js";
|
|
3
|
+
import { RUN_CLI_OPTIONS, RUN_REQUEST_FIELDS, runCommand, runProblems } from "./run-command.js";
|
|
4
|
+
/**
|
|
5
|
+
* `storm exec`: runs any command, the argument list after `--`, as it is, in a run (`runCommand`). It counts no
|
|
6
|
+
* tests and sizes nothing: `storm vitest` does both for vitest.
|
|
7
|
+
*/
|
|
8
|
+
export function command(cmd) {
|
|
9
|
+
return cmd.define({
|
|
10
|
+
requestSchema: z.object({
|
|
11
|
+
...RUN_REQUEST_FIELDS,
|
|
12
|
+
command: z.array(z.string()).min(1, { message: "Give the command to run after --" }),
|
|
13
|
+
}),
|
|
14
|
+
cli: { options: RUN_CLI_OPTIONS, positionals: ["command"] },
|
|
15
|
+
outcomes,
|
|
16
|
+
validate: runProblems,
|
|
17
|
+
handler: async (context, request) => await runCommand(context, request, {
|
|
18
|
+
name: "exec",
|
|
19
|
+
prepare: async (settled) => ({ ok: true, argv: request.command, settled, plan: undefined }),
|
|
20
|
+
ran: (facts) => outcomes.ran(facts),
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { StormTimeline } from "../../resources.ts";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The job summary's Markdown for `timeline`, headed with the invoking command, `storm <command>`; `details` are
|
|
4
|
+
* lines after the critical path, such as the tests'.
|
|
5
|
+
*/
|
|
3
6
|
export declare function jobSummaryMarkdown(timeline: StormTimeline, extras: {
|
|
7
|
+
readonly command: string;
|
|
4
8
|
readonly logs: string | undefined;
|
|
5
9
|
readonly details?: readonly string[];
|
|
6
10
|
}): string;
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
// and where its run directory is, so a CI run that uploads it as an artifact can find it.
|
|
3
3
|
import { seconds } from "./text.js";
|
|
4
4
|
import { criticalPathStep, laneLabel } from "./waterfall.js";
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* The job summary's Markdown for `timeline`, headed with the invoking command, `storm <command>`; `details` are
|
|
7
|
+
* lines after the critical path, such as the tests'.
|
|
8
|
+
*/
|
|
6
9
|
export function jobSummaryMarkdown(timeline, extras) {
|
|
7
|
-
const lines = [
|
|
10
|
+
const lines = [`### storm ${extras.command}`, ""];
|
|
8
11
|
if (timeline.rows.length > 0) {
|
|
9
12
|
lines.push("| Lane | Start | Duration | Idle | Steps |", "| --- | ---: | ---: | ---: | --- |");
|
|
10
13
|
for (const row of timeline.rows)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const metadata: {
|
|
2
|
+
description: string;
|
|
3
|
+
summary: string;
|
|
4
|
+
usages: string[];
|
|
5
|
+
fields: {
|
|
6
|
+
testserverSandboxes: {
|
|
7
|
+
readonly valueLabel: "N";
|
|
8
|
+
readonly description: "How many Testserver sandboxes the command gets, 1 to 32, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1. Gives the run a Testserver side.";
|
|
9
|
+
};
|
|
10
|
+
testserverBuild: {
|
|
11
|
+
readonly valueLabel: "BUILD";
|
|
12
|
+
readonly description: "The build the Testserver sandboxes run: a build name or the build channel stable or latest_main, overriding resources.testserverPool.build in storm.config.ts; default stable. Gives the run a Testserver side.";
|
|
13
|
+
};
|
|
14
|
+
testserverMinTimeLeft: {
|
|
15
|
+
readonly valueLabel: "DURATION";
|
|
16
|
+
readonly description: "The least time left a Testserver sandbox from the pool needs, in whole minutes or hours (30m, 2h), overriding resources.testserverPool.minTimeLeft in storm.config.ts; default 30m. Gives the run a Testserver side.";
|
|
17
|
+
};
|
|
18
|
+
testserverTtl: {
|
|
19
|
+
readonly valueLabel: "DURATION";
|
|
20
|
+
readonly description: "How long each Testserver sandbox the run creates lives, 10m to 5h and longer than minTimeLeft, overriding resources.testserverPool.ttl in storm.config.ts; default 5h. Not with noCreate. Gives the run a Testserver side.";
|
|
21
|
+
};
|
|
22
|
+
testserverNoCreate: {
|
|
23
|
+
readonly description: "Run only on Testserver sandboxes already in the pool, never minting for Testserver or creating: needs no --scope or --project with --local, and takes no --testserver-ttl. Turns on resources.testserverPool.noCreate whatever storm.config.ts says; without it, the file's noCreate, default false, applies. Gives the run a Testserver side.";
|
|
24
|
+
};
|
|
25
|
+
set: {
|
|
26
|
+
readonly valueLabel: "KEY=VALUE";
|
|
27
|
+
readonly description: "Set a resource's option for this run by its key path in storm.config.ts, resources.<name>.<option>, overriding the file and the default; repeat it for each option. The key paths: resources.githubFixtureRepo.repo, the GitHub repository as owner/name, required; resources.githubFixtureRepo.tokenEnv, the host environment variable holding its token, required; resources.githubFixtureRepo.optional, true or false, default false: false refuses the run without the token, true goes on without the repository. The Testserver pool resource's options have their own flags, --testserver-<option>, which --set doesn't take. Any --set of a resource's option gives the run that resource, as storm.config.ts does. An unknown key path, one given twice, one with its own flag, or a value its option refuses is a usage error. Options that don't fit together once merged, or a required one nothing gives, are invalid_resource_options, naming where each value came from.";
|
|
28
|
+
};
|
|
29
|
+
credential: {
|
|
30
|
+
readonly valueLabel: "SOURCE";
|
|
31
|
+
readonly description: "The credential source: mint, the default, mints one with the vercel CLI for --scope and --project; github-actions requests a GitHub Actions OIDC token, in a GitHub Actions job with permissions id-token: write, anew once it is 4 minutes old, and needs no --scope or --project. Only --local takes it: a runner run needs the mint. Only a run holding a resource that takes a credential takes it, the Testserver pool resource without noCreate (resources.testserverPool in storm.config.ts, or any --testserver-* flag but --testserver-no-create); otherwise it is credential_unused. No config key.";
|
|
32
|
+
};
|
|
33
|
+
local: {
|
|
34
|
+
readonly description: "Run the command on this machine instead of in a runner sandbox. Without it, the command runs in a Vercel Sandbox started from a runner snapshot of the base, with this checkout's changes applied, installed and built, from the runner key of storm.config.ts, and its output streams back with paths rewritten to this checkout's. No config key.";
|
|
35
|
+
};
|
|
36
|
+
rebuildSnapshot: {
|
|
37
|
+
readonly description: "Build a runner snapshot of the base whatever the runner snapshot cache holds, replacing an entry for the same base. Not with --local. No config key.";
|
|
38
|
+
};
|
|
39
|
+
keepSandbox: {
|
|
40
|
+
readonly valueLabel: "DURATION";
|
|
41
|
+
readonly description: "How long the runner sandbox keeps running once the run ends, however it ends, so you can connect to it from its page in the Vercel dashboard: 0, which stops and deletes it with the run's other sandboxes, or a whole number of minutes or hours up to 5h (30m, 2h). The run asks Vercel Sandbox to extend the runner sandbox's timeout when it would stop sooner; it never shortens it, so the sandbox may run past the keep time until its own timeout. The run says until when it runs, and storm runs show and runs list say so too. Default: keepSandbox in the runner recipe, else 30m, or 0 when CI is set. Not with --local.";
|
|
42
|
+
};
|
|
43
|
+
showOutput: {
|
|
44
|
+
readonly description: "In a runner run on a terminal, print the runner's step output (a snapshot build, the install, the build) above the live view instead of keeping only each step's last line there. Plain output always prints it. Either way, the run directory keeps it whole. Not with --local. No config key.";
|
|
45
|
+
};
|
|
46
|
+
verbose: {
|
|
47
|
+
readonly description: "Print more as it happens: each Testserver sandbox create's progress messages, the runner's step output as with --show-output, and verbose in the run payload, which has the Vitest adapter's reporters print each test as it finishes and its fixtures print each container start, proxied request and vercel invocation, for passing tests too. No config key.";
|
|
48
|
+
};
|
|
49
|
+
scope: {
|
|
50
|
+
readonly valueLabel: "TEAM";
|
|
51
|
+
readonly description: "The control plane team: the Vercel team whose project's development OIDC tokens the Testserver control plane trusts. Required, from this flag or scope in storm.config.ts, unless --local without a Testserver side, with noCreate or with --credential github-actions.";
|
|
52
|
+
};
|
|
53
|
+
project: {
|
|
54
|
+
readonly valueLabel: "PROJECT";
|
|
55
|
+
readonly description: "The control plane project: the Vercel project, within the team, to mint the credential for. Required, from this flag or project in storm.config.ts, unless --local without a Testserver side, with noCreate or with --credential github-actions.";
|
|
56
|
+
};
|
|
57
|
+
command: {
|
|
58
|
+
valueLabel: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
examples: {
|
|
63
|
+
argv: string;
|
|
64
|
+
description: string;
|
|
65
|
+
}[];
|
|
66
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { RUN_FIELDS, RUN_USAGE_FLAGS } from "./run-metadata.js";
|
|
2
|
+
export const metadata = {
|
|
3
|
+
description: "Run any command, the argument list after --, as it is, with the run payload in STORM_RUN. For vitest, use storm vitest, which counts the tests and sizes the run first; exec counts nothing and sizes nothing. In a local run (--local), the command runs on this machine in the working directory, with this machine's environment less the host variables a resource names (TESTSERVER_BASES and TESTSERVER_BASE), plus STORM_RUN, and FORCE_COLOR or NO_COLOR when neither is set. In a runner run, the default, it runs in a runner sandbox, a Vercel Sandbox readied from the runner recipe in storm.config.ts, in the recipe's cwd, with the runner sandbox's own environment, a PATH that starts with node_modules/.bin of that cwd and of the repository's root, the recipe's env and STORM_RUN, and nothing from this machine's environment; each path under the repository's root in its arguments points at the runner sandbox's copy, and each in its output back at this checkout. With a Testserver side (resources.testserverPool in storm.config.ts, or any --testserver-* flag), first lease usable Testserver sandboxes from the pool and create the rest, while a runner run readies its runner sandbox, and release the leases once the command ends; without one, the run payload names no Testserver sandbox. Shows on stderr what runs when and what runs at once, live on a terminal and one line at a time elsewhere, then a waterfall of the run's lanes naming its critical path, and exits with the command's code. Each run writes what it was and how it ended, its events, its steps' output, its command's output, its test events and its timeline to a run directory under ${XDG_STATE_HOME:-~/.local/state}/storm/runs/, named for its run id, keeping the newest 1000 completed ones and every one whose run is still going; the summary names the run id, storm runs show reads the run back, and storm runs logs prints its command's output and its steps' logs. A flag overrides storm.config.ts, found in the working directory or a parent up to the git worktree's root and checked whole, which overrides the built-in default. With resources.githubFixtureRepo, in storm.config.ts or by a --set of its options, the run reads a token for that GitHub repository from the host variable its tokenEnv names (refusing without it, unless optional), checks the token can read the repository, hands the command the repository, the token and a run prefix (run/<UTC timestamp>-<suffix>) in the run payload, shows the token as <token> in what it prints and writes, and deletes every branch under the run prefix once the command has stopped.",
|
|
4
|
+
summary: "Run any command, in a runner sandbox or locally.",
|
|
5
|
+
usages: [`${RUN_USAGE_FLAGS} -- <command...>`],
|
|
6
|
+
fields: {
|
|
7
|
+
...RUN_FIELDS,
|
|
8
|
+
command: {
|
|
9
|
+
valueLabel: "command",
|
|
10
|
+
description: "The command to run, after --, as an argument list with no shell. Locally it gets this machine's working directory and environment, less TESTSERVER_BASES and TESTSERVER_BASE, plus STORM_RUN and FORCE_COLOR or NO_COLOR; in a runner run, the runner recipe's cwd, its env, the runner's PATH and STORM_RUN, with paths under the repository's root rewritten.",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
examples: [
|
|
14
|
+
{
|
|
15
|
+
argv: "-- pnpm test",
|
|
16
|
+
description: "Run the package's test script in a runner sandbox, with the runner recipe, team and project from storm.config.ts, and its Testserver side, if it has one.",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
argv: "--testserver-sandboxes 4 -- pnpm test:testserver",
|
|
20
|
+
description: "Run a script in a runner sandbox against 4 Testserver sandboxes.",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
argv: "--local --testserver-sandboxes 4 --scope vercel --project vercel -- pnpm test",
|
|
24
|
+
description: "Run the tests on this machine against 4 Testserver sandboxes on the stable build channel.",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
argv: "--keep-sandbox 2h -- pnpm test",
|
|
28
|
+
description: "Run the tests in a runner sandbox and keep it running 2 hours after the run, to debug in it.",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
argv: "--local -- node scripts/smoke.mjs",
|
|
32
|
+
description: "Run a Node.js script on this machine, with no Testserver sandbox when storm.config.ts has no resources.testserverPool.",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
argv: "--local --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
|
|
36
|
+
description: "Create Testserver sandboxes that live 30 minutes, with team and project from storm.config.ts.",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
argv: "--local --testserver-no-create --testserver-sandboxes 4 -- pnpm test",
|
|
40
|
+
description: "Run only on Testserver sandboxes already in the pool, never minting.",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
argv: "--local --verbose --testserver-sandboxes 2 -- pnpm test",
|
|
44
|
+
description: "Run the tests, printing each create's progress and, through the Vitest adapter, each test as it ends.",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
argv: "--local --credential github-actions --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
|
|
48
|
+
description: "In a GitHub Actions job, create Testserver sandboxes with a GitHub Actions OIDC token.",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
argv: "--local --testserver-build latest_main --testserver-min-time-left 75m --scope vercel --project vercel -- pnpm test",
|
|
52
|
+
description: "Run them on the newest main build, with Testserver sandboxes that live at least 75 more minutes.",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//
|
|
2
|
-
// first, whatever the resources hold (`runner: true`); in a local run that settled the mint, the core's
|
|
3
|
-
// source mints when a resource first asks for a credential, and the run ends this way when that resource
|
|
4
|
-
// without it (`runner: false`).
|
|
1
|
+
// A run's `mint_failed`, `exec`'s and `vitest`'s: the run's mint failed. In a runner run, the core mints for the runner
|
|
2
|
+
// sandbox first, whatever the resources hold (`runner: true`); in a local run that settled the mint, the core's
|
|
3
|
+
// credential source mints when a resource first asks for a credential, and the run ends this way when that resource
|
|
4
|
+
// can't go on without it (`runner: false`).
|
|
5
5
|
import { defineErrors } from "@vercel/clinkr";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { RUN_CLEANUP } from "../../resources.js";
|