@cnc-tools/storm 0.15.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-SZEURWRS.js → chunk-4O5C2XGJ.js} +18 -15
- package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-4WAMTUWZ.js} +419 -340
- package/dist/chunks/{chunk-QVS7HRU7.js → chunk-6UHIJXZG.js} +3 -3
- package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
- package/dist/chunks/{chunk-4U4DZ7VG.js → chunk-7DZE67QM.js} +2 -2
- package/dist/chunks/{chunk-VUPZH7J2.js → chunk-BCBKYOHW.js} +1 -1
- package/dist/chunks/{chunk-QUHY6FGN.js → chunk-CKGZA25H.js} +1 -18
- package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-D27KILIA.js} +1 -1
- package/dist/chunks/{chunk-KC4KDJ5K.js → chunk-DADEYJDW.js} +174 -153
- package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
- package/dist/chunks/chunk-F4MOYHRY.js +198 -0
- package/dist/chunks/{chunk-CXAT7ZKP.js → chunk-FNBB6V4R.js} +1 -1
- package/dist/chunks/{chunk-OX7X4B2L.js → chunk-GRT3UIBV.js} +18 -1
- package/dist/chunks/chunk-HP3CURSZ.js +88 -0
- package/dist/chunks/{chunk-PN5ULTTH.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-XEVHP5ZW.js → chunk-M7EKRGVD.js} +8 -8
- package/dist/chunks/chunk-MR77L2GK.js +340 -0
- package/dist/chunks/{chunk-L36GBUBB.js → chunk-RNAS7JHE.js} +1755 -522
- package/dist/chunks/{chunk-5GBMR4HM.js → chunk-RWIXDDCK.js} +4 -192
- 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-YV7GE6EV.js → chunk-YEPFSLQR.js} +480 -375
- package/dist/chunks/{live-app-PI3BAN6Y.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 +4 -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 +39 -4
- 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 +38 -9
- package/dist/commands/exec/outcomes.js +32 -25
- package/dist/commands/exec/plan-run.d.ts +58 -150
- package/dist/commands/exec/plan-run.js +232 -88
- package/dist/commands/exec/planned-outcome.js +8 -1
- 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 +5 -5
- 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 +9 -4
- package/dist/commands/runs/facts.js +28 -11
- package/dist/commands/runs/list/command.d.ts +16 -6
- package/dist/commands/runs/list/command.js +10 -10
- package/dist/commands/runs/list/outcomes.d.ts +8 -3
- package/dist/commands/runs/logs/command.d.ts +6 -2
- package/dist/commands/runs/logs/command.js +10 -10
- package/dist/commands/runs/logs/outcomes.d.ts +3 -1
- package/dist/commands/runs/past-run.d.ts +14 -5
- package/dist/commands/runs/past-run.js +16 -5
- package/dist/commands/runs/show/command.d.ts +20 -8
- package/dist/commands/runs/show/command.js +30 -28
- package/dist/commands/runs/show/outcomes.d.ts +10 -4
- 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 +368 -27
- 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 +19 -18
- package/dist/commands/suites/list/outcomes.js +4 -4
- package/dist/commands/test/command.d.ts +39 -4
- package/dist/commands/test/command.js +50 -255
- package/dist/commands/test/metadata.js +1 -1
- package/dist/commands/test/outcomes.d.ts +19 -2
- package/dist/commands/test/outcomes.js +2 -2
- package/dist/config/check-runner.d.ts +5 -3
- package/dist/config/check-runner.js +33 -7
- package/dist/config/check-suites.js +1 -0
- 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/gateways.d.ts +7 -3
- package/dist/config/index.d.ts +4 -5
- package/dist/config/index.js +3 -4
- package/dist/config/live/config-gateway.js +5 -2
- package/dist/config/load.d.ts +21 -4
- package/dist/config/load.js +129 -15
- package/dist/config/runner.d.ts +7 -8
- package/dist/config/runner.js +1 -1
- package/dist/config/schema.d.ts +17 -5
- package/dist/config/schema.js +11 -3
- package/dist/config/typed-options.d.ts +1 -6
- package/dist/config/typed-options.js +2 -10
- package/dist/config-file/define.d.ts +1 -11
- package/dist/config-file/define.js +3 -3
- package/dist/config-file/runner.d.ts +5 -6
- package/dist/config-file/toolchain.d.ts +13 -7
- package/dist/config-file/toolchain.js +53 -37
- 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/github/resource.d.ts +1 -1
- package/dist/extensions/github/resource.js +1 -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 +2 -2
- package/dist/extensions/testserver/resource.js +2 -2
- 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 +7 -15
- package/dist/planning/plan-only.js +16 -22
- package/dist/planning/run-kind-flags.js +2 -2
- package/dist/planning/run-plan.d.ts +45 -13
- 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 +10 -2
- 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.d.ts +0 -6
- package/dist/runner/base.js +1 -16
- package/dist/runner/build-snapshots.d.ts +55 -29
- package/dist/runner/build-snapshots.js +135 -35
- 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 +92 -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 +141 -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 +25 -24
- package/dist/runner/prepare.js +28 -20
- 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 +38 -28
- package/dist/runner/snapshot-choice.js +1 -1
- package/dist/runner/snapshot-inspect.d.ts +39 -40
- package/dist/runner/snapshot-inspect.js +58 -38
- package/dist/runner/snapshot-key.d.ts +30 -21
- package/dist/runner/snapshot-key.js +49 -29
- 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} +82 -82
- package/dist/runner/vercel-sandbox-options.js +510 -0
- 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 +4 -3
- package/dist/sdk/extension/resource-definition.js +3 -2
- package/dist/sdk/extension/resource-factory.js +3 -4
- 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/sdk/run/present.d.ts +3 -3
- package/dist/sdk/run/present.js +1 -3
- 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 +6 -4
- package/skills/plan-runs.md +2 -2
- package/skills/read-run-output.md +6 -6
- package/dist/chunks/chunk-E4PJNZVG.js +0 -783
- package/dist/chunks/chunk-RAQEXKL6.js +0 -2591
- 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 -46
- package/dist/commands/exec/run-command.d.ts +0 -476
- package/dist/commands/exec/run-command.js +0 -604
- 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 -128
- package/dist/config/recipe-run.d.ts +0 -33
- package/dist/config/recipe-run.js +0 -28
- package/dist/core/sandbox-end.d.ts +0 -64
- package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
- package/dist/runner/recipe.js +0 -425
- package/dist/runner/snapshot-cache.d.ts +0 -148
- package/dist/runner/snapshot-cache.js +0 -126
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
redactor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FNBB6V4R.js";
|
|
4
4
|
import {
|
|
5
5
|
declaredSecretValues,
|
|
6
6
|
effectiveConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RNAS7JHE.js";
|
|
8
8
|
|
|
9
9
|
// src/planning/suites.ts
|
|
10
10
|
function resolveProjectTests(file, driverByName) {
|
|
@@ -51,7 +51,7 @@ function formatCommandLine(command) {
|
|
|
51
51
|
}
|
|
52
52
|
function targetRedactor(target, env) {
|
|
53
53
|
const runner = target.settingsFile.values?.settings.runner;
|
|
54
|
-
return redactor(declaredSecretValues(runner?.kind === "vercel-sandbox" ? runner.
|
|
54
|
+
return redactor(declaredSecretValues(runner?.kind === "vercel-sandbox" ? runner.options : void 0, env));
|
|
55
55
|
}
|
|
56
56
|
function preRunLine(target, extraCliArgs, redact) {
|
|
57
57
|
const label = target.name === null ? "tests" : `suite ${target.name}`;
|
|
@@ -2,21 +2,7 @@ import {
|
|
|
2
2
|
isoSecondsText,
|
|
3
3
|
paint,
|
|
4
4
|
seconds
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
|
|
7
|
-
// src/shared/dashboard.ts
|
|
8
|
-
function projectPage({ team, project }) {
|
|
9
|
-
return `https://vercel.com/${encodeURIComponent(team)}/${encodeURIComponent(project)}`;
|
|
10
|
-
}
|
|
11
|
-
function sandboxPage(where, name) {
|
|
12
|
-
return `${projectPage(where)}/sandboxes/${encodeURIComponent(name)}`;
|
|
13
|
-
}
|
|
14
|
-
function sandboxConnectPage(where, name) {
|
|
15
|
-
return `${sandboxPage(where, name)}/connect`;
|
|
16
|
-
}
|
|
17
|
-
function snapshotPage(where, id) {
|
|
18
|
-
return `${projectPage(where)}/sandboxes/snapshots/${encodeURIComponent(id)}`;
|
|
19
|
-
}
|
|
5
|
+
} from "./chunk-GRT3UIBV.js";
|
|
20
6
|
|
|
21
7
|
// src/shared/sandbox-table.ts
|
|
22
8
|
var SANDBOX_TABLE_HEADER = [
|
|
@@ -92,9 +78,6 @@ function sandboxTableLines(records, style = paint(false)) {
|
|
|
92
78
|
}
|
|
93
79
|
|
|
94
80
|
export {
|
|
95
|
-
sandboxPage,
|
|
96
|
-
sandboxConnectPage,
|
|
97
|
-
snapshotPage,
|
|
98
81
|
SANDBOX_TABLE_HEADER,
|
|
99
82
|
testTotalsText,
|
|
100
83
|
sandboxStateText,
|
|
@@ -1,23 +1,147 @@
|
|
|
1
1
|
import {
|
|
2
2
|
muted
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LKTZ5OXS.js";
|
|
4
4
|
import {
|
|
5
|
-
sandboxPage,
|
|
6
|
-
snapshotPage,
|
|
7
5
|
testTotalsText
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
sandboxRecordSchema
|
|
11
|
-
} from "./chunk-SZEURWRS.js";
|
|
6
|
+
} from "./chunk-CKGZA25H.js";
|
|
12
7
|
import {
|
|
13
8
|
isoSecondsText,
|
|
9
|
+
sandboxPage,
|
|
14
10
|
seconds,
|
|
15
|
-
short
|
|
16
|
-
|
|
11
|
+
short,
|
|
12
|
+
snapshotPage
|
|
13
|
+
} from "./chunk-GRT3UIBV.js";
|
|
14
|
+
import {
|
|
15
|
+
sandboxRecordSchema
|
|
16
|
+
} from "./chunk-4O5C2XGJ.js";
|
|
17
17
|
import {
|
|
18
18
|
stripAnsi
|
|
19
19
|
} from "./chunk-F6N34UWB.js";
|
|
20
20
|
|
|
21
|
+
// src/commands/runs/past-run.ts
|
|
22
|
+
var ALL_RUNS_WHY = ["flag", "no-config-file", "config-file-conflict"];
|
|
23
|
+
function runScope(all, found) {
|
|
24
|
+
if (all) return { kind: "all", why: "flag" };
|
|
25
|
+
switch (found.kind) {
|
|
26
|
+
case "none":
|
|
27
|
+
return { kind: "all", why: "no-config-file" };
|
|
28
|
+
case "conflict":
|
|
29
|
+
return { kind: "all", why: "config-file-conflict" };
|
|
30
|
+
case "found":
|
|
31
|
+
return { kind: "config", configFile: found.path };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function runsInScope(listed, scope) {
|
|
35
|
+
return scope.kind === "all" ? listed : listed.filter(({ record }) => record?.configFile === scope.configFile);
|
|
36
|
+
}
|
|
37
|
+
function onBranch(runs, branch) {
|
|
38
|
+
return branch === void 0 ? runs : runs.filter(({ record }) => record?.git?.branch === branch);
|
|
39
|
+
}
|
|
40
|
+
function newestFinished(runs) {
|
|
41
|
+
return runs.find((run) => !run.active && run.record?.ended !== void 0);
|
|
42
|
+
}
|
|
43
|
+
function newest(runs) {
|
|
44
|
+
return runs[0];
|
|
45
|
+
}
|
|
46
|
+
function finalResults(events) {
|
|
47
|
+
return events.flatMap((event) => event.kind === "test-result" ? [event] : []);
|
|
48
|
+
}
|
|
49
|
+
function sandboxDidNotPass(state, active) {
|
|
50
|
+
return state !== "passed" && !(active && state === "pending");
|
|
51
|
+
}
|
|
52
|
+
function ofSandbox(events, sandbox) {
|
|
53
|
+
return sandbox === void 0 ? events : events.filter((event) => event.sandbox === sandbox);
|
|
54
|
+
}
|
|
55
|
+
function testFiles(events) {
|
|
56
|
+
const files = /* @__PURE__ */ new Map();
|
|
57
|
+
for (const event of events) {
|
|
58
|
+
const sandbox = event.sandbox ?? null;
|
|
59
|
+
const key = `${sandbox ?? ""}\0${event.file}`;
|
|
60
|
+
let held = files.get(key);
|
|
61
|
+
if (held === void 0) {
|
|
62
|
+
held = { file: event.file, sandbox, tests: { passed: 0, failed: 0, skipped: 0 } };
|
|
63
|
+
files.set(key, held);
|
|
64
|
+
}
|
|
65
|
+
if (event.kind === "file-started") held.started = Math.min(held.started ?? event.at, event.at);
|
|
66
|
+
else if (event.kind === "file-finished") held.finished = Math.max(held.finished ?? event.at, event.at);
|
|
67
|
+
else if (event.kind === "test-result")
|
|
68
|
+
held.tests[event.state === "pass" ? "passed" : event.state === "fail" ? "failed" : "skipped"] += 1;
|
|
69
|
+
}
|
|
70
|
+
return [...files.values()].toSorted((a, b) => (a.sandbox ?? -1) - (b.sandbox ?? -1) || (a.file < b.file ? -1 : a.file > b.file ? 1 : 0)).map(({ file, sandbox, started, finished, tests }) => ({
|
|
71
|
+
file,
|
|
72
|
+
sandbox,
|
|
73
|
+
startedAt: started === void 0 ? null : new Date(started).toISOString(),
|
|
74
|
+
finishedAt: finished === void 0 ? null : new Date(finished).toISOString(),
|
|
75
|
+
ms: started === void 0 || finished === void 0 ? null : Math.max(0, finished - started),
|
|
76
|
+
tests: { ...tests }
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
function testTimings(events) {
|
|
80
|
+
const bySandbox = /* @__PURE__ */ new Map();
|
|
81
|
+
for (const event of events) {
|
|
82
|
+
if (event.kind !== "test-started" && event.kind !== "test-attempt-finished") continue;
|
|
83
|
+
let timings = bySandbox.get(event.sandbox);
|
|
84
|
+
if (timings === void 0) {
|
|
85
|
+
timings = /* @__PURE__ */ new Map();
|
|
86
|
+
bySandbox.set(event.sandbox, timings);
|
|
87
|
+
}
|
|
88
|
+
const durationMs = timings.get(event.id)?.durationMs ?? null;
|
|
89
|
+
timings.set(event.id, {
|
|
90
|
+
durationMs: event.kind === "test-attempt-finished" ? (durationMs ?? 0) + event.ms : durationMs,
|
|
91
|
+
worker: event.worker
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return bySandbox;
|
|
95
|
+
}
|
|
96
|
+
function totalAttemptMs(events) {
|
|
97
|
+
let sum = 0;
|
|
98
|
+
for (const event of events) {
|
|
99
|
+
if (event.kind === "test-attempt-finished") sum += event.ms;
|
|
100
|
+
}
|
|
101
|
+
return sum;
|
|
102
|
+
}
|
|
103
|
+
function parseWorkerFlag(raw) {
|
|
104
|
+
const match = /^w?(0|[1-9]\d*)$/i.exec(raw);
|
|
105
|
+
if (match === null) return void 0;
|
|
106
|
+
const parsed = Number(match[1]);
|
|
107
|
+
return Number.isSafeInteger(parsed) && parsed >= 0 ? parsed : void 0;
|
|
108
|
+
}
|
|
109
|
+
function sortBySlowest(tests) {
|
|
110
|
+
return [...tests].toSorted((a, b) => {
|
|
111
|
+
if (a.durationMs === null && b.durationMs === null) return 0;
|
|
112
|
+
if (a.durationMs === null) return 1;
|
|
113
|
+
if (b.durationMs === null) return -1;
|
|
114
|
+
return b.durationMs - a.durationMs;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function selected(result, filters, testWorker = null) {
|
|
118
|
+
if (filters.failed && result.state !== "fail") return false;
|
|
119
|
+
if (filters.test !== void 0 && !result.test.includes(filters.test) && !result.file.includes(filters.test))
|
|
120
|
+
return false;
|
|
121
|
+
if (filters.worker !== void 0 && testWorker !== filters.worker) return false;
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
function deduplicateTestErrors(errors) {
|
|
125
|
+
if (errors === void 0 || errors.length === 0) return [];
|
|
126
|
+
const collapsed = [];
|
|
127
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
128
|
+
for (const error of errors) {
|
|
129
|
+
const name = stripAnsi(error.name);
|
|
130
|
+
const message = stripAnsi(error.message);
|
|
131
|
+
const stack = error.stack === void 0 ? null : stripAnsi(error.stack);
|
|
132
|
+
const diff = error.diff === void 0 ? null : stripAnsi(error.diff);
|
|
133
|
+
const key = `${name}\0${message}\0${stack ?? ""}\0${diff ?? ""}`;
|
|
134
|
+
const existing = byKey.get(key);
|
|
135
|
+
if (existing !== void 0) {
|
|
136
|
+
collapsed[existing].occurrences += 1;
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
byKey.set(key, collapsed.length);
|
|
140
|
+
collapsed.push({ name, message, stack, diff, occurrences: 1 });
|
|
141
|
+
}
|
|
142
|
+
return collapsed;
|
|
143
|
+
}
|
|
144
|
+
|
|
21
145
|
// src/commands/runs/facts.ts
|
|
22
146
|
import { z } from "zod";
|
|
23
147
|
var LOG_STEPS = ["command", "install", "build", "apply", "snapshot"];
|
|
@@ -31,8 +155,8 @@ var scopeSchema = z.discriminatedUnion("kind", [
|
|
|
31
155
|
z.object({
|
|
32
156
|
/** Every run. */
|
|
33
157
|
kind: z.literal("all"),
|
|
34
|
-
/**
|
|
35
|
-
why: z.enum(
|
|
158
|
+
/** Why every run: one of `ALL_RUNS_WHY`. */
|
|
159
|
+
why: z.enum(ALL_RUNS_WHY)
|
|
36
160
|
})
|
|
37
161
|
]);
|
|
38
162
|
var runFactsSchema = z.object({
|
|
@@ -55,10 +179,10 @@ var runFactsSchema = z.object({
|
|
|
55
179
|
z.object({ kind: z.literal("launch-machine") }),
|
|
56
180
|
z.object({
|
|
57
181
|
kind: z.literal("vercel-sandbox"),
|
|
58
|
-
/** The control plane team the runner sandbox ran in. */
|
|
59
|
-
team: z.string(),
|
|
60
|
-
/** The control plane project the runner sandbox ran in. */
|
|
61
|
-
project: z.string(),
|
|
182
|
+
/** The control plane team the runner sandbox ran in; null when unknown (for example, --credential vercel-oidc without --scope). */
|
|
183
|
+
team: z.string().nullable(),
|
|
184
|
+
/** The control plane project the runner sandbox ran in; null when unknown (for example, --credential vercel-oidc without --project). */
|
|
185
|
+
project: z.string().nullable(),
|
|
62
186
|
/** The runner sandbox's region, such as iad1. */
|
|
63
187
|
region: z.string(),
|
|
64
188
|
/** The runner sandbox's runtime, such as node24. */
|
|
@@ -77,14 +201,16 @@ var runFactsSchema = z.object({
|
|
|
77
201
|
keptUntil: z.string().nullable(),
|
|
78
202
|
/** How many whole minutes are left until keptUntil, as of reading the run, 0 once it has passed; null when keptUntil is. */
|
|
79
203
|
keptMinutesLeft: z.number().nullable(),
|
|
80
|
-
/** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, and its page in the Vercel dashboard. Null until known. */
|
|
204
|
+
/** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, where a reused snapshot came from (`local` or `shared`), and its page in the Vercel dashboard. Null until known. */
|
|
81
205
|
snapshot: z.object({
|
|
82
206
|
id: z.string(),
|
|
83
207
|
base: z.string(),
|
|
84
208
|
built: z.boolean(),
|
|
85
209
|
/** How many commits the run's HEAD had that its base, the commit it was built at, lacks; null when the run state had no count. */
|
|
86
210
|
builtBehind: z.number().nullable(),
|
|
87
|
-
|
|
211
|
+
/** Where a reused snapshot came from (`local` or `shared`); null when this run built it or when unknown. */
|
|
212
|
+
source: z.enum(["local", "shared"]).nullable(),
|
|
213
|
+
url: z.string().nullable()
|
|
88
214
|
}).nullable(),
|
|
89
215
|
/** How many bytes of changes the run uploaded to the runner sandbox; null when the run stopped before the upload. */
|
|
90
216
|
uploadBytes: z.number().nullable()
|
|
@@ -157,11 +283,16 @@ function runFacts(run, now) {
|
|
|
157
283
|
function whereFacts(where, now) {
|
|
158
284
|
if (where.kind === "launch-machine") return { kind: "launch-machine" };
|
|
159
285
|
const { sandbox, snapshot, keptUntil } = where;
|
|
286
|
+
const project = where.team !== null && where.project !== null ? { team: where.team, project: where.project } : null;
|
|
160
287
|
return {
|
|
161
288
|
...where,
|
|
162
289
|
keptMinutesLeft: keptUntil === null ? null : Math.max(0, Math.floor((Date.parse(keptUntil) - now.getTime()) / 6e4)),
|
|
163
|
-
sandboxUrl: sandbox === null ? null : sandboxPage(
|
|
164
|
-
snapshot: snapshot === null ? null : {
|
|
290
|
+
sandboxUrl: sandbox === null || project === null ? null : sandboxPage(project, sandbox),
|
|
291
|
+
snapshot: snapshot === null ? null : {
|
|
292
|
+
...snapshot,
|
|
293
|
+
source: snapshot.source ?? null,
|
|
294
|
+
url: project === null ? null : snapshotPage(project, snapshot.id)
|
|
295
|
+
}
|
|
165
296
|
};
|
|
166
297
|
}
|
|
167
298
|
function scopeFacts(scope) {
|
|
@@ -169,7 +300,14 @@ function scopeFacts(scope) {
|
|
|
169
300
|
}
|
|
170
301
|
function scopeText(scope) {
|
|
171
302
|
if (scope.kind === "config") return scope.configFile;
|
|
172
|
-
|
|
303
|
+
switch (scope.why) {
|
|
304
|
+
case "flag":
|
|
305
|
+
return "every config (--all)";
|
|
306
|
+
case "no-config-file":
|
|
307
|
+
return "every config (no config file found)";
|
|
308
|
+
case "config-file-conflict":
|
|
309
|
+
return "every config (storm.config.ts and storm.config.mts in one directory)";
|
|
310
|
+
}
|
|
173
311
|
}
|
|
174
312
|
var runsUnreadable = {
|
|
175
313
|
exitCode: 1,
|
|
@@ -273,124 +411,22 @@ function commandText(run) {
|
|
|
273
411
|
return run.argv.map((arg) => /^[\w@%+=:,./-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'\\''`)}'`).join(" ");
|
|
274
412
|
}
|
|
275
413
|
|
|
276
|
-
// src/commands/runs/past-run.ts
|
|
277
|
-
function runScope(all, configFile) {
|
|
278
|
-
if (all) return { kind: "all", why: "flag" };
|
|
279
|
-
if (configFile === void 0) return { kind: "all", why: "no-config-file" };
|
|
280
|
-
return { kind: "config", configFile };
|
|
281
|
-
}
|
|
282
|
-
function runsInScope(listed, scope) {
|
|
283
|
-
return scope.kind === "all" ? listed : listed.filter(({ record }) => record?.configFile === scope.configFile);
|
|
284
|
-
}
|
|
285
|
-
function onBranch(runs, branch) {
|
|
286
|
-
return branch === void 0 ? runs : runs.filter(({ record }) => record?.git?.branch === branch);
|
|
287
|
-
}
|
|
288
|
-
function newestFinished(runs) {
|
|
289
|
-
return runs.find((run) => !run.active && run.record?.ended !== void 0);
|
|
290
|
-
}
|
|
291
|
-
function newest(runs) {
|
|
292
|
-
return runs[0];
|
|
293
|
-
}
|
|
294
|
-
function finalResults(events) {
|
|
295
|
-
return events.flatMap((event) => event.kind === "test-result" ? [event] : []);
|
|
296
|
-
}
|
|
297
|
-
function sandboxDidNotPass(state, active) {
|
|
298
|
-
return state !== "passed" && !(active && state === "pending");
|
|
299
|
-
}
|
|
300
|
-
function ofSandbox(events, sandbox) {
|
|
301
|
-
return sandbox === void 0 ? events : events.filter((event) => event.sandbox === sandbox);
|
|
302
|
-
}
|
|
303
|
-
function testFiles(events) {
|
|
304
|
-
const files = /* @__PURE__ */ new Map();
|
|
305
|
-
for (const event of events) {
|
|
306
|
-
const sandbox = event.sandbox ?? null;
|
|
307
|
-
const key = `${sandbox ?? ""}\0${event.file}`;
|
|
308
|
-
let held = files.get(key);
|
|
309
|
-
if (held === void 0) {
|
|
310
|
-
held = { file: event.file, sandbox, tests: { passed: 0, failed: 0, skipped: 0 } };
|
|
311
|
-
files.set(key, held);
|
|
312
|
-
}
|
|
313
|
-
if (event.kind === "file-started") held.started = Math.min(held.started ?? event.at, event.at);
|
|
314
|
-
else if (event.kind === "file-finished") held.finished = Math.max(held.finished ?? event.at, event.at);
|
|
315
|
-
else if (event.kind === "test-result")
|
|
316
|
-
held.tests[event.state === "pass" ? "passed" : event.state === "fail" ? "failed" : "skipped"] += 1;
|
|
317
|
-
}
|
|
318
|
-
return [...files.values()].toSorted((a, b) => (a.sandbox ?? -1) - (b.sandbox ?? -1) || (a.file < b.file ? -1 : a.file > b.file ? 1 : 0)).map(({ file, sandbox, started, finished, tests }) => ({
|
|
319
|
-
file,
|
|
320
|
-
sandbox,
|
|
321
|
-
startedAt: started === void 0 ? null : new Date(started).toISOString(),
|
|
322
|
-
finishedAt: finished === void 0 ? null : new Date(finished).toISOString(),
|
|
323
|
-
ms: started === void 0 || finished === void 0 ? null : Math.max(0, finished - started),
|
|
324
|
-
tests: { ...tests }
|
|
325
|
-
}));
|
|
326
|
-
}
|
|
327
|
-
function testTimings(events) {
|
|
328
|
-
const bySandbox = /* @__PURE__ */ new Map();
|
|
329
|
-
for (const event of events) {
|
|
330
|
-
if (event.kind !== "test-started" && event.kind !== "test-attempt-finished") continue;
|
|
331
|
-
let timings = bySandbox.get(event.sandbox);
|
|
332
|
-
if (timings === void 0) {
|
|
333
|
-
timings = /* @__PURE__ */ new Map();
|
|
334
|
-
bySandbox.set(event.sandbox, timings);
|
|
335
|
-
}
|
|
336
|
-
const durationMs = timings.get(event.id)?.durationMs ?? null;
|
|
337
|
-
timings.set(event.id, {
|
|
338
|
-
durationMs: event.kind === "test-attempt-finished" ? (durationMs ?? 0) + event.ms : durationMs,
|
|
339
|
-
worker: event.worker
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
return bySandbox;
|
|
343
|
-
}
|
|
344
|
-
function totalAttemptMs(events) {
|
|
345
|
-
let sum = 0;
|
|
346
|
-
for (const event of events) {
|
|
347
|
-
if (event.kind === "test-attempt-finished") sum += event.ms;
|
|
348
|
-
}
|
|
349
|
-
return sum;
|
|
350
|
-
}
|
|
351
|
-
function parseWorkerFlag(raw) {
|
|
352
|
-
const match = /^w?(0|[1-9]\d*)$/i.exec(raw);
|
|
353
|
-
if (match === null) return void 0;
|
|
354
|
-
const parsed = Number(match[1]);
|
|
355
|
-
return Number.isSafeInteger(parsed) && parsed >= 0 ? parsed : void 0;
|
|
356
|
-
}
|
|
357
|
-
function sortBySlowest(tests) {
|
|
358
|
-
return [...tests].toSorted((a, b) => {
|
|
359
|
-
if (a.durationMs === null && b.durationMs === null) return 0;
|
|
360
|
-
if (a.durationMs === null) return 1;
|
|
361
|
-
if (b.durationMs === null) return -1;
|
|
362
|
-
return b.durationMs - a.durationMs;
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
function selected(result, filters, testWorker = null) {
|
|
366
|
-
if (filters.failed && result.state !== "fail") return false;
|
|
367
|
-
if (filters.test !== void 0 && !result.test.includes(filters.test) && !result.file.includes(filters.test))
|
|
368
|
-
return false;
|
|
369
|
-
if (filters.worker !== void 0 && testWorker !== filters.worker) return false;
|
|
370
|
-
return true;
|
|
371
|
-
}
|
|
372
|
-
function deduplicateTestErrors(errors) {
|
|
373
|
-
if (errors === void 0 || errors.length === 0) return [];
|
|
374
|
-
const collapsed = [];
|
|
375
|
-
const byKey = /* @__PURE__ */ new Map();
|
|
376
|
-
for (const error of errors) {
|
|
377
|
-
const name = stripAnsi(error.name);
|
|
378
|
-
const message = stripAnsi(error.message);
|
|
379
|
-
const stack = error.stack === void 0 ? null : stripAnsi(error.stack);
|
|
380
|
-
const diff = error.diff === void 0 ? null : stripAnsi(error.diff);
|
|
381
|
-
const key = `${name}\0${message}\0${stack ?? ""}\0${diff ?? ""}`;
|
|
382
|
-
const existing = byKey.get(key);
|
|
383
|
-
if (existing !== void 0) {
|
|
384
|
-
collapsed[existing].occurrences += 1;
|
|
385
|
-
continue;
|
|
386
|
-
}
|
|
387
|
-
byKey.set(key, collapsed.length);
|
|
388
|
-
collapsed.push({ name, message, stack, diff, occurrences: 1 });
|
|
389
|
-
}
|
|
390
|
-
return collapsed;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
414
|
export {
|
|
415
|
+
runScope,
|
|
416
|
+
runsInScope,
|
|
417
|
+
onBranch,
|
|
418
|
+
newestFinished,
|
|
419
|
+
newest,
|
|
420
|
+
finalResults,
|
|
421
|
+
sandboxDidNotPass,
|
|
422
|
+
ofSandbox,
|
|
423
|
+
testFiles,
|
|
424
|
+
testTimings,
|
|
425
|
+
totalAttemptMs,
|
|
426
|
+
parseWorkerFlag,
|
|
427
|
+
sortBySlowest,
|
|
428
|
+
selected,
|
|
429
|
+
deduplicateTestErrors,
|
|
394
430
|
LOG_STEPS,
|
|
395
431
|
scopeSchema,
|
|
396
432
|
runFactsSchema,
|
|
@@ -410,20 +446,5 @@ export {
|
|
|
410
446
|
branchText,
|
|
411
447
|
gitText,
|
|
412
448
|
startedText,
|
|
413
|
-
commandText
|
|
414
|
-
runScope,
|
|
415
|
-
runsInScope,
|
|
416
|
-
onBranch,
|
|
417
|
-
newestFinished,
|
|
418
|
-
newest,
|
|
419
|
-
finalResults,
|
|
420
|
-
sandboxDidNotPass,
|
|
421
|
-
ofSandbox,
|
|
422
|
-
testFiles,
|
|
423
|
-
testTimings,
|
|
424
|
-
totalAttemptMs,
|
|
425
|
-
parseWorkerFlag,
|
|
426
|
-
sortBySlowest,
|
|
427
|
-
selected,
|
|
428
|
-
deduplicateTestErrors
|
|
449
|
+
commandText
|
|
429
450
|
};
|
|
@@ -22,13 +22,14 @@ import {
|
|
|
22
22
|
testserverPoolRules,
|
|
23
23
|
ttlMinutes,
|
|
24
24
|
unavailablePoolStoreGateway
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-72ZFEMAW.js";
|
|
26
26
|
import {
|
|
27
27
|
defineResource,
|
|
28
28
|
describeCredentialFailure,
|
|
29
29
|
optionKeyPath,
|
|
30
|
-
tokenRequestFailureFacts
|
|
31
|
-
|
|
30
|
+
tokenRequestFailureFacts,
|
|
31
|
+
vercelOidcTokenFailureFacts
|
|
32
|
+
} from "./chunk-XBDRVFEV.js";
|
|
32
33
|
|
|
33
34
|
// src/extensions/testserver/credential-facts.ts
|
|
34
35
|
import { z } from "zod";
|
|
@@ -46,34 +47,54 @@ var credentialOriginSchema = z.discriminatedUnion("source", [
|
|
|
46
47
|
source: z.literal("github-actions"),
|
|
47
48
|
/** The token's aud and repository claims; null when they can't be read. */
|
|
48
49
|
claims: z.object({ aud: z.string(), repository: z.string() }).nullable()
|
|
50
|
+
}),
|
|
51
|
+
z.object({
|
|
52
|
+
/** A pre-minted Vercel project OIDC token from VERCEL_OIDC_TOKEN. */
|
|
53
|
+
source: z.literal("vercel-oidc")
|
|
49
54
|
})
|
|
50
55
|
]);
|
|
51
56
|
var rejectedCredentialShape = {
|
|
52
57
|
origin: credentialOriginSchema,
|
|
53
|
-
/** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token. */
|
|
58
|
+
/** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token, or a trusted project's token for VERCEL_OIDC_TOKEN. */
|
|
54
59
|
fix: z.string()
|
|
55
60
|
};
|
|
56
61
|
function rejectedCredentialFacts(origin) {
|
|
57
62
|
return {
|
|
58
|
-
origin: origin.source === "mint" ? { source: "mint", ...origin.target } : { source: "github-actions", claims: origin.claims === void 0 ? null : { ...origin.claims } },
|
|
63
|
+
origin: origin.source === "mint" ? { source: "mint", ...origin.target } : origin.source === "vercel-oidc" ? { source: "vercel-oidc" } : { source: "github-actions", claims: origin.claims === void 0 ? null : { ...origin.claims } },
|
|
59
64
|
fix: rejectedCredentialFix(origin)
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
67
|
function rejectedCredentialFix(origin) {
|
|
63
68
|
if (origin.source === "mint")
|
|
64
69
|
return "The Testserver control plane trusts development OIDC tokens only from projects in its Trusted Sources; vercel-internal mints for project vercel on team vercel. Use a trusted team and project, then retry.";
|
|
70
|
+
if (origin.source === "vercel-oidc")
|
|
71
|
+
return "The Testserver control plane trusts development OIDC tokens only from projects in its Trusted Sources. Set VERCEL_OIDC_TOKEN to a token from a trusted project, then retry.";
|
|
65
72
|
const aud = origin.claims?.aud ?? "https://github.com/<owner>";
|
|
66
73
|
const repository = origin.claims?.repository ?? "<owner>/<repo>";
|
|
67
74
|
return `The Testserver control plane trusts GitHub Actions OIDC tokens only from repositories in its Trusted Sources. Ask the \`vercel/testserver\` owners for a Trusted Source rule matching \`aud: ${aud}\` and \`repository: ${repository}\`, then rerun the job.`;
|
|
68
75
|
}
|
|
69
76
|
function rejectedCredentialText(origin) {
|
|
70
|
-
|
|
77
|
+
switch (origin.source) {
|
|
78
|
+
case "mint":
|
|
79
|
+
return `the credential minted for project ${origin.project} on team ${origin.team}`;
|
|
80
|
+
case "github-actions":
|
|
81
|
+
return "the GitHub Actions OIDC token";
|
|
82
|
+
case "vercel-oidc":
|
|
83
|
+
return "the Vercel OIDC token from VERCEL_OIDC_TOKEN";
|
|
84
|
+
}
|
|
71
85
|
}
|
|
72
86
|
function credentialOriginRows(origin) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
87
|
+
switch (origin.source) {
|
|
88
|
+
case "mint":
|
|
89
|
+
return [["Team", origin.team], ["Project", origin.project]];
|
|
90
|
+
case "github-actions":
|
|
91
|
+
return [
|
|
92
|
+
["aud", origin.claims?.aud ?? "unreadable"],
|
|
93
|
+
["repository", origin.claims?.repository ?? "unreadable"]
|
|
94
|
+
];
|
|
95
|
+
case "vercel-oidc":
|
|
96
|
+
return [["Credential", "VERCEL_OIDC_TOKEN"]];
|
|
97
|
+
}
|
|
77
98
|
}
|
|
78
99
|
|
|
79
100
|
// src/extensions/testserver/pr-build-facts.ts
|
|
@@ -443,7 +464,14 @@ function createWith(options, credential) {
|
|
|
443
464
|
return { source: credential, ttlMinutes: ttlMinutes(options) };
|
|
444
465
|
}
|
|
445
466
|
function credentialFailed(failure, ttlMinutes2, failedCreates) {
|
|
446
|
-
|
|
467
|
+
switch (failure.source) {
|
|
468
|
+
case "mint":
|
|
469
|
+
return { kind: "mint-failed", failed: failure };
|
|
470
|
+
case "github-actions":
|
|
471
|
+
return { kind: "token-request-failed", failure: failure.failure, ttlMinutes: ttlMinutes2, failedCreates };
|
|
472
|
+
case "vercel-oidc":
|
|
473
|
+
return { kind: "vercel-oidc-token-failed", failure: failure.failure, ttlMinutes: ttlMinutes2, failedCreates };
|
|
474
|
+
}
|
|
447
475
|
}
|
|
448
476
|
function testserverCanceledFacts(options, facts) {
|
|
449
477
|
return canceledAfter(facts, options.create ? ttlMinutes(options) : void 0);
|
|
@@ -675,6 +703,17 @@ function tokenRequestFailed(failure, data) {
|
|
|
675
703
|
next: [{ type: "text", text: facts.fix }, ...mayExistSteps(mayExist, ttlMinutes2)]
|
|
676
704
|
};
|
|
677
705
|
}
|
|
706
|
+
function vercelOidcTokenFailed(failure, data) {
|
|
707
|
+
const facts = vercelOidcTokenFailureFacts(failure);
|
|
708
|
+
const { ttlMinutes: ttlMinutes2, failedCreates, sandboxMayExist: mayExist } = data;
|
|
709
|
+
return {
|
|
710
|
+
refused: "vercel_oidc_token_failed",
|
|
711
|
+
data: { ...facts, ...data },
|
|
712
|
+
message: `Couldn't use VERCEL_OIDC_TOKEN: ${facts.detail}. The pool had no usable Testserver sandbox, so the command didn't run.`,
|
|
713
|
+
rows: failedCreateRows(failedCreates),
|
|
714
|
+
next: [{ type: "text", text: facts.fix }, ...mayExistSteps(mayExist, ttlMinutes2)]
|
|
715
|
+
};
|
|
716
|
+
}
|
|
678
717
|
function credentialRejected(credential, data) {
|
|
679
718
|
const { origin, fix } = rejectedCredentialFacts(credential);
|
|
680
719
|
const { status, vercelId, ttlMinutes: ttlMinutes2, failedCreates, unpooled, sandboxMayExist: mayExist } = data;
|
|
@@ -811,6 +850,9 @@ function testserverPoolResultWarnings(facts) {
|
|
|
811
850
|
facts.uncreated.source === "mint" ? {
|
|
812
851
|
reason: "mint_failed",
|
|
813
852
|
message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't mint a credential: ${facts.uncreated.cause}. ${facts.uncreated.fix}`
|
|
853
|
+
} : facts.uncreated.source === "vercel-oidc" ? {
|
|
854
|
+
reason: "vercel_oidc_token_failed",
|
|
855
|
+
message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't use VERCEL_OIDC_TOKEN: ${facts.uncreated.cause}. ${facts.uncreated.fix}`
|
|
814
856
|
} : {
|
|
815
857
|
reason: "token_request_failed",
|
|
816
858
|
message: `Couldn't create ${facts.uncreated.count} more Testserver sandboxes: couldn't request a GitHub Actions OIDC token: ${facts.uncreated.cause}. ${facts.uncreated.fix}`
|
|
@@ -941,6 +983,12 @@ function acquireRefusal(refusal) {
|
|
|
941
983
|
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
942
984
|
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox)
|
|
943
985
|
});
|
|
986
|
+
case "vercel-oidc-token-failed":
|
|
987
|
+
return vercelOidcTokenFailed(refusal.failure, {
|
|
988
|
+
ttlMinutes: refusal.ttlMinutes,
|
|
989
|
+
failedCreates: failedCreateFacts(refusal.failedCreates),
|
|
990
|
+
sandboxMayExist: refusal.failedCreates.some(mayLeaveSandbox)
|
|
991
|
+
});
|
|
944
992
|
case "credential-rejected":
|
|
945
993
|
return credentialRejected(refusal.origin, {
|
|
946
994
|
status: refusal.failure.status,
|