@cnc-tools/storm 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application.d.ts +22 -13
- package/dist/application.js +21 -10
- package/dist/bin/run.d.ts +18 -0
- package/dist/bin/run.js +31 -0
- package/dist/bin/storm.js +42 -26
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-5CCP36QQ.js → chunk-2RNDPDTJ.js} +2 -2
- package/dist/chunks/chunk-2VP4GRJM.js +1219 -0
- package/dist/chunks/{chunk-P357TZAY.js → chunk-4O5C2XGJ.js} +18 -15
- package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-4WAMTUWZ.js} +419 -340
- package/dist/chunks/{chunk-OIY3DMF2.js → chunk-6UHIJXZG.js} +3 -3
- package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
- package/dist/chunks/{chunk-CK2GZEPK.js → chunk-7DZE67QM.js} +2 -2
- package/dist/chunks/{chunk-VUPZH7J2.js → chunk-BCBKYOHW.js} +1 -1
- package/dist/chunks/{chunk-2MAD5NKK.js → chunk-CKGZA25H.js} +1 -18
- package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-D27KILIA.js} +1 -1
- package/dist/chunks/{chunk-V4IKA3WI.js → chunk-DADEYJDW.js} +24 -17
- package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
- package/dist/chunks/chunk-F4MOYHRY.js +198 -0
- package/dist/chunks/{chunk-HVNK3I45.js → chunk-FNBB6V4R.js} +1 -1
- package/dist/chunks/{chunk-G3PHMXH5.js → chunk-GRT3UIBV.js} +18 -1
- package/dist/chunks/chunk-HP3CURSZ.js +88 -0
- package/dist/chunks/{chunk-DWEAHX4T.js → chunk-HWIQ2S7K.js} +5 -5
- package/dist/chunks/chunk-JN3YY6ZH.js +2166 -0
- package/dist/chunks/{chunk-TJNFVNKR.js → chunk-LKTZ5OXS.js} +1 -1
- package/dist/chunks/{chunk-3L52KNQA.js → chunk-M7EKRGVD.js} +8 -8
- package/dist/chunks/chunk-MR77L2GK.js +340 -0
- package/dist/chunks/{chunk-DC2CDHNK.js → chunk-RNAS7JHE.js} +1438 -445
- package/dist/chunks/{chunk-FCQUJDA4.js → chunk-RWIXDDCK.js} +4 -189
- package/dist/chunks/{chunk-5VXBKPW6.js → chunk-WV3DP6NR.js} +1 -1
- package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
- package/dist/chunks/{chunk-FOZWA52V.js → chunk-YEPFSLQR.js} +480 -375
- package/dist/chunks/{live-app-WECQOQ4C.js → live-app-R76JQXZL.js} +15 -13
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +1 -1
- package/dist/commands/exec/across-sandboxes-outcomes.js +2 -2
- package/dist/commands/exec/before-run.d.ts +123 -0
- package/dist/commands/exec/before-run.js +105 -0
- package/dist/commands/exec/command.d.ts +31 -2
- package/dist/commands/exec/command.js +31 -95
- package/dist/commands/exec/driver-plan.d.ts +9 -4
- package/dist/commands/exec/driver-plan.js +8 -8
- package/dist/commands/exec/exec-words.js +1 -1
- package/dist/commands/exec/execute-run.d.ts +39 -0
- package/dist/commands/exec/execute-run.js +325 -0
- package/dist/commands/exec/live-view.d.ts +3 -3
- package/dist/commands/exec/live-view.js +16 -15
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/mint-failed.d.ts +38 -0
- package/dist/commands/exec/mint-failed.js +27 -4
- package/dist/commands/exec/outcomes.d.ts +34 -8
- package/dist/commands/exec/outcomes.js +30 -23
- package/dist/commands/exec/plan-run.d.ts +58 -150
- package/dist/commands/exec/plan-run.js +232 -88
- package/dist/commands/exec/progress.d.ts +10 -6
- package/dist/commands/exec/progress.js +38 -25
- package/dist/commands/exec/run-bin.d.ts +11 -11
- package/dist/commands/exec/run-bin.js +9 -9
- package/dist/commands/exec/run-flags.d.ts +69 -0
- package/dist/commands/exec/run-flags.js +58 -0
- package/dist/commands/exec/run-metadata.js +4 -4
- package/dist/commands/exec/run-summary.d.ts +58 -0
- package/dist/commands/exec/run-summary.js +205 -0
- package/dist/commands/exec/runner-refusals.d.ts +82 -0
- package/dist/commands/exec/runner-refusals.js +71 -0
- package/dist/commands/exec/sandbox-progress.js +3 -0
- package/dist/commands/exec/stopped-outcome.d.ts +12 -0
- package/dist/commands/exec/stopped-outcome.js +77 -0
- package/dist/commands/exec/view.d.ts +20 -11
- package/dist/commands/exec/view.js +103 -47
- package/dist/commands/runs/facts.d.ts +7 -3
- package/dist/commands/runs/facts.js +17 -8
- package/dist/commands/runs/list/command.d.ts +14 -6
- package/dist/commands/runs/list/command.js +10 -10
- package/dist/commands/runs/list/outcomes.d.ts +7 -3
- package/dist/commands/runs/logs/command.js +10 -10
- package/dist/commands/runs/show/command.d.ts +14 -6
- package/dist/commands/runs/show/command.js +30 -28
- package/dist/commands/runs/show/outcomes.d.ts +7 -3
- package/dist/commands/runs/show/outcomes.js +7 -5
- package/dist/commands/snapshots/access.d.ts +111 -0
- package/dist/commands/snapshots/access.js +96 -0
- package/dist/commands/snapshots/build/command.d.ts +360 -93
- package/dist/commands/snapshots/build/command.js +446 -150
- package/dist/commands/snapshots/build/metadata.d.ts +10 -0
- package/dist/commands/snapshots/build/metadata.js +31 -11
- package/dist/commands/snapshots/build/outcomes.d.ts +234 -43
- package/dist/commands/snapshots/build/outcomes.js +200 -36
- package/dist/commands/snapshots/list/command.d.ts +366 -25
- package/dist/commands/snapshots/list/command.js +296 -66
- package/dist/commands/snapshots/list/metadata.d.ts +16 -0
- package/dist/commands/snapshots/list/metadata.js +29 -6
- package/dist/commands/snapshots/list/outcomes.d.ts +245 -13
- package/dist/commands/snapshots/list/outcomes.js +221 -50
- package/dist/commands/snapshots/metadata.js +1 -1
- package/dist/commands/snapshots/prune/command.d.ts +430 -0
- package/dist/commands/snapshots/prune/command.js +161 -0
- package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
- package/dist/commands/snapshots/prune/metadata.js +39 -0
- package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
- package/dist/commands/snapshots/prune/outcomes.js +78 -0
- package/dist/commands/suites/list/command.js +17 -17
- package/dist/commands/suites/list/outcomes.js +2 -2
- package/dist/commands/test/command.d.ts +31 -2
- package/dist/commands/test/command.js +49 -252
- package/dist/commands/test/outcomes.d.ts +15 -1
- package/dist/config/check-runner.d.ts +3 -3
- package/dist/config/check-runner.js +8 -7
- package/dist/config/credential-resolver.d.ts +50 -5
- package/dist/config/credential-resolver.js +51 -19
- package/dist/config/credential-settle.d.ts +6 -2
- package/dist/config/credential-settle.js +11 -5
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +1 -1
- package/dist/config/runner.d.ts +5 -5
- package/dist/config/runner.js +1 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/schema.js +1 -1
- package/dist/config-file/define.d.ts +1 -1
- package/dist/config-file/define.js +1 -1
- package/dist/config-file/runner.d.ts +5 -5
- package/dist/config-file/toolchain.d.ts +1 -1
- package/dist/config-file/toolchain.js +2 -2
- package/dist/context.d.ts +8 -6
- package/dist/context.js +7 -6
- package/dist/core/across-sandboxes.d.ts +7 -6
- package/dist/core/across-sandboxes.js +123 -152
- package/dist/core/coordinator.d.ts +166 -0
- package/dist/core/coordinator.js +233 -0
- package/dist/core/events.d.ts +2 -2
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +1 -1
- package/dist/core/outcomes.d.ts +148 -0
- package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
- package/dist/core/resources.d.ts +31 -53
- package/dist/core/resources.js +32 -70
- package/dist/core/run-state.d.ts +7 -1
- package/dist/core/run-state.js +2 -0
- package/dist/core/run.d.ts +32 -236
- package/dist/core/run.js +106 -266
- package/dist/core/state-directory.d.ts +1 -1
- package/dist/core/state-directory.js +2 -2
- package/dist/credential/gateways.d.ts +15 -1
- package/dist/credential/index.d.ts +4 -3
- package/dist/credential/index.js +3 -2
- package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
- package/dist/credential/live/vercel-cli-gateway.js +1 -1
- package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
- package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
- package/dist/credential/source.d.ts +73 -6
- package/dist/credential/source.js +55 -2
- package/dist/extension-commands.d.ts +6 -1
- package/dist/extension-commands.js +15 -1
- package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
- package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
- package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
- package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/credential-facts.d.ts +6 -2
- package/dist/extensions/testserver/credential-facts.js +29 -11
- package/dist/extensions/testserver/lifecycle.js +7 -1
- package/dist/extensions/testserver/limit.d.ts +3 -0
- package/dist/extensions/testserver/limit.js +3 -0
- package/dist/extensions/testserver/provision.d.ts +8 -1
- package/dist/extensions/testserver/provision.js +8 -3
- package/dist/extensions/testserver/refusals.d.ts +6 -1
- package/dist/extensions/testserver/refusals.js +16 -1
- package/dist/extensions/testserver/resource.d.ts +1 -1
- package/dist/extensions/testserver/resource.js +1 -1
- package/dist/extensions/testserver/result.d.ts +1 -1
- package/dist/extensions/testserver/result.js +9 -4
- package/dist/planning/driver-file-lists.d.ts +0 -15
- package/dist/planning/driver-file-lists.js +2 -21
- package/dist/planning/plan-only.d.ts +3 -14
- package/dist/planning/plan-only.js +11 -20
- package/dist/planning/run-kind-flags.js +2 -2
- package/dist/planning/run-plan.d.ts +45 -12
- package/dist/planning/run-plan.js +4 -3
- package/dist/planning/suites.d.ts +1 -1
- package/dist/planning/suites.js +2 -2
- package/dist/planning/test-plan.d.ts +9 -0
- package/dist/planning/test-plan.js +9 -0
- package/dist/run-directory/recording.js +2 -2
- package/dist/run-directory/run-record.d.ts +21 -6
- package/dist/run-directory/run-record.js +12 -9
- package/dist/runner/base.js +1 -1
- package/dist/runner/build-snapshots.d.ts +55 -29
- package/dist/runner/build-snapshots.js +130 -29
- package/dist/runner/context.d.ts +15 -7
- package/dist/runner/context.js +19 -6
- package/dist/runner/events.d.ts +16 -10
- package/dist/runner/gateways.d.ts +87 -21
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/index.d.ts +11 -7
- package/dist/runner/index.js +9 -4
- package/dist/runner/live/sandbox-errors.d.ts +2 -0
- package/dist/runner/live/sandbox-errors.js +4 -0
- package/dist/runner/live/sandbox-gateway.js +129 -3
- package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
- package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
- package/dist/runner/live/snapshot-records.js +6 -7
- package/dist/runner/local-snapshot-index.d.ts +199 -0
- package/dist/runner/local-snapshot-index.js +211 -0
- package/dist/runner/network-policy.d.ts +6 -6
- package/dist/runner/network-policy.js +7 -7
- package/dist/runner/policy-writes.d.ts +1 -1
- package/dist/runner/policy-writes.js +1 -1
- package/dist/runner/prepare.d.ts +14 -14
- package/dist/runner/prepare.js +20 -11
- package/dist/runner/ready.d.ts +18 -10
- package/dist/runner/ready.js +104 -33
- package/dist/runner/sandboxed-command.d.ts +3 -3
- package/dist/runner/sandboxed-command.js +3 -3
- package/dist/runner/scope.d.ts +10 -6
- package/dist/runner/scope.js +10 -3
- package/dist/runner/secrets.d.ts +13 -13
- package/dist/runner/secrets.js +18 -15
- package/dist/runner/session.d.ts +8 -8
- package/dist/runner/session.js +3 -3
- package/dist/runner/shared-snapshot-entry.d.ts +92 -0
- package/dist/runner/shared-snapshot-entry.js +168 -0
- package/dist/runner/shared-snapshot-list.d.ts +81 -0
- package/dist/runner/shared-snapshot-list.js +155 -0
- package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
- package/dist/runner/shared-snapshot-lookup.js +118 -0
- package/dist/runner/shared-snapshot-prune.d.ts +58 -0
- package/dist/runner/shared-snapshot-prune.js +133 -0
- package/dist/runner/snapshot-build.d.ts +42 -14
- package/dist/runner/snapshot-build.js +32 -29
- package/dist/runner/snapshot-choice.js +1 -1
- package/dist/runner/snapshot-inspect.d.ts +39 -40
- package/dist/runner/snapshot-inspect.js +55 -35
- package/dist/runner/snapshot-key.d.ts +13 -12
- package/dist/runner/snapshot-key.js +13 -12
- package/dist/runner/steps.d.ts +1 -1
- package/dist/runner/steps.js +1 -1
- package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +2 -2
- package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +3 -2
- package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +24 -23
- package/dist/runner/{recipe.js → vercel-sandbox-options.js} +70 -69
- package/dist/runner/{recipe-secrets.d.ts → vercel-sandbox-secrets.d.ts} +6 -6
- package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +20 -20
- package/dist/sdk/extension/commands.d.ts +8 -3
- package/dist/sdk/extension/commands.js +3 -1
- package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
- package/dist/sdk/extension/credential-diagnosis.js +25 -5
- package/dist/sdk/extension/credential-source.d.ts +20 -3
- package/dist/sdk/extension/credential-source.js +4 -4
- package/dist/sdk/extension/index.d.ts +3 -2
- package/dist/sdk/extension/index.js +2 -1
- package/dist/sdk/extension/resource-definition.d.ts +1 -1
- package/dist/sdk/extension/secret-source.d.ts +1 -1
- package/dist/sdk/extension/secret-source.js +1 -1
- package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
- package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
- package/dist/shared/cleanup.d.ts +3 -3
- package/dist/shared/cleanup.js +15 -5
- package/dist/shared/snapshot-text.d.ts +4 -4
- package/dist/shared/snapshot-text.js +11 -11
- package/dist/time/duration.js +1 -1
- package/package.json +3 -2
- package/skills/overview.md +4 -4
- package/skills/plan-runs.md +1 -1
- package/skills/read-run-output.md +6 -6
- package/dist/chunks/chunk-7EENF73W.js +0 -782
- package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
- package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
- package/dist/commands/exec/across-sandboxes-run.js +0 -339
- package/dist/commands/exec/plan-only.d.ts +0 -10
- package/dist/commands/exec/plan-only.js +0 -45
- package/dist/commands/exec/run-command.d.ts +0 -475
- package/dist/commands/exec/run-command.js +0 -603
- package/dist/commands/exec/run-planned.d.ts +0 -20
- package/dist/commands/exec/run-planned.js +0 -22
- package/dist/commands/exec/sandbox-view.d.ts +0 -19
- package/dist/commands/exec/sandbox-view.js +0 -72
- package/dist/commands/test/plan.d.ts +0 -92
- package/dist/commands/test/plan.js +0 -125
- package/dist/core/sandbox-end.d.ts +0 -64
- package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
- package/dist/runner/snapshot-cache.d.ts +0 -148
- package/dist/runner/snapshot-cache.js +0 -126
|
@@ -1,32 +1,22 @@
|
|
|
1
|
-
// What the
|
|
2
|
-
// commits, and for the checkout's
|
|
3
|
-
// the
|
|
1
|
+
// What the local snapshot index holds, as a checkout sees it: every indexed snapshot with where it was built, in
|
|
2
|
+
// commits, and for the checkout's runner which one a run here starts from and why not from each other one. It reads
|
|
3
|
+
// the local snapshot index and Git, and changes nothing: no file is removed, nothing is minted, and no sandbox starts.
|
|
4
4
|
import { resolveBase } from "./base.js";
|
|
5
|
-
import { classifySnapshotEntries, isExpiredEntry, pickSnapshot, } from "./snapshot-
|
|
5
|
+
import { classifySnapshotEntries, isExpiredEntry, pickSnapshot, resolveAncestorDistances, } from "./local-snapshot-index.js";
|
|
6
6
|
import { snapshotInputsAt } from "./snapshot-key.js";
|
|
7
|
-
|
|
8
|
-
* Inspects the cache from `cwd` for `recipe`, the runner recipe that applies there, if any. With a recipe, in a Git
|
|
9
|
-
* checkout whose HEAD shares history with one of its base refs, it marks for each team and project the snapshot a run
|
|
10
|
-
* here starts from, by a run's own rule (`classifySnapshotEntries`, `pickSnapshot`), and gives each other
|
|
11
|
-
* snapshot of the recipe the reason it isn't picked. It reads the recipe's declared base files at the merge-base for
|
|
12
|
-
* the run's snapshot key, as a run does. Otherwise it picks none and
|
|
13
|
-
* says why. `all` adds the snapshots of other recipes, and of the recipe's other regions and runtimes, as
|
|
14
|
-
* `other-recipe`. It lists the cache once and classifies that listing, which removes no file, so an expired entry of
|
|
15
|
-
* the recipe stays and is `expired`. A git failure ends it with `checkout-failed`, as it ends a run.
|
|
16
|
-
*/
|
|
17
|
-
export async function inspectSnapshotCache(context, request) {
|
|
7
|
+
export async function inspectLocalSnapshotIndex(context, request) {
|
|
18
8
|
const { checkout, runnerSnapshots } = context;
|
|
19
|
-
const {
|
|
9
|
+
const { options } = request;
|
|
20
10
|
const listed = await runnerSnapshots.listEntries();
|
|
21
11
|
if (!listed.ok)
|
|
22
|
-
return { kind: "
|
|
12
|
+
return { kind: "local-index-unreadable", ...listed.failure };
|
|
23
13
|
const { directory, entries, unreadable } = listed.value;
|
|
24
14
|
const now = context.clock.now();
|
|
25
|
-
const
|
|
26
|
-
entry.
|
|
27
|
-
entry.region ===
|
|
28
|
-
entry.runtime ===
|
|
29
|
-
const shows = (entry) => request.all ||
|
|
15
|
+
const ofRunner = (entry) => options !== undefined &&
|
|
16
|
+
entry.runnerName === options.name &&
|
|
17
|
+
entry.region === options.region &&
|
|
18
|
+
entry.runtime === options.runtime;
|
|
19
|
+
const shows = (entry) => request.all || options === undefined || ofRunner(entry);
|
|
30
20
|
const shown = entries.filter(shows);
|
|
31
21
|
const root = await checkout.repositoryRoot({ cwd: request.cwd });
|
|
32
22
|
const head = root.ok ? await checkout.head({ repoRoot: root.value }) : undefined;
|
|
@@ -37,41 +27,53 @@ export async function inspectSnapshotCache(context, request) {
|
|
|
37
27
|
directory,
|
|
38
28
|
checkout: null,
|
|
39
29
|
picking: { kind: "none", why: "no-checkout" },
|
|
30
|
+
snapshotKey: null,
|
|
40
31
|
snapshots: shown.map((entry) => unchecked(entry, now)),
|
|
41
32
|
unreadable,
|
|
42
33
|
},
|
|
43
34
|
};
|
|
44
35
|
}
|
|
45
36
|
const repoRoot = root.value;
|
|
46
|
-
const resolved =
|
|
37
|
+
const resolved = options === undefined ? undefined : await resolveBase(checkout, { repoRoot, baseRefs: options.baseRefs });
|
|
47
38
|
if (resolved?.kind === "failed")
|
|
48
39
|
return { kind: "checkout-failed", failure: resolved.failure };
|
|
49
|
-
if (
|
|
40
|
+
if (options === undefined || resolved === undefined || resolved.kind !== "resolved") {
|
|
50
41
|
return {
|
|
51
42
|
kind: "ok",
|
|
52
43
|
inspection: {
|
|
53
44
|
directory,
|
|
54
45
|
checkout: { repoRoot, head: head.value, mergeBase: null },
|
|
55
|
-
picking: { kind: "none", why:
|
|
46
|
+
picking: { kind: "none", why: options === undefined ? "no-runner" : "no-base" },
|
|
47
|
+
snapshotKey: null,
|
|
56
48
|
snapshots: shown.map((entry) => unchecked(entry, now)),
|
|
57
49
|
unreadable,
|
|
58
50
|
},
|
|
59
51
|
};
|
|
60
52
|
}
|
|
61
53
|
const mergeBase = resolved.base;
|
|
62
|
-
const inputs = await snapshotInputsAt(checkout, { repoRoot, base: mergeBase,
|
|
54
|
+
const inputs = await snapshotInputsAt(checkout, { repoRoot, base: mergeBase, options });
|
|
63
55
|
if (!inputs.ok)
|
|
64
|
-
return { kind: "invalid-
|
|
56
|
+
return { kind: "invalid-runner", path: inputs.path, problem: inputs.problem };
|
|
65
57
|
const afterBase = await checkout.commitCount({ repoRoot, from: mergeBase, to: "HEAD" });
|
|
66
58
|
if (!afterBase.ok)
|
|
67
59
|
return { kind: "checkout-failed", failure: afterBase.failure };
|
|
68
|
-
// The one listing above is classified as a run would,
|
|
60
|
+
// The one listing above is classified as a run would, with ancestors of the merge-base allowed, and nothing is
|
|
61
|
+
// removed: an expired entry is `expired`.
|
|
62
|
+
const ancestorDistances = await resolveAncestorDistances(context, {
|
|
63
|
+
repoRoot,
|
|
64
|
+
entries,
|
|
65
|
+
options,
|
|
66
|
+
mergeBase,
|
|
67
|
+
});
|
|
68
|
+
if (!ancestorDistances.ok)
|
|
69
|
+
return { kind: "checkout-failed", failure: ancestorDistances.failure };
|
|
69
70
|
const read = classifySnapshotEntries(context, {
|
|
70
71
|
entries,
|
|
71
|
-
|
|
72
|
+
options,
|
|
72
73
|
base: mergeBase,
|
|
73
74
|
snapshotKey: inputs.key,
|
|
74
75
|
commitsAfterBase: afterBase.value,
|
|
76
|
+
ancestorDistances: ancestorDistances.value,
|
|
75
77
|
});
|
|
76
78
|
// The choice is per team and project, since the credential that names them isn't minted here. Every entry that isn't
|
|
77
79
|
// a candidate keeps the classification's reason, since it is ruled out whoever the run's credential names.
|
|
@@ -82,7 +84,12 @@ export async function inspectSnapshotCache(context, request) {
|
|
|
82
84
|
if (pick !== undefined)
|
|
83
85
|
picked.add(pick);
|
|
84
86
|
}
|
|
85
|
-
const place = historyPlacer(context, {
|
|
87
|
+
const place = historyPlacer(context, {
|
|
88
|
+
repoRoot,
|
|
89
|
+
mergeBase,
|
|
90
|
+
commitsAfterBase: afterBase.value,
|
|
91
|
+
ancestorDistances: ancestorDistances.value,
|
|
92
|
+
});
|
|
86
93
|
const snapshots = [];
|
|
87
94
|
for (const verdict of read.verdicts) {
|
|
88
95
|
const { entry } = verdict;
|
|
@@ -95,6 +102,7 @@ export async function inspectSnapshotCache(context, request) {
|
|
|
95
102
|
entry,
|
|
96
103
|
inHistory: true,
|
|
97
104
|
builtBehind: candidate.builtBehind,
|
|
105
|
+
commitsBehindMergeBase: candidate.commitsBehindMergeBase,
|
|
98
106
|
expired,
|
|
99
107
|
picked: picked.has(candidate),
|
|
100
108
|
reason: null,
|
|
@@ -108,28 +116,35 @@ export async function inspectSnapshotCache(context, request) {
|
|
|
108
116
|
snapshots.push({
|
|
109
117
|
entry,
|
|
110
118
|
...placed.value,
|
|
119
|
+
commitsBehindMergeBase: null,
|
|
111
120
|
expired,
|
|
112
121
|
picked: false,
|
|
113
|
-
reason: verdict.kind === "rejected" ? verdict.rejection.reason : "other-
|
|
122
|
+
reason: verdict.kind === "rejected" ? verdict.rejection.reason : "other-runner",
|
|
114
123
|
});
|
|
115
124
|
}
|
|
116
125
|
return {
|
|
117
126
|
kind: "ok",
|
|
118
127
|
inspection: {
|
|
119
128
|
directory,
|
|
120
|
-
checkout: {
|
|
121
|
-
|
|
129
|
+
checkout: {
|
|
130
|
+
repoRoot,
|
|
131
|
+
head: head.value,
|
|
132
|
+
mergeBase: { commit: mergeBase, ref: resolved.ref, commitsAfterBase: afterBase.value },
|
|
133
|
+
},
|
|
134
|
+
picking: { kind: "runner", runner: options.name },
|
|
135
|
+
snapshotKey: inputs.key,
|
|
122
136
|
snapshots,
|
|
123
137
|
unreadable,
|
|
124
138
|
},
|
|
125
139
|
};
|
|
126
140
|
}
|
|
127
|
-
/** An entry storm checked nothing of: outside a Git checkout, or with no
|
|
141
|
+
/** An entry storm checked nothing of: outside a Git checkout, or with no runner or no base to pick for. */
|
|
128
142
|
function unchecked(entry, now) {
|
|
129
143
|
return {
|
|
130
144
|
entry,
|
|
131
145
|
inHistory: null,
|
|
132
146
|
builtBehind: null,
|
|
147
|
+
commitsBehindMergeBase: null,
|
|
133
148
|
expired: isExpiredEntry(entry, now),
|
|
134
149
|
picked: false,
|
|
135
150
|
reason: null,
|
|
@@ -137,12 +152,17 @@ function unchecked(entry, now) {
|
|
|
137
152
|
}
|
|
138
153
|
/**
|
|
139
154
|
* Where a base sits in HEAD's history, for the list: whether HEAD is it or holds it, and if so how many commits HEAD
|
|
140
|
-
* has that it lacks. Git is asked at most once per base, and nothing for the merge-base
|
|
155
|
+
* has that it lacks. Git is asked at most once per base, and nothing for the merge-base or an ancestor of it, whose
|
|
156
|
+
* counts the caller has.
|
|
141
157
|
*/
|
|
142
158
|
function historyPlacer(context, request) {
|
|
143
159
|
const { repoRoot } = request;
|
|
144
160
|
const known = new Map([
|
|
145
161
|
[request.mergeBase, { inHistory: true, builtBehind: request.commitsAfterBase }],
|
|
162
|
+
...Object.entries(request.ancestorDistances).map(([base, commitsBehindMergeBase]) => [
|
|
163
|
+
base,
|
|
164
|
+
{ inHistory: true, builtBehind: request.commitsAfterBase + commitsBehindMergeBase },
|
|
165
|
+
]),
|
|
146
166
|
]);
|
|
147
167
|
return async (base) => {
|
|
148
168
|
const answer = known.get(base);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CheckoutGateway } from "./gateways.ts";
|
|
2
|
-
import { type
|
|
2
|
+
import { type CheckedVercelSandboxOptions, type RunnerStep } from "./vercel-sandbox-options.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Bump when a runner snapshot changes in a way its steps' text doesn't show (the scripts between the steps, what is
|
|
5
5
|
* uploaded, the build sandbox), or the key's encoding changes, so earlier snapshots stop matching. 2 added each step's
|
|
6
|
-
* runner secret names. 3 dropped dev snapshots. 4 replaced per-step runner secret names with the
|
|
6
|
+
* runner secret names. 3 dropped dev snapshots. 4 replaced per-step runner secret names with the runner's credential
|
|
7
7
|
* source identities (`credentials=`). 5 added declared base files' paths and contents (`baseFiles=`).
|
|
8
8
|
*/
|
|
9
9
|
export declare const SNAPSHOT_FORMAT = 5;
|
|
@@ -38,13 +38,14 @@ export declare function baseIndexScript(base: string, staging: string): string;
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function applyScript(staging: string, root?: string): string;
|
|
40
40
|
/**
|
|
41
|
-
* The snapshot key: sha256 hex over `format=<SNAPSHOT_FORMAT>`, `credentials=<the secret source identities the
|
|
41
|
+
* The snapshot key: sha256 hex over `format=<SNAPSHOT_FORMAT>`, `credentials=<the secret source identities the runner's
|
|
42
42
|
* credentials read, sorted, once each, joined with ",">`, `baseFiles=<count>` followed by each sorted declared base
|
|
43
43
|
* file's path and text, each toolchain step's label and script, the base-index script with the placeholders `<base>`
|
|
44
|
-
* and `<staging>`, and each prebuild step's label and script, joined with NUL. A
|
|
44
|
+
* and `<staging>`, and each prebuild step's label and script, joined with NUL. A runner without credentials gives
|
|
45
45
|
* `credentials=`, and one without declared base files gives `baseFiles=0`. Every snapshot step gets every credential,
|
|
46
|
-
* so the source identities are in the key once, never the values, domains, or headers: a
|
|
47
|
-
* source builds another snapshot, and every machine with the same
|
|
46
|
+
* so the source identities are in the key once, never the values, domains, or headers: a runner that reads another
|
|
47
|
+
* source builds another snapshot, and every machine with the same runner options shares one. The base isn't in the
|
|
48
|
+
* key: a
|
|
48
49
|
* cache entry records it beside the key.
|
|
49
50
|
*/
|
|
50
51
|
export declare function snapshotKey(steps: {
|
|
@@ -53,7 +54,7 @@ export declare function snapshotKey(steps: {
|
|
|
53
54
|
readonly toolchains: readonly RunnerStep[];
|
|
54
55
|
readonly prebuild: readonly RunnerStep[];
|
|
55
56
|
}): string;
|
|
56
|
-
/** A
|
|
57
|
+
/** A runner's snapshot inputs at one base and their key, or why a declared base file couldn't be read there. */
|
|
57
58
|
export type SnapshotInputsAt = {
|
|
58
59
|
readonly ok: true;
|
|
59
60
|
readonly baseFiles: readonly DeclaredBaseFile[];
|
|
@@ -64,15 +65,15 @@ export type SnapshotInputsAt = {
|
|
|
64
65
|
readonly problem: string;
|
|
65
66
|
};
|
|
66
67
|
/**
|
|
67
|
-
* Reads `
|
|
68
|
-
*
|
|
68
|
+
* Reads `options`'s declared base files at `base` and computes its snapshot key with the secret source identities the
|
|
69
|
+
* runner's credentials read. Fails with `path: ["snapshot", "toolchains"]` if any declared base file is missing or
|
|
69
70
|
* unreadable at `base`.
|
|
70
71
|
*/
|
|
71
72
|
export declare function snapshotInputsAt(checkout: CheckoutGateway, request: {
|
|
72
73
|
readonly repoRoot: string;
|
|
73
74
|
readonly base: string;
|
|
74
|
-
readonly
|
|
75
|
-
readonly snapshot: Pick<
|
|
76
|
-
readonly credentials:
|
|
75
|
+
readonly options: {
|
|
76
|
+
readonly snapshot: Pick<CheckedVercelSandboxOptions["snapshot"], "toolchains" | "prebuild">;
|
|
77
|
+
readonly credentials: CheckedVercelSandboxOptions["credentials"];
|
|
77
78
|
};
|
|
78
79
|
}): Promise<SnapshotInputsAt>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// What a runner snapshot is built from, and the scripts that commit a base in a build sandbox and a run's changes in
|
|
2
2
|
// a runner sandbox. The snapshot key hashes the declared base files' paths and contents, the steps' text, and the
|
|
3
|
-
// secret source identities the
|
|
3
|
+
// secret source identities the runner's credentials read, so editing a step or a declared base file means a new
|
|
4
4
|
// snapshot.
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
|
-
import { credentialSourceIds, declaredBaseFilePaths } from "./
|
|
6
|
+
import { credentialSourceIds, declaredBaseFilePaths, } from "./vercel-sandbox-options.js";
|
|
7
7
|
/**
|
|
8
8
|
* Bump when a runner snapshot changes in a way its steps' text doesn't show (the scripts between the steps, what is
|
|
9
9
|
* uploaded, the build sandbox), or the key's encoding changes, so earlier snapshots stop matching. 2 added each step's
|
|
10
|
-
* runner secret names. 3 dropped dev snapshots. 4 replaced per-step runner secret names with the
|
|
10
|
+
* runner secret names. 3 dropped dev snapshots. 4 replaced per-step runner secret names with the runner's credential
|
|
11
11
|
* source identities (`credentials=`). 5 added declared base files' paths and contents (`baseFiles=`).
|
|
12
12
|
*/
|
|
13
13
|
export const SNAPSHOT_FORMAT = 5;
|
|
@@ -70,13 +70,14 @@ export function applyScript(staging, root = SANDBOX_ROOT) {
|
|
|
70
70
|
], root);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
* The snapshot key: sha256 hex over `format=<SNAPSHOT_FORMAT>`, `credentials=<the secret source identities the
|
|
73
|
+
* The snapshot key: sha256 hex over `format=<SNAPSHOT_FORMAT>`, `credentials=<the secret source identities the runner's
|
|
74
74
|
* credentials read, sorted, once each, joined with ",">`, `baseFiles=<count>` followed by each sorted declared base
|
|
75
75
|
* file's path and text, each toolchain step's label and script, the base-index script with the placeholders `<base>`
|
|
76
|
-
* and `<staging>`, and each prebuild step's label and script, joined with NUL. A
|
|
76
|
+
* and `<staging>`, and each prebuild step's label and script, joined with NUL. A runner without credentials gives
|
|
77
77
|
* `credentials=`, and one without declared base files gives `baseFiles=0`. Every snapshot step gets every credential,
|
|
78
|
-
* so the source identities are in the key once, never the values, domains, or headers: a
|
|
79
|
-
* source builds another snapshot, and every machine with the same
|
|
78
|
+
* so the source identities are in the key once, never the values, domains, or headers: a runner that reads another
|
|
79
|
+
* source builds another snapshot, and every machine with the same runner options shares one. The base isn't in the
|
|
80
|
+
* key: a
|
|
80
81
|
* cache entry records it beside the key.
|
|
81
82
|
*/
|
|
82
83
|
export function snapshotKey(steps) {
|
|
@@ -95,13 +96,13 @@ export function snapshotKey(steps) {
|
|
|
95
96
|
.digest("hex");
|
|
96
97
|
}
|
|
97
98
|
/**
|
|
98
|
-
* Reads `
|
|
99
|
-
*
|
|
99
|
+
* Reads `options`'s declared base files at `base` and computes its snapshot key with the secret source identities the
|
|
100
|
+
* runner's credentials read. Fails with `path: ["snapshot", "toolchains"]` if any declared base file is missing or
|
|
100
101
|
* unreadable at `base`.
|
|
101
102
|
*/
|
|
102
103
|
export async function snapshotInputsAt(checkout, request) {
|
|
103
|
-
const { repoRoot, base,
|
|
104
|
-
const { snapshot } =
|
|
104
|
+
const { repoRoot, base, options } = request;
|
|
105
|
+
const { snapshot } = options;
|
|
105
106
|
const baseFiles = [];
|
|
106
107
|
for (const path of declaredBaseFilePaths(snapshot.toolchains)) {
|
|
107
108
|
const file = await checkout.readFileAt({ repoRoot, commit: base, path });
|
|
@@ -125,7 +126,7 @@ export async function snapshotInputsAt(checkout, request) {
|
|
|
125
126
|
ok: true,
|
|
126
127
|
baseFiles,
|
|
127
128
|
key: snapshotKey({
|
|
128
|
-
credentials: credentialSourceIds(
|
|
129
|
+
credentials: credentialSourceIds(options),
|
|
129
130
|
baseFiles,
|
|
130
131
|
toolchains: snapshot.toolchains,
|
|
131
132
|
prebuild: snapshot.prebuild,
|
package/dist/runner/steps.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare function runStep(context: {
|
|
|
37
37
|
readonly script: string;
|
|
38
38
|
}, progress: RunnerProgress, signal: AbortSignal): Promise<StepOutcome>;
|
|
39
39
|
/**
|
|
40
|
-
* How a stage ends on a failed network policy write at `around`: granting credentials before the
|
|
40
|
+
* How a stage ends on a failed network policy write at `around`: granting credentials before the runner's snapshot
|
|
41
41
|
* steps, its run steps, or the command, or revoking them before a snapshot save. A stop when the run was canceled, or
|
|
42
42
|
* closing the scope began, a failure otherwise.
|
|
43
43
|
*/
|
package/dist/runner/steps.js
CHANGED
|
@@ -40,7 +40,7 @@ export async function runStep(context, request, progress, signal) {
|
|
|
40
40
|
return { kind: "succeeded", ms };
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* How a stage ends on a failed network policy write at `around`: granting credentials before the
|
|
43
|
+
* How a stage ends on a failed network policy write at `around`: granting credentials before the runner's snapshot
|
|
44
44
|
* steps, its run steps, or the command, or revoking them before a snapshot save. A stop when the run was canceled, or
|
|
45
45
|
* closing the scope began, a failure otherwise.
|
|
46
46
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** Records one static problem at `path` inside
|
|
1
|
+
/** Records one static problem at `path` inside Vercel Sandbox runner options, worded to follow the key. */
|
|
2
2
|
export type Report = (path: readonly string[], problem: string) => void;
|
|
3
3
|
/** Reports each key of `value` not in `known`; whether there were none. */
|
|
4
4
|
export declare function reportUnknownKeys(value: Readonly<Record<string, unknown>>, known: ReadonlySet<string>, path: readonly string[], what: string, report: Report): boolean;
|
|
5
5
|
/** A value as a problem names it: a string or number as written, otherwise its kind. */
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function describeOptionValue(value: unknown): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Pure problem-reporting helpers shared by `
|
|
1
|
+
// Pure problem-reporting helpers shared by `vercel-sandbox-options.ts` and `vercel-sandbox-secrets.ts` during
|
|
2
|
+
// `checkVercelSandboxOptions`.
|
|
2
3
|
/** Reports each key of `value` not in `known`; whether there were none. */
|
|
3
4
|
export function reportUnknownKeys(value, known, path, what, report) {
|
|
4
5
|
let ok = true;
|
|
@@ -10,7 +11,7 @@ export function reportUnknownKeys(value, known, path, what, report) {
|
|
|
10
11
|
return ok;
|
|
11
12
|
}
|
|
12
13
|
/** A value as a problem names it: a string or number as written, otherwise its kind. */
|
|
13
|
-
export function
|
|
14
|
+
export function describeOptionValue(value) {
|
|
14
15
|
if (typeof value === "string")
|
|
15
16
|
return JSON.stringify(value);
|
|
16
17
|
if (typeof value === "number" || typeof value === "boolean")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RunTestPlan } from "../sdk/extension/index.ts";
|
|
2
|
-
import { type CredentialDeclaration, credentialSourceIds, type UnsafeSecretEnvVar } from "./
|
|
2
|
+
import { type CredentialDeclaration, credentialSourceIds, type UnsafeSecretEnvVar } from "./vercel-sandbox-secrets.ts";
|
|
3
3
|
export { type CredentialDeclaration, credentialSourceIds, type UnsafeSecretEnvVar };
|
|
4
4
|
/** A bash script, run with `bash -lc` in the repository's root, and the label that names it in progress and errors. */
|
|
5
5
|
export interface RunnerStep {
|
|
@@ -31,8 +31,8 @@ export type RunnerVcpuCount = number | RunnerVcpuRule;
|
|
|
31
31
|
/**
|
|
32
32
|
* What a repository declares about its runner snapshot and what each run does on top of it.
|
|
33
33
|
*/
|
|
34
|
-
export interface
|
|
35
|
-
/** Lowercase letters, digits and dashes. Names the
|
|
34
|
+
export interface VercelSandboxOptions {
|
|
35
|
+
/** Lowercase letters, digits and dashes. Names the runner's sandboxes (`storm-runner-<name>`) and cache entries. */
|
|
36
36
|
readonly name: string;
|
|
37
37
|
readonly snapshot: {
|
|
38
38
|
/** The build sandbox's vCPUs. */
|
|
@@ -61,7 +61,7 @@ export interface RunnerRecipe {
|
|
|
61
61
|
* Extra environment variables for the command. It can't set `STORM_RUN`. When it sets neither `FORCE_COLOR` nor
|
|
62
62
|
* `NO_COLOR`, storm sets `FORCE_COLOR=1` when the local terminal asks for color (a TTY or `FORCE_COLOR`),
|
|
63
63
|
* `NO_COLOR=1` when the launcher explicitly opted out (`--no-color` or a non-empty `NO_COLOR`), and neither on a
|
|
64
|
-
* plain non-TTY launcher; when the
|
|
64
|
+
* plain non-TTY launcher; when the runner options set either, storm sets neither.
|
|
65
65
|
*/
|
|
66
66
|
readonly env?: Readonly<Record<string, string>>;
|
|
67
67
|
/**
|
|
@@ -122,7 +122,7 @@ export interface RunnerRecipe {
|
|
|
122
122
|
readonly sandboxes?: RunnerSandboxCount;
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
|
-
* How many runner sandboxes a run can have, the runner
|
|
125
|
+
* How many runner sandboxes a run can have, the Vercel Sandbox runner options' `sandboxes` key: `max`, the limit, a whole number from
|
|
126
126
|
* 1 to `MAX_RUNNER_SANDBOXES`, and `default`, the number of runner sandboxes of a run with no `--sandboxes` or
|
|
127
127
|
* `--file-lists`. No run from the config file has more runner sandboxes than `max`.
|
|
128
128
|
*/
|
|
@@ -163,16 +163,16 @@ export type SandboxCountDefault = number | SandboxCountDefaultRule;
|
|
|
163
163
|
* typing mistake that would start hundreds of runner sandboxes, not a claim about what Vercel Sandbox holds.
|
|
164
164
|
*/
|
|
165
165
|
export declare const MAX_RUNNER_SANDBOXES = 32;
|
|
166
|
-
/** The defaults of a
|
|
167
|
-
export declare const
|
|
166
|
+
/** The defaults of a runner's optional keys. */
|
|
167
|
+
export declare const VERCEL_SANDBOX_DEFAULTS: {
|
|
168
168
|
readonly cwd: ".";
|
|
169
169
|
readonly timeout: "60m";
|
|
170
170
|
readonly baseRefs: readonly ["main", "origin/main"];
|
|
171
171
|
readonly region: "iad1";
|
|
172
172
|
readonly runtime: "node22";
|
|
173
173
|
};
|
|
174
|
-
/**
|
|
175
|
-
export interface
|
|
174
|
+
/** Vercel Sandbox runner options that passed `checkVercelSandboxOptions`, with every optional key's default filled in. */
|
|
175
|
+
export interface CheckedVercelSandboxOptions extends VercelSandboxOptions {
|
|
176
176
|
readonly run: {
|
|
177
177
|
readonly install: RunnerStep;
|
|
178
178
|
readonly build: RunnerStep;
|
|
@@ -180,44 +180,45 @@ export interface CheckedRecipe extends RunnerRecipe {
|
|
|
180
180
|
readonly cwd: string;
|
|
181
181
|
readonly env: Readonly<Record<string, string>>;
|
|
182
182
|
/**
|
|
183
|
-
* The sandbox credentials, in the
|
|
183
|
+
* The sandbox credentials, in the runner's order, each header in lowercase and each `requests` given; empty when
|
|
184
184
|
* absent. `credentialSourceIds` gives their sorted, unique source identities.
|
|
185
185
|
*/
|
|
186
186
|
readonly credentials: readonly Required<CredentialDeclaration>[];
|
|
187
187
|
/**
|
|
188
|
-
* The unsafe secret environment variables passed into the command's environment, in the
|
|
188
|
+
* The unsafe secret environment variables passed into the command's environment, in the runner's order; empty when
|
|
189
189
|
* absent.
|
|
190
190
|
*/
|
|
191
191
|
readonly unsafeSecretEnvVars: readonly UnsafeSecretEnvVar[];
|
|
192
192
|
readonly timeout: string;
|
|
193
193
|
/** `timeout` in minutes. */
|
|
194
194
|
readonly timeoutMinutes: number;
|
|
195
|
-
/** `keepSandbox` in minutes; undefined when the
|
|
195
|
+
/** `keepSandbox` in minutes; undefined when the runner options don't set it. */
|
|
196
196
|
readonly keepSandboxMinutes: number | undefined;
|
|
197
197
|
readonly baseRefs: readonly string[];
|
|
198
198
|
readonly region: string;
|
|
199
199
|
readonly runtime: string;
|
|
200
200
|
}
|
|
201
201
|
/**
|
|
202
|
-
* One thing wrong with
|
|
203
|
-
* itself), and what is wrong, worded to follow the key (`must be …, not …`).
|
|
202
|
+
* One thing wrong with Vercel Sandbox runner options: the key path inside them (`["snapshot", "vcpus"]`; empty for
|
|
203
|
+
* the options object itself), and what is wrong, worded to follow the key (`must be …, not …`).
|
|
204
204
|
*/
|
|
205
|
-
export interface
|
|
205
|
+
export interface VercelSandboxOptionProblem {
|
|
206
206
|
readonly path: readonly string[];
|
|
207
207
|
readonly problem: string;
|
|
208
208
|
}
|
|
209
|
-
export type
|
|
209
|
+
export type VercelSandboxOptionsCheck = {
|
|
210
210
|
readonly ok: true;
|
|
211
|
-
readonly value:
|
|
211
|
+
readonly value: CheckedVercelSandboxOptions;
|
|
212
212
|
} | {
|
|
213
213
|
readonly ok: false;
|
|
214
|
-
readonly problems: readonly
|
|
214
|
+
readonly problems: readonly VercelSandboxOptionProblem[];
|
|
215
215
|
};
|
|
216
216
|
/**
|
|
217
|
-
* Checks
|
|
217
|
+
* Checks Vercel Sandbox runner options against their static rules: the keys they may hold and each value's shape.
|
|
218
|
+
* Every value must be plain
|
|
218
219
|
* data; functions are refused with the declared form to use instead. Every problem is reported.
|
|
219
220
|
*/
|
|
220
|
-
export declare function
|
|
221
|
+
export declare function checkVercelSandboxOptions(value: unknown): VercelSandboxOptionsCheck;
|
|
221
222
|
/** The sorted, unique repository-relative base file paths declared across `toolchains`. */
|
|
222
223
|
export declare function declaredBaseFilePaths(toolchains: readonly ToolchainStep[]): readonly string[];
|
|
223
224
|
/**
|
|
@@ -231,11 +232,11 @@ export interface VcpuRun {
|
|
|
231
232
|
readonly sandboxes: number;
|
|
232
233
|
}
|
|
233
234
|
/**
|
|
234
|
-
* The runner sandbox's vCPUs for `run`: the
|
|
235
|
+
* The runner sandbox's vCPUs for `run`: the runner's number, or the declared resource-scaling rule evaluated against
|
|
235
236
|
* `run.resources` and `run.sandboxes`. When the named resource is absent from the run, `min` is used. When the named
|
|
236
237
|
* resource is present and its named option is missing or not a non-negative finite number, returns a problem.
|
|
237
238
|
*/
|
|
238
|
-
export declare function resolveVcpus(
|
|
239
|
+
export declare function resolveVcpus(options: Pick<VercelSandboxOptions, "vcpus">, run: VcpuRun): {
|
|
239
240
|
readonly ok: true;
|
|
240
241
|
readonly vcpus: number;
|
|
241
242
|
} | {
|
|
@@ -243,7 +244,7 @@ export declare function resolveVcpus(recipe: Pick<RunnerRecipe, "vcpus">, run: V
|
|
|
243
244
|
readonly problem: string;
|
|
244
245
|
};
|
|
245
246
|
/**
|
|
246
|
-
* The number of runner sandboxes `runner.sandboxes.default` gives a run with test plan `testPlan`: the
|
|
247
|
+
* The number of runner sandboxes `runner.sandboxes.default` gives a run with test plan `testPlan`: the runner's number,
|
|
247
248
|
* or the declared `{ filesPerSandbox, max? }` rule evaluated against `testPlan`. A number above `sandboxes.max` is not
|
|
248
249
|
* a problem here: the run lowers it to `sandboxes.max` and says so.
|
|
249
250
|
*/
|