@cnc-tools/storm 0.12.0 → 0.14.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.js +5 -1
- package/dist/bin/storm.js +6 -2
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-FK4RLDEK.js → chunk-27P2QSIM.js} +1 -1
- package/dist/chunks/{chunk-ODQHQJLE.js → chunk-5ED3IDUJ.js} +749 -1121
- package/dist/chunks/{chunk-FSP3SJ35.js → chunk-5TMHYH7G.js} +16 -46
- package/dist/chunks/{chunk-Y3BUNNRG.js → chunk-BFLYGMG3.js} +12 -7
- package/dist/chunks/{chunk-LQKNI3EG.js → chunk-BRUIATTR.js} +6 -6
- package/dist/chunks/{chunk-RYRJNHL7.js → chunk-HOKDKP5A.js} +3 -9
- package/dist/chunks/{chunk-SXW6XN4R.js → chunk-IVRRGGCD.js} +60 -20
- package/dist/chunks/{chunk-TMQQYHUX.js → chunk-QBR5VHJ7.js} +1 -1
- package/dist/chunks/{chunk-YT5OROR7.js → chunk-RA4L2ACU.js} +12 -2
- package/dist/chunks/{chunk-TEEZL3GA.js → chunk-RKONDLPS.js} +17 -71
- package/dist/chunks/{chunk-IYM44FUX.js → chunk-UC6DULWY.js} +2 -2
- package/dist/chunks/{chunk-4XT5RC5T.js → chunk-XPCUINWS.js} +6 -42
- package/dist/chunks/{chunk-U7M3ZB3Z.js → chunk-YBPTMJUM.js} +123 -180
- package/dist/chunks/{chunk-ISGQJIQM.js → chunk-Z5OXOZD3.js} +125 -83
- package/dist/chunks/{chunk-7D6LC5JY.js → chunk-ZH5R7W4A.js} +7 -39
- package/dist/chunks/{live-app-AZ5N5HBD.js → live-app-FBVWUUMT.js} +7 -7
- package/dist/commands/exec/command.d.ts +4 -90
- package/dist/commands/exec/command.js +15 -41
- package/dist/commands/exec/define-run-command.d.ts +19 -100
- package/dist/commands/exec/define-run-command.js +48 -15
- package/dist/commands/exec/driver-plan.d.ts +24 -16
- package/dist/commands/exec/driver-plan.js +34 -15
- package/dist/commands/exec/driver-refusals.js +7 -6
- package/dist/commands/exec/exec-words.d.ts +1 -1
- package/dist/commands/exec/exec-words.js +8 -2
- package/dist/commands/exec/final-results.d.ts +39 -0
- package/dist/commands/exec/final-results.js +29 -0
- package/dist/commands/exec/live-view.js +18 -22
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/outcomes.d.ts +15 -109
- package/dist/commands/exec/outcomes.js +25 -39
- package/dist/commands/exec/plan-run.d.ts +11 -3
- package/dist/commands/exec/plan-run.js +3 -2
- package/dist/commands/exec/progress.d.ts +3 -19
- package/dist/commands/exec/progress.js +16 -60
- package/dist/commands/exec/run-command.d.ts +5 -24
- package/dist/commands/exec/run-command.js +32 -84
- package/dist/commands/exec/run-metadata.d.ts +0 -6
- package/dist/commands/exec/run-metadata.js +2 -8
- package/dist/commands/exec/snapshot-text.d.ts +7 -16
- package/dist/commands/exec/snapshot-text.js +9 -49
- package/dist/commands/exec/test-plan.d.ts +2 -1
- package/dist/commands/exec/test-plan.js +13 -4
- package/dist/commands/exec/tests-summary.d.ts +2 -2
- package/dist/commands/exec/view.js +2 -12
- package/dist/commands/exec/worker-chart.d.ts +1 -1
- package/dist/commands/playwright/command.d.ts +12 -97
- package/dist/commands/playwright/command.js +14 -14
- package/dist/commands/playwright/metadata.js +2 -2
- package/dist/commands/runs/facts.d.ts +1 -37
- package/dist/commands/runs/facts.js +4 -36
- package/dist/commands/runs/list/command.d.ts +0 -72
- package/dist/commands/runs/list/command.js +6 -6
- package/dist/commands/runs/list/outcomes.d.ts +0 -36
- package/dist/commands/runs/logs/command.js +6 -6
- package/dist/commands/runs/show/command.d.ts +2 -74
- package/dist/commands/runs/show/command.js +16 -43
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +1 -37
- package/dist/commands/runs/show/outcomes.js +8 -42
- package/dist/commands/snapshots/build/command.d.ts +14 -411
- package/dist/commands/snapshots/build/command.js +59 -234
- package/dist/commands/snapshots/build/metadata.js +10 -7
- package/dist/commands/snapshots/build/outcomes.d.ts +11 -241
- package/dist/commands/snapshots/build/outcomes.js +29 -196
- package/dist/commands/snapshots/list/command.d.ts +2 -36
- package/dist/commands/snapshots/list/command.js +20 -56
- package/dist/commands/snapshots/list/metadata.js +1 -1
- package/dist/commands/snapshots/list/outcomes.d.ts +2 -37
- package/dist/commands/snapshots/list/outcomes.js +13 -53
- package/dist/commands/vitest/command.d.ts +14 -98
- package/dist/commands/vitest/command.js +14 -14
- package/dist/commands/vitest/metadata.js +2 -2
- package/dist/config/resolve.d.ts +1 -1
- package/dist/config/resolve.js +2 -1
- package/dist/config/schema.d.ts +8 -0
- package/dist/config/schema.js +5 -4
- package/dist/core/events.d.ts +5 -6
- package/dist/core/run-state.d.ts +7 -29
- package/dist/core/run-state.js +3 -26
- package/dist/core/run.d.ts +6 -14
- package/dist/core/run.js +17 -28
- package/dist/extensions/playwright/driver.js +17 -10
- package/dist/extensions/testserver/commands/pool/create/command.js +4 -4
- package/dist/extensions/testserver/commands/pool/list/command.js +2 -2
- package/dist/extensions/testserver/definition.d.ts +1 -1
- package/dist/extensions/testserver/extension.d.ts +1 -1
- package/dist/extensions/testserver/options/rules.d.ts +3 -3
- package/dist/extensions/testserver/options/rules.js +5 -5
- package/dist/extensions/testserver/resource.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -0
- package/dist/extensions/testserver/vercel-cli/index.js +1 -0
- package/dist/extensions/testserver/vercel-cli/report.js +5 -2
- package/dist/extensions/testserver/vercel-cli/session-id.d.ts +8 -0
- package/dist/extensions/testserver/vercel-cli/session-id.js +16 -0
- package/dist/extensions/testserver/vitest/config.d.ts +2 -2
- package/dist/extensions/testserver/vitest/config.js +2 -2
- package/dist/extensions/testserver/vitest/container-scope.d.ts +25 -16
- package/dist/extensions/testserver/vitest/container-scope.js +32 -13
- package/dist/extensions/testserver/vitest/diagnostics.d.ts +5 -4
- package/dist/extensions/testserver/vitest/diagnostics.js +15 -8
- package/dist/extensions/testserver/vitest/fixtures.d.ts +10 -1
- package/dist/extensions/testserver/vitest/fixtures.js +36 -10
- package/dist/extensions/testserver/vitest/types.d.ts +9 -0
- package/dist/extensions/vitest/driver.js +28 -14
- package/dist/extensions/vitest/plan/gateways.d.ts +28 -5
- package/dist/extensions/vitest/plan/gateways.js +2 -2
- package/dist/extensions/vitest/plan/list-output.d.ts +5 -0
- package/dist/extensions/vitest/plan/list-output.js +23 -9
- package/dist/extensions/vitest/plan/live/list-gateway.d.ts +3 -2
- package/dist/extensions/vitest/plan/live/list-gateway.js +77 -64
- package/dist/extensions/vitest/plan/plan-over.d.ts +19 -7
- package/dist/extensions/vitest/plan/plan-over.js +18 -7
- package/dist/extensions/vitest/plan/plan.d.ts +14 -5
- package/dist/extensions/vitest/plan/plan.js +23 -9
- package/dist/extensions.d.ts +2 -2
- package/dist/run-directory/index.d.ts +1 -1
- package/dist/run-directory/index.js +0 -1
- package/dist/run-directory/plan.d.ts +3 -2
- package/dist/run-directory/plan.js +6 -3
- package/dist/run-directory/recording.js +2 -2
- package/dist/run-directory/run-record.d.ts +18 -135
- package/dist/run-directory/run-record.js +8 -68
- package/dist/runner/build-snapshots.d.ts +50 -114
- package/dist/runner/build-snapshots.js +70 -159
- package/dist/runner/events.d.ts +4 -88
- package/dist/runner/gateways.d.ts +5 -23
- package/dist/runner/index.d.ts +5 -6
- package/dist/runner/index.js +1 -1
- package/dist/runner/live/snapshot-records.js +7 -18
- package/dist/runner/prepare.d.ts +11 -22
- package/dist/runner/prepare.js +6 -17
- package/dist/runner/ready.d.ts +16 -45
- package/dist/runner/ready.js +34 -59
- package/dist/runner/recipe.d.ts +5 -45
- package/dist/runner/recipe.js +0 -41
- package/dist/runner/sandboxed-command.d.ts +5 -3
- package/dist/runner/sandboxed-command.js +10 -4
- package/dist/runner/scope.d.ts +8 -25
- package/dist/runner/scope.js +4 -8
- package/dist/runner/session.d.ts +18 -65
- package/dist/runner/session.js +15 -83
- package/dist/runner/snapshot-build.d.ts +2 -2
- package/dist/runner/snapshot-cache.d.ts +22 -74
- package/dist/runner/snapshot-cache.js +15 -107
- package/dist/runner/snapshot-inspect.d.ts +9 -13
- package/dist/runner/snapshot-inspect.js +48 -57
- package/dist/runner/snapshot-key.d.ts +9 -14
- package/dist/runner/snapshot-key.js +15 -22
- package/dist/sdk/extension/driver.d.ts +32 -6
- package/dist/sdk/extension/driver.js +12 -2
- package/dist/sdk/extension/index.d.ts +1 -1
- package/dist/sdk/extension/index.js +2 -1
- package/dist/sdk/extension/resource-definition.d.ts +6 -5
- package/dist/vendor/testserver-sdk/container/api-request.d.ts +2 -3
- package/dist/vendor/testserver-sdk/container/api-request.js +2 -3
- package/dist/vendor/testserver-sdk/container/container.d.ts +12 -2
- package/dist/vendor/testserver-sdk/container/container.js +10 -7
- package/dist/vendor/testserver-sdk/container/recorder.d.ts +29 -7
- package/dist/vendor/testserver-sdk/container/recorder.js +26 -14
- package/dist/vendor/testserver-sdk/index.d.ts +1 -1
- package/dist/vendor/testserver-sdk/index.js +1 -1
- package/dist/vendor/testserver-sdk/proxy/exchange.d.ts +24 -5
- package/dist/vendor/testserver-sdk/proxy/exchange.js +43 -25
- package/dist/vendor/testserver-sdk/proxy/faulted-exchange.js +15 -10
- package/dist/vendor/testserver-sdk/proxy/faults.d.ts +6 -5
- package/dist/vendor/testserver-sdk/proxy/proxy.d.ts +10 -1
- package/dist/vendor/testserver-sdk/proxy/proxy.js +5 -3
- package/dist/vendor/testserver-sdk/proxy/records.d.ts +17 -17
- package/dist/vendor/testserver-sdk/proxy/records.js +18 -17
- package/dist/vendor/testserver-sdk/records/body.d.ts +7 -9
- package/dist/vendor/testserver-sdk/records/body.js +10 -15
- package/dist/vendor/testserver-sdk/records/headers.d.ts +79 -0
- package/dist/vendor/testserver-sdk/records/headers.js +162 -0
- package/dist/vendor/testserver-sdk/records/index.d.ts +2 -1
- package/dist/vendor/testserver-sdk/records/index.js +4 -2
- package/dist/vendor/testserver-sdk/records/records.d.ts +19 -10
- package/package.json +5 -4
- package/skills/overview.md +5 -5
- package/skills/read-run-output.md +8 -9
- package/dist/runner/snapshot-save.d.ts +0 -70
- package/dist/runner/snapshot-save.js +0 -160
- package/dist/runner/snapshot-start.d.ts +0 -25
- package/dist/runner/snapshot-start.js +0 -16
- package/skills/testserver-builds.md +0 -82
|
@@ -2,7 +2,7 @@ import { mintTargetText } from "../../credential/index.js";
|
|
|
2
2
|
import { megabytesText, secondsOf, secondsText, warningTally, } from "../../core/index.js";
|
|
3
3
|
import { DEFINITION_SET } from "../../extensions.js";
|
|
4
4
|
import { versionText } from "../../version.js";
|
|
5
|
-
import { builtAtText,
|
|
5
|
+
import { builtAtText, rejectionLines, snapshotCacheNoteText } from "./snapshot-text.js";
|
|
6
6
|
import { isoSecondsText, keepTimeText, releaseText, seconds, short } from "./text.js";
|
|
7
7
|
/**
|
|
8
8
|
* A run's progress as plain lines through `write`, one call per line. Each of storm's own lines starts with the
|
|
@@ -47,6 +47,7 @@ export function plainRenderer(options) {
|
|
|
47
47
|
lanesStartedAt: undefined,
|
|
48
48
|
readyAt: { runner: undefined, resources: {} },
|
|
49
49
|
cleanupStartedAt: undefined,
|
|
50
|
+
mergeBase: undefined,
|
|
50
51
|
folded: false,
|
|
51
52
|
};
|
|
52
53
|
const resources = DEFINITION_SET.presentations.plain({ verbose: options.verbose === true });
|
|
@@ -141,7 +142,7 @@ function eventLines(event, now, state, line, options) {
|
|
|
141
142
|
return [line("command", `${event.command} ${commandEnd(event.outcome)} after ${seconds(event.ms)}`)];
|
|
142
143
|
case "cleanup-started":
|
|
143
144
|
state.cleanupStartedAt = now;
|
|
144
|
-
return [line("cleanup", cleanupText(event.
|
|
145
|
+
return [line("cleanup", cleanupText(event.keepMs, releaseText(event.resources, false)))];
|
|
145
146
|
case "cleanup-finished": {
|
|
146
147
|
const problems = [
|
|
147
148
|
...(event.notStopped === 0 ? [] : [`${event.notStopped} not stopped`]),
|
|
@@ -153,6 +154,7 @@ function eventLines(event, now, state, line, options) {
|
|
|
153
154
|
];
|
|
154
155
|
}
|
|
155
156
|
case "runner-prepared":
|
|
157
|
+
state.mergeBase = event.base;
|
|
156
158
|
return [
|
|
157
159
|
line("runner", `merge-base ${short(event.base)}, of HEAD and ${event.baseRef}`),
|
|
158
160
|
...preparedNoteTexts(event).map((text) => line("runner", text)),
|
|
@@ -171,7 +173,7 @@ function eventLines(event, now, state, line, options) {
|
|
|
171
173
|
function runnerLines(event, state, line, options) {
|
|
172
174
|
switch (event.kind) {
|
|
173
175
|
case "snapshot-reused":
|
|
174
|
-
return [line("runner", snapshotReusedText(event))];
|
|
176
|
+
return [line("runner", snapshotReusedText(event, state.mergeBase))];
|
|
175
177
|
case "snapshot-build-started":
|
|
176
178
|
return snapshotBuildTexts(event).map((text) => line("runner", text));
|
|
177
179
|
case "runner-sandbox-starting":
|
|
@@ -223,25 +225,15 @@ function runnerLines(event, state, line, options) {
|
|
|
223
225
|
];
|
|
224
226
|
case "sandbox-kept":
|
|
225
227
|
return [line("cleanup", `kept the runner sandbox ${event.name} running until ${isoSecondsText(event.stopsAt)}`)];
|
|
226
|
-
// The cleanup line says the run saves a dev snapshot.
|
|
227
|
-
case "dev-snapshot-saving":
|
|
228
|
-
return [];
|
|
229
|
-
case "dev-snapshot-saved":
|
|
230
|
-
case "dev-snapshot-not-saved":
|
|
231
|
-
return [line("cleanup", devSnapshotSaveText(event))];
|
|
232
|
-
case "dev-snapshot-skipped":
|
|
233
|
-
return [line("cleanup", devSnapshotSkippedText(event))];
|
|
234
|
-
case "dev-snapshots-dropped":
|
|
235
|
-
case "dev-snapshots-not-dropped":
|
|
236
|
-
return [line("runner", devSnapshotsDropText(event))];
|
|
237
228
|
}
|
|
238
229
|
}
|
|
239
230
|
/**
|
|
240
231
|
* The line that says which runner snapshot the run starts from: its id, and where it was built, in commits a person
|
|
241
|
-
* knows
|
|
232
|
+
* knows: at HEAD's commit, at the run's merge-base (`mergeBase`, undefined when the run didn't say it), or some commits
|
|
233
|
+
* before HEAD.
|
|
242
234
|
*/
|
|
243
|
-
export function snapshotReusedText(event) {
|
|
244
|
-
return `snapshot ${event.snapshotId}, ${builtAtText({
|
|
235
|
+
export function snapshotReusedText(event, mergeBase) {
|
|
236
|
+
return `snapshot ${event.snapshotId}, ${builtAtText({ base: event.base, builtBehind: event.builtBehind, mergeBase })}`;
|
|
245
237
|
}
|
|
246
238
|
/**
|
|
247
239
|
* The lines that say the run builds a base snapshot: where and why, then why each cached snapshot of the recipe
|
|
@@ -259,45 +251,12 @@ export function snapshotBuildTexts(event) {
|
|
|
259
251
|
return [`${building} (${SNAPSHOT_BUILD_REASON_TEXT[why.kind]}); ${tail}`];
|
|
260
252
|
}
|
|
261
253
|
}
|
|
262
|
-
/** Why a run whose command ended on its own saves no dev snapshot, as its line says. */
|
|
263
|
-
export function devSnapshotSkippedText(event) {
|
|
264
|
-
return `no new dev snapshot: ${noSaveText(event.reason)}`;
|
|
265
|
-
}
|
|
266
|
-
/** How saving a dev snapshot ended, as its line says. */
|
|
267
|
-
export function devSnapshotSaveText(event) {
|
|
268
|
-
if (event.kind === "dev-snapshot-saved") {
|
|
269
|
-
return `saved dev snapshot ${event.snapshotId} for ${headText(event.branch)} at ${short(event.head)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`;
|
|
270
|
-
}
|
|
271
|
-
return `not saving a dev snapshot: ${notSavedReason(event.save)}`;
|
|
272
|
-
}
|
|
273
|
-
/** HEAD as a save's lines name it: its branch, or that it is detached. */
|
|
274
|
-
export function headText(branch) {
|
|
275
|
-
return branch ?? "a detached HEAD";
|
|
276
|
-
}
|
|
277
|
-
function notSavedReason(save) {
|
|
278
|
-
switch (save.kind) {
|
|
279
|
-
case "failed":
|
|
280
|
-
return `the ${save.step === "scrub" ? "scrub" : "save"} failed: ${save.message}`;
|
|
281
|
-
case "stopped":
|
|
282
|
-
return "the run is stopping";
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
254
|
/** Why a base snapshot is being built, as its line says in parentheses. */
|
|
286
255
|
const SNAPSHOT_BUILD_REASON_TEXT = {
|
|
287
256
|
"no-snapshot": "no cached snapshot fits",
|
|
288
257
|
full: "--full",
|
|
289
258
|
base: "the cache has no base snapshot at that commit",
|
|
290
259
|
};
|
|
291
|
-
/**
|
|
292
|
-
* What `storm snapshots build --full` did to the entries of the dev snapshots built on the base snapshot it replaced,
|
|
293
|
-
* as its line says.
|
|
294
|
-
*/
|
|
295
|
-
export function devSnapshotsDropText(event) {
|
|
296
|
-
if (event.kind === "dev-snapshots-not-dropped")
|
|
297
|
-
return `couldn't drop a dev snapshot built on the replaced base snapshot from the cache: ${event.message}; a later run may start from it`;
|
|
298
|
-
const count = event.snapshotIds.length;
|
|
299
|
-
return `dropped ${count} dev ${count === 1 ? "snapshot" : "snapshots"} built on the replaced base snapshot from the cache: ${event.snapshotIds.join(", ")}`;
|
|
300
|
-
}
|
|
301
260
|
/**
|
|
302
261
|
* What a stopping run says it releases of its resource instances, such as ` and releasing a, b`, by their resource
|
|
303
262
|
* keys: every instance the run takes, since it doesn't know yet what each acquire took.
|
|
@@ -314,18 +273,15 @@ function closeFold(state) {
|
|
|
314
273
|
return ["::endgroup::"];
|
|
315
274
|
}
|
|
316
275
|
/**
|
|
317
|
-
* What cleaning up does, as its first line says: with a runner sandbox (`
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* when it releases none).
|
|
276
|
+
* What cleaning up does, as its first line says: with a runner sandbox (`keepMs`, null without one), keeping it running
|
|
277
|
+
* when its keep time is above 0, else stopping and deleting the runner's sandboxes; then releasing the resource
|
|
278
|
+
* instances (`release`, none when it releases none).
|
|
321
279
|
*/
|
|
322
|
-
function cleanupText(
|
|
323
|
-
if (
|
|
280
|
+
function cleanupText(keepMs, release) {
|
|
281
|
+
if (keepMs === null)
|
|
324
282
|
return release === undefined ? "nothing to release" : `${release}…`;
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
const sandboxes = sandbox.ms > 0
|
|
328
|
-
? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}`
|
|
283
|
+
const sandboxes = keepMs > 0
|
|
284
|
+
? `keeping the runner sandbox running ${keepTimeText(keepMs)}`
|
|
329
285
|
: "stopping and deleting the runner's sandboxes";
|
|
330
286
|
return `${sandboxes}${release === undefined ? "" : `, then ${release}`}…`;
|
|
331
287
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ArgumentIssue, CommandError, CommandResult, ExecutionContext } from "@vercel/clinkr";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import type { StormApp } from "../../context.ts";
|
|
4
|
-
import { type
|
|
4
|
+
import { type CheckoutFailure, type PrepareRunnerOutcome } from "../../runner/index.ts";
|
|
5
5
|
import { type DriverHints, type RunTestPlan } from "../../sdk/extension/index.ts";
|
|
6
6
|
import { type RunRunnerFailure } from "../../core/index.ts";
|
|
7
7
|
import { type PlanOption } from "../../run-directory/index.ts";
|
|
@@ -19,8 +19,6 @@ export declare const RUN_REQUEST_FIELDS: {
|
|
|
19
19
|
mint: "mint";
|
|
20
20
|
}>>;
|
|
21
21
|
unsandboxed: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
-
saveDevSnapshot: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
-
noReuseDevSnapshot: z.ZodDefault<z.ZodBoolean>;
|
|
24
22
|
showOutput: z.ZodDefault<z.ZodBoolean>;
|
|
25
23
|
keepSandbox: z.ZodOptional<z.ZodString>;
|
|
26
24
|
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -39,8 +37,6 @@ declare const runRequestSchema: z.ZodObject<{
|
|
|
39
37
|
mint: "mint";
|
|
40
38
|
}>>;
|
|
41
39
|
unsandboxed: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
-
saveDevSnapshot: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
-
noReuseDevSnapshot: z.ZodDefault<z.ZodBoolean>;
|
|
44
40
|
showOutput: z.ZodDefault<z.ZodBoolean>;
|
|
45
41
|
keepSandbox: z.ZodOptional<z.ZodString>;
|
|
46
42
|
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -65,7 +61,7 @@ export interface RunCommandSpec<TTestPlan extends RunTestPlan, TRan, TRefusal> {
|
|
|
65
61
|
* What the run's summary says to do next, in the words of the command's driver, such as about a run with no final
|
|
66
62
|
* test results.
|
|
67
63
|
*/
|
|
68
|
-
readonly hints: DriverHints
|
|
64
|
+
readonly hints: Pick<DriverHints, "noFinalResults">;
|
|
69
65
|
/** The command's part of planning the run (`PlanCommand`). */
|
|
70
66
|
readonly planCommand: PlanCommand<TTestPlan, TRefusal>;
|
|
71
67
|
/** The `ran` outcome for a run whose command ran, from what every run reports and the run's plan. */
|
|
@@ -104,18 +100,8 @@ export interface RunCommandSpec<TTestPlan extends RunTestPlan, TRan, TRefusal> {
|
|
|
104
100
|
* always mints, for the runner sandbox, so it needs `scope` and `project` whatever its resources are. In a sandboxed
|
|
105
101
|
* run, the first SIGINT, SIGTERM or SIGHUP stops the run in any phase: the sandboxed command is killed, every sandbox
|
|
106
102
|
* the run started is stopped and deleted, the resources are released, and the run cancels. `storm snapshots build`
|
|
107
|
-
* builds runner snapshots without a run. A
|
|
108
|
-
*
|
|
109
|
-
* commit or on top of it starts from it, unless it started from a dev snapshot built at HEAD's commit: one save per
|
|
110
|
-
* commit (`saveMode`). It saves none when `CI` is set, `--keep-sandbox` is above 0, or the recipe's install or build
|
|
111
|
-
* step names a runner secret and the recipe doesn't set `trustDevSnapshots`. `--save-dev-snapshot` (not with
|
|
112
|
-
* `--unsandboxed` or a `--keep-sandbox` above 0) saves once the command ended on its own, whatever its exit code and
|
|
113
|
-
* whatever the run started from, under `CI` too; on a recipe that doesn't trust dev snapshots it is
|
|
114
|
-
* `dev_snapshots_not_trusted`, a usage error that names the recipe key, before the runner's local checks.
|
|
115
|
-
* `--save-dev-snapshot=false` saves none. The recipe's `saveDevSnapshot` says the same for every run that gives
|
|
116
|
-
* neither that flag nor a `--keep-sandbox` above 0. `--no-reuse-dev-snapshot`, or the recipe's `reuseDevSnapshot: false`, starts
|
|
117
|
-
* the run from a base snapshot. A run whose save starts keeps no runner sandbox, however the save ends; one whose
|
|
118
|
-
* save never starts, such as one whose command failed without the flag, keeps it for the keep time.
|
|
103
|
+
* builds runner snapshots without a run. A run saves no runner snapshot as it ends: it keeps the runner sandbox for
|
|
104
|
+
* the keep time.
|
|
119
105
|
*
|
|
120
106
|
* `--credential` (no config key) picks the credential source: `mint`, the default, or `github-actions`, which requests
|
|
121
107
|
* a GitHub Actions OIDC token instead and so needs no `--scope` or `--project`; any given are unused. A sandboxed run
|
|
@@ -148,7 +134,7 @@ export interface RunCommandSpec<TTestPlan extends RunTestPlan, TRan, TRefusal> {
|
|
|
148
134
|
* storm reads the resources' secrets for it from each one's pure `secrets`, over its options merged once, each function
|
|
149
135
|
* default given `NOT_COUNTED` (`settleRunResources`), whether or not the checks across them pass.
|
|
150
136
|
*/
|
|
151
|
-
export declare function runCommand<TTestPlan extends RunTestPlan, TRan extends CommandResult, TRefusal extends CommandError = never>({ app, ui, signal }: ExecutionContext<StormApp>, request: RunCommandRequest, spec: RunCommandSpec<TTestPlan, TRan, TRefusal>): Promise<TRan | TRefusal | import("@vercel/clinkr").ClinkrError<"canceled"> | CommandError<"credential_unused"> | CommandError<"
|
|
137
|
+
export declare function runCommand<TTestPlan extends RunTestPlan, TRan extends CommandResult, TRefusal extends CommandError = never>({ app, ui, signal }: ExecutionContext<StormApp>, request: RunCommandRequest, spec: RunCommandSpec<TTestPlan, TRan, TRefusal>): Promise<TRan | TRefusal | import("@vercel/clinkr").ClinkrError<"canceled"> | CommandError<"credential_unused"> | CommandError<"invalid_config"> | CommandError<"invalid_resource_options"> | CommandError<"mint_failed"> | CommandError<"missing_runner"> | CommandError<"missing_target"> | CommandError<"no_base_ref"> | CommandError<"resource_refused"> | CommandError<"resource_refused_before_run"> | CommandError<"runner_failed"> | CommandError<"runner_secrets_invalid"> | CommandError<"snapshot_gone"> | CommandError<"spawn_failed"> | CommandError<"submodules_refused">>;
|
|
152
138
|
/** What is wrong with a run's request that its schema can't say, as `validate` reports it. */
|
|
153
139
|
export declare function runProblems(request: RunCommandRequest): readonly ArgumentIssue[];
|
|
154
140
|
/**
|
|
@@ -163,11 +149,6 @@ export declare function prepareRefusal(prepared: Exclude<PrepareRunnerOutcome, {
|
|
|
163
149
|
* `runner_failed` with `checkout-failed`, holding nothing.
|
|
164
150
|
*/
|
|
165
151
|
export declare function checkoutFailedRefusal(failure: CheckoutFailure): CommandError<"runner_failed">;
|
|
166
|
-
/**
|
|
167
|
-
* The save mode of a run here that gives neither `--save-dev-snapshot` nor `--keep-sandbox`: the recipe default, else
|
|
168
|
-
* the built-in default. `storm snapshots build` reads it to say when it saves a dev snapshot that such a run would not.
|
|
169
|
-
*/
|
|
170
|
-
export declare function runSaveDefault(recipe: Pick<CheckedRecipe, "saveDevSnapshot" | "run" | "trustDevSnapshots">, env: Readonly<Record<string, string | undefined>>): RunnerSaveMode;
|
|
171
152
|
/** How long a runner sandbox keeps running once its run ends, when neither the flag nor the recipe says. */
|
|
172
153
|
export declare const DEFAULT_KEEP_SANDBOX_MINUTES = 30;
|
|
173
154
|
/** A runner failure as outcomes report it. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { forwardSigterm } from "../../forward-sigterm.js";
|
|
7
7
|
import { describeMintFailure } from "../../credential/index.js";
|
|
8
|
-
import { prepareRunner,
|
|
8
|
+
import { prepareRunner, } from "../../runner/index.js";
|
|
9
9
|
import { invalidConfig, recipeRun } from "../../config/index.js";
|
|
10
10
|
import { isCi } from "../../sdk/extension/index.js";
|
|
11
11
|
import { commandExitStatus, executeRun, timedProgress, } from "../../core/index.js";
|
|
@@ -13,6 +13,7 @@ import { DEFINITION_SET } from "../../extensions.js";
|
|
|
13
13
|
import { recordRun, } from "../../run-directory/index.js";
|
|
14
14
|
import { parseKeepTime } from "../../time/index.js";
|
|
15
15
|
import { jobSummaryMarkdown } from "./job-summary.js";
|
|
16
|
+
import { lacksFinalResults } from "./final-results.js";
|
|
16
17
|
import { testsSummaryLines } from "./tests-summary.js";
|
|
17
18
|
import { resourceFlagFields, resourceFlagProblems, resourceFlagValues } from "./resource-flags.js";
|
|
18
19
|
import { runView } from "./view.js";
|
|
@@ -31,8 +32,6 @@ const OWN_RUN_FIELDS = {
|
|
|
31
32
|
project: z.string().min(1).optional(),
|
|
32
33
|
credential: z.enum(["mint", "github-actions"]).optional(),
|
|
33
34
|
unsandboxed: z.boolean().default(false),
|
|
34
|
-
saveDevSnapshot: z.boolean().optional(),
|
|
35
|
-
noReuseDevSnapshot: z.boolean().default(false),
|
|
36
35
|
showOutput: z.boolean().default(false),
|
|
37
36
|
keepSandbox: z.string().optional(),
|
|
38
37
|
verbose: z.boolean().default(false),
|
|
@@ -78,18 +77,8 @@ const runRequestSchema = z.object(RUN_REQUEST_FIELDS);
|
|
|
78
77
|
* always mints, for the runner sandbox, so it needs `scope` and `project` whatever its resources are. In a sandboxed
|
|
79
78
|
* run, the first SIGINT, SIGTERM or SIGHUP stops the run in any phase: the sandboxed command is killed, every sandbox
|
|
80
79
|
* the run started is stopped and deleted, the resources are released, and the run cancels. `storm snapshots build`
|
|
81
|
-
* builds runner snapshots without a run. A
|
|
82
|
-
*
|
|
83
|
-
* commit or on top of it starts from it, unless it started from a dev snapshot built at HEAD's commit: one save per
|
|
84
|
-
* commit (`saveMode`). It saves none when `CI` is set, `--keep-sandbox` is above 0, or the recipe's install or build
|
|
85
|
-
* step names a runner secret and the recipe doesn't set `trustDevSnapshots`. `--save-dev-snapshot` (not with
|
|
86
|
-
* `--unsandboxed` or a `--keep-sandbox` above 0) saves once the command ended on its own, whatever its exit code and
|
|
87
|
-
* whatever the run started from, under `CI` too; on a recipe that doesn't trust dev snapshots it is
|
|
88
|
-
* `dev_snapshots_not_trusted`, a usage error that names the recipe key, before the runner's local checks.
|
|
89
|
-
* `--save-dev-snapshot=false` saves none. The recipe's `saveDevSnapshot` says the same for every run that gives
|
|
90
|
-
* neither that flag nor a `--keep-sandbox` above 0. `--no-reuse-dev-snapshot`, or the recipe's `reuseDevSnapshot: false`, starts
|
|
91
|
-
* the run from a base snapshot. A run whose save starts keeps no runner sandbox, however the save ends; one whose
|
|
92
|
-
* save never starts, such as one whose command failed without the flag, keeps it for the keep time.
|
|
80
|
+
* builds runner snapshots without a run. A run saves no runner snapshot as it ends: it keeps the runner sandbox for
|
|
81
|
+
* the keep time.
|
|
93
82
|
*
|
|
94
83
|
* `--credential` (no config key) picks the credential source: `mint`, the default, or `github-actions`, which requests
|
|
95
84
|
* a GitHub Actions OIDC token instead and so needs no `--scope` or `--project`; any given are unused. A sandboxed run
|
|
@@ -182,6 +171,9 @@ export async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
182
171
|
// view's.
|
|
183
172
|
const observer = recording.observer(view.observer);
|
|
184
173
|
const terminal = recording.terminal(view.runnerTerminal);
|
|
174
|
+
// Where the command reports its tests: a runner sandbox's own file, which the runner follows, or the run directory's
|
|
175
|
+
// test events file, which a run with no runner hands its command only once the run directory opened.
|
|
176
|
+
const collected = run.runner !== undefined || recording.testEvents !== undefined;
|
|
185
177
|
let outcome;
|
|
186
178
|
try {
|
|
187
179
|
const ended = await executeRun(DEFINITION_SET, { ...app.context, runnerTerminal: secrets.length === 0 ? terminal : redactingTerminal(terminal, redact) }, app.resourceContexts, run.runner === undefined && recording.testEvents !== undefined
|
|
@@ -199,11 +191,18 @@ export async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
199
191
|
throw error;
|
|
200
192
|
}
|
|
201
193
|
sigterm.release();
|
|
202
|
-
const ran = await summarize(app, {
|
|
194
|
+
const { timeline: ran, finalResults } = await summarize(app, {
|
|
195
|
+
command: spec.name,
|
|
196
|
+
hints: spec.hints,
|
|
197
|
+
view,
|
|
198
|
+
recording,
|
|
199
|
+
outcome,
|
|
200
|
+
});
|
|
203
201
|
switch (outcome.kind) {
|
|
204
202
|
case "ran": {
|
|
205
|
-
app.exit.status = commandExitStatus(outcome.command);
|
|
206
203
|
const { command } = outcome;
|
|
204
|
+
const runId = recording.opened.ok ? recording.opened.id : null;
|
|
205
|
+
app.exit.status = commandExitStatus(outcome.command);
|
|
207
206
|
return spec.ran({
|
|
208
207
|
version: app.version,
|
|
209
208
|
commit: app.commit,
|
|
@@ -220,22 +219,20 @@ export async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
220
219
|
: {
|
|
221
220
|
snapshotId: outcome.runner.snapshotId,
|
|
222
221
|
base: outcome.runner.base,
|
|
223
|
-
|
|
224
|
-
snapshotHead: outcome.runner.snapshotHead,
|
|
225
|
-
snapshotKind: outcome.runner.snapshot.kind,
|
|
226
|
-
snapshotBuiltAt: outcome.runner.snapshot.builtAt,
|
|
227
|
-
builtBehind: outcome.runner.snapshot.builtBehind,
|
|
222
|
+
builtBehind: outcome.runner.builtBehind,
|
|
228
223
|
uploadBytes: outcome.runner.uploadBytes,
|
|
229
224
|
built: outcome.runner.built,
|
|
230
225
|
vcpus: outcome.runner.vcpus,
|
|
231
226
|
region: outcome.runner.region,
|
|
232
227
|
runtime: outcome.runner.runtime,
|
|
233
228
|
buildMs: outcome.runner.buildMs,
|
|
234
|
-
save: outcome.runner.save,
|
|
235
|
-
noSaveReason: outcome.runner.noSave,
|
|
236
229
|
},
|
|
237
230
|
timeline: ran,
|
|
238
|
-
runId
|
|
231
|
+
runId,
|
|
232
|
+
noFinalTestResults: lacksFinalResults(command.kind === "exited" ? command.code : null, {
|
|
233
|
+
...finalResults,
|
|
234
|
+
collected,
|
|
235
|
+
}),
|
|
239
236
|
}, { testPlan, options: planOptions });
|
|
240
237
|
}
|
|
241
238
|
case "resource_refused":
|
|
@@ -274,7 +271,7 @@ export async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
274
271
|
}
|
|
275
272
|
/** What is wrong with a run's request that its schema can't say, as `validate` reports it. */
|
|
276
273
|
export function runProblems(request) {
|
|
277
|
-
const { credential, unsandboxed,
|
|
274
|
+
const { credential, unsandboxed, showOutput, keepSandbox } = request;
|
|
278
275
|
return [
|
|
279
276
|
...resourceFlagProblems(request),
|
|
280
277
|
...(!unsandboxed && credential === "github-actions"
|
|
@@ -309,22 +306,6 @@ export function runProblems(request) {
|
|
|
309
306
|
},
|
|
310
307
|
]
|
|
311
308
|
: []),
|
|
312
|
-
...(saveDevSnapshot === true && unsandboxed
|
|
313
|
-
? [
|
|
314
|
-
{
|
|
315
|
-
field: "saveDevSnapshot",
|
|
316
|
-
message: "--save-dev-snapshot saves a sandboxed run's runner sandbox; drop it or --unsandboxed.",
|
|
317
|
-
},
|
|
318
|
-
]
|
|
319
|
-
: []),
|
|
320
|
-
...(saveDevSnapshot === true && keepsSandbox(keepSandbox)
|
|
321
|
-
? [
|
|
322
|
-
{
|
|
323
|
-
field: "saveDevSnapshot",
|
|
324
|
-
message: "--save-dev-snapshot saves the runner sandbox instead of keeping it; drop --keep-sandbox or set it to 0.",
|
|
325
|
-
},
|
|
326
|
-
]
|
|
327
|
-
: []),
|
|
328
309
|
];
|
|
329
310
|
}
|
|
330
311
|
/**
|
|
@@ -346,18 +327,11 @@ async function runRequestFor(app, options) {
|
|
|
346
327
|
};
|
|
347
328
|
return { ok: true, run };
|
|
348
329
|
}
|
|
349
|
-
// No run flag grants the trust a recipe whose install or build takes a runner secret needs to save a dev snapshot.
|
|
350
|
-
if (request.saveDevSnapshot && !devSnapshotsTrusted(where.recipe))
|
|
351
|
-
return {
|
|
352
|
-
ok: false,
|
|
353
|
-
refusal: runErrors.devSnapshotsNotTrusted({ flag: "--save-dev-snapshot", configFile }),
|
|
354
|
-
};
|
|
355
330
|
const prepared = await prepareRunner(app.context, {
|
|
356
331
|
cwd: app.cwd,
|
|
357
332
|
recipe: where.recipe,
|
|
358
333
|
// The recipe's `vcpus` reads each of the run's resources by its definition: one its `beforeRun` skipped isn't.
|
|
359
334
|
vcpusRun: recipeRun(recipeResources(used.requests)),
|
|
360
|
-
reuseDevSnapshots: !request.noReuseDevSnapshot && where.recipe.reuseDevSnapshot,
|
|
361
335
|
});
|
|
362
336
|
if (prepared.kind !== "ok") {
|
|
363
337
|
const refusal = prepareRefusal(prepared, configFile);
|
|
@@ -377,7 +351,6 @@ async function runRequestFor(app, options) {
|
|
|
377
351
|
target: where.target,
|
|
378
352
|
user: app.user,
|
|
379
353
|
secrets: where.secrets,
|
|
380
|
-
save: saveMode(request, where.recipe, app.env),
|
|
381
354
|
keepMs,
|
|
382
355
|
},
|
|
383
356
|
};
|
|
@@ -415,7 +388,8 @@ export function checkoutFailedRefusal(failure) {
|
|
|
415
388
|
* Once the run is done: ends its recording, which writes how the run ended to the run directory and closes it
|
|
416
389
|
* (`RunRecording.end`). Then it appends the job summary, and has the view print the waterfall, with the worker chart
|
|
417
390
|
* under its tests lane, the tests' summary, the logs of failed steps, and what went wrong with the run directory. The
|
|
418
|
-
* job summary leaves the worker chart out. It answers the timeline, which a ran outcome carries
|
|
391
|
+
* job summary leaves the worker chart out. It answers the timeline, which a ran outcome carries, and how many final
|
|
392
|
+
* test results the run's test events held (`FinalResultsRead`).
|
|
419
393
|
*/
|
|
420
394
|
async function summarize(app, run) {
|
|
421
395
|
const { view, recording } = run;
|
|
@@ -445,7 +419,13 @@ async function summarize(app, run) {
|
|
|
445
419
|
: []),
|
|
446
420
|
],
|
|
447
421
|
}));
|
|
448
|
-
return
|
|
422
|
+
return {
|
|
423
|
+
timeline,
|
|
424
|
+
finalResults: {
|
|
425
|
+
finalResults: tests.events.filter((event) => event.kind === "test-result").length,
|
|
426
|
+
partial: tests.unreadable > 0 || tests.incomplete !== undefined,
|
|
427
|
+
},
|
|
428
|
+
};
|
|
449
429
|
}
|
|
450
430
|
/**
|
|
451
431
|
* How the workers' clock maps to the run's, for the worker chart under the tests lane; undefined without one. The
|
|
@@ -504,38 +484,6 @@ function recipeResources(requests) {
|
|
|
504
484
|
return [key, { definition, options }];
|
|
505
485
|
}));
|
|
506
486
|
}
|
|
507
|
-
/** Whether `--keep-sandbox` asks for a keep time above 0. `validate` refused a flag this can't read. */
|
|
508
|
-
function keepsSandbox(flag) {
|
|
509
|
-
return flag !== undefined && (parseKeepTime(flag) ?? 0) > 0;
|
|
510
|
-
}
|
|
511
|
-
/**
|
|
512
|
-
* Whether a sandboxed run saves its runner sandbox as a dev snapshot (`RunnerSaveMode`): `--save-dev-snapshot` as
|
|
513
|
-
* given, `always` or `never`; else never when `--keep-sandbox` asks to keep the runner sandbox, since a save deletes
|
|
514
|
-
* it and the flag is this run's own; else the recipe's `saveDevSnapshot` as given, with `CI` set too, as its
|
|
515
|
-
* `keepSandbox` applies there. With none of them it saves once per commit, once a command exits 0 (`new-head`), so a
|
|
516
|
-
* failed command's runner sandbox is kept for a person to connect to, but never when `CI` is set, since the runner
|
|
517
|
-
* snapshot cache is this machine's and a CI machine's next run rarely finds it, and never when the recipe's install
|
|
518
|
-
* or build step names a runner secret and it doesn't set `trustDevSnapshots` (`devSnapshotsTrusted`).
|
|
519
|
-
*/
|
|
520
|
-
function saveMode(request, recipe, env) {
|
|
521
|
-
const flag = request.saveDevSnapshot;
|
|
522
|
-
if (flag !== undefined)
|
|
523
|
-
return flag ? { kind: "always" } : { kind: "never", reason: "no-save-flag" };
|
|
524
|
-
if (keepsSandbox(request.keepSandbox))
|
|
525
|
-
return { kind: "never", reason: "keep-sandbox" };
|
|
526
|
-
if (recipe.saveDevSnapshot !== undefined)
|
|
527
|
-
return recipe.saveDevSnapshot ? { kind: "always" } : { kind: "never", reason: "recipe" };
|
|
528
|
-
if (isCi(env))
|
|
529
|
-
return { kind: "never", reason: "ci" };
|
|
530
|
-
return devSnapshotsTrusted(recipe) ? { kind: "new-head" } : { kind: "never", reason: "not-trusted" };
|
|
531
|
-
}
|
|
532
|
-
/**
|
|
533
|
-
* The save mode of a run here that gives neither `--save-dev-snapshot` nor `--keep-sandbox`: the recipe default, else
|
|
534
|
-
* the built-in default. `storm snapshots build` reads it to say when it saves a dev snapshot that such a run would not.
|
|
535
|
-
*/
|
|
536
|
-
export function runSaveDefault(recipe, env) {
|
|
537
|
-
return saveMode({}, recipe, env);
|
|
538
|
-
}
|
|
539
487
|
/** How long a runner sandbox keeps running once its run ends, when neither the flag nor the recipe says. */
|
|
540
488
|
export const DEFAULT_KEEP_SANDBOX_MINUTES = 30;
|
|
541
489
|
/**
|
|
@@ -15,12 +15,6 @@ export declare function runFields(verbose: string): {
|
|
|
15
15
|
unsandboxed: {
|
|
16
16
|
description: string;
|
|
17
17
|
};
|
|
18
|
-
saveDevSnapshot: {
|
|
19
|
-
description: string;
|
|
20
|
-
};
|
|
21
|
-
noReuseDevSnapshot: {
|
|
22
|
-
description: string;
|
|
23
|
-
};
|
|
24
18
|
keepSandbox: {
|
|
25
19
|
valueLabel: string;
|
|
26
20
|
description: string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// test runner: what `--verbose` does under a driver's program is the driver's to say (`DriverHelp.verbose`).
|
|
6
6
|
import { RESOURCE_FLAG_HELP, RESOURCE_USAGE_FLAGS, resourceRunExamples } from "./resource-flags.js";
|
|
7
7
|
/** The flags every run takes, as a usage line names them, before the command's own arguments. */
|
|
8
|
-
export const RUN_USAGE_FLAGS = `${RESOURCE_USAGE_FLAGS} [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>] [--unsandboxed | [--
|
|
8
|
+
export const RUN_USAGE_FLAGS = `${RESOURCE_USAGE_FLAGS} [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>] [--unsandboxed | [--show-output] [--keep-sandbox <DURATION>]] [--verbose]`;
|
|
9
9
|
/**
|
|
10
10
|
* The field descriptions of the run's own flags. `--verbose`'s ends in `verbose`, the driver's words for what
|
|
11
11
|
* `verbose` in the run payload does under its program (`DriverHelp.verbose`).
|
|
@@ -18,15 +18,9 @@ const ownRunFields = (verbose) => ({
|
|
|
18
18
|
unsandboxed: {
|
|
19
19
|
description: "Run the command on this machine, with no isolation: it sees this machine's files and environment, less the variables the resources drop. 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.",
|
|
20
20
|
},
|
|
21
|
-
saveDevSnapshot: {
|
|
22
|
-
description: "Save the runner sandbox as a dev snapshot at HEAD's commit once the command ends on its own, after a successful install and build, whatever the command's exit code and whatever the run started from, under CI too, so a later run from this checkout at that commit, or at a commit on top of it, starts from this run's installed packages and build outputs. Not with --unsandboxed, or with --keep-sandbox above 0. --save-dev-snapshot=false saves none. Without the flag, a sandboxed run saves one when the command exits 0, unless it started from a dev snapshot built at HEAD's commit, so each commit saves once; it saves none when the command fails, when CI is set, with --keep-sandbox above 0, or when the runner recipe's install or build step names a runner secret and the recipe doesn't set trustDevSnapshots: true, since those steps would run in a later run on top of what the command wrote in this run. Such a recipe also reuses no dev snapshot, and this flag is a usage error for it: only the recipe's trustDevSnapshots: true grants that trust. A detached HEAD saves as any HEAD does. The save resets the working tree to the snapshot's base, keeps .git and ignored files such as node_modules and build outputs, and empties /tmp; the snapshot keeps whatever the command wrote there and to $HOME, a resource's token included. A run that starts a save keeps no runner sandbox, however the save ends; a run that starts none, such as one a signal stops, one whose install or build fails, or, without the flag, one whose command fails, keeps it for the keep time. Without the flag and without --keep-sandbox above 0, saveDevSnapshot in the runner recipe says the same as the flag for every run: false saves none, true saves as --save-dev-snapshot does.",
|
|
23
|
-
},
|
|
24
|
-
noReuseDevSnapshot: {
|
|
25
|
-
description: "Start this run from a base snapshot: no dev snapshot counts when the run picks its runner snapshot. The run may still save one. Without the flag, a run starts from the cached runner snapshot of its merge-base whose commit is the fewest commits behind HEAD in HEAD's history, and a dev snapshot counts only when this checkout saved it at HEAD's commit or at an ancestor of it. reuseDevSnapshot: false in the runner recipe says the same for every run.",
|
|
26
|
-
},
|
|
27
21
|
keepSandbox: {
|
|
28
22
|
valueLabel: "DURATION",
|
|
29
|
-
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).
|
|
23
|
+
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 --unsandboxed.",
|
|
30
24
|
},
|
|
31
25
|
showOutput: {
|
|
32
26
|
description: "In a sandboxed 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 --unsandboxed. No config key.",
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import type { RejectedSnapshot,
|
|
1
|
+
import type { RejectedSnapshot, SnapshotCacheNote, SnapshotRejectionReason } from "../../runner/index.ts";
|
|
2
2
|
/** How many of the snapshots a run doesn't start from its build line lists, before it counts the rest. */
|
|
3
3
|
export declare const REJECTIONS_SHOWN = 5;
|
|
4
4
|
/** `count` commits, as text: `1 commit`, `24 commits`. */
|
|
5
5
|
export declare function commitsText(count: number): string;
|
|
6
6
|
/**
|
|
7
7
|
* Where a runner snapshot was built, from the commits a run knows: at HEAD's commit, at the run's merge-base, or some
|
|
8
|
-
* commits before HEAD.
|
|
9
|
-
*
|
|
10
|
-
* still reads true; a count storm doesn't have is null.
|
|
8
|
+
* commits before HEAD. A snapshot is built at its `base`; `mergeBase` is the run's own, undefined when the run didn't
|
|
9
|
+
* say it; a count storm doesn't have is null.
|
|
11
10
|
*/
|
|
12
11
|
export declare function builtAtText(snapshot: {
|
|
13
|
-
readonly
|
|
12
|
+
readonly base: string;
|
|
14
13
|
readonly builtBehind: number | null;
|
|
15
|
-
readonly
|
|
14
|
+
readonly mergeBase: string | undefined;
|
|
16
15
|
}): string;
|
|
17
|
-
/**
|
|
18
|
-
* Why a run doesn't start from a cached snapshot, as a person reads it after the snapshot's id. It reads only the root
|
|
19
|
-
* of the checkout that saved the snapshot (`repoRoot`, null for a base snapshot), its built-at commit (`builtAt`) and
|
|
20
|
-
* its base (`base`).
|
|
21
|
-
*/
|
|
16
|
+
/** Why a run doesn't start from a cached snapshot, as a person reads it after the snapshot's id. */
|
|
22
17
|
export declare function rejectionText(reason: SnapshotRejectionReason, snapshot: {
|
|
23
|
-
readonly repoRoot: string | null;
|
|
24
|
-
readonly builtAt: string;
|
|
25
18
|
readonly base: string;
|
|
26
19
|
}): string;
|
|
27
20
|
/**
|
|
@@ -29,10 +22,8 @@ export declare function rejectionText(reason: SnapshotRejectionReason, snapshot:
|
|
|
29
22
|
* at most, then how many more `storm snapshots list` shows.
|
|
30
23
|
*/
|
|
31
24
|
export declare function rejectionLines(rejected: readonly RejectedSnapshot[]): string[];
|
|
32
|
-
/** Why a run whose command ended on its own saved no dev snapshot, as its cleanup line says after the colon. */
|
|
33
|
-
export declare function noSaveText(reason: RunnerNoSaveReason): string;
|
|
34
25
|
/** Every reason a run doesn't start from a cached snapshot, for a schema. */
|
|
35
|
-
export declare const REJECTION_REASONS: readonly ["expired", "expires-soon", "other-
|
|
26
|
+
export declare const REJECTION_REASONS: readonly ["expired", "expires-soon", "other-base", "steps-changed", "other-owner"];
|
|
36
27
|
/**
|
|
37
28
|
* What removing expired entries from the runner snapshot cache noticed, as a run's and `storm snapshots build`'s
|
|
38
29
|
* progress line.
|