@cnc-tools/storm 0.16.0 → 0.18.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/bin/storm.js +54 -40
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-24UYAK4R.js} +465 -365
- package/dist/chunks/{chunk-DC2CDHNK.js → chunk-2JMWUKH3.js} +2074 -473
- package/dist/chunks/{chunk-FOZWA52V.js → chunk-3VXZONGE.js} +481 -376
- package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-55O4FCN4.js} +1 -1
- package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
- package/dist/chunks/chunk-AS37D43E.js +2173 -0
- package/dist/chunks/chunk-CQAY6GLP.js +1260 -0
- package/dist/chunks/chunk-DZLU7BYK.js +340 -0
- package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
- package/dist/chunks/{chunk-TJNFVNKR.js → chunk-EI3XDCEI.js} +1 -1
- package/dist/chunks/{chunk-HVNK3I45.js → chunk-FDUY3BNF.js} +1 -1
- package/dist/chunks/{chunk-FCQUJDA4.js → chunk-GUCCYCIO.js} +4 -189
- package/dist/chunks/{chunk-OIY3DMF2.js → chunk-HBI4LEMH.js} +3 -3
- package/dist/chunks/{chunk-2MAD5NKK.js → chunk-K4MDQPLW.js} +1 -18
- package/dist/chunks/chunk-KK7PAWIZ.js +198 -0
- package/dist/chunks/{chunk-G3PHMXH5.js → chunk-KQ5FXRUD.js} +18 -1
- package/dist/chunks/{chunk-5VXBKPW6.js → chunk-LKXHGGGX.js} +1 -1
- package/dist/chunks/{chunk-P357TZAY.js → chunk-LOGHIUUB.js} +21 -18
- package/dist/chunks/{chunk-CK2GZEPK.js → chunk-OEPFINFT.js} +2 -2
- package/dist/chunks/{chunk-DWEAHX4T.js → chunk-OI4AP6Z7.js} +5 -5
- package/dist/chunks/{chunk-V4IKA3WI.js → chunk-PMBQWVTW.js} +26 -19
- package/dist/chunks/chunk-SZMYIIG2.js +88 -0
- package/dist/chunks/{chunk-5CCP36QQ.js → chunk-TXCOFC7N.js} +1 -1
- package/dist/chunks/{chunk-VUPZH7J2.js → chunk-UXD3TVWM.js} +1 -1
- package/dist/chunks/{chunk-3L52KNQA.js → chunk-WNW2QXQK.js} +8 -8
- package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
- package/dist/chunks/{live-app-WECQOQ4C.js → live-app-UY7BEDUN.js} +17 -13
- package/dist/cli.d.ts +28 -0
- package/dist/cli.js +64 -0
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +2 -2
- package/dist/commands/exec/across-sandboxes-outcomes.js +3 -3
- package/dist/commands/exec/before-run.d.ts +123 -0
- package/dist/commands/exec/before-run.js +105 -0
- package/dist/commands/exec/command.d.ts +67 -14
- package/dist/commands/exec/command.js +31 -95
- package/dist/commands/exec/driver-plan.d.ts +9 -4
- package/dist/commands/exec/driver-plan.js +8 -8
- package/dist/commands/exec/exec-words.js +1 -1
- package/dist/commands/exec/execute-run.d.ts +39 -0
- package/dist/commands/exec/execute-run.js +325 -0
- package/dist/commands/exec/live-view.d.ts +3 -3
- package/dist/commands/exec/live-view.js +16 -15
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/mint-failed.d.ts +38 -0
- package/dist/commands/exec/mint-failed.js +27 -4
- package/dist/commands/exec/outcomes.d.ts +104 -22
- package/dist/commands/exec/outcomes.js +73 -26
- package/dist/commands/exec/plan-run.d.ts +58 -150
- package/dist/commands/exec/plan-run.js +239 -90
- package/dist/commands/exec/progress.d.ts +10 -6
- package/dist/commands/exec/progress.js +38 -25
- package/dist/commands/exec/run-bin.d.ts +11 -11
- package/dist/commands/exec/run-bin.js +9 -9
- package/dist/commands/exec/run-flags.d.ts +69 -0
- package/dist/commands/exec/run-flags.js +58 -0
- package/dist/commands/exec/run-metadata.js +4 -4
- package/dist/commands/exec/run-summary.d.ts +58 -0
- package/dist/commands/exec/run-summary.js +205 -0
- package/dist/commands/exec/runner-refusals.d.ts +82 -0
- package/dist/commands/exec/runner-refusals.js +71 -0
- package/dist/commands/exec/sandbox-progress.js +3 -0
- package/dist/commands/exec/stopped-outcome.d.ts +12 -0
- package/dist/commands/exec/stopped-outcome.js +77 -0
- package/dist/commands/exec/view.d.ts +20 -11
- package/dist/commands/exec/view.js +103 -47
- package/dist/commands/runs/facts.d.ts +8 -4
- package/dist/commands/runs/facts.js +19 -10
- package/dist/commands/runs/list/command.d.ts +16 -8
- package/dist/commands/runs/list/command.js +10 -10
- package/dist/commands/runs/list/outcomes.d.ts +8 -4
- package/dist/commands/runs/logs/command.js +10 -10
- package/dist/commands/runs/show/command.d.ts +16 -8
- package/dist/commands/runs/show/command.js +31 -29
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +8 -4
- package/dist/commands/runs/show/outcomes.js +8 -6
- package/dist/commands/snapshots/access.d.ts +111 -0
- package/dist/commands/snapshots/access.js +96 -0
- package/dist/commands/snapshots/build/command.d.ts +376 -101
- package/dist/commands/snapshots/build/command.js +447 -149
- package/dist/commands/snapshots/build/metadata.d.ts +10 -0
- package/dist/commands/snapshots/build/metadata.js +31 -11
- package/dist/commands/snapshots/build/outcomes.d.ts +242 -47
- package/dist/commands/snapshots/build/outcomes.js +200 -36
- package/dist/commands/snapshots/list/command.d.ts +368 -27
- package/dist/commands/snapshots/list/command.js +298 -68
- package/dist/commands/snapshots/list/metadata.d.ts +16 -0
- package/dist/commands/snapshots/list/metadata.js +29 -6
- package/dist/commands/snapshots/list/outcomes.d.ts +247 -15
- package/dist/commands/snapshots/list/outcomes.js +223 -52
- package/dist/commands/snapshots/metadata.js +1 -1
- package/dist/commands/snapshots/prune/command.d.ts +430 -0
- package/dist/commands/snapshots/prune/command.js +161 -0
- package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
- package/dist/commands/snapshots/prune/metadata.js +39 -0
- package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
- package/dist/commands/snapshots/prune/outcomes.js +78 -0
- package/dist/commands/suites/list/command.js +17 -17
- package/dist/commands/suites/list/outcomes.js +2 -2
- package/dist/commands/test/command.d.ts +67 -14
- package/dist/commands/test/command.js +49 -252
- package/dist/commands/test/outcomes.d.ts +33 -7
- package/dist/config/check-runner.d.ts +3 -3
- package/dist/config/check-runner.js +8 -7
- package/dist/config/credential-resolver.d.ts +50 -5
- package/dist/config/credential-resolver.js +51 -19
- package/dist/config/credential-settle.d.ts +6 -2
- package/dist/config/credential-settle.js +11 -5
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +1 -1
- package/dist/config/runner.d.ts +5 -5
- package/dist/config/runner.js +1 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/schema.js +1 -1
- package/dist/config-file/define.d.ts +1 -1
- package/dist/config-file/define.js +1 -1
- package/dist/config-file/runner.d.ts +5 -5
- package/dist/config-file/toolchain.d.ts +14 -4
- package/dist/config-file/toolchain.js +43 -7
- package/dist/context.d.ts +10 -6
- package/dist/context.js +8 -6
- package/dist/core/across-sandboxes.d.ts +7 -6
- package/dist/core/across-sandboxes.js +123 -152
- package/dist/core/coordinator.d.ts +166 -0
- package/dist/core/coordinator.js +233 -0
- package/dist/core/events.d.ts +2 -2
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +1 -1
- package/dist/core/outcomes.d.ts +148 -0
- package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
- package/dist/core/resources.d.ts +31 -53
- package/dist/core/resources.js +32 -70
- package/dist/core/run-state.d.ts +7 -1
- package/dist/core/run-state.js +2 -0
- package/dist/core/run.d.ts +32 -236
- package/dist/core/run.js +107 -267
- package/dist/core/state-directory.d.ts +1 -1
- package/dist/core/state-directory.js +2 -2
- package/dist/credential/gateways.d.ts +15 -1
- package/dist/credential/index.d.ts +4 -3
- package/dist/credential/index.js +3 -2
- package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
- package/dist/credential/live/vercel-cli-gateway.js +1 -1
- package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
- package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
- package/dist/credential/source.d.ts +73 -6
- package/dist/credential/source.js +55 -2
- package/dist/extension-commands.d.ts +1 -1
- package/dist/extension-commands.js +2 -2
- package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
- package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
- package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
- package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/credential-facts.d.ts +6 -2
- package/dist/extensions/testserver/credential-facts.js +29 -11
- package/dist/extensions/testserver/lifecycle.js +7 -1
- package/dist/extensions/testserver/limit.d.ts +3 -0
- package/dist/extensions/testserver/limit.js +3 -0
- package/dist/extensions/testserver/provision.d.ts +8 -1
- package/dist/extensions/testserver/provision.js +8 -3
- package/dist/extensions/testserver/refusals.d.ts +6 -1
- package/dist/extensions/testserver/refusals.js +16 -1
- package/dist/extensions/testserver/resource.d.ts +1 -1
- package/dist/extensions/testserver/resource.js +1 -1
- package/dist/extensions/testserver/result.d.ts +1 -1
- package/dist/extensions/testserver/result.js +9 -4
- package/dist/planning/driver-file-lists.d.ts +0 -15
- package/dist/planning/driver-file-lists.js +2 -21
- package/dist/planning/plan-only.d.ts +3 -14
- package/dist/planning/plan-only.js +11 -20
- package/dist/planning/run-kind-flags.js +2 -2
- package/dist/planning/run-plan.d.ts +45 -12
- package/dist/planning/run-plan.js +4 -3
- package/dist/planning/suites.d.ts +1 -1
- package/dist/planning/suites.js +2 -2
- package/dist/planning/test-plan.d.ts +9 -0
- package/dist/planning/test-plan.js +9 -0
- package/dist/run-directory/recording.js +3 -3
- package/dist/run-directory/run-record.d.ts +26 -11
- package/dist/run-directory/run-record.js +16 -13
- package/dist/runner/base.js +1 -1
- package/dist/runner/build-snapshots.d.ts +60 -29
- package/dist/runner/build-snapshots.js +136 -29
- package/dist/runner/context.d.ts +15 -7
- package/dist/runner/context.js +19 -6
- package/dist/runner/events.d.ts +16 -10
- package/dist/runner/gateways.d.ts +122 -23
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/gh.d.ts +42 -0
- package/dist/runner/gh.js +58 -0
- package/dist/runner/index.d.ts +13 -8
- package/dist/runner/index.js +12 -6
- package/dist/runner/live/checkout-gateway.js +7 -0
- package/dist/runner/live/gh-output.d.ts +17 -0
- package/dist/runner/live/gh-output.js +37 -0
- package/dist/runner/live/gh-token-gateway.d.ts +13 -0
- package/dist/runner/live/gh-token-gateway.js +51 -0
- package/dist/runner/live/sandbox-errors.d.ts +2 -0
- package/dist/runner/live/sandbox-errors.js +4 -0
- package/dist/runner/live/sandbox-gateway.js +140 -4
- package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
- package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
- package/dist/runner/live/snapshot-records.js +12 -12
- package/dist/runner/local-snapshot-index.d.ts +205 -0
- package/dist/runner/local-snapshot-index.js +210 -0
- package/dist/runner/network-policy.d.ts +6 -6
- package/dist/runner/network-policy.js +7 -7
- package/dist/runner/policy-writes.d.ts +1 -1
- package/dist/runner/policy-writes.js +1 -1
- package/dist/runner/prepare.d.ts +14 -14
- package/dist/runner/prepare.js +20 -11
- package/dist/runner/ready.d.ts +19 -11
- package/dist/runner/ready.js +104 -33
- package/dist/runner/sandboxed-command.d.ts +3 -3
- package/dist/runner/sandboxed-command.js +3 -3
- package/dist/runner/scope.d.ts +15 -8
- package/dist/runner/scope.js +16 -5
- package/dist/runner/secrets.d.ts +41 -18
- package/dist/runner/secrets.js +226 -30
- package/dist/runner/session.d.ts +8 -8
- package/dist/runner/session.js +6 -3
- package/dist/runner/shared-snapshot-entry.d.ts +92 -0
- package/dist/runner/shared-snapshot-entry.js +168 -0
- package/dist/runner/shared-snapshot-list.d.ts +81 -0
- package/dist/runner/shared-snapshot-list.js +155 -0
- package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
- package/dist/runner/shared-snapshot-lookup.js +118 -0
- package/dist/runner/shared-snapshot-prune.d.ts +58 -0
- package/dist/runner/shared-snapshot-prune.js +133 -0
- package/dist/runner/snapshot-build.d.ts +42 -14
- package/dist/runner/snapshot-build.js +79 -47
- package/dist/runner/snapshot-choice.js +2 -1
- package/dist/runner/snapshot-inspect.d.ts +39 -40
- package/dist/runner/snapshot-inspect.js +52 -35
- package/dist/runner/snapshot-key.d.ts +32 -17
- package/dist/runner/snapshot-key.js +43 -18
- package/dist/runner/snapshot-source.d.ts +31 -0
- package/dist/runner/snapshot-source.js +122 -0
- package/dist/runner/steps.d.ts +1 -1
- package/dist/runner/steps.js +1 -1
- package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +4 -2
- package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +7 -2
- package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +59 -28
- package/dist/runner/{recipe.js → vercel-sandbox-options.js} +128 -84
- package/dist/runner/vercel-sandbox-secrets.d.ts +116 -0
- package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +159 -26
- package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
- package/dist/sdk/extension/credential-diagnosis.js +25 -5
- package/dist/sdk/extension/credential-source.d.ts +20 -3
- package/dist/sdk/extension/credential-source.js +4 -4
- package/dist/sdk/extension/index.d.ts +3 -2
- package/dist/sdk/extension/index.js +2 -1
- package/dist/sdk/extension/resource-definition.d.ts +1 -1
- package/dist/sdk/extension/secret-source.d.ts +1 -1
- package/dist/sdk/extension/secret-source.js +1 -1
- package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
- package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
- package/dist/shared/cleanup.d.ts +3 -3
- package/dist/shared/cleanup.js +15 -5
- package/dist/shared/snapshot-text.d.ts +4 -4
- package/dist/shared/snapshot-text.js +11 -11
- package/dist/time/duration.js +1 -1
- package/package.json +5 -3
- package/skills/overview.md +4 -4
- package/skills/plan-runs.md +1 -1
- package/skills/read-run-output.md +6 -6
- package/dist/application.d.ts +0 -21
- package/dist/application.js +0 -30
- package/dist/chunks/chunk-7EENF73W.js +0 -782
- package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
- package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
- package/dist/commands/exec/across-sandboxes-run.js +0 -339
- package/dist/commands/exec/plan-only.d.ts +0 -10
- package/dist/commands/exec/plan-only.js +0 -45
- package/dist/commands/exec/run-command.d.ts +0 -475
- package/dist/commands/exec/run-command.js +0 -603
- package/dist/commands/exec/run-planned.d.ts +0 -20
- package/dist/commands/exec/run-planned.js +0 -22
- package/dist/commands/exec/sandbox-view.d.ts +0 -19
- package/dist/commands/exec/sandbox-view.js +0 -72
- package/dist/commands/test/plan.d.ts +0 -92
- package/dist/commands/test/plan.js +0 -125
- package/dist/core/sandbox-end.d.ts +0 -64
- package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
- package/dist/runner/recipe-secrets.d.ts +0 -67
- package/dist/runner/snapshot-cache.d.ts +0 -148
- package/dist/runner/snapshot-cache.js +0 -126
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
// End-of-run summaries, job summaries, waterfall rendering, final-results counting, and `sandboxes_ran` outcome fact
|
|
2
|
+
// builders shared by `storm test` and `storm exec`.
|
|
3
|
+
import { DEFINITION_SET } from "../../extensions.js";
|
|
4
|
+
import { fileListMismatches } from "../../planning/file-lists.js";
|
|
5
|
+
import { RUN_CLEANUP } from "../../shared/cleanup.js";
|
|
6
|
+
import { sandboxConnectPage } from "../../shared/dashboard.js";
|
|
7
|
+
import { acrossSandboxesJobSummaryMarkdown, jobSummaryMarkdown } from "../../shared/job-summary.js";
|
|
8
|
+
import { testsSummaryLines } from "../../shared/tests-summary.js";
|
|
9
|
+
import { paint } from "../../shared/text.js";
|
|
10
|
+
import { waterfallLines } from "../../shared/waterfall.js";
|
|
11
|
+
import { hasPoorParallelism, testsChart } from "../../shared/worker-chart.js";
|
|
12
|
+
import { acrossSandboxesEndLines, showsFailed } from "./sandbox-lines.js";
|
|
13
|
+
/** Counts final test results and partial-read flags across a run's recorded test events. */
|
|
14
|
+
export function countFinalResults(tests) {
|
|
15
|
+
return {
|
|
16
|
+
finalResults: tests.events.filter((event) => event.kind === "test-result").length,
|
|
17
|
+
partial: tests.unreadable > 0 || tests.incomplete !== undefined,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** Shortens a path under `$HOME` to `~/...` for display in summaries and headers. */
|
|
21
|
+
export function displayPath(path, env) {
|
|
22
|
+
const home = env["HOME"];
|
|
23
|
+
if (home === undefined || home === "" || !path.startsWith(`${home}/`))
|
|
24
|
+
return path;
|
|
25
|
+
return `~${path.slice(home.length)}`;
|
|
26
|
+
}
|
|
27
|
+
/** Ends a single run's recording, appends its job summary, finishes its view, and returns its timeline and test counts. */
|
|
28
|
+
export async function summarizeSingle(app, run) {
|
|
29
|
+
const { view, recording } = run;
|
|
30
|
+
const recorded = await recording.end(run.outcome);
|
|
31
|
+
const { timeline, tests } = recorded;
|
|
32
|
+
const logs = recording.opened.ok ? recording.opened.path : undefined;
|
|
33
|
+
const failed = tests.events.some((event) => event.kind === "test-result" && event.state === "fail");
|
|
34
|
+
const testsLines = testsSummaryLines(tests.events, run.hints, tests.unreadable, tests.incomplete);
|
|
35
|
+
const stepLogs = failedStepLogs(timeline, recording, app.env);
|
|
36
|
+
const clock = workerClock(recorded);
|
|
37
|
+
const charted = clock === undefined ? undefined : testsChart(tests.events, run.hints, tests.unreadable, clock, tests.incomplete);
|
|
38
|
+
const workersHint = charted !== undefined && hasPoorParallelism(charted.parallelism);
|
|
39
|
+
const summarized = await app.context.jobSummary.appendJobSummary(jobSummaryMarkdown(timeline, {
|
|
40
|
+
command: run.command,
|
|
41
|
+
logs,
|
|
42
|
+
details: [...testsLines, ...stepLogs],
|
|
43
|
+
}));
|
|
44
|
+
await view.finish(waterfallLines(timeline, {
|
|
45
|
+
width: view.width,
|
|
46
|
+
colorDepth: view.colorDepth,
|
|
47
|
+
logs: logsText(recording, recorded.writeFailure, app.env, failed, workersHint),
|
|
48
|
+
...(charted === undefined ? {} : { workers: charted.lanes }),
|
|
49
|
+
details: [...(charted?.notes ?? testsLines), ...stepLogs, ...jobSummaryFailureLines(summarized)],
|
|
50
|
+
}));
|
|
51
|
+
return { timeline, finalResults: countFinalResults(tests) };
|
|
52
|
+
}
|
|
53
|
+
/** Compares each runner sandbox's assigned file list against the test files it reported. */
|
|
54
|
+
export function listMismatches(recorded) {
|
|
55
|
+
return fileListMismatches(recorded.sandboxes.map(({ record, tests }) => ({
|
|
56
|
+
sandbox: record.sandbox,
|
|
57
|
+
files: record.files,
|
|
58
|
+
exitCode: record.exitCode,
|
|
59
|
+
reported: tests.events.map((event) => event.file),
|
|
60
|
+
whole: tests.unreadable === 0 && tests.incomplete === undefined,
|
|
61
|
+
})));
|
|
62
|
+
}
|
|
63
|
+
/** Appends a multi-sandbox run's job summary and finishes its view with per-sandbox waterfalls and the end table. */
|
|
64
|
+
export async function summarizeAcrossSandboxes(app, run) {
|
|
65
|
+
const { view, recording, recorded, hints } = run;
|
|
66
|
+
const style = paint(view.colorDepth !== "none");
|
|
67
|
+
const events = recorded.sandboxes.flatMap((sandbox) => sandbox.tests.events.map((event) => ({ ...event, sandbox: sandbox.record.sandbox })));
|
|
68
|
+
const testsLines = testsSummaryLines(events, hints, recorded.tests.unreadable, recorded.tests.incomplete);
|
|
69
|
+
const failed = events.some((event) => event.kind === "test-result" && event.state === "fail");
|
|
70
|
+
const opened = recording.opened;
|
|
71
|
+
const summarized = await app.context.jobSummary.appendJobSummary(acrossSandboxesJobSummaryMarkdown(recorded.sandboxes.map(({ record }) => record), { command: run.command, logs: opened.ok ? opened.path : undefined, details: testsLines }));
|
|
72
|
+
const ranSandboxes = run.outcome.kind === "sandboxes_ran" || run.outcome.kind === "canceled";
|
|
73
|
+
const sandboxes = recorded.sandboxes.map((sandbox) => {
|
|
74
|
+
const tests = sandbox.timeline.rows.find((row) => row.name === "command");
|
|
75
|
+
const charted = tests === undefined
|
|
76
|
+
? undefined
|
|
77
|
+
: testsChart(sandbox.tests.events, hints, sandbox.tests.unreadable, { runStartedAt: Date.parse(sandbox.timeline.startedAt), offsetMs: sandbox.workerOffsetMs, tests }, sandbox.tests.incomplete);
|
|
78
|
+
return {
|
|
79
|
+
sandbox: sandbox.record.sandbox,
|
|
80
|
+
waterfall: waterfallLines(sandbox.timeline, {
|
|
81
|
+
width: view.width,
|
|
82
|
+
colorDepth: view.colorDepth,
|
|
83
|
+
logs: undefined,
|
|
84
|
+
...(charted === undefined ? {} : { workers: charted.lanes, details: charted.notes }),
|
|
85
|
+
}),
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
const [first] = sandboxes;
|
|
89
|
+
const runId = opened.ok ? opened.id : undefined;
|
|
90
|
+
const records = recorded.sandboxes.map(({ record }) => record);
|
|
91
|
+
const lines = acrossSandboxesEndLines({
|
|
92
|
+
sandboxes: ranSandboxes ? sandboxes : [],
|
|
93
|
+
records,
|
|
94
|
+
tests: testsLines,
|
|
95
|
+
runId,
|
|
96
|
+
logs: logsText(recording, recorded.writeFailure, app.env, failed && !showsFailed(records, runId), false),
|
|
97
|
+
mismatches: run.mismatches,
|
|
98
|
+
...(run.extraMismatchHint === undefined ? {} : { extraMismatchHint: run.extraMismatchHint }),
|
|
99
|
+
paint: style,
|
|
100
|
+
});
|
|
101
|
+
const once = ranSandboxes || first === undefined ? [] : first.waterfall;
|
|
102
|
+
await view.finish([...once, ...lines, ...jobSummaryFailureLines(summarized)]);
|
|
103
|
+
}
|
|
104
|
+
/** Builds the `SandboxesRanFacts` payload for a completed run across runner sandboxes. */
|
|
105
|
+
export function sandboxesRanFacts(app, run) {
|
|
106
|
+
const { outcome, recorded, recording, plan, runner } = run;
|
|
107
|
+
const records = recorded.sandboxes.map(({ record }) => record);
|
|
108
|
+
const count = (state) => records.filter((record) => record.state === state).length;
|
|
109
|
+
const totals = records.flatMap(({ tests }) => (tests === null ? [] : [tests]));
|
|
110
|
+
const snapshotState = recorded.state.runner?.snapshot;
|
|
111
|
+
const { entry } = outcome.snapshot;
|
|
112
|
+
return {
|
|
113
|
+
version: app.version,
|
|
114
|
+
commit: app.commit,
|
|
115
|
+
configFile: run.configFile,
|
|
116
|
+
runId: recording.opened.ok ? recording.opened.id : null,
|
|
117
|
+
runDirectory: recording.opened.ok ? recording.opened.path : null,
|
|
118
|
+
sandboxes: records,
|
|
119
|
+
states: {
|
|
120
|
+
passed: count("passed"),
|
|
121
|
+
failed: count("failed"),
|
|
122
|
+
"not-started": count("not-started"),
|
|
123
|
+
canceled: count("canceled"),
|
|
124
|
+
},
|
|
125
|
+
tests: totals.length === 0
|
|
126
|
+
? null
|
|
127
|
+
: {
|
|
128
|
+
passed: totals.reduce((sum, { passed }) => sum + passed, 0),
|
|
129
|
+
failed: totals.reduce((sum, { failed }) => sum + failed, 0),
|
|
130
|
+
skipped: totals.reduce((sum, { skipped }) => sum + skipped, 0),
|
|
131
|
+
},
|
|
132
|
+
plan: {
|
|
133
|
+
...plan,
|
|
134
|
+
options: plan.options.map((option) => ({ ...option })),
|
|
135
|
+
...(plan.sandboxes === undefined ? {} : { sandboxes: { ...plan.sandboxes } }),
|
|
136
|
+
},
|
|
137
|
+
resources: DEFINITION_SET.reports.ranFacts(outcome.resources),
|
|
138
|
+
wallMs: recorded.wallMs,
|
|
139
|
+
runner: {
|
|
140
|
+
snapshotId: entry.snapshotId,
|
|
141
|
+
base: entry.base,
|
|
142
|
+
builtBehind: snapshotState !== undefined && snapshotState.kind !== "building" ? snapshotState.builtBehind : null,
|
|
143
|
+
built: outcome.snapshot.built,
|
|
144
|
+
vcpus: runner.prepared.vcpus,
|
|
145
|
+
region: entry.region,
|
|
146
|
+
image: entry.image,
|
|
147
|
+
uploadBytes: recorded.uploadBytes,
|
|
148
|
+
},
|
|
149
|
+
cleanup: RUN_CLEANUP.facts(outcome),
|
|
150
|
+
kept: outcome.sandboxes.flatMap(({ sandbox, runnerCleanup }) => {
|
|
151
|
+
const kept = runnerCleanup?.kept ?? null;
|
|
152
|
+
return kept === null
|
|
153
|
+
? []
|
|
154
|
+
: [
|
|
155
|
+
{
|
|
156
|
+
sandbox,
|
|
157
|
+
name: kept.name,
|
|
158
|
+
stopsAt: kept.stopsAt,
|
|
159
|
+
url: runner.target === null ? null : sandboxConnectPage(runner.target, kept.name),
|
|
160
|
+
},
|
|
161
|
+
];
|
|
162
|
+
}),
|
|
163
|
+
notKept: outcome.sandboxes.flatMap(({ sandbox, runnerCleanup }) => {
|
|
164
|
+
const notKept = runnerCleanup?.notKept ?? null;
|
|
165
|
+
return notKept === null ? [] : [{ sandbox, name: notKept.name, message: notKept.message }];
|
|
166
|
+
}),
|
|
167
|
+
fileListMismatches: run.mismatches.map(({ sandbox, missing, extra }) => ({
|
|
168
|
+
sandbox,
|
|
169
|
+
missing: [...missing],
|
|
170
|
+
extra: [...extra],
|
|
171
|
+
})),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function jobSummaryFailureLines(summarized) {
|
|
175
|
+
return summarized.kind === "failed"
|
|
176
|
+
? [` couldn't append to the job summary at ${summarized.failure.path}: ${summarized.failure.message}`]
|
|
177
|
+
: [];
|
|
178
|
+
}
|
|
179
|
+
function workerClock({ timeline, workerOffsetMs }) {
|
|
180
|
+
const tests = timeline.rows.find((row) => row.name === "command");
|
|
181
|
+
if (tests === undefined)
|
|
182
|
+
return undefined;
|
|
183
|
+
return { runStartedAt: Date.parse(timeline.startedAt), offsetMs: workerOffsetMs, tests };
|
|
184
|
+
}
|
|
185
|
+
function logsText({ opened }, writeFailure, env, failed, workersHint) {
|
|
186
|
+
if (!opened.ok)
|
|
187
|
+
return `none: couldn't make ${opened.failure.path}: ${opened.failure.message}`;
|
|
188
|
+
const path = `${displayPath(opened.path, env)}/`;
|
|
189
|
+
const problems = [
|
|
190
|
+
...(writeFailure === undefined ? [] : [`couldn't write ${writeFailure.path}: ${writeFailure.message}`]),
|
|
191
|
+
...opened.pruneFailures.slice(0, 1).map((failure) => `couldn't remove ${failure.path}: ${failure.message}`),
|
|
192
|
+
];
|
|
193
|
+
const flags = `${failed ? " --failed" : ""}${workersHint ? " --workers" : ""}`;
|
|
194
|
+
const show = `storm runs show ${opened.id}${flags}`;
|
|
195
|
+
return `${problems.length === 0 ? path : `${path} (${problems.join("; ")})`} · ${show}`;
|
|
196
|
+
}
|
|
197
|
+
function failedStepLogs(timeline, recording, env) {
|
|
198
|
+
const runner = timeline.rows.find((row) => row.name === "runner");
|
|
199
|
+
return (runner?.steps ?? [])
|
|
200
|
+
.filter((step) => step.outcome === "failed")
|
|
201
|
+
.flatMap((step) => {
|
|
202
|
+
const log = recording.stepLog(step.name);
|
|
203
|
+
return log === undefined ? [] : [` failed ${step.name}, whole output: ${displayPath(log, env)}`];
|
|
204
|
+
});
|
|
205
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { RunRunnerFailure } from "../../core/index.ts";
|
|
2
|
+
import type { CheckoutFailure, PrepareRunnerOutcome } from "../../runner/index.ts";
|
|
3
|
+
/**
|
|
4
|
+
* The refusal for a runner whose local checks failed: no base, submodules, runner options storm can't use at the run's
|
|
5
|
+
* base or for its sandbox count (`invalid_config`, naming the key inside `runner`), or git or tar failing.
|
|
6
|
+
*/
|
|
7
|
+
export declare function prepareRefusal(prepared: Exclude<PrepareRunnerOutcome, {
|
|
8
|
+
readonly kind: "ok";
|
|
9
|
+
}>, configFile: string | null): import("@vercel/clinkr").CommandError<"invalid_config"> | import("@vercel/clinkr").CommandError<"no_base_ref"> | import("@vercel/clinkr").CommandError<"runner_failed"> | import("@vercel/clinkr").CommandError<"submodules_refused">;
|
|
10
|
+
/**
|
|
11
|
+
* The refusal for a run in a runner sandbox whose checkout git couldn't read before anything was minted, acquired, or
|
|
12
|
+
* started: `runner_failed` with `checkout-failed`, holding nothing.
|
|
13
|
+
*/
|
|
14
|
+
export declare function checkoutFailedRefusal(failure: CheckoutFailure): import("@vercel/clinkr").CommandError<"runner_failed">;
|
|
15
|
+
/**
|
|
16
|
+
* Each resource's resolved options, by resource key: what a Vercel Sandbox runner's declared `vcpus` rule reads.
|
|
17
|
+
*/
|
|
18
|
+
export declare function vcpuResources(requests: Readonly<Record<string, {
|
|
19
|
+
readonly definition: string;
|
|
20
|
+
readonly options: unknown;
|
|
21
|
+
}>>): {
|
|
22
|
+
readonly [key: string]: Readonly<Record<string, unknown>>;
|
|
23
|
+
};
|
|
24
|
+
/** A runner failure as outcomes report it. */
|
|
25
|
+
export declare function runnerFailureFacts(failure: RunRunnerFailure): {
|
|
26
|
+
message?: never;
|
|
27
|
+
kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
|
|
28
|
+
label: string;
|
|
29
|
+
exitCode: number | null;
|
|
30
|
+
tail: string[];
|
|
31
|
+
command?: never;
|
|
32
|
+
operation?: never;
|
|
33
|
+
around?: never;
|
|
34
|
+
reason?: never;
|
|
35
|
+
status?: never;
|
|
36
|
+
} | {
|
|
37
|
+
label?: never;
|
|
38
|
+
exitCode?: never;
|
|
39
|
+
tail?: never;
|
|
40
|
+
kind: "sandbox-api-failed";
|
|
41
|
+
operation: import("../../runner/events.ts").RunnerSandboxCall;
|
|
42
|
+
status: number | null;
|
|
43
|
+
message: string;
|
|
44
|
+
command?: never;
|
|
45
|
+
around?: never;
|
|
46
|
+
reason?: never;
|
|
47
|
+
} | {
|
|
48
|
+
label?: never;
|
|
49
|
+
exitCode?: never;
|
|
50
|
+
tail?: never;
|
|
51
|
+
kind: "checkout-failed";
|
|
52
|
+
message: string;
|
|
53
|
+
command: string | null;
|
|
54
|
+
operation?: never;
|
|
55
|
+
around?: never;
|
|
56
|
+
reason?: never;
|
|
57
|
+
status?: never;
|
|
58
|
+
} | {
|
|
59
|
+
label?: never;
|
|
60
|
+
exitCode?: never;
|
|
61
|
+
tail?: never;
|
|
62
|
+
command?: never;
|
|
63
|
+
kind: "network-policy-failed";
|
|
64
|
+
operation: "inject" | "remove";
|
|
65
|
+
around: import("../../runner/events.ts").NetworkPolicyPlace;
|
|
66
|
+
reason: "api" | "timed-out";
|
|
67
|
+
status: number | null;
|
|
68
|
+
message: string;
|
|
69
|
+
} | {
|
|
70
|
+
team: string;
|
|
71
|
+
project: string;
|
|
72
|
+
message?: never;
|
|
73
|
+
label?: never;
|
|
74
|
+
exitCode?: never;
|
|
75
|
+
tail?: never;
|
|
76
|
+
command?: never;
|
|
77
|
+
operation?: never;
|
|
78
|
+
around?: never;
|
|
79
|
+
reason?: never;
|
|
80
|
+
status?: never;
|
|
81
|
+
kind: "credential-claims-missing";
|
|
82
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Shared runner preparation refusal and failure-fact mappers used by runs (`execute-run.ts`, `driver-plan.ts`) and
|
|
2
|
+
// snapshot commands (`commands/snapshots/`).
|
|
3
|
+
import { invalidConfig } from "../../config/index.js";
|
|
4
|
+
import { RUN_CLEANUP } from "../../shared/cleanup.js";
|
|
5
|
+
import { runErrors } from "./outcomes.js";
|
|
6
|
+
/** The cleanup of a run that never started a runner sandbox or acquired a resource. */
|
|
7
|
+
const NOTHING_RELEASED = { runnerCleanup: null, resourceCleanup: {} };
|
|
8
|
+
/**
|
|
9
|
+
* The refusal for a runner whose local checks failed: no base, submodules, runner options storm can't use at the run's
|
|
10
|
+
* base or for its sandbox count (`invalid_config`, naming the key inside `runner`), or git or tar failing.
|
|
11
|
+
*/
|
|
12
|
+
export function prepareRefusal(prepared, configFile) {
|
|
13
|
+
switch (prepared.kind) {
|
|
14
|
+
case "no-base-ref":
|
|
15
|
+
return runErrors.noBaseRef({ refs: prepared.refs.map(({ ref, reason }) => ({ ref, reason })) });
|
|
16
|
+
case "submodules":
|
|
17
|
+
return runErrors.submodulesRefused({ paths: [...prepared.paths] });
|
|
18
|
+
case "invalid-runner":
|
|
19
|
+
return invalidConfig(configFile ?? "", [
|
|
20
|
+
{ key: ["runner", ...prepared.path].join("."), location: null, problem: prepared.problem },
|
|
21
|
+
]);
|
|
22
|
+
case "checkout-failed":
|
|
23
|
+
return checkoutFailedRefusal(prepared.failure);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The refusal for a run in a runner sandbox whose checkout git couldn't read before anything was minted, acquired, or
|
|
28
|
+
* started: `runner_failed` with `checkout-failed`, holding nothing.
|
|
29
|
+
*/
|
|
30
|
+
export function checkoutFailedRefusal(failure) {
|
|
31
|
+
return runErrors.runnerFailed({
|
|
32
|
+
failure: runnerFailureFacts({ kind: "checkout-failed", failure }),
|
|
33
|
+
cleanup: RUN_CLEANUP.facts(NOTHING_RELEASED),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Each resource's resolved options, by resource key: what a Vercel Sandbox runner's declared `vcpus` rule reads.
|
|
38
|
+
*/
|
|
39
|
+
export function vcpuResources(requests) {
|
|
40
|
+
return Object.fromEntries(Object.entries(requests).map(([key, { options }]) => {
|
|
41
|
+
// A resource's options are the plain values its definition merges to: always an object.
|
|
42
|
+
if (typeof options !== "object" || options === null)
|
|
43
|
+
throw new Error(`${key}'s options are not an object`);
|
|
44
|
+
return [key, options];
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
/** A runner failure as outcomes report it. */
|
|
48
|
+
export function runnerFailureFacts(failure) {
|
|
49
|
+
switch (failure.kind) {
|
|
50
|
+
case "snapshot-build-step-failed":
|
|
51
|
+
case "apply-failed":
|
|
52
|
+
case "install-failed":
|
|
53
|
+
case "build-failed":
|
|
54
|
+
return { kind: failure.kind, label: failure.label, exitCode: failure.exitCode, tail: [...failure.tail] };
|
|
55
|
+
case "sandbox-api-failed":
|
|
56
|
+
return { kind: failure.kind, operation: failure.operation, status: failure.status, message: failure.message };
|
|
57
|
+
case "checkout-failed":
|
|
58
|
+
return { kind: failure.kind, message: failure.failure.message, command: failure.failure.displayCommand ?? null };
|
|
59
|
+
case "network-policy-failed":
|
|
60
|
+
return {
|
|
61
|
+
kind: failure.kind,
|
|
62
|
+
operation: failure.operation,
|
|
63
|
+
around: failure.around,
|
|
64
|
+
reason: failure.reason,
|
|
65
|
+
status: failure.status,
|
|
66
|
+
message: failure.message,
|
|
67
|
+
};
|
|
68
|
+
case "credential-claims-missing":
|
|
69
|
+
return { kind: failure.kind, ...failure.target };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -60,6 +60,9 @@ function endTone(state, style) {
|
|
|
60
60
|
}
|
|
61
61
|
export function sandboxProgress(options) {
|
|
62
62
|
const { count } = options;
|
|
63
|
+
// Intentional `{ github: false }`: runs across runner sandboxes suppress `step-output` lines on the terminal (step
|
|
64
|
+
// logs stay in each runner sandbox entry), so GitHub Actions `::group::` folds for step output would wrap empty
|
|
65
|
+
// groups.
|
|
63
66
|
const own = plainRenderer({ github: false });
|
|
64
67
|
let origin;
|
|
65
68
|
let started = false;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RunOutcome } from "../../core/index.ts";
|
|
2
|
+
/** Every outcome of a run that stopped before its command finished. */
|
|
3
|
+
export type StoppedRunOutcome = Exclude<RunOutcome, {
|
|
4
|
+
readonly kind: "ran";
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: "sandboxes_ran";
|
|
7
|
+
}>;
|
|
8
|
+
/** Maps a stopped run outcome to its Clinkr error outcome, including cleanup and cancellation facts. */
|
|
9
|
+
export declare function mapStoppedOutcome(outcome: StoppedRunOutcome, canceledOptions?: {
|
|
10
|
+
readonly commandLine?: string;
|
|
11
|
+
readonly keptLines?: readonly string[];
|
|
12
|
+
}): import("@vercel/clinkr").ClinkrError<"canceled"> | import("@vercel/clinkr").CommandError<"mint_failed"> | import("@vercel/clinkr").CommandError<"resource_refused"> | import("@vercel/clinkr").CommandError<"runner_failed"> | import("@vercel/clinkr").CommandError<"snapshot_gone"> | import("@vercel/clinkr").CommandError<"spawn_failed"> | import("@vercel/clinkr").CommandError<"vercel_oidc_token_failed">;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Mapping stopped core run outcomes (`RunOutcome` minus `ran` and `sandboxes_ran`) to Clinkr error and cancellation
|
|
2
|
+
// outcomes, including cleanup facts and kept/unstopped runner sandbox notices.
|
|
3
|
+
import { describeMintFailure, vercelOidcTokenFailureFacts } from "../../credential/index.js";
|
|
4
|
+
import { DEFINITION_SET } from "../../extensions.js";
|
|
5
|
+
import { keptText, notDeletedText, notKeptText, notStoppedText, RUN_CLEANUP, } from "../../shared/cleanup.js";
|
|
6
|
+
import { mintFailedErrors } from "./mint-failed.js";
|
|
7
|
+
import { outcomes, runErrors } from "./outcomes.js";
|
|
8
|
+
import { resourceRefused } from "./resource-refusals.js";
|
|
9
|
+
import { runnerFailureFacts } from "./runner-refusals.js";
|
|
10
|
+
/** Maps a stopped run outcome to its Clinkr error outcome, including cleanup and cancellation facts. */
|
|
11
|
+
export function mapStoppedOutcome(outcome, canceledOptions) {
|
|
12
|
+
switch (outcome.kind) {
|
|
13
|
+
case "resource_refused":
|
|
14
|
+
return resourceRefused(outcome, RUN_CLEANUP.facts(outcome));
|
|
15
|
+
case "mint_failed":
|
|
16
|
+
return mintFailedErrors.mintFailed({
|
|
17
|
+
...outcome.target,
|
|
18
|
+
...describeMintFailure(outcome.failure, outcome.target),
|
|
19
|
+
runner: outcome.runner,
|
|
20
|
+
cleanup: RUN_CLEANUP.facts(outcome),
|
|
21
|
+
});
|
|
22
|
+
case "vercel_oidc_token_failed":
|
|
23
|
+
return mintFailedErrors.vercelOidcTokenFailed({
|
|
24
|
+
...vercelOidcTokenFailureFacts(outcome.failure),
|
|
25
|
+
runner: outcome.runner,
|
|
26
|
+
cleanup: RUN_CLEANUP.facts(outcome),
|
|
27
|
+
});
|
|
28
|
+
case "spawn_failed":
|
|
29
|
+
return runErrors.spawnFailed({
|
|
30
|
+
executable: outcome.executable,
|
|
31
|
+
message: outcome.message,
|
|
32
|
+
cleanup: RUN_CLEANUP.facts({ runnerCleanup: null, resourceCleanup: outcome.resourceCleanup }),
|
|
33
|
+
});
|
|
34
|
+
case "canceled":
|
|
35
|
+
return outcomes.canceled({ changed: canceledChanges(outcome, canceledOptions) });
|
|
36
|
+
case "runner_failed":
|
|
37
|
+
return runErrors.runnerFailed({
|
|
38
|
+
failure: runnerFailureFacts(outcome.failure),
|
|
39
|
+
cleanup: RUN_CLEANUP.facts(outcome),
|
|
40
|
+
});
|
|
41
|
+
case "snapshot_gone":
|
|
42
|
+
return runErrors.snapshotGone({
|
|
43
|
+
snapshotId: outcome.entry.snapshotId,
|
|
44
|
+
base: outcome.entry.base,
|
|
45
|
+
removal: outcome.removal === undefined ? null : { ...outcome.removal },
|
|
46
|
+
cleanup: RUN_CLEANUP.facts(outcome),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function canceledChanges(outcome, options = {}) {
|
|
51
|
+
const { commandStopped } = outcome;
|
|
52
|
+
const lines = [
|
|
53
|
+
options.commandLine ??
|
|
54
|
+
(commandStopped === true ? "The command was stopped in the runner sandbox." : "The command didn't run."),
|
|
55
|
+
];
|
|
56
|
+
const cleanup = RUN_CLEANUP.facts(outcome).runner;
|
|
57
|
+
if (cleanup !== null)
|
|
58
|
+
lines.push(...runnerCleanupLines(cleanup, options.keptLines));
|
|
59
|
+
else if (options.keptLines !== undefined)
|
|
60
|
+
lines.push(...options.keptLines);
|
|
61
|
+
lines.push(...DEFINITION_SET.reports.canceledLines(outcome.resourceCleanup));
|
|
62
|
+
return lines.join("\n");
|
|
63
|
+
}
|
|
64
|
+
function runnerCleanupLines({ kept, notKept, notStopped, notDeleted }, keptLines) {
|
|
65
|
+
const problems = [
|
|
66
|
+
...(notKept === null ? [] : [notKeptText(notKept)]),
|
|
67
|
+
...notStopped.map(notStoppedText),
|
|
68
|
+
...notDeleted.map(notDeletedText),
|
|
69
|
+
];
|
|
70
|
+
const allKept = [...(kept === null ? [] : [keptText(kept)]), ...(keptLines ?? [])];
|
|
71
|
+
if (allKept.length === 0)
|
|
72
|
+
return problems.length === 0 ? ["Every sandbox the runner started is stopped and deleted."] : problems;
|
|
73
|
+
return [
|
|
74
|
+
...allKept,
|
|
75
|
+
...(problems.length === 0 ? ["Every other sandbox the runner started is stopped and deleted."] : problems),
|
|
76
|
+
];
|
|
77
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { ColorDepth } from "@vercel/clinkr";
|
|
2
|
-
import type { Presentation } from "../../presentation.ts";
|
|
3
2
|
import { type ProgressTerminal, type RunObserver } from "../../core/index.ts";
|
|
3
|
+
import type { Presentation } from "../../presentation.ts";
|
|
4
4
|
import type { RunnerTerminal } from "../../runner/index.ts";
|
|
5
|
-
import type { Clock } from "../../time/index.ts";
|
|
5
|
+
import type { Clock, Timer } from "../../time/index.ts";
|
|
6
|
+
import type { SandboxProgress } from "./sandbox-progress.ts";
|
|
7
|
+
/** How long the plain multi-sandbox view waits before asking again for progress lines that came due. */
|
|
8
|
+
export declare const PROGRESS_TICK_MS = 1000;
|
|
6
9
|
/** A run's view: what hears its events, where the command's output goes, and how the summary prints. */
|
|
7
10
|
export interface RunView {
|
|
8
11
|
readonly observer: RunObserver;
|
|
@@ -10,16 +13,22 @@ export interface RunView {
|
|
|
10
13
|
readonly runnerTerminal: RunnerTerminal;
|
|
11
14
|
/** The width the summary is laid out in. */
|
|
12
15
|
readonly width: number;
|
|
13
|
-
/** The color depth stderr supports for the summary
|
|
16
|
+
/** The color depth stderr supports for the summary; `"none"` when color is off or under `--json`. */
|
|
14
17
|
readonly colorDepth: ColorDepth;
|
|
15
|
-
/** Ends any live region, then prints `summary`'s lines; under `--json`, prints nothing. */
|
|
16
|
-
finish(summary
|
|
18
|
+
/** Ends any live region or tick loop, then prints `summary`'s lines; under `--json`, prints nothing. */
|
|
19
|
+
finish(summary?: readonly string[]): Promise<void>;
|
|
17
20
|
}
|
|
21
|
+
/** Whether the view renders a single run or a run across runner sandboxes. */
|
|
22
|
+
export type RunViewMode = {
|
|
23
|
+
readonly kind: "single";
|
|
24
|
+
readonly showOutput: boolean;
|
|
25
|
+
readonly verbose: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: "sandboxes";
|
|
28
|
+
readonly progress: SandboxProgress;
|
|
29
|
+
};
|
|
18
30
|
/**
|
|
19
|
-
* The view for `presentation`. Without `progress`, as under `--json`, it shows nothing.
|
|
20
|
-
* lines through `progress`; a live view draws on `context.progressTerminal`, where the command's output also goes,
|
|
21
|
-
* above the live region, and with `showOutput` each step's output too. `verbose` tells each resource's presentation,
|
|
22
|
-
* which may then add lines of its own, and adds each step's output to a live view.
|
|
31
|
+
* The view for `presentation` and `mode`. Without `progress`, as under `--json`, it shows nothing.
|
|
23
32
|
*/
|
|
24
33
|
export declare function runView(options: {
|
|
25
34
|
readonly presentation: Presentation;
|
|
@@ -28,7 +37,7 @@ export declare function runView(options: {
|
|
|
28
37
|
readonly progressTerminal: ProgressTerminal;
|
|
29
38
|
readonly runnerTerminal: RunnerTerminal;
|
|
30
39
|
readonly clock: Clock;
|
|
40
|
+
readonly timer?: Timer;
|
|
31
41
|
};
|
|
32
|
-
readonly
|
|
33
|
-
readonly verbose: boolean;
|
|
42
|
+
readonly mode: RunViewMode;
|
|
34
43
|
}): RunView;
|