@intentius/chant 0.124.86 → 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.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 +69 -10
- package/dist/ci-evidence-jobs.d.ts.map +1 -1
- package/dist/ci-evidence-jobs.js +72 -8
- 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 +20 -1
- 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 +38 -14
- package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
- package/dist/cli/handlers/ci-evidence.js +238 -26
- 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 +21 -3
- package/dist/components/check-steps.js +1 -1
- 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 +262 -3
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +243 -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 -20
- 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 +17 -4
- package/dist/op/op-waves-evidence.d.ts.map +1 -1
- package/dist/op/op-waves-evidence.js +32 -10
- 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 +51 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +66 -16
- package/dist/state-migration.d.ts +23 -0
- 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 +310 -303
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +13 -7
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +4 -3
- 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 +25 -0
- package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence-report.js +20 -0
- package/dist/workspace/trust/check-evidence.d.ts +59 -13
- package/dist/workspace/trust/check-evidence.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence.js +101 -24
- package/dist/workspace/trust/ci-tag-statement.d.ts +2 -2
- package/dist/workspace/trust/ci-tag-statement.d.ts.map +1 -1
- package/dist/workspace/trust/dsse.d.ts +40 -2
- package/dist/workspace/trust/dsse.d.ts.map +1 -1
- package/dist/workspace/trust/dsse.js +34 -2
- package/dist/workspace/trust/evidence.d.ts +7 -2
- package/dist/workspace/trust/evidence.d.ts.map +1 -1
- package/dist/workspace/trust/evidence.js +5 -0
- package/dist/workspace/trust/keyless-fixture.d.ts +41 -0
- package/dist/workspace/trust/keyless-fixture.d.ts.map +1 -0
- package/dist/workspace/trust/keyless-fixture.js +161 -0
- package/dist/workspace/trust/keyless.d.ts +202 -0
- package/dist/workspace/trust/keyless.d.ts.map +1 -0
- package/dist/workspace/trust/keyless.js +488 -0
- package/dist/workspace/trust/local-evidence.d.ts +3 -0
- package/dist/workspace/trust/local-evidence.d.ts.map +1 -1
- package/dist/workspace/trust/op-run-statement.d.ts +2 -2
- package/dist/workspace/trust/op-run-statement.d.ts.map +1 -1
- 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/policy.d.ts +56 -1
- package/dist/workspace/trust/policy.d.ts.map +1 -1
- package/dist/workspace/trust/policy.js +103 -2
- 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 +62 -3
- package/dist/workspace/trust/ref-gate.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate.js +75 -8
- package/dist/workspace/trust/run-statement.d.ts +3 -3
- package/dist/workspace/trust/run-statement.d.ts.map +1 -1
- package/dist/workspace/trust/runner-identity.d.ts +56 -0
- package/dist/workspace/trust/runner-identity.d.ts.map +1 -0
- package/dist/workspace/trust/runner-identity.js +65 -0
- package/dist/workspace/trust/trust-files.d.ts.map +1 -1
- package/dist/workspace/trust/trust-files.js +8 -1
- 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 +85 -10
- 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 +35 -13
- package/src/cli/handlers/ci-evidence-open.test.ts +164 -0
- package/src/cli/handlers/ci-evidence.ts +223 -24
- 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 +25 -3
- package/src/components/check-report-summary.test.ts +78 -0
- package/src/components/check-steps.ts +1 -1
- 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 +419 -14
- 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 -20
- 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 +37 -4
- package/src/op/op-waves-evidence.ts +32 -11
- 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 +88 -16
- 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/ci-green.ts +4 -3
- 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 +33 -0
- package/src/workspace/trust/check-evidence.test.ts +3 -3
- package/src/workspace/trust/check-evidence.ts +110 -28
- package/src/workspace/trust/ci-tag-statement.ts +2 -2
- package/src/workspace/trust/dsse.ts +48 -4
- package/src/workspace/trust/evidence.ts +7 -2
- package/src/workspace/trust/keyless-fixture.ts +214 -0
- package/src/workspace/trust/keyless.test.ts +220 -0
- package/src/workspace/trust/keyless.ts +557 -0
- package/src/workspace/trust/local-evidence.ts +3 -1
- package/src/workspace/trust/op-run-statement.ts +2 -2
- package/src/workspace/trust/open-evidence.ts +129 -0
- package/src/workspace/trust/policy.ts +129 -2
- 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 +90 -8
- package/src/workspace/trust/run-statement.ts +3 -3
- package/src/workspace/trust/runner-identity.ts +92 -0
- package/src/workspace/trust/trust-files.test.ts +6 -0
- package/src/workspace/trust/trust-files.ts +14 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant dev generated-check [<render>...] [--json]` (#4909): render the
|
|
3
|
+
* product's declared generated files (`chantGenerated` in its root
|
|
4
|
+
* package.json) into a directory under the OS temp directory, compare each
|
|
5
|
+
* with the committed file, and exit 1 naming every one that drifted. The
|
|
6
|
+
* directory is left in place and printed. Exit 2 when the product declares
|
|
7
|
+
* no `chantGenerated`.
|
|
8
|
+
*/
|
|
9
|
+
import { checkGenerated, readGeneratedCheckConfig } from "../../generated-check";
|
|
10
|
+
import { formatError } from "../format";
|
|
11
|
+
import type { CommandContext } from "../registry";
|
|
12
|
+
|
|
13
|
+
const USAGE = "chant dev generated-check [<render>...] [--json]";
|
|
14
|
+
|
|
15
|
+
export async function runDevGeneratedCheck(ctx: CommandContext): Promise<number> {
|
|
16
|
+
const productDir = process.cwd();
|
|
17
|
+
let config;
|
|
18
|
+
try {
|
|
19
|
+
config = readGeneratedCheckConfig(productDir);
|
|
20
|
+
} catch (err) {
|
|
21
|
+
console.error(formatError({ message: err instanceof Error ? err.message : String(err), hint: USAGE }));
|
|
22
|
+
return 2;
|
|
23
|
+
}
|
|
24
|
+
if (!config) {
|
|
25
|
+
console.error(formatError({ message: "package.json here declares no chantGenerated", hint: USAGE }));
|
|
26
|
+
return 2;
|
|
27
|
+
}
|
|
28
|
+
const only = (ctx.args.positionals ?? []).slice(1);
|
|
29
|
+
const result = await checkGenerated(productDir, config, { only });
|
|
30
|
+
if (ctx.args.json) {
|
|
31
|
+
console.log(JSON.stringify(result, null, 2));
|
|
32
|
+
} else {
|
|
33
|
+
for (const f of result.matched) console.error(` generated-check: ${f} matches its render`);
|
|
34
|
+
for (const p of result.problems) console.error(`generated-check: ${p}`);
|
|
35
|
+
console.error(`generated-check: the renders are in ${result.out}`);
|
|
36
|
+
if (result.ok) console.error(`generated-check: ${result.matched.length} files match ${result.renders.length} renders`);
|
|
37
|
+
}
|
|
38
|
+
return result.ok ? 0 : 1;
|
|
39
|
+
}
|
|
@@ -517,6 +517,26 @@ describe("runLifecycleDiff --live", () => {
|
|
|
517
517
|
expect(seen?.attributes?.chart).toBe("web-1.2.3");
|
|
518
518
|
});
|
|
519
519
|
|
|
520
|
+
test("--live --json writes a lexicon's liveAbsentStatus as its section's absent, and nothing for one that sets none (#4896)", async () => {
|
|
521
|
+
buildMock.mockResolvedValue(makeBuildResult({ sql: ["events"], aws: ["bucket"] }));
|
|
522
|
+
fetchLifecycleMock.mockResolvedValue(undefined);
|
|
523
|
+
readSnapshotMock.mockResolvedValue(null);
|
|
524
|
+
const plugins: LexiconPlugin[] = [
|
|
525
|
+
{ ...createMockPlugin({ name: "sql", describeResources: staticObservation({}) }), liveAbsentStatus: "missing" },
|
|
526
|
+
createMockPlugin({ name: "aws", describeResources: staticObservation({}) }),
|
|
527
|
+
];
|
|
528
|
+
await runLifecycleDiff({
|
|
529
|
+
args: makeArgs({ command: "state", path: "diff", extraPositional: "prod", live: true, json: true }),
|
|
530
|
+
plugins,
|
|
531
|
+
serializers: plugins.map((p) => p.serializer),
|
|
532
|
+
} as never);
|
|
533
|
+
const payload = JSON.parse(stdoutBuf.join("\n")) as { lexicons: Record<string, { absent?: string; resources?: { missing: string[] } }> };
|
|
534
|
+
expect(payload.lexicons.sql.resources?.missing).toEqual(["events"]);
|
|
535
|
+
expect(payload.lexicons.sql.absent).toBe("missing");
|
|
536
|
+
expect(payload.lexicons.aws.resources?.missing).toEqual(["bucket"]);
|
|
537
|
+
expect("absent" in payload.lexicons.aws).toBe(false);
|
|
538
|
+
});
|
|
539
|
+
|
|
520
540
|
test("--live lists artifacts for a configured lexicon with NO built entities — the deploy-step estate shape", async () => {
|
|
521
541
|
// kubemicrovm-ops: helm is a configured lexicon whose releases exist only
|
|
522
542
|
// as component helm-upgrade steps, so the built manifest carries no helm
|
|
@@ -811,6 +811,8 @@ interface LiveDiffOutcome {
|
|
|
811
811
|
string,
|
|
812
812
|
{
|
|
813
813
|
resources?: LiveDiffResult;
|
|
814
|
+
/** The lexicon's `liveAbsentStatus` (#4896): what an entity in `resources.missing` is. Present only when the lexicon sets it. */
|
|
815
|
+
absent?: "pending" | "missing";
|
|
814
816
|
observed?: Record<string, ResourceMetadata>;
|
|
815
817
|
/** Declared entities the lexicon could not read (#1089), keyed by name. */
|
|
816
818
|
unobserved?: Record<string, UnobservedEntity>;
|
|
@@ -997,6 +999,8 @@ async function runLifecycleDiffLive(args: LiveDiffArgs): Promise<LiveDiffOutcome
|
|
|
997
999
|
if (args.json) {
|
|
998
1000
|
const entry = (byLexicon[lexiconName] ??= {});
|
|
999
1001
|
entry.resources = diff;
|
|
1002
|
+
// What a confirmed-absent entity is, when the lexicon says (#4896); left out for every other lexicon.
|
|
1003
|
+
if (plugin.liveAbsentStatus) entry.absent = plugin.liveAbsentStatus;
|
|
1000
1004
|
entry.observed = observedNow; // live state (#862) — status/attributes per resource
|
|
1001
1005
|
if (Object.keys(observed.unobserved).length > 0) entry.unobserved = observed.unobserved;
|
|
1002
1006
|
} else renderLiveDiff(lexiconName, args.environment, diff);
|
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
import { spawnSync } from "node:child_process";
|
|
8
8
|
import { join, resolve } from "node:path";
|
|
9
9
|
import { checkBundle, readBundleCheckConfig, type BundleCheckResult } from "../../bundle-check";
|
|
10
|
-
import { installLocalChant, LocalChantError, productManifests, resetLocalChant, type LocalChantResult } from "../../local-chant";
|
|
10
|
+
import { installLocalChant, LocalChantError, localChantImage, productManifests, resetLocalChant, type LocalChantResult } from "../../local-chant";
|
|
11
11
|
import { formatError } from "../format";
|
|
12
12
|
import type { CommandContext } from "../registry";
|
|
13
13
|
|
|
14
14
|
const LOCAL_USAGE = "chant dev local <chant-dir> [--with <package>]... [--build '<command>'] [--json] | chant dev local --reset [--build '<command>']";
|
|
15
15
|
const CHECK_USAGE = "chant dev bundle-check [<package-dir>] [--json]";
|
|
16
|
+
const IMAGE_USAGE = "chant dev local-image [--with <package>]... [--json] [-- <docker build arguments>...]";
|
|
16
17
|
|
|
17
18
|
/** The product packages that declare `chantBundleCheck`, as directories. */
|
|
18
19
|
function checkedPackages(productDir: string): string[] {
|
|
@@ -75,6 +76,7 @@ export async function runDevLocal(ctx: CommandContext): Promise<number> {
|
|
|
75
76
|
console.log(JSON.stringify({ reset, local: installed ? { commit: installed.mark.commit, dir: installed.mark.dir, packed: installed.packed.map((p) => ({ name: p.name, version: p.version })), marked: installed.marked } : undefined, checks: results }, null, 2));
|
|
76
77
|
} else if (installed) {
|
|
77
78
|
console.log(`chant commit: ${installed.mark.commit}`);
|
|
79
|
+
console.log(`chant version: ${installed.packed[0]?.version ?? "none"} (local build)`);
|
|
78
80
|
}
|
|
79
81
|
return ok ? 0 : 1;
|
|
80
82
|
}
|
|
@@ -104,3 +106,39 @@ export async function runDevBundleCheck(ctx: CommandContext): Promise<number> {
|
|
|
104
106
|
if (ctx.args.json) console.log(JSON.stringify(results, null, 2));
|
|
105
107
|
return ok ? 0 : 1;
|
|
106
108
|
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* `chant dev local-image [--with <package>]... [-- <docker build arguments>]`
|
|
112
|
+
* (#4909): build a product's image with the chant the product has installed.
|
|
113
|
+
* With no docker arguments it prints the chant version the image would
|
|
114
|
+
* install (the pin, or `local-<commit>`), for a label that rebuilds the image
|
|
115
|
+
* when it changes; `--json` prints the version, the mark and the arguments.
|
|
116
|
+
* With them it runs `docker build` with `--build-arg CHANT_VERSION=<version>`
|
|
117
|
+
* and, for a `chant dev local` build, `--build-context
|
|
118
|
+
* chant-local=<product>/.chant-local` first. `--with` names a package the
|
|
119
|
+
* image installs from the tarballs besides core. Exit 1 when the local build's
|
|
120
|
+
* tarballs are missing or docker fails, 2 for a usage error.
|
|
121
|
+
*/
|
|
122
|
+
export async function runDevLocalImage(ctx: CommandContext): Promise<number> {
|
|
123
|
+
const docker = (ctx.args.positionals ?? []).slice(1);
|
|
124
|
+
let image;
|
|
125
|
+
try {
|
|
126
|
+
image = localChantImage(process.cwd(), { with: ctx.args.withPackages });
|
|
127
|
+
} catch (err) {
|
|
128
|
+
if (!(err instanceof LocalChantError)) throw err;
|
|
129
|
+
console.error(formatError({ message: err.message, hint: IMAGE_USAGE }));
|
|
130
|
+
return 1;
|
|
131
|
+
}
|
|
132
|
+
if (docker.length === 0) {
|
|
133
|
+
if (ctx.args.json) console.log(JSON.stringify(image, null, 2));
|
|
134
|
+
else console.log(image.version);
|
|
135
|
+
return 0;
|
|
136
|
+
}
|
|
137
|
+
console.error(`chant dev local-image: docker build with chant ${image.version}`);
|
|
138
|
+
const r = spawnSync("docker", ["build", ...image.args, ...docker], { cwd: process.cwd(), stdio: "inherit" });
|
|
139
|
+
if (r.error) {
|
|
140
|
+
console.error(formatError({ message: `docker build: ${r.error.message}` }));
|
|
141
|
+
return 1;
|
|
142
|
+
}
|
|
143
|
+
return r.status === 0 ? 0 : 1;
|
|
144
|
+
}
|
package/src/cli/handlers/pr.ts
CHANGED
|
@@ -1033,10 +1033,14 @@ async function newMigrations(p: Prepared): Promise<PrMigrationFile[]> {
|
|
|
1033
1033
|
* the Ops cannot be read, nothing is checked and the plan goes on. The
|
|
1034
1034
|
* generated plan holds no forge token (#4295), so there the plan-note job's
|
|
1035
1035
|
* `pr-post` asks instead, reading the Ops at the target branch's commit.
|
|
1036
|
+
* A product plan's own watches (#4888) come from `CHANT_PLAN_WATCHES`, which
|
|
1037
|
+
* the generated note job sets from the pipeline.
|
|
1036
1038
|
*/
|
|
1037
1039
|
async function overdueOps(forge: PrForge | undefined, member: string | undefined): Promise<PrOverdue[]> {
|
|
1038
|
-
const { overdueOpsAt } = await import("../../op/schedule-overdue");
|
|
1039
|
-
|
|
1040
|
+
const { overdueOpsAt, plannedWatchesFromEnv } = await import("../../op/schedule-overdue");
|
|
1041
|
+
const log = (line: string): void => console.error(formatWarning({ message: line }));
|
|
1042
|
+
const watches = plannedWatchesFromEnv(process.env, log);
|
|
1043
|
+
return overdueOpsAt({ forge, cwd: resolve("."), ...(member ? { member } : {}), ...(watches.length > 0 ? { watches } : {}), log });
|
|
1040
1044
|
}
|
|
1041
1045
|
|
|
1042
1046
|
/** chant components pr-apply --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--require-review] [--before-merge [--requires <list>]] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
|
|
@@ -2817,13 +2821,41 @@ export async function runComponentsPrPost(ctx: CommandContext): Promise<number>
|
|
|
2817
2821
|
// #4628: the target branch's commit for the note's tip line, and the job summary where the forge keeps one.
|
|
2818
2822
|
...(args.tip ? { baseTip: args.tip } : {}),
|
|
2819
2823
|
...(args.forge !== "gitlab" && process.env.GITHUB_STEP_SUMMARY ? { summaryFile: process.env.GITHUB_STEP_SUMMARY } : {}),
|
|
2824
|
+
// #4899: the product plan job's run record, kept on chant/lifecycle with the note.
|
|
2825
|
+
...(args.recordRun ? { recordRun: await planRunRecorder(args.forge as ForgeKind, args.recordRun) } : {}),
|
|
2820
2826
|
});
|
|
2821
2827
|
for (const message of posted.warnings) console.error(formatWarning({ message }));
|
|
2822
2828
|
if (posted.refused) console.error(formatWarning({ message: `the plan report was not used: ${posted.refused}` }));
|
|
2823
|
-
console.error(formatInfo(`pr-post: ${prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}`));
|
|
2829
|
+
console.error(formatInfo(`pr-post: ${prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}${posted.recorded ? `; run ${posted.recorded} recorded` : ""}`));
|
|
2824
2830
|
return 0;
|
|
2825
2831
|
}
|
|
2826
2832
|
|
|
2833
|
+
/**
|
|
2834
|
+
* How `pr-post --record-run <plan job>` keeps a product plan job's run
|
|
2835
|
+
* record (#4899): its run is this run on GitHub and Forgejo, named by the
|
|
2836
|
+
* plan job's key, and this pipeline on GitLab, where a re-plan's note job
|
|
2837
|
+
* runs in the re-plan's own pipeline. The record is appended to the run
|
|
2838
|
+
* ledger once, by its id, and `chant/lifecycle` is pushed.
|
|
2839
|
+
*/
|
|
2840
|
+
async function planRunRecorder(forge: ForgeKind, job: string): Promise<import("../../pr-post").PlanRunRecorder> {
|
|
2841
|
+
const { resolveCiJob, resolveCiRun } = await import("../../lifecycle/release-ledger");
|
|
2842
|
+
const ci = forge === "gitlab" ? resolveCiRun(process.env) : resolveCiJob(process.env);
|
|
2843
|
+
const origin = ci ? (forge === "gitlab" ? ci.runOrigin : { ...ci.runOrigin, jobId: job }) : undefined;
|
|
2844
|
+
return { ...(origin ? { origin } : {}), keep: keepPlanRunRecord };
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2847
|
+
/** Append `record` to the run ledger unless a record with its id is there, and push `chant/lifecycle` (#4899). Returns a warning when the push did not land. */
|
|
2848
|
+
async function keepPlanRunRecord(record: import("../../op/runtime").OpRunRecordInput): Promise<string | undefined> {
|
|
2849
|
+
const { fetchLifecycleStatus, pushLifecycleReport } = await import("../../lifecycle/git");
|
|
2850
|
+
const { appendRunRecord, readRunLedger } = await import("../../lifecycle/run-ledger");
|
|
2851
|
+
await fetchLifecycleStatus().catch(() => undefined);
|
|
2852
|
+
const { records } = await readRunLedger(record.env, record.op);
|
|
2853
|
+
if (records.some((r) => r.id === record.id)) return undefined;
|
|
2854
|
+
await appendRunRecord(record);
|
|
2855
|
+
const pushed = await pushLifecycleReport();
|
|
2856
|
+
return pushed.pushed ? undefined : `the plan job's run record is on this job's chant/lifecycle only: ${pushed.pushWarning ?? "the push did not land"}`;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2827
2859
|
/**
|
|
2828
2860
|
* The description check pr-post runs after the note (#4629), when the
|
|
2829
2861
|
* responses turn it on (`--respond description=check`, or `CHANT_RESPOND`):
|
|
@@ -2901,7 +2933,9 @@ async function runComponentsPrPostStale(ctx: CommandContext): Promise<number> {
|
|
|
2901
2933
|
* (`postOpenPlanReports`, ../../pr-post.ts). The branch is `--branch`, else
|
|
2902
2934
|
* the pipeline's own (`CI_COMMIT_BRANCH`). The plan job is `plan`, or
|
|
2903
2935
|
* `<member>-plan` with `--member`, as the gitlab lexicon names it, and the
|
|
2904
|
-
* artifact path is `--output` from the repository root.
|
|
2936
|
+
* artifact path is `--output` from the repository root. With
|
|
2937
|
+
* `--evidence-dir <dir>` (#4914) each note ends with the checks the
|
|
2938
|
+
* pipeline's signing job signed for that head. It exits 0 once it
|
|
2905
2939
|
* has posted, as `pr-post` does.
|
|
2906
2940
|
*/
|
|
2907
2941
|
async function runComponentsPrPostOpen(ctx: CommandContext): Promise<number> {
|
|
@@ -2940,6 +2974,10 @@ async function runComponentsPrPostOpen(ctx: CommandContext): Promise<number> {
|
|
|
2940
2974
|
...(description ? { description } : {}),
|
|
2941
2975
|
// #4628: the target branch's commit this pipeline runs at, which each note's tip line names.
|
|
2942
2976
|
...(args.tip ? { baseTip: args.tip } : {}),
|
|
2977
|
+
// #4899: each product plan job's run record, from its artifacts.
|
|
2978
|
+
...(args.recordRun ? { recordRun: { ...(process.env.CI_PROJECT_PATH ? { repo: process.env.CI_PROJECT_PATH } : {}), keep: keepPlanRunRecord } } : {}),
|
|
2979
|
+
// #4914: each merge request's evidence.json from this pipeline's signing job, for the note's checks line.
|
|
2980
|
+
...(args.evidenceDir ? { evidenceDir: resolve(args.evidenceDir) } : {}),
|
|
2943
2981
|
});
|
|
2944
2982
|
} catch (err) {
|
|
2945
2983
|
return fail(err instanceof Error ? err.message : String(err));
|
|
@@ -2953,7 +2991,7 @@ async function runComponentsPrPostOpen(ctx: CommandContext): Promise<number> {
|
|
|
2953
2991
|
const posted = p.posted!;
|
|
2954
2992
|
for (const message of posted.warnings) console.error(formatWarning({ message: `!${p.pr}: ${message}` }));
|
|
2955
2993
|
if (posted.refused) console.error(formatWarning({ message: `!${p.pr}: the plan report was not used: ${posted.refused}` }));
|
|
2956
|
-
console.error(formatInfo(`pr-post: !${p.pr} ${prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}`));
|
|
2994
|
+
console.error(formatInfo(`pr-post: !${p.pr} ${prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}${posted.recorded ? `; run ${posted.recorded} recorded` : ""}`));
|
|
2957
2995
|
}
|
|
2958
2996
|
if (done.posts.length === 0) console.error(formatInfo(`pr-post: no open merge request into ${branch} has a ${gitlabPlanJobName(member)} job`));
|
|
2959
2997
|
return 0;
|
|
@@ -88,6 +88,10 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
|
|
|
88
88
|
console.error(formatError({ message: `--decide and --${args.share !== undefined ? "share" : "group"} are two different jobs; pass one` }));
|
|
89
89
|
return 1;
|
|
90
90
|
}
|
|
91
|
+
if (args.policyOnly && (args.share !== undefined || args.group !== undefined)) {
|
|
92
|
+
console.error(formatError({ message: `--policy-only runs a wave's policy in its own or its deciding job; a --${args.share !== undefined ? "share" : "group"} job has none of its own` }));
|
|
93
|
+
return 1;
|
|
94
|
+
}
|
|
91
95
|
let spec: OpWavesSpec | undefined;
|
|
92
96
|
const job = { ...(args.share !== undefined ? { share: args.share } : {}), ...(args.group !== undefined ? { group: args.group } : {}) };
|
|
93
97
|
if (args.eventsJson && args.json) {
|
|
@@ -113,11 +117,14 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
|
|
|
113
117
|
specFile: relative(process.cwd(), path),
|
|
114
118
|
wave: args.wave,
|
|
115
119
|
...(args.decide ? { decide: true } : {}),
|
|
120
|
+
...(args.policyOnly ? { policyOnly: true } : {}),
|
|
116
121
|
...(args.share !== undefined ? { share: args.share } : {}),
|
|
117
122
|
...(args.group !== undefined ? { group: args.group } : {}),
|
|
118
123
|
...(args.base ? { base: args.base } : {}),
|
|
119
124
|
});
|
|
120
125
|
if (args.json) console.log(JSON.stringify(result, null, 2));
|
|
126
|
+
// #4926: the policy step applied nothing; the wave's own step tells people how it went.
|
|
127
|
+
if (args.policyOnly) return result.exitCode;
|
|
121
128
|
// #3761: tell people, when the spec says where. Delivery never changes the exit code.
|
|
122
129
|
await notifyOpWave(spec, args.wave, { result }, job);
|
|
123
130
|
// #4629: a refused wave's diff and a failed apply's triage, on the pull request or a tracking issue.
|
package/src/cli/main.ts
CHANGED
|
@@ -267,18 +267,27 @@ E2E harness:
|
|
|
267
267
|
CLEAN, or the rejecting lines and exits 3.
|
|
268
268
|
|
|
269
269
|
CI:
|
|
270
|
-
ci check --base <rev> [<target>...] [--output <dir>] [--json]
|
|
270
|
+
ci check --base <rev> [<target>...] [--output <dir>] [--summary <file>] [--json]
|
|
271
271
|
Run the ci.hooks.check hooks the workspace declaration
|
|
272
272
|
at --base names, once each, or once per target with
|
|
273
273
|
perRun, with no forge token or cloud credentials in
|
|
274
274
|
their environment. Writes check-hooks.json under
|
|
275
|
-
--output (default .chant/check)
|
|
275
|
+
--output (default .chant/check), and with --summary
|
|
276
|
+
appends the report's markdown section to the file;
|
|
277
|
+
exits 1 when one failed.
|
|
276
278
|
ci evidence sign --check-id <id>[,<id>...] [--at <rev>] [--base <rev>] [--no-push]
|
|
277
279
|
Sign that each named check passed at --at, with the
|
|
278
280
|
runner key in CHANT_RUNNER_KEY or --key, and keep it on
|
|
279
281
|
chant/lifecycle by the commit's tree. With --from-report
|
|
280
282
|
<dir> --result <result>, sign plan and policy from the
|
|
281
283
|
plan job's report, as a generated plan note job does.
|
|
284
|
+
With --open --job <job> --from-report <dir> -o <out>,
|
|
285
|
+
in a GitLab pipeline of the target branch, sign each
|
|
286
|
+
open merge request's settled <job> from its artifact.
|
|
287
|
+
With --from-job <job> [--claims <dir>], sign each
|
|
288
|
+
named check whose step in that job of this run and
|
|
289
|
+
commit the forge reports as passed, as a wave's
|
|
290
|
+
evidence job does (#4926).
|
|
282
291
|
ci evidence verify --check-id <id>[,<id>...] [--at <rev>] [--base <rev>] [--json]
|
|
283
292
|
Verify the kept evidence for --at's tree against the
|
|
284
293
|
runner keys at --base; exits 1 when one is not current.
|
|
@@ -287,12 +296,13 @@ CI:
|
|
|
287
296
|
expectation in CHANT_JOB_GUARD, which a generated
|
|
288
297
|
op-wave job carries. Exits 1, one line per value
|
|
289
298
|
that differs, before any credential is taken.
|
|
290
|
-
ci forge-check [--env <env>] [--member <name>] [--forge <forge>] [--repo <owner/name>] [--branch <default>] [--require-clouds] [--json]
|
|
299
|
+
ci forge-check [--env <env>] [--member <name>] [--forge <forge>] [--repo <owner/name>] [--branch <default>] [--require-clouds] [--ref-gate-status] [--json]
|
|
291
300
|
Read the forge, each cloud's trust policy and Pulumi
|
|
292
301
|
Cloud's OIDC policies against the pipelines
|
|
293
302
|
ci.identity.cloud gives --env (default production):
|
|
294
303
|
apply environments, branch protection, required
|
|
295
304
|
statuses, and each identity trusted to its own jobs.
|
|
305
|
+
--ref-gate-status requires the ref gate's status too.
|
|
296
306
|
Read-only; exits 1 on a mismatch, and with
|
|
297
307
|
--require-clouds on a cloud it had no credentials for.
|
|
298
308
|
ci last-green [--json] [--lane <name>] [--from <rev>] The newest first-parent commit of
|
|
@@ -598,6 +608,10 @@ Ops:
|
|
|
598
608
|
pipeline runs. --decide plans and decides only;
|
|
599
609
|
--share <i> applies one share of a decided wave;
|
|
600
610
|
--group <name> applies one job group's runs.
|
|
611
|
+
--policy-only plans the wave and runs its policy
|
|
612
|
+
hold, applying nothing, and exits 0 only when the
|
|
613
|
+
policy ran and denied nothing: the wave job's
|
|
614
|
+
policy step, whose result its evidence job reads (#4926).
|
|
601
615
|
--record-plans (no --wave), in a pull request's
|
|
602
616
|
pipeline: plan every wave at its head and record the
|
|
603
617
|
digests a pr-review approval mode compares.
|
|
@@ -1057,7 +1071,8 @@ Workspace (level 1, #2524):
|
|
|
1057
1071
|
workspace ref-gate check|status --ref <ref> [--at <rev>] [--base <rev>] [--json]
|
|
1058
1072
|
Decide a ref update against the checks .chant/trust.json
|
|
1059
1073
|
at base requires for the ref; status sets the commit
|
|
1060
|
-
status a forge requires
|
|
1074
|
+
status a forge requires; status --open sets it on
|
|
1075
|
+
every open pull request into the branch (#4935)
|
|
1061
1076
|
workspace ref-gate install --hook pre-receive|pre-push [--git-dir <dir>]
|
|
1062
1077
|
Write the git hook that refuses an update whose commit
|
|
1063
1078
|
lacks current evidence for a blocking check
|
|
@@ -1476,6 +1491,14 @@ Lexicon development:
|
|
|
1476
1491
|
Check a bundle against its package.json chantBundleCheck: imports
|
|
1477
1492
|
only Node, its dependencies and chant served as compiled JS, the
|
|
1478
1493
|
dependencies on the root's chant pin, size ceilings, denied inputs
|
|
1494
|
+
dev local-image [--with <package>]... [-- <docker build args>]
|
|
1495
|
+
Print the chant an image installs (the pin, or local-<commit>
|
|
1496
|
+
after dev local), or run docker build with CHANT_VERSION and,
|
|
1497
|
+
for a local build, the chant-local build context
|
|
1498
|
+
dev generated-check [<render>...]
|
|
1499
|
+
Render the files package.json's chantGenerated declares into a
|
|
1500
|
+
directory under the OS temp dir, compare each with the committed
|
|
1501
|
+
file, and fail naming the ones that drifted
|
|
1479
1502
|
dev dead-guards [<product-dir>]
|
|
1480
1503
|
Fail naming each feature-detect on a chant floor (a floor read off
|
|
1481
1504
|
a lazily loaded module, a subpath loaded behind a catch, the
|
|
@@ -1581,6 +1604,15 @@ Options:
|
|
|
1581
1604
|
apply on merge tells it. With --control-setting
|
|
1582
1605
|
<key>=<value> (repeatable) for op, member,
|
|
1583
1606
|
readTokenSecret and the other control settings
|
|
1607
|
+
--evidence-runner-key-secret <NAME>, --evidence-identity oidc [--evidence-audience <aud>]
|
|
1608
|
+
(build --pr-loop) The runner identity the note job
|
|
1609
|
+
signs plan and policy with (#4935)
|
|
1610
|
+
--check-job (build --pr-loop) A check job that runs ci check on
|
|
1611
|
+
the pull request's commit, and with evidence a job
|
|
1612
|
+
that signs each passed hook (#4935)
|
|
1613
|
+
--ref-gate-status (build --pr-loop) A job that sets the ref gate's
|
|
1614
|
+
status on the pull request's commit (#4935); (ci
|
|
1615
|
+
forge-check) the default branch requires it (#4913)
|
|
1584
1616
|
--no-release-record Skip auto-emitting a release-ledger record after a
|
|
1585
1617
|
successful \`run --components\` deploy (default: on;
|
|
1586
1618
|
also settable via chant.config.ts's
|
|
@@ -1984,6 +2016,8 @@ export const commandRegistry: CommandDef[] = [
|
|
|
1984
2016
|
// #4787: build a product against a chant checkout, and check its bundle. Imported on first use.
|
|
1985
2017
|
{ name: "dev local", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/local-chant")).runDevLocal(ctx) },
|
|
1986
2018
|
{ name: "dev bundle-check", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/local-chant")).runDevBundleCheck(ctx) },
|
|
2019
|
+
{ name: "dev local-image", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/local-chant")).runDevLocalImage(ctx) },
|
|
2020
|
+
{ name: "dev generated-check", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/generated-check")).runDevGeneratedCheck(ctx) },
|
|
1987
2021
|
// #4792: the feature-detects on a chant floor the product's pin already meets.
|
|
1988
2022
|
{ name: "dev dead-guards", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/dead-guards")).runDevDeadGuards(ctx) },
|
|
1989
2023
|
|
package/src/cli/parse-args.ts
CHANGED
|
@@ -21,6 +21,8 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
21
21
|
"--help",
|
|
22
22
|
"--open",
|
|
23
23
|
"--note-commands",
|
|
24
|
+
"--check-job",
|
|
25
|
+
"--ref-gate-status",
|
|
24
26
|
"--locks",
|
|
25
27
|
"--version",
|
|
26
28
|
"--agents",
|
|
@@ -80,6 +82,7 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
80
82
|
"--require-runner-start",
|
|
81
83
|
"--require-clouds",
|
|
82
84
|
"--no-push",
|
|
85
|
+
"--no-forks",
|
|
83
86
|
"--list",
|
|
84
87
|
"--no-require-review",
|
|
85
88
|
"--expire",
|
|
@@ -102,6 +105,7 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
102
105
|
"--root-only",
|
|
103
106
|
"--generated",
|
|
104
107
|
"--decide",
|
|
108
|
+
"--policy-only",
|
|
105
109
|
"--record-plans",
|
|
106
110
|
"--approval-status",
|
|
107
111
|
"--waves-outcome",
|
|
@@ -483,6 +487,9 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
483
487
|
result.wave = wave;
|
|
484
488
|
} else if (arg === "--decide") {
|
|
485
489
|
result.decide = true;
|
|
490
|
+
} else if (arg === "--policy-only") {
|
|
491
|
+
// `chant run wave --policy-only` (#4926): plan the wave and run its policy hold, as a step of its own.
|
|
492
|
+
result.policyOnly = true;
|
|
486
493
|
} else if (arg === "--record-plans") {
|
|
487
494
|
result.recordPlans = true;
|
|
488
495
|
} else if (arg === "--approval-status") {
|
|
@@ -570,6 +577,12 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
570
577
|
// `chant lock --from-report <pr-plan.json>` (#4293): lock the components a pull-request report lists.
|
|
571
578
|
result.fromReport = args[++i];
|
|
572
579
|
if (!result.fromReport || result.fromReport.startsWith("-")) throw new Error("--from-report needs a report file: --from-report <pr-plan.json>");
|
|
580
|
+
} else if (arg === "--from-job" || arg === "--claims") {
|
|
581
|
+
// `chant ci evidence sign --from-job <job> [--claims <dir>]` (#4926): sign from another job's step results.
|
|
582
|
+
const value = args[++i];
|
|
583
|
+
if (value === undefined || value.startsWith("-")) throw new Error(arg === "--from-job" ? "--from-job needs the job's name: --from-job <job>" : "--claims needs a directory: --claims <dir>");
|
|
584
|
+
if (arg === "--from-job") result.fromJob = value;
|
|
585
|
+
else result.claims = value;
|
|
573
586
|
} else if (arg === "--report-url") {
|
|
574
587
|
// `chant components pr-plan|pr-apply --report-url <url>` (#4007).
|
|
575
588
|
const url = args[++i];
|
|
@@ -579,6 +592,9 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
579
592
|
// `chant components pr-post --result <result>` (#4295): the plan job's own result, which fails the status when it failed.
|
|
580
593
|
result.planResult = args[++i];
|
|
581
594
|
if (!result.planResult || result.planResult.startsWith("-")) throw new Error("--result needs the plan job's result: --result success|failure|cancelled");
|
|
595
|
+
} else if (arg === "--no-forks") {
|
|
596
|
+
// `chant ci evidence sign --open --no-forks` (#4914): sign for no merge request from a fork.
|
|
597
|
+
result.noForks = true;
|
|
582
598
|
} else if (arg === "--no-status") {
|
|
583
599
|
// `chant ci run|serve --no-status` (#4097): post no commit status for the job.
|
|
584
600
|
result.noStatus = true;
|
|
@@ -926,6 +942,36 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
926
942
|
} else if (arg === "--note-commands") {
|
|
927
943
|
// `chant build --pr-loop --note-commands` (#4785).
|
|
928
944
|
result.noteCommands = true;
|
|
945
|
+
} else if (arg === "--check-job") {
|
|
946
|
+
// `chant build --pr-loop --check-job` (#4935): the check job, chant ci check on the pull request's commit.
|
|
947
|
+
result.checkJob = true;
|
|
948
|
+
} else if (arg === "--ref-gate-status") {
|
|
949
|
+
// `chant build --pr-loop --ref-gate-status` (#4935): the job that sets the ref gate's status; on `ci forge-check` (#4913), require it.
|
|
950
|
+
result.refGateStatus = true;
|
|
951
|
+
} else if (arg === "--evidence-runner-key-secret") {
|
|
952
|
+
// `chant build --pr-loop --evidence-runner-key-secret <NAME>` (#4935): the secret holding the runner key the note job signs with.
|
|
953
|
+
result.evidenceRunnerKeySecret = args[++i];
|
|
954
|
+
if (!result.evidenceRunnerKeySecret || result.evidenceRunnerKeySecret.startsWith("-")) throw new Error("--evidence-runner-key-secret needs the secret holding the runner key: --evidence-runner-key-secret <NAME>");
|
|
955
|
+
} else if (arg === "--evidence-identity") {
|
|
956
|
+
// `chant build --pr-loop --evidence-identity oidc` (#4935, #4869): sign keyless from the job's OIDC identity.
|
|
957
|
+
result.evidenceIdentity = args[++i];
|
|
958
|
+
if (result.evidenceIdentity !== "oidc") throw new Error(`--evidence-identity takes oidc, the one identity chant signs keyless with: got "${result.evidenceIdentity ?? ""}"`);
|
|
959
|
+
} else if (arg === "--evidence-audience") {
|
|
960
|
+
// `chant build --pr-loop --evidence-identity oidc --evidence-audience <aud>` (#4935, #4869).
|
|
961
|
+
result.evidenceAudience = args[++i];
|
|
962
|
+
if (!result.evidenceAudience || result.evidenceAudience.startsWith("-")) throw new Error("--evidence-audience needs the OIDC token's audience: --evidence-audience <aud>");
|
|
963
|
+
} else if (arg === "--record-run") {
|
|
964
|
+
// `chant components pr-post --record-run <plan job>` (#4899): keep the product plan job's run record on chant/lifecycle.
|
|
965
|
+
result.recordRun = args[++i];
|
|
966
|
+
if (!result.recordRun || !/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(result.recordRun)) throw new Error(`--record-run needs the plan job's name: got "${result.recordRun ?? ""}"`);
|
|
967
|
+
} else if (arg === "--evidence-dir") {
|
|
968
|
+
// `chant components pr-post --open --evidence-dir <dir>` (#4914): each merge request's evidence.json, from the GitLab signing job.
|
|
969
|
+
result.evidenceDir = args[++i];
|
|
970
|
+
if (!result.evidenceDir || result.evidenceDir.startsWith("-")) throw new Error("--evidence-dir needs the directory the signing job kept: --evidence-dir .chant/evidence/plan");
|
|
971
|
+
} else if (arg === "--summary") {
|
|
972
|
+
// `chant ci check --summary <file>` (#4914): the check report's markdown section, appended to the file.
|
|
973
|
+
result.checkSummary = args[++i];
|
|
974
|
+
if (!result.checkSummary || result.checkSummary.startsWith("-")) throw new Error("--summary needs a file to append the check report's section to: --summary <file>");
|
|
929
975
|
} else if (arg === "--locks") {
|
|
930
976
|
// `chant components pr-notes --locks` (#4785).
|
|
931
977
|
result.locks = true;
|
package/src/cli/registry.ts
CHANGED
|
@@ -334,6 +334,8 @@ export interface ParsedArgs {
|
|
|
334
334
|
wave?: number;
|
|
335
335
|
/** `chant run wave --decide` (#3679) — plan a wide wave and decide its gate, applying nothing. */
|
|
336
336
|
decide?: boolean;
|
|
337
|
+
/** `chant run wave --policy-only` (#4926) — plan the wave and run its policy hold, applying nothing: the wave job's policy step. */
|
|
338
|
+
policyOnly?: boolean;
|
|
337
339
|
/** `chant run wave --record-plans` (#3684) — plan every wave at a pull request's head and record the digests for a `pr-review` gate. */
|
|
338
340
|
recordPlans?: boolean;
|
|
339
341
|
/** `chant run wave --approval-status` (#4630) — post `<product>/approval` on an open pull request's head under `pr-review` or `pull-request`. */
|
|
@@ -375,6 +377,10 @@ export interface ParsedArgs {
|
|
|
375
377
|
lockStage?: string;
|
|
376
378
|
/** `chant lock --from-report <file>` (#4293): lock the components a `pr-plan.json` lists. */
|
|
377
379
|
fromReport?: string;
|
|
380
|
+
/** `chant ci evidence sign --from-job <job>` (#4926): sign the checks whose steps in that job of this run passed. */
|
|
381
|
+
fromJob?: string;
|
|
382
|
+
/** `chant ci evidence sign --from-job <job> --claims <dir>` (#4926): the directory of the checks' claim files. */
|
|
383
|
+
claims?: string;
|
|
378
384
|
/** `chant lock --alive <run>` (#4552): print `alive` or `dead` for a run that holds rows or the repo lock tag. */
|
|
379
385
|
aliveRun?: string;
|
|
380
386
|
/** `chant lock --beat <run>` (#4660): the heartbeat side process of the rows a run holds. Not for people. */
|
|
@@ -589,6 +595,24 @@ export interface ParsedArgs {
|
|
|
589
595
|
staleNotes?: boolean;
|
|
590
596
|
/** `chant build --pr-loop --note-commands` (#4785): on GitLab, the scheduled job that answers the product's comment commands by polling merge request notes. */
|
|
591
597
|
noteCommands?: boolean;
|
|
598
|
+
/** `chant build --pr-loop --check-job` (#4935): the check job, `chant ci check` on the pull request's commit. */
|
|
599
|
+
checkJob?: boolean;
|
|
600
|
+
/** `chant build --pr-loop --ref-gate-status` (#4935): the job that runs `chant workspace ref-gate status` for the pull request's commit. `chant ci forge-check --ref-gate-status` (#4913): the default branch requires its status. */
|
|
601
|
+
refGateStatus?: boolean;
|
|
602
|
+
/** `chant build --pr-loop --evidence-runner-key-secret <NAME>` (#4935): the secret holding the runner key the note job signs `plan` and `policy` with. */
|
|
603
|
+
evidenceRunnerKeySecret?: string;
|
|
604
|
+
/** `chant build --pr-loop --evidence-identity oidc` (#4935, #4869): sign keyless from the job's OIDC identity. */
|
|
605
|
+
evidenceIdentity?: string;
|
|
606
|
+
/** `chant build --pr-loop --evidence-audience <aud>` (#4935, #4869): the keyless signing token's audience. */
|
|
607
|
+
evidenceAudience?: string;
|
|
608
|
+
/** `chant components pr-post --record-run <plan job>` (#4899): keep the product plan job's run record on chant/lifecycle. */
|
|
609
|
+
recordRun?: string;
|
|
610
|
+
/** `chant components pr-post --open --evidence-dir <dir>` (#4914): where the GitLab signing job kept each merge request's `evidence.json`, for the note's checks line. */
|
|
611
|
+
evidenceDir?: string;
|
|
612
|
+
/** `chant ci evidence sign --open --no-forks` (#4914): sign for no merge request from a fork. */
|
|
613
|
+
noForks?: boolean;
|
|
614
|
+
/** `chant ci check --summary <file>` (#4914): append the check report's markdown section to the file. */
|
|
615
|
+
checkSummary?: string;
|
|
592
616
|
/** `chant components pr-notes --locks` (#4785): the pipeline has the lock and unlock jobs, so a lock or unlock note starts them. */
|
|
593
617
|
locks?: boolean;
|
|
594
618
|
/** `chant components pr-post --stale` (#4628): mark the open pull requests' notes stale after the target branch moved. */
|
|
@@ -31,10 +31,11 @@ import { parseJsonText } from "../workspace/jsonc";
|
|
|
31
31
|
import { memberAtCwd } from "../workspace/security";
|
|
32
32
|
import { locateWorkspace } from "../workspace/which-chant";
|
|
33
33
|
import type { CheckStepOutcome } from "./check-steps";
|
|
34
|
-
import { CHECK_EVIDENCE_KEY_ENV, LOCAL_EVIDENCE_KEY_ENV } from "../workspace/trust/check-evidence-report";
|
|
34
|
+
import { CHECK_EVIDENCE_KEY_ENV, LOCAL_EVIDENCE_KEY_ENV, SIGNING_ID_TOKEN_VAR } from "../workspace/trust/check-evidence-report";
|
|
35
35
|
import { acceptedLocalEvidence, acceptsLocalEvidence, fetchLocalEvidence } from "../workspace/trust/local-evidence";
|
|
36
36
|
|
|
37
37
|
export { CI_CHECK_HOOK_FLOOR } from "../op/op-waves";
|
|
38
|
+
export { CHECK_SUMMARY_FLOOR } from "../release-floors";
|
|
38
39
|
|
|
39
40
|
/** The check hooks a job runs, and where they were read. */
|
|
40
41
|
export interface CheckHooksRead {
|
|
@@ -101,8 +102,8 @@ const CLOUD_CREDENTIAL_VARS = [
|
|
|
101
102
|
* else.
|
|
102
103
|
*/
|
|
103
104
|
export function checkHookEnv(env: NodeJS.ProcessEnv = process.env): Record<string, string> {
|
|
104
|
-
// #4870, #4868: the runner key and the local evidence key the check runner signs each hook's evidence with never reach a hook.
|
|
105
|
-
const drop = new Set<string>([...FORGE_TOKEN_VARS, ...OIDC_REQUEST_VARS, ...Object.values(TRADED_VARS).flat(), ...CLOUD_CREDENTIAL_VARS, CHECK_EVIDENCE_KEY_ENV, LOCAL_EVIDENCE_KEY_ENV]);
|
|
105
|
+
// #4870, #4868: the runner key and the local evidence key the check runner signs each hook's evidence with never reach a hook, nor (#4869) GitLab's signing token.
|
|
106
|
+
const drop = new Set<string>([...FORGE_TOKEN_VARS, ...OIDC_REQUEST_VARS, ...Object.values(TRADED_VARS).flat(), ...CLOUD_CREDENTIAL_VARS, CHECK_EVIDENCE_KEY_ENV, LOCAL_EVIDENCE_KEY_ENV, SIGNING_ID_TOKEN_VAR]);
|
|
106
107
|
const out: Record<string, string> = {};
|
|
107
108
|
for (const [name, value] of Object.entries(env)) {
|
|
108
109
|
if (value === undefined || drop.has(name) || name.startsWith("TF_TOKEN_")) continue;
|
|
@@ -161,6 +162,27 @@ export function passedCheckHooks(outcomes: readonly CheckHookOutcome[]): Array<{
|
|
|
161
162
|
return [...byName].filter(([, runs]) => runs.every((r) => r.outcome === "passed")).map(([check, runs]) => ({ check, runs }));
|
|
162
163
|
}
|
|
163
164
|
|
|
165
|
+
/**
|
|
166
|
+
* The check report's markdown section (#4914): a heading naming the base
|
|
167
|
+
* the hooks were read at, a line per hook run and per lexicon check step,
|
|
168
|
+
* the failure, and the checks whose evidence was signed. A product's check
|
|
169
|
+
* step keeps it in its own report or job summary (`chant ci check
|
|
170
|
+
* --summary <file>`) instead of rendering `check-hooks.json` itself. Empty
|
|
171
|
+
* when no hook is declared and no step ran.
|
|
172
|
+
*/
|
|
173
|
+
export function checkReportSummary(report: Pick<CheckHooksReport, "status" | "base" | "hooks" | "steps" | "failed" | "evidence">): string[] {
|
|
174
|
+
if (report.status === "none") return [];
|
|
175
|
+
const at = report.base === "HEAD" ? "" : ` (read at ${/^[0-9a-f]{40}$/.test(report.base) ? report.base.slice(0, 12) : report.base})`;
|
|
176
|
+
const hooks = report.hooks.map(
|
|
177
|
+
(h) => `- ${h.outcome}: \`${h.name}\`${h.target ? ` for \`${h.target}\`` : ""}${h.outcome === "failed" ? `, exit ${h.exit}` : ""}${h.reason ? ` (${h.reason})` : ""}`,
|
|
178
|
+
);
|
|
179
|
+
const steps = (report.steps ?? []).map(
|
|
180
|
+
(s) => `- ${s.outcome}: \`${s.lexicon} ${s.step}\` for \`${s.member}\`${s.stack ? ` (stack \`${s.stack}\`)` : ""}${s.outcome === "failed" ? `, exit ${s.exit}` : ""}${s.reason && s.outcome !== "failed" ? ` (${s.reason})` : ""}`,
|
|
181
|
+
);
|
|
182
|
+
const signed = report.evidence ? [`- signed: ${report.evidence.signed.map((c) => `\`${c}\``).join(", ")} as ${report.evidence.runner}`] : [];
|
|
183
|
+
return [`### Check hooks${at}`, "", ...hooks, ...steps, ...(report.failed ? [`- ${report.failed}`] : []), ...signed, ""];
|
|
184
|
+
}
|
|
185
|
+
|
|
164
186
|
/** Where {@link runCheckHooks} writes its runs file and report unless told: `.chant/check`. */
|
|
165
187
|
export const CHECK_HOOKS_DIR = ".chant/check";
|
|
166
188
|
|