@intentius/chant 0.124.87 → 0.124.88
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/action-pins.d.ts +1 -0
- package/dist/action-pins.d.ts.map +1 -1
- package/dist/action-pins.js +2 -0
- package/dist/actor.d.ts +12 -0
- package/dist/actor.d.ts.map +1 -0
- package/dist/actor.js +18 -0
- package/dist/bundle-check.d.ts +20 -5
- package/dist/bundle-check.d.ts.map +1 -1
- package/dist/bundle-check.js +20 -5
- package/dist/chant-install.d.ts +98 -0
- package/dist/chant-install.d.ts.map +1 -1
- package/dist/chant-install.js +204 -2
- package/dist/ci-commit.d.ts +1 -1
- package/dist/ci-commit.d.ts.map +1 -1
- package/dist/ci-commit.js +1 -2
- package/dist/ci-control.d.ts +1 -1
- package/dist/ci-control.d.ts.map +1 -1
- package/dist/ci-control.js +1 -1
- package/dist/ci-evidence-claims.d.ts +59 -0
- package/dist/ci-evidence-claims.d.ts.map +1 -0
- package/dist/ci-evidence-claims.js +87 -0
- package/dist/ci-evidence-from-job.d.ts +103 -0
- package/dist/ci-evidence-from-job.d.ts.map +1 -0
- package/dist/ci-evidence-from-job.js +162 -0
- package/dist/ci-evidence-jobs.d.ts +39 -4
- package/dist/ci-evidence-jobs.d.ts.map +1 -1
- package/dist/ci-evidence-jobs.js +38 -4
- package/dist/ci-handover.d.ts +12 -0
- package/dist/ci-handover.d.ts.map +1 -1
- package/dist/ci-handover.js +15 -3
- package/dist/ci-identity.d.ts +32 -6
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +40 -8
- package/dist/ci-image.d.ts +47 -9
- package/dist/ci-image.d.ts.map +1 -1
- package/dist/ci-image.js +45 -18
- package/dist/ci-jobs.d.ts +1 -1
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +7 -2
- package/dist/ci-login.d.ts +75 -13
- package/dist/ci-login.d.ts.map +1 -1
- package/dist/ci-login.js +89 -37
- package/dist/ci-product-words.d.ts +20 -1
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +27 -1
- package/dist/ci-product.d.ts +21 -2
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +21 -2
- package/dist/cli/handlers/approve-confirm.d.ts +14 -0
- package/dist/cli/handlers/approve-confirm.d.ts.map +1 -1
- package/dist/cli/handlers/approve-confirm.js +46 -0
- package/dist/cli/handlers/build.d.ts +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +22 -1
- package/dist/cli/handlers/ci-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-check.js +21 -1
- package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
- package/dist/cli/handlers/ci-evidence.js +227 -18
- package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-forge-check.js +34 -17
- package/dist/cli/handlers/generated-check.d.ts +3 -0
- package/dist/cli/handlers/generated-check.d.ts.map +1 -0
- package/dist/cli/handlers/generated-check.js +41 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +3 -0
- package/dist/cli/handlers/local-chant.d.ts +13 -0
- package/dist/cli/handlers/local-chant.d.ts.map +1 -1
- package/dist/cli/handlers/local-chant.js +42 -1
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +42 -5
- package/dist/cli/handlers/run-wave.js +8 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +38 -4
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +66 -0
- package/dist/cli/registry.d.ts +24 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/check-hooks.d.ts +10 -0
- package/dist/components/check-hooks.d.ts.map +1 -1
- package/dist/components/check-hooks.js +18 -0
- package/dist/components/pr-checks.d.ts +105 -0
- package/dist/components/pr-checks.d.ts.map +1 -0
- package/dist/components/pr-checks.js +119 -0
- package/dist/components/pr-pipeline.d.ts +34 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +14 -1
- package/dist/components/product-pipeline.d.ts +16 -1
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +17 -2
- package/dist/components/product-plan.d.ts +257 -4
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +241 -11
- package/dist/config.d.ts +10 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -6
- package/dist/control/consumers.d.ts +6 -0
- package/dist/control/consumers.d.ts.map +1 -1
- package/dist/control/consumers.js +6 -0
- package/dist/dead-guards.d.ts.map +1 -1
- package/dist/dead-guards.js +9 -6
- package/dist/discovery/files.d.ts +1 -1
- package/dist/discovery/files.js +1 -1
- package/dist/drift-issue.d.ts +20 -3
- package/dist/drift-issue.d.ts.map +1 -1
- package/dist/drift-issue.js +16 -0
- package/dist/drift-record.d.ts +45 -5
- package/dist/drift-record.d.ts.map +1 -1
- package/dist/drift-record.js +27 -6
- package/dist/floor-table.d.ts +6 -6
- package/dist/floor-table.d.ts.map +1 -1
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +58 -21
- package/dist/floor-table.js +10 -7
- package/dist/forge-check/contract.d.ts +8 -0
- package/dist/forge-check/contract.d.ts.map +1 -1
- package/dist/forge-check/contract.js +4 -1
- package/dist/forge-check/index.d.ts +2 -0
- package/dist/forge-check/index.d.ts.map +1 -1
- package/dist/forge-check/index.js +2 -0
- package/dist/forge-flags.d.ts +10 -0
- package/dist/forge-flags.d.ts.map +1 -1
- package/dist/forge-flags.js +31 -0
- package/dist/forge-remote.d.ts +47 -0
- package/dist/forge-remote.d.ts.map +1 -0
- package/dist/forge-remote.js +69 -0
- package/dist/generated-check.d.ts +74 -0
- package/dist/generated-check.d.ts.map +1 -0
- package/dist/generated-check.js +216 -0
- package/dist/lexicon.d.ts +16 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.d.ts +15 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +49 -3
- package/dist/lifecycle/release-images.d.ts +22 -1
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +27 -3
- package/dist/lifecycle/release-ledger.d.ts +4 -3
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +3 -2
- package/dist/local-chant.d.ts +57 -3
- package/dist/local-chant.d.ts.map +1 -1
- package/dist/local-chant.js +122 -13
- package/dist/op/op-waves-evidence-jobs.d.ts +92 -0
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -0
- package/dist/op/op-waves-evidence-jobs.js +112 -0
- package/dist/op/op-waves-evidence.d.ts +12 -1
- package/dist/op/op-waves-evidence.d.ts.map +1 -1
- package/dist/op/op-waves-evidence.js +23 -2
- package/dist/op/op-waves-run.d.ts +12 -1
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +54 -3
- package/dist/op/op-waves.d.ts +8 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +10 -0
- package/dist/op/schedule-overdue.d.ts +39 -2
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +89 -7
- package/dist/pr-forge-reads.d.ts +21 -1
- package/dist/pr-forge-reads.d.ts.map +1 -1
- package/dist/pr-forge-reads.js +19 -1
- package/dist/pr-forge.d.ts +7 -1
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +7 -2
- package/dist/pr-plan-note.d.ts +24 -0
- package/dist/pr-plan-note.d.ts.map +1 -1
- package/dist/pr-plan-note.js +11 -1
- package/dist/pr-plan-record.d.ts +47 -0
- package/dist/pr-plan-record.d.ts.map +1 -0
- package/dist/pr-plan-record.js +89 -0
- package/dist/pr-post.d.ts +40 -0
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +79 -6
- package/dist/pr-requires.d.ts +8 -0
- package/dist/pr-requires.d.ts.map +1 -1
- package/dist/pr-requires.js +3 -1
- package/dist/ref-gate-init.d.ts +76 -0
- package/dist/ref-gate-init.d.ts.map +1 -0
- package/dist/ref-gate-init.js +144 -0
- package/dist/ref-gate-rules.d.ts +19 -0
- package/dist/ref-gate-rules.d.ts.map +1 -0
- package/dist/ref-gate-rules.js +17 -0
- package/dist/release-floors.d.ts +64 -16
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +65 -17
- package/dist/state-migration.d.ts +24 -1
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +39 -3
- package/dist/state-unlock.d.ts +32 -1
- package/dist/state-unlock.d.ts.map +1 -1
- package/dist/state-unlock.js +31 -0
- package/dist/wave-runtime.mjs +292 -285
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +13 -7
- package/dist/workspace/drift-cli.d.ts +1 -1
- package/dist/workspace/drift-cli.d.ts.map +1 -1
- package/dist/workspace/drift-cli.js +5 -12
- package/dist/workspace/forge-work.d.ts +3 -2
- package/dist/workspace/forge-work.d.ts.map +1 -1
- package/dist/workspace/forge-work.js +7 -17
- package/dist/workspace/lexicon-outputs.js +2 -2
- package/dist/workspace/release-workflow.d.ts +26 -3
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +48 -6
- package/dist/workspace/trust/check-evidence-report.d.ts +18 -0
- package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence-report.js +13 -0
- package/dist/workspace/trust/check-evidence.d.ts +13 -1
- package/dist/workspace/trust/check-evidence.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence.js +8 -3
- package/dist/workspace/trust/evidence.d.ts +5 -0
- package/dist/workspace/trust/evidence.d.ts.map +1 -1
- package/dist/workspace/trust/evidence.js +5 -0
- package/dist/workspace/trust/open-evidence.d.ts +67 -0
- package/dist/workspace/trust/open-evidence.d.ts.map +1 -0
- package/dist/workspace/trust/open-evidence.js +92 -0
- package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate-cli.js +65 -3
- package/dist/workspace/trust/ref-gate.d.ts +61 -2
- package/dist/workspace/trust/ref-gate.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate.js +72 -7
- package/package.json +1 -1
- package/src/action-pins.ts +2 -0
- package/src/actor.test.ts +12 -0
- package/src/actor.ts +19 -0
- package/src/bundle-check.test.ts +22 -0
- package/src/bundle-check.ts +33 -5
- package/src/chant-install.test.ts +109 -1
- package/src/chant-install.ts +243 -2
- package/src/ci-commit.test.ts +51 -5
- package/src/ci-commit.ts +1 -2
- package/src/ci-control.ts +1 -0
- package/src/ci-evidence-claims.ts +102 -0
- package/src/ci-evidence-from-job.test.ts +147 -0
- package/src/ci-evidence-from-job.ts +195 -0
- package/src/ci-evidence-jobs.ts +41 -4
- package/src/ci-handover.ts +16 -3
- package/src/ci-identity.test.ts +3 -3
- package/src/ci-identity.ts +51 -11
- package/src/ci-image.test.ts +60 -10
- package/src/ci-image.ts +78 -19
- package/src/ci-jobs.ts +7 -2
- package/src/ci-login.test.ts +131 -3
- package/src/ci-login.token-drop.test.ts +204 -0
- package/src/ci-login.ts +137 -39
- package/src/ci-product-words.ts +30 -0
- package/src/ci-product.ts +26 -1
- package/src/cli/commands/__fixtures__/source-dir-root/migrations/0001-init/backfill.ts +3 -0
- package/src/cli/handlers/approve-confirm.test.ts +35 -0
- package/src/cli/handlers/approve-confirm.ts +44 -0
- package/src/cli/handlers/build-source-dir.test.ts +4 -0
- package/src/cli/handlers/build.ts +20 -2
- package/src/cli/handlers/ci-check.ts +19 -1
- package/src/cli/handlers/ci-evidence-open.test.ts +164 -0
- package/src/cli/handlers/ci-evidence.ts +210 -16
- package/src/cli/handlers/ci-forge-check.ts +22 -9
- package/src/cli/handlers/generated-check.ts +39 -0
- package/src/cli/handlers/lifecycle.test.ts +20 -0
- package/src/cli/handlers/lifecycle.ts +4 -0
- package/src/cli/handlers/local-chant.ts +39 -1
- package/src/cli/handlers/pr.ts +43 -5
- package/src/cli/handlers/run-wave.ts +7 -0
- package/src/cli/main.ts +38 -4
- package/src/cli/parse-args.ts +46 -0
- package/src/cli/registry.ts +24 -0
- package/src/components/check-hooks.ts +22 -0
- package/src/components/check-report-summary.test.ts +78 -0
- package/src/components/pr-checks.ts +159 -0
- package/src/components/pr-pipeline.ts +41 -1
- package/src/components/product-pipeline.ts +25 -3
- package/src/components/product-plan.test.ts +102 -1
- package/src/components/product-plan.ts +416 -15
- package/src/config.ts +13 -8
- package/src/control/consumers.ts +7 -0
- package/src/dead-guards.test.ts +27 -5
- package/src/dead-guards.ts +9 -6
- package/src/discovery/files.ts +1 -1
- package/src/drift-issue.test.ts +29 -1
- package/src/drift-issue.ts +28 -3
- package/src/drift-record.test.ts +25 -0
- package/src/drift-record.ts +55 -6
- package/src/floor-table.data.ts +58 -21
- package/src/floor-table.ts +12 -9
- package/src/forge-check/contract.ts +11 -1
- package/src/forge-check/forge-check.test.ts +8 -0
- package/src/forge-check/index.ts +2 -0
- package/src/forge-flags.test.ts +25 -1
- package/src/forge-flags.ts +34 -0
- package/src/forge-remote.test.ts +37 -0
- package/src/forge-remote.ts +79 -0
- package/src/generated-check.e2e.test.ts +98 -0
- package/src/generated-check.test.ts +104 -0
- package/src/generated-check.ts +269 -0
- package/src/lexicon.ts +17 -0
- package/src/lifecycle/publish-npm.ts +56 -3
- package/src/lifecycle/release-catalog.test.ts +2 -2
- package/src/lifecycle/release-images-dockerfile.test.ts +20 -0
- package/src/lifecycle/release-images.test.ts +44 -0
- package/src/lifecycle/release-images.ts +39 -3
- package/src/lifecycle/release-ledger.ts +4 -3
- package/src/local-chant.e2e.test.ts +81 -6
- package/src/local-chant.test.ts +22 -3
- package/src/local-chant.ts +130 -13
- package/src/op/op-waves-evidence-jobs.ts +134 -0
- package/src/op/op-waves-evidence.test.ts +36 -3
- package/src/op/op-waves-evidence.ts +23 -3
- package/src/op/op-waves-run.ts +57 -2
- package/src/op/op-waves.ts +11 -0
- package/src/op/schedule-overdue.test.ts +83 -1
- package/src/op/schedule-overdue.ts +107 -9
- package/src/pr-forge-reads-compare.test.ts +2 -1
- package/src/pr-forge-reads.ts +37 -1
- package/src/pr-forge.ts +14 -3
- package/src/pr-plan-note.ts +32 -3
- package/src/pr-plan-record.test.ts +75 -0
- package/src/pr-plan-record.ts +101 -0
- package/src/pr-post-plan-note.test.ts +60 -0
- package/src/pr-post.test.ts +30 -0
- package/src/pr-post.ts +110 -6
- package/src/pr-requires.test.ts +20 -0
- package/src/pr-requires.ts +10 -1
- package/src/ref-gate-init.ts +189 -0
- package/src/ref-gate-rules.ts +26 -0
- package/src/release-floors.ts +86 -17
- package/src/state-migration-record.test.ts +90 -0
- package/src/state-migration.test.ts +1 -1
- package/src/state-migration.ts +52 -3
- package/src/state-unlock.test.ts +33 -1
- package/src/state-unlock.ts +49 -1
- package/src/workspace/ci-green-cli.ts +12 -6
- package/src/workspace/drift-cli.ts +6 -18
- package/src/workspace/forge-work.ts +7 -14
- package/src/workspace/lexicon-outputs.ts +2 -2
- package/src/workspace/release-workflow.test.ts +70 -0
- package/src/workspace/release-workflow.ts +56 -8
- package/src/workspace/trust/check-evidence-report.ts +24 -0
- package/src/workspace/trust/check-evidence.ts +17 -5
- package/src/workspace/trust/evidence.ts +5 -0
- package/src/workspace/trust/open-evidence.ts +129 -0
- package/src/workspace/trust/ref-gate-cli.ts +59 -3
- package/src/workspace/trust/ref-gate-pieces.test.ts +175 -0
- package/src/workspace/trust/ref-gate.e2e.test.ts +17 -0
- package/src/workspace/trust/ref-gate.ts +87 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-green-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/ci-green-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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AM,CAAC,CAyCvE;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBpE;AAID,wBAAsB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBpE;AAeD,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAgFxE"}
|
|
@@ -235,7 +235,12 @@ export async function runCiWorkflow(ctx) {
|
|
|
235
235
|
const repoRoot = gitTop(root) ?? root;
|
|
236
236
|
const member = resolveMemberContext(cwd, found);
|
|
237
237
|
const target = ctx.args.output ? resolve(realpathSync(cwd), ctx.args.output) : join(repoRoot, CI_GREEN_WORKFLOW_FILE);
|
|
238
|
-
|
|
238
|
+
// #4909: under `chant dev generated-check` the file goes to the render
|
|
239
|
+
// tree; it is read and named as the committed file it stands for.
|
|
240
|
+
const { committedPathOf, isRenderPath, renderPathOf } = await import("../generated-check.js");
|
|
241
|
+
const rendering = isRenderPath(target);
|
|
242
|
+
const asCommitted = committedPathOf(target);
|
|
243
|
+
const fromRepo = relative(repoRoot, asCommitted).split(sep).join("/");
|
|
239
244
|
// The merge queue's verdict (#4644) is ours too, and holds no phase.
|
|
240
245
|
const sources = readWorkflowSources(repoRoot, fromRepo).filter((s) => s.path !== MERGE_QUEUE_WORKFLOW_FILE);
|
|
241
246
|
const scan = workflowsHolding(green, sources);
|
|
@@ -254,8 +259,8 @@ export async function runCiWorkflow(ctx) {
|
|
|
254
259
|
}
|
|
255
260
|
const base = member ? member.memberRoot : root;
|
|
256
261
|
const parts = ["chant", "ci", "workflow", ...extra.flatMap((w) => ["--workflow", w])];
|
|
257
|
-
if (ctx.args.output)
|
|
258
|
-
parts.push("--output", relative(base,
|
|
262
|
+
if (ctx.args.output && !(rendering && asCommitted === join(repoRoot, CI_GREEN_WORKFLOW_FILE)))
|
|
263
|
+
parts.push("--output", relative(base, asCommitted).split(sep).join("/"));
|
|
259
264
|
if (ctx.args.ciChant)
|
|
260
265
|
parts.push("--chant", ctx.args.ciChant);
|
|
261
266
|
if (ctx.args.ciInstall)
|
|
@@ -277,21 +282,22 @@ export async function runCiWorkflow(ctx) {
|
|
|
277
282
|
const npmLock = ctx.args.ciInstall && existsSync(join(root, "package-lock.json")) ? (workspaceRoot === "." ? "package-lock.json" : `${workspaceRoot}/package-lock.json`) : undefined;
|
|
278
283
|
const yaml = renderCiGreenWorkflow({ green, workflows, chantVersion: readerVersion(), workspaceRoot, chant: ctx.args.ciChant, install: ctx.args.ciInstall, npmLock, push, ...(runnerKeySecret ? { runnerKeySecret } : {}), ...(compose ? { compose } : {}) });
|
|
279
284
|
const written = writeWorkflowFile(target, ciGreenHeader(command, member ? "member" : "root") + yaml);
|
|
280
|
-
if (member)
|
|
285
|
+
if (member && !rendering)
|
|
281
286
|
recordGeneratedFiles(member.memberRoot, [{ path: fromRepo, command }]);
|
|
282
287
|
console.log(`Wrote ${written}: ticks when ${workflows.join(", ")} complete${workflows.length === 1 ? "s" : ""} on ${greenBranches(green).join(", ")}${compose ? " or a chant/compose/ branch" : ""}, and every 15 minutes.`);
|
|
283
288
|
// #4644: the merge queue's verdict, beside the tick and from the same command.
|
|
284
289
|
if (green.mergeQueue && !member) {
|
|
285
290
|
const queue = renderMergeQueueWorkflow({ green, chantVersion: readerVersion(), workspaceRoot, chant: ctx.args.ciChant, install: ctx.args.ciInstall, npmLock });
|
|
286
|
-
const at = writeWorkflowFile(join(repoRoot, MERGE_QUEUE_WORKFLOW_FILE), ciGreenHeader(command, "root") + queue);
|
|
291
|
+
const at = writeWorkflowFile(rendering ? renderPathOf(join(repoRoot, MERGE_QUEUE_WORKFLOW_FILE)) : join(repoRoot, MERGE_QUEUE_WORKFLOW_FILE), ciGreenHeader(command, "root") + queue);
|
|
287
292
|
const retries = green.mergeQueue.retries;
|
|
288
293
|
const again = retries > 0 ? `, re-running a failed job's workflow run up to ${retries} time${retries === 1 ? "" : "s"} first` : "";
|
|
289
294
|
console.log(`Wrote ${at}: on each merge group, ${MERGE_QUEUE_VERDICT_JOB} passes when every required phase passed on the group's commit${again}. Require ${MERGE_QUEUE_VERDICT_JOB} in the branch's ruleset.`);
|
|
290
295
|
}
|
|
291
296
|
for (const e of edits) {
|
|
292
|
-
|
|
297
|
+
// A check renders every edited workflow, changed or not, so each has its twin in the render tree.
|
|
298
|
+
if (!e.changed && !rendering)
|
|
293
299
|
continue;
|
|
294
|
-
const path = writeWorkflowFile(join(repoRoot, e.path), e.text);
|
|
300
|
+
const path = writeWorkflowFile(rendering ? renderPathOf(join(repoRoot, e.path)) : join(repoRoot, e.path), e.text);
|
|
295
301
|
console.log(e.build === "newest"
|
|
296
302
|
? `Wrote ${path}'s triggers and concurrency: ${e.phases.join(", ")} build${e.phases.length === 1 ? "s" : ""} the newest commit on ${greenBranches(green).join(", ")} when a run ends, and a ci/build/<sha> tag by hand.`
|
|
297
303
|
: `Wrote ${path}'s triggers and concurrency: ${e.phases.join(", ")} build${e.phases.length === 1 ? "s" : ""} every commit on ${greenBranches(green).join(", ")}, none cancelled, and a ci/build/<sha> tag by hand when the forge ran nothing.`);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* | kind | default read | how |
|
|
10
10
|
* |---|---|---|
|
|
11
|
-
* | `chant` | `live-read` | the member's `chant lifecycle diff <env> --live --json`, through `liveDiffDriftRecords`
|
|
11
|
+
* | `chant` | `live-read` | the member's `chant lifecycle diff <env> --live --json`, each lexicon's section through `lexiconDriftRecords` (`liveDiffDriftRecords`, with `mergeDeepDrift` when a lexicon has a deep reader, and the section's `absent`, #4896). `--components` adds `chant components status <env> --live --json` through `componentStatusDriftRecords`. Needs `--env` |
|
|
12
12
|
* | `terraform` | `state` | `chant lifecycle drift` in the member's reader project: the terraform lexicon's `readDrift`, `terraform show -json` over state, or `--read plan` for a saved plan's `show -json` |
|
|
13
13
|
* | `choudoufu` | `ownership` | the same, through `choudoufu live-plan -json` (and `live-ls`), or `--read plan` for live-plan with a plan beside it; `--resource <addr>` passes `choudoufu live-plan -resource=<addr>`'s stream through |
|
|
14
14
|
* | `pulumi` | `refresh` | `chant lifecycle drift` in the member's reader project: the pulumi lexicon's `readDrift`, `pulumi refresh --preview-only --json --target <urn>` per resource in the checked-in export, or `plunge drift --resource <urn> --stream` for a member on plunge; `--resource <urn>` reads that URN alone (#4455) |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drift-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/drift-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,iBAAiB,CAAC;AAElE,OAAO,
|
|
1
|
+
{"version":3,"file":"drift-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/drift-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAeL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EAGf,MAAM,iBAAiB,CAAC;AASzB,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,yUAcY,CAAC;AAC3C,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,oGAAoG;AACpG,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAKpE,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAA4B,CAAC;AAa/E,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAAe,CAAC;AAE/D,6FAA6F;AAC7F,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AA4F5G;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CAoFpF;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,sBAAsB,CAQjG;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuC5E"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* | kind | default read | how |
|
|
10
10
|
* |---|---|---|
|
|
11
|
-
* | `chant` | `live-read` | the member's `chant lifecycle diff <env> --live --json`, through `liveDiffDriftRecords`
|
|
11
|
+
* | `chant` | `live-read` | the member's `chant lifecycle diff <env> --live --json`, each lexicon's section through `lexiconDriftRecords` (`liveDiffDriftRecords`, with `mergeDeepDrift` when a lexicon has a deep reader, and the section's `absent`, #4896). `--components` adds `chant components status <env> --live --json` through `componentStatusDriftRecords`. Needs `--env` |
|
|
12
12
|
* | `terraform` | `state` | `chant lifecycle drift` in the member's reader project: the terraform lexicon's `readDrift`, `terraform show -json` over state, or `--read plan` for a saved plan's `show -json` |
|
|
13
13
|
* | `choudoufu` | `ownership` | the same, through `choudoufu live-plan -json` (and `live-ls`), or `--read plan` for live-plan with a plan beside it; `--resource <addr>` passes `choudoufu live-plan -resource=<addr>`'s stream through |
|
|
14
14
|
* | `pulumi` | `refresh` | `chant lifecycle drift` in the member's reader project: the pulumi lexicon's `readDrift`, `pulumi refresh --preview-only --json --target <urn>` per resource in the checked-in export, or `plunge drift --resource <urn> --stream` for a member on plunge; `--resource <urn>` reads that URN alone (#4455) |
|
|
@@ -44,7 +44,7 @@ import { existsSync } from "node:fs";
|
|
|
44
44
|
import { resolve } from "node:path";
|
|
45
45
|
import { formatError } from "../cli/format.js";
|
|
46
46
|
import { graphNodeFor } from "../change-set-graph.js";
|
|
47
|
-
import { componentStatusDriftRecords, countDriftStatuses, decodeDriftLines,
|
|
47
|
+
import { componentStatusDriftRecords, countDriftStatuses, decodeDriftLines, DRIFT_READS, DRIFT_SCHEMA_ID, DRIFT_VERSION, driftExpected, driftPlanner, driftRecordLine, driftSettle, driftStart, encodeDriftLines, foldDriftLines, lexiconDriftRecords, } from "../drift-record.js";
|
|
48
48
|
import { readDeclaration, readerVersion, WORKSPACE_ERROR_CODES, WorkspaceReadError } from "./declaration.js";
|
|
49
49
|
import { prepareKindReaders } from "./kind-readers.js";
|
|
50
50
|
import { loadKindRegistry } from "./kinds.js";
|
|
@@ -154,16 +154,9 @@ function chantRecords(member, diffOut, componentsOut, observedAt, version) {
|
|
|
154
154
|
const lexicons = [...Object.values(doc.lexicons ?? {}), ...Object.values(doc.stacks ?? {}).flatMap((s) => Object.values(s))];
|
|
155
155
|
const base = { member, observedAt, ...(version ? { version } : {}) };
|
|
156
156
|
const out = [];
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const types = {};
|
|
161
|
-
for (const [name, meta] of Object.entries(lex.observed ?? {}))
|
|
162
|
-
if (typeof meta?.type === "string")
|
|
163
|
-
types[name] = meta.type;
|
|
164
|
-
const thin = liveDiffDriftRecords({ ...base, diff: lex.resources, types });
|
|
165
|
-
out.push(...(lex.deep ? mergeDeepDrift(thin, deepDiffDriftRecords({ ...base, diff: lex.deep })) : thin));
|
|
166
|
-
}
|
|
157
|
+
// The section's own `absent` (#4896): the sql lexicon's confirmed-absent objects are missing, not pending.
|
|
158
|
+
for (const section of lexicons)
|
|
159
|
+
out.push(...lexiconDriftRecords({ ...base, section }));
|
|
167
160
|
if (componentsOut !== undefined) {
|
|
168
161
|
let rows;
|
|
169
162
|
try {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* reason, and its number still stands. After a network failure, a 401 or a
|
|
22
22
|
* 403, the rest are answered with the same reason without another call.
|
|
23
23
|
*/
|
|
24
|
+
import { forgeKindOfHost } from "../forge-remote.js";
|
|
24
25
|
import { type ForgeFetch, type ForgeKind } from "../pr-forge.js";
|
|
25
26
|
/** What the forge says one pull request closes. */
|
|
26
27
|
export interface PullRequestCloses {
|
|
@@ -57,8 +58,8 @@ export interface ForgeWorkOptions {
|
|
|
57
58
|
/** How long one call may take. Default 15 seconds. */
|
|
58
59
|
timeoutMs?: number;
|
|
59
60
|
}
|
|
60
|
-
/** The forge kind a remote host is
|
|
61
|
-
export
|
|
61
|
+
/** The forge kind a remote host is, as `@intentius/chant/forge-remote` reads it (#4920). */
|
|
62
|
+
export { forgeKindOfHost };
|
|
62
63
|
/** The REST base of a forge at `host`, as the clients take it. */
|
|
63
64
|
export declare function forgeApiBase(kind: ForgeKind, host: string): string;
|
|
64
65
|
/** A reader of what pull requests close, for the repository at `top`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forge-work.d.ts","sourceRoot":"","sources":["../../src/workspace/forge-work.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"forge-work.d.ts","sourceRoot":"","sources":["../../src/workspace/forge-work.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,eAAe,EAAiB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAkF,KAAK,UAAU,EAAE,KAAK,SAAS,EAAkC,MAAM,aAAa,CAAC;AAE9K,mDAAmD;AACnD,MAAM,WAAW,iBAAiB;IAChC,uFAAuF;IACvF,QAAQ,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC/C,yDAAyD;IACzD,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;CAC3E;AAED,MAAM,WAAW,gBAAgB;IAC/B,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,uGAAuG;IACvG,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC/C,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAqBD,4FAA4F;AAC5F,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGlE;AAgCD,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,gBAAqB,GAAG,eAAe,CAkDzF;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE;IAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAE,EAAE,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1J"}
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
* 403, the rest are answered with the same reason without another call.
|
|
23
23
|
*/
|
|
24
24
|
import { execFileSync } from "node:child_process";
|
|
25
|
-
import {
|
|
26
|
-
import { remoteHost } from "../op/activities/gh-host.js";
|
|
25
|
+
import { forgeKindOfHost, forgeOfRemote } from "../forge-remote.js";
|
|
27
26
|
import { detectForge, FORGE_TOKEN_ORDER, ForgeApiError, forgeClient, forgeTargetFromEnv } from "../pr-forge.js";
|
|
28
27
|
/** How many pull requests are asked about at once. */
|
|
29
28
|
const CONCURRENCY = 4;
|
|
@@ -43,17 +42,8 @@ function ghAuthToken(host) {
|
|
|
43
42
|
return undefined;
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
/** The forge kind a remote host is
|
|
47
|
-
export
|
|
48
|
-
const h = host.toLowerCase().replace(/:\d+$/, "");
|
|
49
|
-
if (h === "github.com" || /(^|[.-])github([.-]|$)/.test(h))
|
|
50
|
-
return "github";
|
|
51
|
-
if (h === "gitlab.com" || /(^|[.-])gitlab([.-]|$)/.test(h))
|
|
52
|
-
return "gitlab";
|
|
53
|
-
if (h === "codeberg.org" || /(^|[.-])(forgejo|gitea)([.-]|$)/.test(h))
|
|
54
|
-
return "forgejo";
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
45
|
+
/** The forge kind a remote host is, as `@intentius/chant/forge-remote` reads it (#4920). */
|
|
46
|
+
export { forgeKindOfHost };
|
|
57
47
|
/** The REST base of a forge at `host`, as the clients take it. */
|
|
58
48
|
export function forgeApiBase(kind, host) {
|
|
59
49
|
if (kind === "github")
|
|
@@ -75,11 +65,11 @@ function locate(top, opts) {
|
|
|
75
65
|
const url = opts.remoteUrl !== undefined ? opts.remoteUrl : gitRemote(top);
|
|
76
66
|
if (!url)
|
|
77
67
|
return { source: null, reason: "there is no origin remote to name the forge" };
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
if (!host || !repo || !kind)
|
|
68
|
+
// #4920: the origin remote's forge, as `@intentius/chant/forge-remote` reads it.
|
|
69
|
+
const at = forgeOfRemote(url);
|
|
70
|
+
if (!at)
|
|
82
71
|
return { source: null, reason: `origin (${url}) is not on a forge chant reads issues from: GitHub, GitLab or Forgejo` };
|
|
72
|
+
const { kind, host, repo } = at;
|
|
83
73
|
const source = { kind, host, repo };
|
|
84
74
|
const names = ["CHANT_FORGE_TOKEN", ...FORGE_TOKEN_ORDER[kind]];
|
|
85
75
|
const tokenSource = names.find((n) => env[n]?.trim());
|
|
@@ -58,8 +58,8 @@ function staticInclude(read) {
|
|
|
58
58
|
/**
|
|
59
59
|
* Only the files under the member's `sourceDir`, when its config sets one, as
|
|
60
60
|
* a build reads them (#3941). Without one, every source file of the member
|
|
61
|
-
* but its top-level `scripts/`, which a root build leaves
|
|
62
|
-
* `ROOT_SOURCE_EXCLUDES`) unless `include` brings
|
|
61
|
+
* but its top-level `scripts/` and `migrations/`, which a root build leaves
|
|
62
|
+
* out (#4794, #4921, `ROOT_SOURCE_EXCLUDES`) unless `include` brings one back.
|
|
63
63
|
*/
|
|
64
64
|
function withinSourceDir(files, member, sourceDir, include = []) {
|
|
65
65
|
if (!sourceDir) {
|
|
@@ -34,9 +34,9 @@ export interface ReleasePipelineConfig {
|
|
|
34
34
|
env?: Record<string, string>;
|
|
35
35
|
/**
|
|
36
36
|
* Steps the cut and publish jobs run after the install (#4751): `{ run }`,
|
|
37
|
-
* or `{ uses, with }` on GitHub and Forgejo, such as
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* or `{ uses, with }` on GitHub and Forgejo, such as a newer npm. GitLab
|
|
38
|
+
* takes `run` steps as script lines and refuses `uses` by name. QEMU for
|
|
39
|
+
* the platforms `release.images` builds is set up without one (#4876).
|
|
40
40
|
*/
|
|
41
41
|
setup?: OpSetupStep[];
|
|
42
42
|
/** Where the workflow is written, from the repository root, such as `.github/workflows/publish.yml` for an npm trusted publisher that names that file. Default {@link RELEASE_WORKFLOW_FILES}. */
|
|
@@ -66,6 +66,12 @@ export interface ReleaseWorkflowInput {
|
|
|
66
66
|
* two jobs cannot change what is published.
|
|
67
67
|
*/
|
|
68
68
|
imageArchives?: string[];
|
|
69
|
+
/**
|
|
70
|
+
* The platforms `release.images` builds (#4876). Those the runner can't run
|
|
71
|
+
* ({@link RELEASE_RUNNER_PLATFORM}) get QEMU's binfmt handlers in the cut
|
|
72
|
+
* and publish jobs, before `release.workflow.setup`.
|
|
73
|
+
*/
|
|
74
|
+
imagePlatforms?: string[];
|
|
69
75
|
/** `release.lane` (#4692): the gate's green lane. */
|
|
70
76
|
lane?: string;
|
|
71
77
|
/**
|
|
@@ -120,6 +126,23 @@ export declare const NPM_TRUSTED_PUBLISHING_SETUP = "have=\"$(npm --version)\";
|
|
|
120
126
|
* nothing.
|
|
121
127
|
*/
|
|
122
128
|
export declare function targetExtras(forge: ReleaseWorkflowForge, targets: ReadonlyArray<ReleaseWorkflowTarget>, p: ReleasePipelineConfig): Pick<ReleasePipelineConfig, "permissions" | "env" | "setup">;
|
|
129
|
+
/** The platform the jobs `chant release workflow` writes run on: GitHub's and Forgejo's `ubuntu-latest`, and a GitLab runner's default (#4876). */
|
|
130
|
+
export declare const RELEASE_RUNNER_PLATFORM = "linux/amd64";
|
|
131
|
+
/** The binfmt image a GitLab job installs QEMU's handlers with (#4876). */
|
|
132
|
+
export declare const RELEASE_BINFMT_IMAGE = "tonistiigi/binfmt";
|
|
133
|
+
/** The architectures among `platforms` the runner can't run, as QEMU names them (`linux/arm/v7` is `arm`), each once. */
|
|
134
|
+
export declare function qemuArchitectures(platforms: readonly string[]): string[];
|
|
135
|
+
/**
|
|
136
|
+
* QEMU's binfmt setup for the platforms `release.images` builds that the
|
|
137
|
+
* runner can't, such as `linux/arm64` on an amd64 runner (#4876), so no
|
|
138
|
+
* product names it in `release.workflow.setup`. GitHub and Forgejo get
|
|
139
|
+
* `docker/setup-qemu-action` at its pin; GitLab a `docker run --privileged`
|
|
140
|
+
* of {@link RELEASE_BINFMT_IMAGE}, which `chant release workflow` notes needs
|
|
141
|
+
* an executor that runs privileged containers. A config whose `setup` names
|
|
142
|
+
* the action or the binfmt image already gets nothing more, so its file
|
|
143
|
+
* renders as it did.
|
|
144
|
+
*/
|
|
145
|
+
export declare function qemuSetup(forge: ReleaseWorkflowForge, platforms: readonly string[], p: ReleasePipelineConfig): OpSetupStep[];
|
|
123
146
|
/** The flags `chant release publish` gets under the groups. */
|
|
124
147
|
export declare function publishFlags(groups: ReadonlySet<SecurityGroup>): string[];
|
|
125
148
|
/** Where `chant release images` writes the digests the publish job's build reads (#4657), by default and at a workstation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-workflow.d.ts","sourceRoot":"","sources":["../../src/workspace/release-workflow.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KA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AG,EAAE,OAAO,iBAAiB,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsEvG"}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* renders the tag-triggered file it always did.
|
|
29
29
|
*/
|
|
30
30
|
import { ACTION_PINS, tagComments, usesRef } from "../action-pins.js";
|
|
31
|
-
import { resolveReleaseImages } from "../lifecycle/release-images.js";
|
|
31
|
+
import { releaseImagePlatforms, resolveReleaseImages } from "../lifecycle/release-images.js";
|
|
32
32
|
import { GENERATED_MARKER } from "../discovery/files.js";
|
|
33
33
|
export const RELEASE_WORKFLOW_FORGES = ["github", "forgejo", "gitlab"];
|
|
34
34
|
/** Where each forge's publish workflow is written, relative to the repository root. */
|
|
@@ -73,6 +73,33 @@ export function targetExtras(forge, targets, p) {
|
|
|
73
73
|
const setup = npm && !(p.setup ?? []).some((s) => !("uses" in s) && s.run === NPM_TRUSTED_PUBLISHING_SETUP) ? [{ run: NPM_TRUSTED_PUBLISHING_SETUP }] : [];
|
|
74
74
|
return { ...(permissions ? { permissions } : {}), ...(Object.keys(env).length > 0 ? { env } : {}), ...(setup.length > 0 ? { setup } : {}) };
|
|
75
75
|
}
|
|
76
|
+
/** The platform the jobs `chant release workflow` writes run on: GitHub's and Forgejo's `ubuntu-latest`, and a GitLab runner's default (#4876). */
|
|
77
|
+
export const RELEASE_RUNNER_PLATFORM = "linux/amd64";
|
|
78
|
+
/** The binfmt image a GitLab job installs QEMU's handlers with (#4876). */
|
|
79
|
+
export const RELEASE_BINFMT_IMAGE = "tonistiigi/binfmt";
|
|
80
|
+
/** The architectures among `platforms` the runner can't run, as QEMU names them (`linux/arm/v7` is `arm`), each once. */
|
|
81
|
+
export function qemuArchitectures(platforms) {
|
|
82
|
+
return [...new Set(platforms.filter((p) => p.split("/").slice(0, 2).join("/") !== RELEASE_RUNNER_PLATFORM).map((p) => p.split("/")[1] ?? p))].sort();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* QEMU's binfmt setup for the platforms `release.images` builds that the
|
|
86
|
+
* runner can't, such as `linux/arm64` on an amd64 runner (#4876), so no
|
|
87
|
+
* product names it in `release.workflow.setup`. GitHub and Forgejo get
|
|
88
|
+
* `docker/setup-qemu-action` at its pin; GitLab a `docker run --privileged`
|
|
89
|
+
* of {@link RELEASE_BINFMT_IMAGE}, which `chant release workflow` notes needs
|
|
90
|
+
* an executor that runs privileged containers. A config whose `setup` names
|
|
91
|
+
* the action or the binfmt image already gets nothing more, so its file
|
|
92
|
+
* renders as it did.
|
|
93
|
+
*/
|
|
94
|
+
export function qemuSetup(forge, platforms, p) {
|
|
95
|
+
const archs = qemuArchitectures(platforms);
|
|
96
|
+
if (archs.length === 0)
|
|
97
|
+
return [];
|
|
98
|
+
const named = (p.setup ?? []).some((s) => ("uses" in s ? /^docker\/setup-qemu-action@/.test(s.uses) : s.run.includes(RELEASE_BINFMT_IMAGE)));
|
|
99
|
+
if (named)
|
|
100
|
+
return [];
|
|
101
|
+
return forge === "gitlab" ? [{ run: `docker run --privileged --rm ${RELEASE_BINFMT_IMAGE} --install ${archs.join(",")}` }] : [{ uses: usesRef(ACTION_PINS.dockerSetupQemu4), with: { platforms: archs.join(",") } }];
|
|
102
|
+
}
|
|
76
103
|
/** The flags `chant release publish` gets under the groups. */
|
|
77
104
|
export function publishFlags(groups) {
|
|
78
105
|
return [...(groups.has("supply-chain") ? ["--require-provenance"] : []), "--yes"];
|
|
@@ -109,11 +136,13 @@ export function renderReleaseWorkflow(input) {
|
|
|
109
136
|
const version = input.version === true;
|
|
110
137
|
// #4786: the targets' own needs first, then the config's, so a config that set them by hand renders the same file without them.
|
|
111
138
|
const derived = targetExtras(input.forge, input.publish ?? [], p);
|
|
139
|
+
// #4876: QEMU before the config's setup, where the products named it.
|
|
140
|
+
const qemu = images ? qemuSetup(input.forge, input.imagePlatforms ?? [], p) : [];
|
|
112
141
|
const extra = jobExtras({
|
|
113
142
|
...p,
|
|
114
143
|
...(derived.permissions ? { permissions: { ...p.permissions, ...derived.permissions } } : {}),
|
|
115
144
|
...(derived.env ? { env: { ...p.env, ...derived.env } } : {}),
|
|
116
|
-
...(derived.setup ? { setup: [...(p.setup ?? []), ...derived.setup] } : {}),
|
|
145
|
+
...(derived.setup || qemu.length > 0 ? { setup: [...qemu, ...(p.setup ?? []), ...(derived.setup ?? [])] } : {}),
|
|
117
146
|
}, input.forge);
|
|
118
147
|
// #4767: Forgejo's job token is not a GitHub token, and GitLab has no such expression.
|
|
119
148
|
const forgeToken = input.forge === "github" && p.env?.GITHUB_TOKEN === undefined && (input.publish ?? []).some((t) => t.type === "forge" && t.forge === "github" && !t.tokenEnv)
|
|
@@ -212,11 +241,16 @@ function jobExtras(p, forge) {
|
|
|
212
241
|
for (const s of setup)
|
|
213
242
|
if (!("uses" in s) && s.run.trim() === "")
|
|
214
243
|
throw new Error(`${where}.setup: a run step is empty`);
|
|
244
|
+
for (const s of setup)
|
|
245
|
+
if (s.name !== undefined && (s.name.trim() === "" || /[\r\n]/.test(s.name)))
|
|
246
|
+
throw new Error(`${where}.setup: a step's name is blank or more than one line`);
|
|
215
247
|
}
|
|
216
248
|
const q = (v) => JSON.stringify(v);
|
|
217
249
|
const map = (indent, entries) => entries.map(([k, v]) => `${indent}${k}: ${q(v)}`);
|
|
250
|
+
// #4932: a named step opens with its name.
|
|
218
251
|
const githubSteps = setup.flatMap((s) => [
|
|
219
|
-
|
|
252
|
+
...(s.name !== undefined ? [` - name: ${q(s.name)}`] : []),
|
|
253
|
+
` ${s.name !== undefined ? " " : "-"} ${"uses" in s ? `uses: ${s.uses}` : `run: ${q(s.run)}`}`,
|
|
220
254
|
...("uses" in s && s.with && Object.keys(s.with).length > 0 ? [" with:", ...map(" ", Object.entries(s.with))] : []),
|
|
221
255
|
...(s.env && Object.keys(s.env).length > 0 ? [" env:", ...map(" ", Object.entries(s.env))] : []),
|
|
222
256
|
]);
|
|
@@ -489,7 +523,7 @@ export async function runReleaseWorkflow(ctx) {
|
|
|
489
523
|
groups,
|
|
490
524
|
workspaceRoot,
|
|
491
525
|
...(release?.workflow ? { pipeline: release.workflow } : {}),
|
|
492
|
-
...((release?.images?.length ?? 0) > 0 ? { images: true, imageArchives: resolveReleaseImages(release.images).map((i) => i.archive) } : {}),
|
|
526
|
+
...((release?.images?.length ?? 0) > 0 ? { images: true, imageArchives: resolveReleaseImages(release.images).map((i) => i.archive), imagePlatforms: releaseImagePlatforms(release.images) } : {}),
|
|
493
527
|
...(release?.lane ? { lane: release.lane } : {}),
|
|
494
528
|
...(release?.version ? { version: true } : {}),
|
|
495
529
|
...(release?.publish ? { publish: release.publish } : {}),
|
|
@@ -498,6 +532,10 @@ export async function runReleaseWorkflow(ctx) {
|
|
|
498
532
|
...(args.ciChant ? { chant: args.ciChant } : {}),
|
|
499
533
|
});
|
|
500
534
|
const target = args.output ? resolve(process.cwd(), args.output) : join(repoRoot, release?.workflow?.file ?? RELEASE_WORKFLOW_FILES[forge]);
|
|
535
|
+
// #4909: under `chant dev generated-check` the header names the committed file the render stands for.
|
|
536
|
+
const { committedPathOf, isRenderPath } = await import("../generated-check.js");
|
|
537
|
+
const asCommitted = committedPathOf(target);
|
|
538
|
+
const defaultTarget = join(repoRoot, release?.workflow?.file ?? RELEASE_WORKFLOW_FILES[forge]);
|
|
501
539
|
const parts = ["chant", "release", "workflow", "--forge", forge];
|
|
502
540
|
if (args.ciInstall)
|
|
503
541
|
parts.push("--install", args.ciInstall);
|
|
@@ -505,8 +543,8 @@ export async function runReleaseWorkflow(ctx) {
|
|
|
505
543
|
parts.push("--build", args.buildCommand);
|
|
506
544
|
if (args.ciChant)
|
|
507
545
|
parts.push("--chant", args.ciChant);
|
|
508
|
-
if (args.output)
|
|
509
|
-
parts.push("--output", relative(root,
|
|
546
|
+
if (args.output && !(isRenderPath(target) && asCommitted === defaultTarget))
|
|
547
|
+
parts.push("--output", relative(root, asCommitted).split(sep).join("/"));
|
|
510
548
|
mkdirSync(dirname(target), { recursive: true });
|
|
511
549
|
writeFileSync(target, releaseWorkflowHeader(parts.map(shellArg).join(" ")) + text);
|
|
512
550
|
const shown = relative(process.cwd(), target).split(sep).join("/") || target;
|
|
@@ -515,6 +553,10 @@ export async function runReleaseWorkflow(ctx) {
|
|
|
515
553
|
console.log(formatSuccess(`Wrote ${shown}: ${what}${extras.length > 0 ? `, and ${extras.join(" and ")}` : ""}.`));
|
|
516
554
|
if (forge === "gitlab")
|
|
517
555
|
console.log(`Include it from .gitlab-ci.yml: include: [{ local: ${release?.workflow?.file ?? RELEASE_WORKFLOW_FILES.gitlab} }]`);
|
|
556
|
+
// #4876: a GitLab executor that refuses privileged containers can't install the handlers from the job.
|
|
557
|
+
const archs = (release?.images?.length ?? 0) > 0 ? qemuArchitectures(releaseImagePlatforms(release.images)) : [];
|
|
558
|
+
if (forge === "gitlab" && archs.length > 0 && text.includes(`${RELEASE_BINFMT_IMAGE} --install`))
|
|
559
|
+
console.log(`The cut and publish jobs install QEMU's binfmt handlers for ${archs.join(", ")} with docker run --privileged ${RELEASE_BINFMT_IMAGE}: the runner's executor must run privileged containers, or have the handlers installed on its host.`);
|
|
518
560
|
if (forge === "gitlab" && release?.workflow?.trigger === "dispatch")
|
|
519
561
|
console.log("The cut and publish jobs push with CHANT_RELEASE_TOKEN: a project access token with write_repository, as a masked CI/CD variable.");
|
|
520
562
|
return 0;
|
|
@@ -50,6 +50,24 @@ export declare function planReportChecks(dir: string, result: string | undefined
|
|
|
50
50
|
}>;
|
|
51
51
|
skipped: CheckEvidenceNote["skipped"];
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* What a GitLab signing job in the target branch's pipeline keeps for one
|
|
55
|
+
* merge request (#4914), `<out>/<iid>/evidence.json`: the note, with the
|
|
56
|
+
* merge request and the head it was signed for, so the note job uses it
|
|
57
|
+
* only for that head.
|
|
58
|
+
*/
|
|
59
|
+
export interface OpenEvidenceFile extends CheckEvidenceNote {
|
|
60
|
+
pr: number;
|
|
61
|
+
head: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The `evidence.json` the signing job kept for merge request `pr` at
|
|
65
|
+
* `head` under `dir` (#4914), as text for the note job's report directory,
|
|
66
|
+
* or undefined when it kept none for that head. The file comes from a job
|
|
67
|
+
* of the same target-branch pipeline, which ran none of the change's code;
|
|
68
|
+
* it is read as data all the same.
|
|
69
|
+
*/
|
|
70
|
+
export declare function openEvidenceFor(dir: string, pr: number, head: string): string | undefined;
|
|
53
71
|
/**
|
|
54
72
|
* The line the plan note ends with when the signing step wrote
|
|
55
73
|
* {@link CHECK_EVIDENCE_FILE} in `dir`, or undefined when it did not.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-evidence-report.d.ts","sourceRoot":"","sources":["../../../src/workspace/trust/check-evidence-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,oHAAoH;AACpH,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAEzD,4HAA4H;AAC5H,eAAO,MAAM,sBAAsB,6BAA6B,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D,iHAAiH;AACjH,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAE9D,sFAAsF;AACtF,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AAEnD,2DAA2D;AAC3D,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/E,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnD;AAkCD,8GAA8G;AAC9G,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,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AAC,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAA;CAAE,CAkBnK;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIzF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAWrE"}
|
|
@@ -89,6 +89,19 @@ export function planReportChecks(dir, result) {
|
|
|
89
89
|
skipped.push({ check: "policy", reason: policy.reason });
|
|
90
90
|
return { sign, skipped };
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* The `evidence.json` the signing job kept for merge request `pr` at
|
|
94
|
+
* `head` under `dir` (#4914), as text for the note job's report directory,
|
|
95
|
+
* or undefined when it kept none for that head. The file comes from a job
|
|
96
|
+
* of the same target-branch pipeline, which ran none of the change's code;
|
|
97
|
+
* it is read as data all the same.
|
|
98
|
+
*/
|
|
99
|
+
export function openEvidenceFor(dir, pr, head) {
|
|
100
|
+
const doc = readJson(join(dir, String(pr), CHECK_EVIDENCE_FILE));
|
|
101
|
+
if (!doc || doc.pr !== pr || doc.head !== head || !Array.isArray(doc.signed) || !Array.isArray(doc.skipped))
|
|
102
|
+
return undefined;
|
|
103
|
+
return JSON.stringify({ signed: doc.signed, skipped: doc.skipped }, null, 2) + "\n";
|
|
104
|
+
}
|
|
92
105
|
/**
|
|
93
106
|
* The line the plan note ends with when the signing step wrote
|
|
94
107
|
* {@link CHECK_EVIDENCE_FILE} in `dir`, or undefined when it did not.
|
|
@@ -89,13 +89,24 @@ export declare function commitAndTree(repo: string, rev: string): {
|
|
|
89
89
|
commit: string;
|
|
90
90
|
tree: string;
|
|
91
91
|
};
|
|
92
|
-
/**
|
|
92
|
+
/** Where a check's pass was read from (#4926): the forge's run and job ids, and the step whose conclusion said so. */
|
|
93
|
+
export interface CheckSource {
|
|
94
|
+
run: number;
|
|
95
|
+
job: number;
|
|
96
|
+
step?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The check's statement over `commit`, with the digest of what it said when
|
|
100
|
+
* given, and (#4926) the run, job and step a signer outside the check's job
|
|
101
|
+
* read its pass from, so a verifier can look them up.
|
|
102
|
+
*/
|
|
93
103
|
export declare function checkStatement(input: {
|
|
94
104
|
commit: string;
|
|
95
105
|
tree: string;
|
|
96
106
|
check: string;
|
|
97
107
|
runner: string;
|
|
98
108
|
claim?: Buffer | string;
|
|
109
|
+
source?: CheckSource;
|
|
99
110
|
}): EvidenceStatement;
|
|
100
111
|
/** One check signed. */
|
|
101
112
|
export interface SignedCheck {
|
|
@@ -109,6 +120,7 @@ export interface SignedCheck {
|
|
|
109
120
|
export declare function signChecks(repo: string, at: string, checks: readonly {
|
|
110
121
|
check: string;
|
|
111
122
|
claim?: Buffer | string;
|
|
123
|
+
source?: CheckSource;
|
|
112
124
|
}[], signer: EvidenceSigner): Promise<SignedCheck[]>;
|
|
113
125
|
/**
|
|
114
126
|
* Attach each envelope to its commit's evidence note and push
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-evidence.d.ts","sourceRoot":"","sources":["../../../src/workspace/trust/check-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAOH,OAAO,EAA0D,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AACnG,OAAO,EAA6D,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/G,OAAO,EAAkB,kBAAkB,EAAqB,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEtF,OAAO,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AAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQtI"}
|
|
@@ -145,7 +145,11 @@ export function commitAndTree(repo, rev) {
|
|
|
145
145
|
const commit = git(repo, ["rev-parse", "--verify", "--quiet", `${rev}^{commit}`]);
|
|
146
146
|
return { commit, tree: git(repo, ["rev-parse", `${commit}^{tree}`]) };
|
|
147
147
|
}
|
|
148
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* The check's statement over `commit`, with the digest of what it said when
|
|
150
|
+
* given, and (#4926) the run, job and step a signer outside the check's job
|
|
151
|
+
* read its pass from, so a verifier can look them up.
|
|
152
|
+
*/
|
|
149
153
|
export function checkStatement(input) {
|
|
150
154
|
if (!input.check.trim())
|
|
151
155
|
throw new Error("a check's evidence needs the check's name");
|
|
@@ -159,6 +163,7 @@ export function checkStatement(input) {
|
|
|
159
163
|
tree: input.tree,
|
|
160
164
|
check: input.check,
|
|
161
165
|
...(input.claim !== undefined ? { claim: { sha256: createHash("sha256").update(input.claim).digest("hex") } } : {}),
|
|
166
|
+
...(input.source ? { source: { run: input.source.run, job: input.source.job, ...(input.source.step ? { step: input.source.step } : {}) } } : {}),
|
|
162
167
|
},
|
|
163
168
|
};
|
|
164
169
|
}
|
|
@@ -166,8 +171,8 @@ export function checkStatement(input) {
|
|
|
166
171
|
export async function signChecks(repo, at, checks, signer) {
|
|
167
172
|
const { commit, tree } = commitAndTree(repo, at);
|
|
168
173
|
const out = [];
|
|
169
|
-
for (const { check, claim } of checks) {
|
|
170
|
-
const statement = checkStatement({ commit, tree, check, runner: signer.principal, ...(claim !== undefined ? { claim } : {}) });
|
|
174
|
+
for (const { check, claim, source } of checks) {
|
|
175
|
+
const statement = checkStatement({ commit, tree, check, runner: signer.principal, ...(claim !== undefined ? { claim } : {}), ...(source ? { source } : {}) });
|
|
171
176
|
out.push({ check, commit, tree, runner: signer.principal, envelope: await signer.sign(IN_TOTO_PAYLOAD_TYPE, Buffer.from(canonicalJson(statement), "utf8")) });
|
|
172
177
|
}
|
|
173
178
|
return out;
|
|
@@ -47,6 +47,11 @@ export declare const evidenceStatementSchema: z.ZodObject<{
|
|
|
47
47
|
environment: z.ZodOptional<z.ZodObject<{
|
|
48
48
|
sha256: z.ZodString;
|
|
49
49
|
}, z.core.$strict>>;
|
|
50
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
run: z.ZodNumber;
|
|
52
|
+
job: z.ZodNumber;
|
|
53
|
+
step: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, z.core.$strict>>;
|
|
50
55
|
}, z.core.$strict>;
|
|
51
56
|
}, z.core.$strict>;
|
|
52
57
|
export type EvidenceStatement = z.infer<typeof evidenceStatementSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../../../src/workspace/trust/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAsD,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC/F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,cAAc,oCAAoC,CAAC;AAChE,eAAO,MAAM,yBAAyB,kDAAkD,CAAC;AAEzF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,+ZAmBS,CAAC;AAC3C,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAKtE,kGAAkG;AAClG,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../../../src/workspace/trust/evidence.ts"],"names":[],"mappings":"AAAA;;;;;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AE,MAAM,CAAC;IACf,8EAA8E;IAC9E,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,eAAe,GACvB;IACE,EAAE,EAAE,IAAI,CAAC;IACT,qGAAqG;IACrG,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B,GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe,CAmCvH"}
|
|
@@ -70,6 +70,11 @@ export const evidenceStatementSchema = z
|
|
|
70
70
|
check: z.string().min(1),
|
|
71
71
|
claim: z.object({ sha256: sha256Hex }).strict().optional(),
|
|
72
72
|
environment: z.object({ sha256: sha256Hex }).strict().optional(),
|
|
73
|
+
// #4926: the forge's record the signer relied on: the run, the job, and the step whose conclusion it read.
|
|
74
|
+
source: z
|
|
75
|
+
.object({ run: z.number().int().nonnegative(), job: z.number().int().nonnegative(), step: z.string().min(1).optional() })
|
|
76
|
+
.strict()
|
|
77
|
+
.optional(),
|
|
73
78
|
})
|
|
74
79
|
.strict(),
|
|
75
80
|
})
|