@intentius/chant 0.124.32 → 0.124.33
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/ci-jobs.d.ts +4 -0
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +9 -2
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +18 -3
- package/dist/cli/handlers/lifecycle-health.d.ts +16 -0
- package/dist/cli/handlers/lifecycle-health.d.ts.map +1 -0
- package/dist/cli/handlers/lifecycle-health.js +150 -0
- package/dist/cli/handlers/lifecycle.d.ts +26 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +1 -1
- package/dist/cli/handlers/pr.d.ts +2 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +124 -2
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +16 -1
- package/dist/cli/handlers/release.d.ts +16 -1
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +83 -11
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +81 -21
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +23 -1
- package/dist/cli/registry.d.ts +18 -4
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/deploy-inputs.d.ts +91 -0
- package/dist/components/deploy-inputs.d.ts.map +1 -0
- package/dist/components/deploy-inputs.js +184 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +9 -0
- package/dist/components/gate-plan.d.ts +8 -0
- package/dist/components/gate-plan.d.ts.map +1 -1
- package/dist/components/gate-plan.js +6 -0
- package/dist/components/pr-pipeline.d.ts +33 -10
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +42 -11
- package/dist/components/pr-run.d.ts +1 -1
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/release-compile.d.ts +37 -2
- package/dist/components/release-compile.d.ts.map +1 -1
- package/dist/components/release-compile.js +64 -8
- package/dist/components/release-promote.d.ts +17 -3
- package/dist/components/release-promote.d.ts.map +1 -1
- package/dist/components/release-promote.js +79 -18
- package/dist/components/verbs/bom-writer.d.ts +1 -1
- package/dist/components/verbs/bom-writer.d.ts.map +1 -1
- package/dist/components/verbs/lockfile-sbom-generator.d.ts +20 -0
- package/dist/components/verbs/lockfile-sbom-generator.d.ts.map +1 -1
- package/dist/components/verbs/lockfile-sbom-generator.js +41 -4
- package/dist/components/wave-plan.d.ts +10 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +32 -4
- package/dist/graph-detail.d.ts.map +1 -1
- package/dist/graph-detail.js +32 -7
- package/dist/health.d.ts +110 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +105 -0
- package/dist/health.schema.json +191 -0
- package/dist/lexicon.d.ts +27 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/merge-record.d.ts +104 -0
- package/dist/lifecycle/merge-record.d.ts.map +1 -0
- package/dist/lifecycle/merge-record.js +102 -0
- package/dist/lifecycle/publish-attachments.d.ts +8 -5
- package/dist/lifecycle/publish-attachments.d.ts.map +1 -1
- package/dist/lifecycle/publish-attachments.js +27 -13
- package/dist/lifecycle/publish-npm.d.ts +3 -2
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +4 -3
- package/dist/lifecycle/release-at.d.ts +40 -0
- package/dist/lifecycle/release-at.d.ts.map +1 -0
- package/dist/lifecycle/release-at.js +83 -0
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +23 -12
- package/dist/lifecycle/release-publish.d.ts +28 -12
- package/dist/lifecycle/release-publish.d.ts.map +1 -1
- package/dist/lifecycle/release-publish.js +29 -17
- package/dist/lifecycle/release-store.d.ts +25 -2
- package/dist/lifecycle/release-store.d.ts.map +1 -1
- package/dist/lifecycle/release-store.js +40 -13
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +1 -0
- package/dist/lint/rules/op/index.d.ts +2 -1
- package/dist/lint/rules/op/index.d.ts.map +1 -1
- package/dist/lint/rules/op/index.js +4 -2
- package/dist/lint/rules/op/ops018-shell-image-digest.d.ts +10 -0
- package/dist/lint/rules/op/ops018-shell-image-digest.d.ts.map +1 -0
- package/dist/lint/rules/op/ops018-shell-image-digest.js +38 -0
- package/dist/op/activities/activity-contracts.d.ts +5 -0
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.js +3 -0
- package/dist/op/activities/shell.d.ts +38 -0
- package/dist/op/activities/shell.d.ts.map +1 -1
- package/dist/op/activities/shell.js +89 -3
- package/dist/op/builders.d.ts +7 -0
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/builders.js +7 -0
- package/dist/op/runtime.d.ts +2 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/pr-loop.d.ts +14 -3
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +15 -5
- package/dist/pr-report-url.d.ts +2 -2
- package/dist/pr-report-url.d.ts.map +1 -1
- package/dist/runner-start.d.ts +179 -0
- package/dist/runner-start.d.ts.map +1 -0
- package/dist/runner-start.js +277 -0
- package/dist/wave-runtime.mjs +235 -228
- package/dist/workspace/check.schema.json +70 -2
- package/dist/workspace/checks/security.d.ts +35 -0
- package/dist/workspace/checks/security.d.ts.map +1 -0
- package/dist/workspace/checks/security.js +305 -0
- package/dist/workspace/checks.d.ts +2 -0
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/checks.js +5 -0
- package/dist/workspace/ci-builds.d.ts +163 -0
- package/dist/workspace/ci-builds.d.ts.map +1 -0
- package/dist/workspace/ci-builds.js +315 -0
- package/dist/workspace/ci-green-cli.d.ts +2 -1
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +25 -5
- package/dist/workspace/ci-green-forge.d.ts +12 -0
- package/dist/workspace/ci-green-forge.d.ts.map +1 -1
- package/dist/workspace/ci-green-forge.js +12 -0
- package/dist/workspace/ci-green-workflow.d.ts +55 -1
- package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
- package/dist/workspace/ci-green-workflow.js +128 -1
- package/dist/workspace/ci-green.d.ts +89 -4
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +310 -23
- package/dist/workspace/ci-last-green.schema.json +49 -0
- package/dist/workspace/ci-list.schema.json +35 -1
- package/dist/workspace/ci-run-index.d.ts +1 -1
- package/dist/workspace/ci-run-index.d.ts.map +1 -1
- package/dist/workspace/ci-run-index.schema.json +1 -1
- package/dist/workspace/ci-run.d.ts +12 -6
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +72 -16
- package/dist/workspace/ci-runner-start.d.ts +77 -0
- package/dist/workspace/ci-runner-start.d.ts.map +1 -0
- package/dist/workspace/ci-runner-start.js +185 -0
- package/dist/workspace/ci-serve.d.ts +76 -7
- package/dist/workspace/ci-serve.d.ts.map +1 -1
- package/dist/workspace/ci-serve.js +153 -19
- package/dist/workspace/declaration.d.ts +17 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +3 -0
- package/dist/workspace/declaration.schema.json +23 -0
- package/dist/workspace/ls.d.ts +2 -0
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/ls.js +1 -1
- package/dist/workspace/ls.schema.json +2 -1
- package/dist/workspace/member-pipeline.d.ts +1 -0
- package/dist/workspace/member-pipeline.d.ts.map +1 -1
- package/dist/workspace/member-pipeline.js +2 -0
- package/dist/workspace/merge-record.schema.json +49 -0
- package/dist/workspace/pr-report.schema.json +3 -3
- package/dist/workspace/reason-codes.d.ts +17 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +18 -0
- package/dist/workspace/release-candidates.d.ts +129 -0
- package/dist/workspace/release-candidates.d.ts.map +1 -0
- package/dist/workspace/release-candidates.js +233 -0
- package/dist/workspace/release-candidates.schema.json +353 -0
- package/dist/workspace/security.d.ts +40 -0
- package/dist/workspace/security.d.ts.map +1 -0
- package/dist/workspace/security.js +99 -0
- package/package.json +8 -1
- package/src/__fixtures__/pr-loop/pr-plan.note.golden.md +1 -1
- package/src/ci-jobs.ts +11 -2
- package/src/cli/handlers/build.test.ts +36 -0
- package/src/cli/handlers/build.ts +18 -3
- package/src/cli/handlers/lifecycle-health.test.ts +123 -0
- package/src/cli/handlers/lifecycle-health.ts +157 -0
- package/src/cli/handlers/lifecycle.ts +1 -1
- package/src/cli/handlers/pr-deploy-inputs.test.ts +209 -0
- package/src/cli/handlers/pr-record.test.ts +201 -0
- package/src/cli/handlers/pr.test.ts +22 -0
- package/src/cli/handlers/pr.ts +127 -4
- package/src/cli/handlers/promote.test.ts +17 -0
- package/src/cli/handlers/promote.ts +16 -1
- package/src/cli/handlers/release-cut-at.e2e.test.ts +115 -0
- package/src/cli/handlers/release-publish-targets.e2e.test.ts +2 -2
- package/src/cli/handlers/release-verify.e2e.test.ts +12 -10
- package/src/cli/handlers/release.e2e.test.ts +19 -28
- package/src/cli/handlers/release.ts +81 -11
- package/src/cli/main.ts +81 -21
- package/src/cli/parse-args.ts +17 -1
- package/src/cli/registry.ts +18 -4
- package/src/components/deploy-inputs.test.ts +108 -0
- package/src/components/deploy-inputs.ts +225 -0
- package/src/components/driver.ts +11 -0
- package/src/components/gate-plan.ts +9 -0
- package/src/components/pr-pipeline.ts +56 -15
- package/src/components/pr-run.ts +1 -1
- package/src/components/release-compile.test.ts +34 -0
- package/src/components/release-compile.ts +89 -8
- package/src/components/release-promote.test.ts +55 -2
- package/src/components/release-promote.ts +93 -23
- package/src/components/verbs/bom-writer.ts +1 -1
- package/src/components/verbs/lockfile-sbom-generator.test.ts +36 -0
- package/src/components/verbs/lockfile-sbom-generator.ts +43 -5
- package/src/components/wave-plan.ts +32 -4
- package/src/graph-detail.test.ts +57 -0
- package/src/graph-detail.ts +33 -7
- package/src/health.schema.json +191 -0
- package/src/health.test.ts +62 -0
- package/src/health.ts +178 -0
- package/src/lexicon.ts +41 -1
- package/src/lifecycle/merge-record.test.ts +111 -0
- package/src/lifecycle/merge-record.ts +154 -0
- package/src/lifecycle/publish-attachments.ts +25 -13
- package/src/lifecycle/publish-npm.ts +4 -3
- package/src/lifecycle/publish-targets.test.ts +34 -4
- package/src/lifecycle/release-at.test.ts +48 -0
- package/src/lifecycle/release-at.ts +100 -0
- package/src/lifecycle/release-cut.test.ts +41 -0
- package/src/lifecycle/release-cut.ts +22 -11
- package/src/lifecycle/release-publish.test.ts +43 -13
- package/src/lifecycle/release-publish.ts +38 -18
- package/src/lifecycle/release-store.ts +57 -13
- package/src/lifecycle/run-ledger.test.ts +13 -0
- package/src/lifecycle/run-ledger.ts +1 -0
- package/src/lint/rules/op/index.ts +4 -2
- package/src/lint/rules/op/ops018-shell-image-digest.test.ts +60 -0
- package/src/lint/rules/op/ops018-shell-image-digest.ts +48 -0
- package/src/op/activities/activity-contracts.ts +3 -0
- package/src/op/activities/shell-container.e2e.test.ts +67 -0
- package/src/op/activities/shell.test.ts +44 -1
- package/src/op/activities/shell.ts +110 -3
- package/src/op/builders.ts +7 -0
- package/src/op/runtime.ts +2 -0
- package/src/op/step-console.test.ts +4 -2
- package/src/pr-loop.test.ts +29 -0
- package/src/pr-loop.ts +26 -7
- package/src/pr-report-url.ts +2 -2
- package/src/runner-start-bundle.test.ts +29 -0
- package/src/runner-start.test.ts +179 -0
- package/src/runner-start.ts +329 -0
- package/src/workspace/check-contract.test.ts +3 -2
- package/src/workspace/check.schema.json +70 -2
- package/src/workspace/checks/security.test.ts +138 -0
- package/src/workspace/checks/security.ts +305 -0
- package/src/workspace/checks.ts +5 -0
- package/src/workspace/ci-builds.e2e.test.ts +208 -0
- package/src/workspace/ci-builds.test.ts +174 -0
- package/src/workspace/ci-builds.ts +385 -0
- package/src/workspace/ci-green-builds.test.ts +180 -0
- package/src/workspace/ci-green-cli.test.ts +54 -0
- package/src/workspace/ci-green-cli.ts +26 -5
- package/src/workspace/ci-green-forge.ts +24 -0
- package/src/workspace/ci-green-workflow.test.ts +84 -1
- package/src/workspace/ci-green-workflow.ts +139 -2
- package/src/workspace/ci-green.test.ts +5 -2
- package/src/workspace/ci-green.ts +359 -27
- package/src/workspace/ci-last-green.schema.json +49 -0
- package/src/workspace/ci-list.schema.json +35 -1
- package/src/workspace/ci-run-index.schema.json +1 -1
- package/src/workspace/ci-run-index.ts +1 -1
- package/src/workspace/ci-run.test.ts +24 -7
- package/src/workspace/ci-run.ts +78 -16
- package/src/workspace/ci-runner-start.test.ts +151 -0
- package/src/workspace/ci-runner-start.ts +193 -0
- package/src/workspace/ci-serve-builds.test.ts +86 -0
- package/src/workspace/ci-serve.test.ts +59 -0
- package/src/workspace/ci-serve.ts +177 -22
- package/src/workspace/declaration.schema.json +23 -0
- package/src/workspace/declaration.test.ts +17 -0
- package/src/workspace/declaration.ts +22 -1
- package/src/workspace/ls.schema.json +2 -1
- package/src/workspace/ls.ts +3 -2
- package/src/workspace/member-pipeline.ts +2 -1
- package/src/workspace/merge-record.schema.json +49 -0
- package/src/workspace/pr-report.schema.json +3 -3
- package/src/workspace/reason-codes.test.ts +2 -0
- package/src/workspace/reason-codes.ts +18 -0
- package/src/workspace/release-candidates.schema.json +353 -0
- package/src/workspace/release-candidates.test.ts +106 -0
- package/src/workspace/release-candidates.ts +315 -0
- package/src/workspace/security.test.ts +70 -0
- package/src/workspace/security.ts +118 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-cut.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-cut.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;
|
|
1
|
+
{"version":3,"file":"release-cut.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C,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAC;IAC/H,2FAA2F;IAC3F,KAAK,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,+EAA+E;IAC/E,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC5B,oFAAoF;IACpF,YAAY,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC5F,wEAAwE;IACxE,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CA4DnE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CA6DpE"}
|
|
@@ -36,11 +36,10 @@ import { execFileSync } from "node:child_process";
|
|
|
36
36
|
import { realpathSync } from "node:fs";
|
|
37
37
|
import { relative, resolve } from "node:path";
|
|
38
38
|
import { canonicalJson } from "../effect-receipt.js";
|
|
39
|
-
import { contentDigest } from "../content-digest.js";
|
|
40
39
|
import { getHeadCommit } from "./git.js";
|
|
41
40
|
import { resolveMemberLedger } from "./member-ledger.js";
|
|
42
41
|
import { resolveCiRun } from "./release-ledger.js";
|
|
43
|
-
import { appendCut, invalidLabel, labelsByDigest, makeRelease, persistRelease, readAllReleases, readCuts, readRelease, ReleaseLabelError, } from "./release-store.js";
|
|
42
|
+
import { appendCut, invalidLabel, labelsByDigest, makeRelease, persistRelease, readAllReleases, readCuts, readRelease, ReleaseLabelError, templateBytesDigest, } from "./release-store.js";
|
|
44
43
|
export class ReleaseCutError extends Error {
|
|
45
44
|
constructor(code, message, fix) {
|
|
46
45
|
super(message);
|
|
@@ -213,18 +212,30 @@ async function prepare(req) {
|
|
|
213
212
|
member: ledger.members.length > 0 ? ledger.members.join("/") : null,
|
|
214
213
|
};
|
|
215
214
|
}
|
|
216
|
-
/**
|
|
215
|
+
/**
|
|
216
|
+
* The targets and template bytes of a compile, each template by its content
|
|
217
|
+
* digest. A compile of components names its directories in `trees` (#4155),
|
|
218
|
+
* an empty list when it has none, which marks the target as one that records
|
|
219
|
+
* every deploy input. A project with no components has no deploy step to
|
|
220
|
+
* name one, and its targets have no `trees`.
|
|
221
|
+
*/
|
|
217
222
|
function targetsOf(compiled) {
|
|
218
223
|
const templates = [];
|
|
219
|
-
const targets = compiled.map((t) =>
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
const targets = compiled.map((t) => {
|
|
225
|
+
const seen = new Set();
|
|
226
|
+
const recorded = [];
|
|
227
|
+
for (const tpl of t.templates) {
|
|
228
|
+
// A file named twice, as a values file inside a recorded chart, is recorded once.
|
|
229
|
+
const key = `${tpl.component ?? ""}\u0000${tpl.path}`;
|
|
230
|
+
if (seen.has(key))
|
|
231
|
+
continue;
|
|
232
|
+
seen.add(key);
|
|
233
|
+
const digest = templateBytesDigest(tpl.content, tpl.encoding);
|
|
234
|
+
templates.push({ digest, content: tpl.content, ...(tpl.encoding ? { encoding: tpl.encoding } : {}) });
|
|
235
|
+
recorded.push({ component: tpl.component, path: tpl.path, digest, ...(tpl.encoding ? { encoding: tpl.encoding } : {}) });
|
|
236
|
+
}
|
|
237
|
+
return { env: t.env, params: t.params, templates: recorded, ...(t.trees ? { trees: t.trees } : {}) };
|
|
238
|
+
});
|
|
228
239
|
return { targets, templates };
|
|
229
240
|
}
|
|
230
241
|
/**
|
|
@@ -7,16 +7,23 @@
|
|
|
7
7
|
*
|
|
8
8
|
* - a release no cut names (`release-not-found`);
|
|
9
9
|
* - a release cut from a revoked commit (`release-revoked`, #4033);
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
* `release-signature-unverified
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* - under an `identity.gates` entry for `release` (#4031), a release with no
|
|
11
|
+
* cut signed by a signer in the gate's class (`release-unsigned` or
|
|
12
|
+
* `release-signature-unverified`);
|
|
13
|
+
* - when the workspace opts into `verified-releases` (`security` in
|
|
14
|
+
* chant.workspace.json, #4168), a release none of whose cuts carries a
|
|
15
|
+
* signature that verifies for its actor against `.chant/allowed_signers`
|
|
16
|
+
* at base (#4049). `--allow-unsigned` publishes it anyway, with a warning;
|
|
17
|
+
* it never overrides the release gate.
|
|
18
|
+
*
|
|
19
|
+
* With neither, an unsigned release publishes quietly, and the plan records
|
|
20
|
+
* its `signature` status (#4168: security features are opt-in).
|
|
16
21
|
*
|
|
17
22
|
* It then says whether the run has an OIDC token to sign provenance with
|
|
18
|
-
* ({@link detectProvenance})
|
|
19
|
-
* runs; `--require-provenance` refuses instead
|
|
23
|
+
* ({@link detectProvenance}). Under `supply-chain` it warns when there is
|
|
24
|
+
* none, before any target runs; `--require-provenance` refuses instead
|
|
25
|
+
* (`publish-provenance-missing`). Without either, provenance is only the
|
|
26
|
+
* plan's `provenance` field.
|
|
20
27
|
* The targets come from {@link releasePublishTargets}: the member declares them under `release.publish` in its `chant.config.ts` (#4047).
|
|
21
28
|
* With a target, the checkout must be the release's commit with a clean
|
|
22
29
|
* tree ({@link checkCheckoutIsRelease}), every target is planned before any
|
|
@@ -140,6 +147,12 @@ export interface PublishContext {
|
|
|
140
147
|
redactor: Redactor;
|
|
141
148
|
/** Print one line of progress. The line is redacted. */
|
|
142
149
|
log(line: string): void;
|
|
150
|
+
/**
|
|
151
|
+
* Whether a target with no SBOM source refuses (`publish-sbom-missing`),
|
|
152
|
+
* as under the `supply-chain` group (#4168). False or absent: it publishes
|
|
153
|
+
* without an SBOM. A declared `sbom` file is attached either way.
|
|
154
|
+
*/
|
|
155
|
+
requireSbom?: boolean;
|
|
143
156
|
}
|
|
144
157
|
/** A target refused or failed. The message never holds a credential. */
|
|
145
158
|
export declare class PublishTargetError extends Error {
|
|
@@ -219,7 +232,7 @@ export interface PublishPlan {
|
|
|
219
232
|
reason: string;
|
|
220
233
|
};
|
|
221
234
|
provenance: ProvenanceCheck;
|
|
222
|
-
/** The warning printed before publishing, when the run has no OIDC token. */
|
|
235
|
+
/** The warning printed before publishing, when the run has no OIDC token and the workspace opts into `supply-chain` (#4168). */
|
|
223
236
|
warning: string | null;
|
|
224
237
|
/** The warning printed before publishing a release with no verified signature under `--allow-unsigned` (#4049). */
|
|
225
238
|
signatureWarning: string | null;
|
|
@@ -230,15 +243,18 @@ export interface PublishPlan {
|
|
|
230
243
|
targets: PublishTarget[];
|
|
231
244
|
/** Masks the run's credentials in what the publish prints. */
|
|
232
245
|
redactor: Redactor;
|
|
246
|
+
/** Whether a target with no SBOM source is refused (`publish-sbom-missing`): the workspace opts into `supply-chain` (#4168). Otherwise it publishes without one. */
|
|
247
|
+
requireSbom: boolean;
|
|
233
248
|
}
|
|
234
249
|
/**
|
|
235
250
|
* Resolve `ref` (a label or a digest) in the member at `cwd` and decide
|
|
236
251
|
* whether it may be published, reading the local `chant/lifecycle` branch,
|
|
237
252
|
* the local tags and the declaration at base. Fetches nothing.
|
|
238
253
|
*
|
|
239
|
-
* `allowUnsigned` publishes a release with no verified signature, which
|
|
240
|
-
*
|
|
241
|
-
* `requireProvenance` refuses a run with no OIDC token,
|
|
254
|
+
* `allowUnsigned` publishes a release with no verified signature, which
|
|
255
|
+
* `verified-releases` refuses otherwise (#4049, #4168); it does not override
|
|
256
|
+
* the release gate. `requireProvenance` refuses a run with no OIDC token,
|
|
257
|
+
* where `supply-chain` warns and no group says nothing.
|
|
242
258
|
*/
|
|
243
259
|
export declare function preparePublish(req: {
|
|
244
260
|
cwd: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-publish.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-publish.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"release-publish.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtE,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,IAAI,EAAE,OAAO,CAAC;IACd,sDAAsD;IACtD,EAAE,EAAE,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAAC;IAC/B,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,eAAe,CAYtF;AAED,mEAAmE;AACnE,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kHAAkH;IAClH,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IACnC,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,6GAA6G;AAC7G,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,+FAA+F;IAC/F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MAAM,EAAE;IAN7B,YACE,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GAAG,SAAS,EACd,IAAI,EAAE,OAAO,GAAG,QAAQ,EACxB,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,EAAE,MAAM,EAAE,EAI5B;CACF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAClC,GAAG,EAAE,cAAc,CAAC;IACpB,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB,GAAG,OAAO,CAAC,UAAU,CAAC,CAiFtB"}
|
|
@@ -7,16 +7,23 @@
|
|
|
7
7
|
*
|
|
8
8
|
* - a release no cut names (`release-not-found`);
|
|
9
9
|
* - a release cut from a revoked commit (`release-revoked`, #4033);
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
* `release-signature-unverified
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* - under an `identity.gates` entry for `release` (#4031), a release with no
|
|
11
|
+
* cut signed by a signer in the gate's class (`release-unsigned` or
|
|
12
|
+
* `release-signature-unverified`);
|
|
13
|
+
* - when the workspace opts into `verified-releases` (`security` in
|
|
14
|
+
* chant.workspace.json, #4168), a release none of whose cuts carries a
|
|
15
|
+
* signature that verifies for its actor against `.chant/allowed_signers`
|
|
16
|
+
* at base (#4049). `--allow-unsigned` publishes it anyway, with a warning;
|
|
17
|
+
* it never overrides the release gate.
|
|
18
|
+
*
|
|
19
|
+
* With neither, an unsigned release publishes quietly, and the plan records
|
|
20
|
+
* its `signature` status (#4168: security features are opt-in).
|
|
16
21
|
*
|
|
17
22
|
* It then says whether the run has an OIDC token to sign provenance with
|
|
18
|
-
* ({@link detectProvenance})
|
|
19
|
-
* runs; `--require-provenance` refuses instead
|
|
23
|
+
* ({@link detectProvenance}). Under `supply-chain` it warns when there is
|
|
24
|
+
* none, before any target runs; `--require-provenance` refuses instead
|
|
25
|
+
* (`publish-provenance-missing`). Without either, provenance is only the
|
|
26
|
+
* plan's `provenance` field.
|
|
20
27
|
* The targets come from {@link releasePublishTargets}: the member declares them under `release.publish` in its `chant.config.ts` (#4047).
|
|
21
28
|
* With a target, the checkout must be the release's commit with a clean
|
|
22
29
|
* tree ({@link checkCheckoutIsRelease}), every target is planned before any
|
|
@@ -76,9 +83,10 @@ export async function releasePublishTargets(cwd, deps = {}) {
|
|
|
76
83
|
* whether it may be published, reading the local `chant/lifecycle` branch,
|
|
77
84
|
* the local tags and the declaration at base. Fetches nothing.
|
|
78
85
|
*
|
|
79
|
-
* `allowUnsigned` publishes a release with no verified signature, which
|
|
80
|
-
*
|
|
81
|
-
* `requireProvenance` refuses a run with no OIDC token,
|
|
86
|
+
* `allowUnsigned` publishes a release with no verified signature, which
|
|
87
|
+
* `verified-releases` refuses otherwise (#4049, #4168); it does not override
|
|
88
|
+
* the release gate. `requireProvenance` refuses a run with no OIDC token,
|
|
89
|
+
* where `supply-chain` warns and no group says nothing.
|
|
82
90
|
*/
|
|
83
91
|
export async function preparePublish(req) {
|
|
84
92
|
const { resolveRelease, readCuts } = await import("./release-store.js");
|
|
@@ -86,6 +94,7 @@ export async function preparePublish(req) {
|
|
|
86
94
|
const { scopeSource } = await import("../workspace/write-scope.js");
|
|
87
95
|
const { releaseRuleFrom } = await import("../workspace/identity.js");
|
|
88
96
|
const { checkReleaseSignature } = await import("../workspace/identity-gate-rule.js");
|
|
97
|
+
const { securityGroupsIn } = await import("../workspace/security.js");
|
|
89
98
|
const { cwd, ref } = req;
|
|
90
99
|
const found = await resolveRelease(ref, { cwd });
|
|
91
100
|
if (!found)
|
|
@@ -102,7 +111,9 @@ export async function preparePublish(req) {
|
|
|
102
111
|
},
|
|
103
112
|
};
|
|
104
113
|
}
|
|
105
|
-
const
|
|
114
|
+
const source = scopeSource(cwd);
|
|
115
|
+
const rule = releaseRuleFrom(source);
|
|
116
|
+
const groups = securityGroupsIn(source, cwd);
|
|
106
117
|
const cuts = (await readCuts({ cwd })).cuts.filter((c) => c.releaseDigest === release.releaseDigest);
|
|
107
118
|
const checks = cuts.map((c) => ({
|
|
108
119
|
cut: c,
|
|
@@ -121,9 +132,9 @@ export async function preparePublish(req) {
|
|
|
121
132
|
},
|
|
122
133
|
};
|
|
123
134
|
}
|
|
124
|
-
// #4049:
|
|
135
|
+
// #4049, #4168: under verified-releases a publish refuses a release whose signature does not verify, unless --allow-unsigned. Without it an unsigned release publishes quietly.
|
|
125
136
|
let signatureWarning = null;
|
|
126
|
-
if (!verified) {
|
|
137
|
+
if (!verified && groups.has("verified-releases")) {
|
|
127
138
|
const why = unsigned
|
|
128
139
|
? `${name} has no signed cut`
|
|
129
140
|
: `no cut of ${name} carries a signature that verifies against the signers file at base: ${checks.map((c) => c.check.reason).join("; ")}`;
|
|
@@ -131,7 +142,7 @@ export async function preparePublish(req) {
|
|
|
131
142
|
return {
|
|
132
143
|
refusal: {
|
|
133
144
|
code: unsigned ? "release-unsigned" : "release-signature-unverified",
|
|
134
|
-
message: `${why}, and chant
|
|
145
|
+
message: `${why}, and the workspace opts into verified-releases (security in chant.workspace.json), which publishes only a release signed by a key in .chant/allowed_signers`,
|
|
135
146
|
fix: `Cut it signed with a key .chant/allowed_signers lists for the chant-release namespace: chant release cut ${label ?? "<label>"} --sign --yes. To publish it unsigned anyway, pass --allow-unsigned.`,
|
|
136
147
|
},
|
|
137
148
|
};
|
|
@@ -169,7 +180,7 @@ export async function preparePublish(req) {
|
|
|
169
180
|
},
|
|
170
181
|
};
|
|
171
182
|
}
|
|
172
|
-
const warning = provenance.oidc
|
|
183
|
+
const warning = provenance.oidc || !groups.has("supply-chain")
|
|
173
184
|
? null
|
|
174
185
|
: `this publish runs without OIDC, so what it publishes carries no provenance: ${provenance.reason}. Publish from CI to get provenance.`;
|
|
175
186
|
const { resolveMemberLedger } = await import("./member-ledger.js");
|
|
@@ -178,7 +189,7 @@ export async function preparePublish(req) {
|
|
|
178
189
|
const member = ledger.members.length > 0 ? ledger.members.join("/") : null;
|
|
179
190
|
const releaseTag = label !== null ? releaseTagName(member, label) : null;
|
|
180
191
|
const redactor = createRedactor(env, targets.flatMap((t) => t.credentialEnv));
|
|
181
|
-
return { release, label, signature, provenance, warning, signatureWarning, cut, releaseTag, targets, redactor };
|
|
192
|
+
return { release, label, signature, provenance, warning, signatureWarning, cut, releaseTag, targets, redactor, requireSbom: groups.has("supply-chain") };
|
|
182
193
|
}
|
|
183
194
|
/**
|
|
184
195
|
* A publish with a target reads files from the checkout it runs in: package
|
|
@@ -228,6 +239,7 @@ export function publishContext(plan, req) {
|
|
|
228
239
|
env: req.env ?? process.env,
|
|
229
240
|
redactor: plan.redactor,
|
|
230
241
|
log: (line) => req.log(plan.redactor.redact(line)),
|
|
242
|
+
requireSbom: plan.requireSbom,
|
|
231
243
|
};
|
|
232
244
|
}
|
|
233
245
|
/** A publish that stopped, with what it left staged and revealed so a run of the same command resumes. */
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* _releases/<releaseDigest>.json the release, written once and never rewritten
|
|
15
15
|
* _releases/cuts.jsonl one line per cut, with the release's label
|
|
16
16
|
* _releases/templates/<digest>.txt each template's bytes, by content digest
|
|
17
|
+
* _releases/templates/<digest>.b64 a file that is not UTF-8, base64 (#4155)
|
|
17
18
|
*
|
|
18
19
|
* `:` is written as `_` in file names, as `_plans/` and `_builds/` do. A
|
|
19
20
|
* workspace member's copy sits under `_members/<member>/` through the same
|
|
@@ -24,6 +25,14 @@
|
|
|
24
25
|
* (ws-104 question 5). They are named by content digest, so a template that
|
|
25
26
|
* two environments or two releases share is stored once.
|
|
26
27
|
*
|
|
28
|
+
* Since #4155 a cut records every local file a deploy step deploys from, not
|
|
29
|
+
* only `template`, `manifest` and `values` files: a chart, a kustomize
|
|
30
|
+
* directory, a site's tree. A directory is recorded as one template per file
|
|
31
|
+
* under it, and named in the target's `trees`, so a promote deploys the
|
|
32
|
+
* recorded tree. A target with `trees` is one such cut; a target without the
|
|
33
|
+
* field was cut before #4155, and a promote of it reads directories and the
|
|
34
|
+
* other fields from the checkout, as it did then.
|
|
35
|
+
*
|
|
27
36
|
* `releaseDigest` is `computePlanDigest("release", subject)` over the member,
|
|
28
37
|
* the commit, the artifact digests and each target's env, templates and the
|
|
29
38
|
* name and value of each param. A param's `source`, the label, the actor, the
|
|
@@ -56,6 +65,14 @@ export interface ReleaseTemplate {
|
|
|
56
65
|
path: string;
|
|
57
66
|
/** `sha256:<hex>` of the file's bytes. */
|
|
58
67
|
digest: string;
|
|
68
|
+
/** `base64` for a file that is not UTF-8 (#4155): its stored copy is base64. Absent for text. */
|
|
69
|
+
encoding?: "base64";
|
|
70
|
+
}
|
|
71
|
+
/** A directory a component's deploy names, whose files the target records as templates under its path (#4155). */
|
|
72
|
+
export interface ReleaseTree {
|
|
73
|
+
component: string | null;
|
|
74
|
+
/** The directory as the deploy step names it, relative to the member's directory. */
|
|
75
|
+
path: string;
|
|
59
76
|
}
|
|
60
77
|
/** One resolved build parameter of a target. */
|
|
61
78
|
export interface ReleaseParam {
|
|
@@ -69,6 +86,8 @@ export interface ReleaseTarget {
|
|
|
69
86
|
env: string;
|
|
70
87
|
templates: ReleaseTemplate[];
|
|
71
88
|
params: ReleaseParam[];
|
|
89
|
+
/** The directories the target records (#4155). Absent on a target cut before #4155. */
|
|
90
|
+
trees?: ReleaseTree[];
|
|
72
91
|
}
|
|
73
92
|
/** The release file, `_releases/<releaseDigest>.json`. */
|
|
74
93
|
export interface Release {
|
|
@@ -120,6 +139,8 @@ export declare function computeReleaseDigest(release: ReleaseSubject): string;
|
|
|
120
139
|
export declare function makeRelease(subject: ReleaseSubject): Release;
|
|
121
140
|
/** Whether a release's own `releaseDigest` is the digest of what it holds. */
|
|
122
141
|
export declare function verifyReleaseDigest(release: Release): boolean;
|
|
142
|
+
/** The digest of a template's bytes: its text, or what its base64 decodes to. */
|
|
143
|
+
export declare function templateBytesDigest(content: string, encoding?: "base64"): string;
|
|
123
144
|
/** Why a label can't be used, or undefined when it can. */
|
|
124
145
|
export declare function invalidLabel(label: string): string | undefined;
|
|
125
146
|
/** Thrown when a cut would give a label two digests, or a digest two labels. */
|
|
@@ -130,7 +151,9 @@ export declare class ReleaseLabelError extends Error {
|
|
|
130
151
|
/** A release's template bytes, as the cut read them. */
|
|
131
152
|
export interface TemplateContent {
|
|
132
153
|
digest: string;
|
|
154
|
+
/** The text, or the base64 of the bytes when `encoding` is `base64`. */
|
|
133
155
|
content: string;
|
|
156
|
+
encoding?: "base64";
|
|
134
157
|
}
|
|
135
158
|
/**
|
|
136
159
|
* Store a release and its template bytes in one commit. A release already
|
|
@@ -187,8 +210,8 @@ export declare function appendCut(input: Omit<ReleaseCut, "version" | "signature
|
|
|
187
210
|
}, opts?: {
|
|
188
211
|
cwd?: string;
|
|
189
212
|
}): Promise<CutOutcome>;
|
|
190
|
-
/** A template's bytes by digest, or null when none is stored. */
|
|
191
|
-
export declare function readReleaseTemplate(digest: string, opts?: LedgerLocation): Promise<string | null>;
|
|
213
|
+
/** A template's bytes by digest, or null when none is stored. Under `base64` (#4155), the stored base64 of the bytes. */
|
|
214
|
+
export declare function readReleaseTemplate(digest: string, opts?: LedgerLocation, encoding?: "base64"): Promise<string | null>;
|
|
192
215
|
/**
|
|
193
216
|
* Find a release by its digest or its label. Null when neither names one.
|
|
194
217
|
* A string that names a digest is read as a digest first.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-store.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-store.ts"],"names":[],"mappings":"AAAA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,EAAE,IAAI,CAAC,EAAE,cAAc,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAE5H;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAAC,CAQnI"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* _releases/<releaseDigest>.json the release, written once and never rewritten
|
|
15
15
|
* _releases/cuts.jsonl one line per cut, with the release's label
|
|
16
16
|
* _releases/templates/<digest>.txt each template's bytes, by content digest
|
|
17
|
+
* _releases/templates/<digest>.b64 a file that is not UTF-8, base64 (#4155)
|
|
17
18
|
*
|
|
18
19
|
* `:` is written as `_` in file names, as `_plans/` and `_builds/` do. A
|
|
19
20
|
* workspace member's copy sits under `_members/<member>/` through the same
|
|
@@ -24,6 +25,14 @@
|
|
|
24
25
|
* (ws-104 question 5). They are named by content digest, so a template that
|
|
25
26
|
* two environments or two releases share is stored once.
|
|
26
27
|
*
|
|
28
|
+
* Since #4155 a cut records every local file a deploy step deploys from, not
|
|
29
|
+
* only `template`, `manifest` and `values` files: a chart, a kustomize
|
|
30
|
+
* directory, a site's tree. A directory is recorded as one template per file
|
|
31
|
+
* under it, and named in the target's `trees`, so a promote deploys the
|
|
32
|
+
* recorded tree. A target with `trees` is one such cut; a target without the
|
|
33
|
+
* field was cut before #4155, and a promote of it reads directories and the
|
|
34
|
+
* other fields from the checkout, as it did then.
|
|
35
|
+
*
|
|
27
36
|
* `releaseDigest` is `computePlanDigest("release", subject)` over the member,
|
|
28
37
|
* the commit, the artifact digests and each target's env, templates and the
|
|
29
38
|
* name and value of each param. A param's `source`, the label, the actor, the
|
|
@@ -31,7 +40,7 @@
|
|
|
31
40
|
* same digest.
|
|
32
41
|
*/
|
|
33
42
|
import { sortedJsonReplacer } from "../utils.js";
|
|
34
|
-
import { contentDigest } from "../content-digest.js";
|
|
43
|
+
import { contentDigest, sha256Hex } from "../content-digest.js";
|
|
35
44
|
import { computePlanDigest } from "./plan-digest.js";
|
|
36
45
|
import { ledgerDir, listFilesInDir, readBlobBySha, readBlobFromPath, readPathSha, RefCASConflictError, writeLedgerFiles, } from "./git.js";
|
|
37
46
|
/** The directory on `chant/lifecycle` that holds releases, cuts and template bytes. */
|
|
@@ -54,9 +63,12 @@ export function normalizeRelease(release) {
|
|
|
54
63
|
.map((t) => ({
|
|
55
64
|
env: t.env,
|
|
56
65
|
templates: [...t.templates]
|
|
57
|
-
.map(({ component, path, digest }) => ({ component, path, digest }))
|
|
66
|
+
.map(({ component, path, digest, encoding }) => ({ component, path, digest, ...(encoding ? { encoding } : {}) }))
|
|
58
67
|
.sort((a, b) => byString(a.component ?? "", b.component ?? "") || byString(a.path, b.path)),
|
|
59
68
|
params: [...t.params].map(({ name, value, source }) => ({ name, value, source })).sort((a, b) => byString(a.name, b.name)),
|
|
69
|
+
...(t.trees
|
|
70
|
+
? { trees: [...t.trees].map(({ component, path }) => ({ component, path })).sort((a, b) => byString(a.component ?? "", b.component ?? "") || byString(a.path, b.path)) }
|
|
71
|
+
: {}),
|
|
60
72
|
}))
|
|
61
73
|
.sort((a, b) => byString(a.env, b.env)),
|
|
62
74
|
};
|
|
@@ -68,7 +80,12 @@ export function releaseHashInput(release) {
|
|
|
68
80
|
member: n.member,
|
|
69
81
|
commit: n.commit,
|
|
70
82
|
artifactDigests: n.artifactDigests,
|
|
71
|
-
targets: n.targets.map((t) => ({
|
|
83
|
+
targets: n.targets.map((t) => ({
|
|
84
|
+
env: t.env,
|
|
85
|
+
templates: t.templates,
|
|
86
|
+
params: t.params.map(({ name, value }) => ({ name, value })),
|
|
87
|
+
...(t.trees ? { trees: t.trees } : {}),
|
|
88
|
+
})),
|
|
72
89
|
};
|
|
73
90
|
}
|
|
74
91
|
/** `computePlanDigest("release", input)` over {@link releaseHashInput}. */
|
|
@@ -86,7 +103,11 @@ export function verifyReleaseDigest(release) {
|
|
|
86
103
|
}
|
|
87
104
|
const stem = (digest) => digest.replace(/:/g, "_");
|
|
88
105
|
const releaseFile = (digest) => `${stem(digest)}.json`;
|
|
89
|
-
const templateFile = (digest) => `${stem(digest)}
|
|
106
|
+
const templateFile = (digest, encoding) => `${stem(digest)}.${encoding === "base64" ? "b64" : "txt"}`;
|
|
107
|
+
/** The digest of a template's bytes: its text, or what its base64 decodes to. */
|
|
108
|
+
export function templateBytesDigest(content, encoding) {
|
|
109
|
+
return encoding === "base64" ? `sha256:${sha256Hex(Buffer.from(content, "base64"))}` : contentDigest(content);
|
|
110
|
+
}
|
|
90
111
|
/** A label names a release in commands such as `chant release cut <label>`, so it is one plain word. */
|
|
91
112
|
const LABEL_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
|
|
92
113
|
/** Why a label can't be used, or undefined when it can. */
|
|
@@ -113,7 +134,7 @@ export async function persistRelease(release, templates, opts) {
|
|
|
113
134
|
throw new Error(`release ${release.releaseDigest} does not hash to its own digest; refusing to store it`);
|
|
114
135
|
}
|
|
115
136
|
for (const t of templates) {
|
|
116
|
-
if (
|
|
137
|
+
if (templateBytesDigest(t.content, t.encoding) !== t.digest)
|
|
117
138
|
throw new Error(`template bytes do not hash to ${t.digest}; refusing to store them`);
|
|
118
139
|
}
|
|
119
140
|
const dir = await ledgerDir(RELEASES_DIR, opts);
|
|
@@ -124,12 +145,13 @@ export async function persistRelease(release, templates, opts) {
|
|
|
124
145
|
files.push({ path: releasePath, content: `${JSON.stringify(release, sortedJsonReplacer)}\n`, expectPriorSha: null });
|
|
125
146
|
const seen = new Set();
|
|
126
147
|
for (const t of templates) {
|
|
127
|
-
|
|
148
|
+
const file = templateFile(t.digest, t.encoding);
|
|
149
|
+
if (seen.has(file))
|
|
128
150
|
continue;
|
|
129
|
-
seen.add(
|
|
130
|
-
if ((await readPathSha(`${RELEASES_DIR}/${TEMPLATES_SUBDIR}`,
|
|
151
|
+
seen.add(file);
|
|
152
|
+
if ((await readPathSha(`${RELEASES_DIR}/${TEMPLATES_SUBDIR}`, file, opts)) !== null)
|
|
131
153
|
continue;
|
|
132
|
-
files.push({ path: `${dir}/${TEMPLATES_SUBDIR}/${
|
|
154
|
+
files.push({ path: `${dir}/${TEMPLATES_SUBDIR}/${file}`, content: t.content, expectPriorSha: null });
|
|
133
155
|
}
|
|
134
156
|
if (files.length === 0)
|
|
135
157
|
return { commit: null, written: false };
|
|
@@ -166,7 +188,12 @@ export function parseRelease(text) {
|
|
|
166
188
|
r.targets.every((t) => t &&
|
|
167
189
|
typeof t.env === "string" &&
|
|
168
190
|
Array.isArray(t.templates) &&
|
|
169
|
-
t.templates.every((x) => x &&
|
|
191
|
+
t.templates.every((x) => x &&
|
|
192
|
+
(x.component === null || typeof x.component === "string") &&
|
|
193
|
+
typeof x.path === "string" &&
|
|
194
|
+
typeof x.digest === "string" &&
|
|
195
|
+
(x.encoding === undefined || x.encoding === "base64")) &&
|
|
196
|
+
(t.trees === undefined || (Array.isArray(t.trees) && t.trees.every((x) => x && (x.component === null || typeof x.component === "string") && typeof x.path === "string"))) &&
|
|
170
197
|
Array.isArray(t.params) &&
|
|
171
198
|
t.params.every((p) => p && typeof p.name === "string" && ["string", "number", "boolean"].includes(typeof p.value) && typeof p.source === "string"));
|
|
172
199
|
return ok ? r : null;
|
|
@@ -297,9 +324,9 @@ export async function appendCut(input, opts) {
|
|
|
297
324
|
}
|
|
298
325
|
throw lastErr;
|
|
299
326
|
}
|
|
300
|
-
/** A template's bytes by digest, or null when none is stored. */
|
|
301
|
-
export async function readReleaseTemplate(digest, opts) {
|
|
302
|
-
return readBlobFromPath(`${RELEASES_DIR}/${TEMPLATES_SUBDIR}`, templateFile(digest), opts);
|
|
327
|
+
/** A template's bytes by digest, or null when none is stored. Under `base64` (#4155), the stored base64 of the bytes. */
|
|
328
|
+
export async function readReleaseTemplate(digest, opts, encoding) {
|
|
329
|
+
return readBlobFromPath(`${RELEASES_DIR}/${TEMPLATES_SUBDIR}`, templateFile(digest, encoding), opts);
|
|
303
330
|
}
|
|
304
331
|
/**
|
|
305
332
|
* Find a release by its digest or its label. Null when neither names one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/run-ledger.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAkB,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAA+C,MAAM,eAAe,CAAC;AASrI,0EAA0E;AAC1E,eAAO,MAAM,eAAe,UAAU,CAAC;AAMvC,8FAA8F;AAC9F,wBAAgB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,MAAM,CAEjE;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC,EACzC,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,KAAK,EAAE;IACL,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2D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AW,CAAC,WAAW,CAAC,CAAC;IACrC,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC,GACA,gBAAgB,CAkDlB;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,gBAAgB,EACvB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC,CAsBlD;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAkCxD"}
|
|
@@ -91,6 +91,7 @@ export function buildRunRecord(config, records, times) {
|
|
|
91
91
|
...(record.point ? { point: record.point } : {}),
|
|
92
92
|
...(record.gate ? { gate: record.gate } : {}),
|
|
93
93
|
...(record.resumed ? { resumed: record.resumed } : {}),
|
|
94
|
+
...(record.fn === "shellCmd" && typeof record.args?.image === "string" ? { image: record.args.image } : {}),
|
|
94
95
|
});
|
|
95
96
|
if (record.outcome)
|
|
96
97
|
outcomes[record.outcome.name] = record.outcome.value;
|
|
@@ -16,6 +16,7 @@ export { ops014 } from "./ops014-converge-rule-refusals.js";
|
|
|
16
16
|
export { ops015 } from "./ops015-gate-approval.js";
|
|
17
17
|
export { ops016 } from "./ops016-gate-resume.js";
|
|
18
18
|
export { ops017, ops017Check, workspaceIdentityGates } from "./ops017-gate-alias.js";
|
|
19
|
+
export { ops018 } from "./ops018-shell-image-digest.js";
|
|
19
20
|
export { sys010, sys010Check } from "./sys010-key-over-plain-http.js";
|
|
20
21
|
export interface CoreOpCheckOptions {
|
|
21
22
|
/** `decide.backends` from the project's chant.config, for SYS010 (#2828). */
|
|
@@ -25,7 +26,7 @@ export interface CoreOpCheckOptions {
|
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
28
|
* Core's own post-synth checks over the Op model: OPS012, OPS013, OPS014,
|
|
28
|
-
* OPS015, OPS016, OPS017 over the workspace's `identity.gates`, and SYS010
|
|
29
|
+
* OPS015, OPS016, OPS017 over the workspace's `identity.gates`, OPS018, and SYS010
|
|
29
30
|
* over the `decide` steps and the configured decide backends.
|
|
30
31
|
*/
|
|
31
32
|
export declare function coreOpChecks(opts?: CoreOpCheckOptions): PostSynthCheck[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lint/rules/op/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lint/rules/op/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AASvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IACpE,6GAA6G;IAC7G,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;CACpD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,GAAE,kBAAuB,GAAG,cAAc,EAAE,CAE5E"}
|
|
@@ -14,6 +14,7 @@ import { ops014 } from "./ops014-converge-rule-refusals.js";
|
|
|
14
14
|
import { ops015 } from "./ops015-gate-approval.js";
|
|
15
15
|
import { ops016 } from "./ops016-gate-resume.js";
|
|
16
16
|
import { ops017Check } from "./ops017-gate-alias.js";
|
|
17
|
+
import { ops018 } from "./ops018-shell-image-digest.js";
|
|
17
18
|
import { sys010Check } from "./sys010-key-over-plain-http.js";
|
|
18
19
|
export { ops012 } from "./ops012-activity-contract.js";
|
|
19
20
|
export { ops013 } from "./ops013-step-output-ref.js";
|
|
@@ -21,12 +22,13 @@ export { ops014 } from "./ops014-converge-rule-refusals.js";
|
|
|
21
22
|
export { ops015 } from "./ops015-gate-approval.js";
|
|
22
23
|
export { ops016 } from "./ops016-gate-resume.js";
|
|
23
24
|
export { ops017, ops017Check, workspaceIdentityGates } from "./ops017-gate-alias.js";
|
|
25
|
+
export { ops018 } from "./ops018-shell-image-digest.js";
|
|
24
26
|
export { sys010, sys010Check } from "./sys010-key-over-plain-http.js";
|
|
25
27
|
/**
|
|
26
28
|
* Core's own post-synth checks over the Op model: OPS012, OPS013, OPS014,
|
|
27
|
-
* OPS015, OPS016, OPS017 over the workspace's `identity.gates`, and SYS010
|
|
29
|
+
* OPS015, OPS016, OPS017 over the workspace's `identity.gates`, OPS018, and SYS010
|
|
28
30
|
* over the `decide` steps and the configured decide backends.
|
|
29
31
|
*/
|
|
30
32
|
export function coreOpChecks(opts = {}) {
|
|
31
|
-
return [ops012, ops013, ops014, ops015, ops016, ops017Check(opts.identityGates), sys010Check(opts.decideBackends)];
|
|
33
|
+
return [ops012, ops013, ops014, ops015, ops016, ops017Check(opts.identityGates), ops018, sys010Check(opts.decideBackends)];
|
|
32
34
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OPS018: a `shellCmd` step that runs in a container (#4015) names its image
|
|
3
|
+
* pinned by digest, `<ref>@sha256:<digest>`, as a literal string. A tag can
|
|
4
|
+
* move between two runs of the same Op, and then the step record's image no
|
|
5
|
+
* longer says what ran. Checked over the main phases, `onFailure`, and the
|
|
6
|
+
* steps inside an effect.
|
|
7
|
+
*/
|
|
8
|
+
import type { PostSynthCheck } from "../../post-synth.js";
|
|
9
|
+
export declare const ops018: PostSynthCheck;
|
|
10
|
+
//# sourceMappingURL=ops018-shell-image-digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ops018-shell-image-digest.d.ts","sourceRoot":"","sources":["../../../../src/lint/rules/op/ops018-shell-image-digest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kBAAkB,CAAC;AAW9F,eAAO,MAAM,MAAM,EAAE,cA6BpB,CAAC"}
|