@intentius/chant 0.124.28 → 0.124.29
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/build-params.d.ts +34 -1
- package/dist/build-params.d.ts.map +1 -1
- package/dist/build-params.js +31 -1
- package/dist/change-set-graph.d.ts +8 -1
- package/dist/change-set-graph.d.ts.map +1 -1
- package/dist/change-set-graph.js +4 -2
- package/dist/change-set.d.ts +10 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +4 -3
- package/dist/cli/build-params-cli.d.ts +7 -1
- package/dist/cli/build-params-cli.d.ts.map +1 -1
- package/dist/cli/build-params-cli.js +17 -8
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +6 -3
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +45 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +15 -4
- package/dist/cli/handlers/fan-out.d.ts +9 -0
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +40 -3
- package/dist/cli/handlers/lifecycle-gc.d.ts +19 -0
- package/dist/cli/handlers/lifecycle-gc.d.ts.map +1 -0
- package/dist/cli/handlers/lifecycle-gc.js +143 -0
- package/dist/cli/handlers/pr.d.ts +11 -3
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +134 -26
- package/dist/cli/handlers/promote.d.ts +7 -0
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +210 -33
- package/dist/cli/handlers/release.d.ts +62 -5
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +414 -28
- package/dist/cli/handlers/run.d.ts +11 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +67 -6
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +61 -10
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +24 -2
- package/dist/cli/registry.d.ts +15 -3
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/run-events.d.ts +3 -2
- package/dist/cli/run-events.d.ts.map +1 -1
- package/dist/cli/run-events.js +5 -3
- package/dist/components/auto-release.d.ts +2 -0
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +1 -0
- package/dist/components/capability.d.ts +9 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/driver.d.ts +8 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +35 -0
- package/dist/components/fan-out-inputs.d.ts +69 -0
- package/dist/components/fan-out-inputs.d.ts.map +1 -0
- package/dist/components/fan-out-inputs.js +169 -0
- package/dist/components/fan-out-record.d.ts +13 -0
- package/dist/components/fan-out-record.d.ts.map +1 -1
- package/dist/components/fan-out-record.js +16 -0
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +50 -0
- package/dist/components/fan-out.d.ts +4 -0
- package/dist/components/fan-out.d.ts.map +1 -1
- package/dist/components/pr-pipeline.d.ts +25 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +22 -4
- package/dist/components/promote.d.ts +23 -0
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +60 -2
- package/dist/components/release-compile.d.ts +9 -0
- package/dist/components/release-compile.d.ts.map +1 -1
- package/dist/components/release-compile.js +9 -3
- package/dist/components/release-gate.d.ts +11 -1
- package/dist/components/release-gate.d.ts.map +1 -1
- package/dist/components/release-gate.js +10 -4
- package/dist/components/wave-plan.d.ts +5 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +10 -2
- package/dist/config.d.ts +38 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/flag-params.d.ts +54 -0
- package/dist/flag-params.d.ts.map +1 -0
- package/dist/flag-params.js +130 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +120 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts.map +1 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.js +304 -0
- package/dist/lifecycle/change-set-store.d.ts +2 -1
- package/dist/lifecycle/change-set-store.d.ts.map +1 -1
- package/dist/lifecycle/change-set-store.js +2 -1
- package/dist/lifecycle/delivery-metrics.d.ts +139 -0
- package/dist/lifecycle/delivery-metrics.d.ts.map +1 -0
- package/dist/lifecycle/delivery-metrics.js +145 -0
- package/dist/lifecycle/deploy-outcome.d.ts +81 -0
- package/dist/lifecycle/deploy-outcome.d.ts.map +1 -0
- package/dist/lifecycle/deploy-outcome.js +101 -0
- package/dist/lifecycle/gate-change-set.d.ts +10 -1
- package/dist/lifecycle/gate-change-set.d.ts.map +1 -1
- package/dist/lifecycle/gate-change-set.js +35 -3
- package/dist/lifecycle/gate-ledger.d.ts +2 -3
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +30 -1
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +31 -5
- package/dist/lifecycle/index.d.ts +4 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +4 -0
- package/dist/lifecycle/mixed-environment.d.ts +95 -0
- package/dist/lifecycle/mixed-environment.d.ts.map +1 -0
- package/dist/lifecycle/mixed-environment.js +154 -0
- package/dist/lifecycle/publish-attachments.d.ts +79 -0
- package/dist/lifecycle/publish-attachments.d.ts.map +1 -0
- package/dist/lifecycle/publish-attachments.js +179 -0
- package/dist/lifecycle/publish-credentials.d.ts +37 -0
- package/dist/lifecycle/publish-credentials.d.ts.map +1 -0
- package/dist/lifecycle/publish-credentials.js +69 -0
- package/dist/lifecycle/publish-declaration.d.ts +97 -0
- package/dist/lifecycle/publish-declaration.d.ts.map +1 -0
- package/dist/lifecycle/publish-declaration.js +83 -0
- package/dist/lifecycle/publish-forge.d.ts +53 -0
- package/dist/lifecycle/publish-forge.d.ts.map +1 -0
- package/dist/lifecycle/publish-forge.js +298 -0
- package/dist/lifecycle/publish-npm.d.ts +61 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -0
- package/dist/lifecycle/publish-npm.js +242 -0
- package/dist/lifecycle/publish-oci.d.ts +64 -0
- package/dist/lifecycle/publish-oci.d.ts.map +1 -0
- package/dist/lifecycle/publish-oci.js +383 -0
- package/dist/lifecycle/publish-record.d.ts +66 -0
- package/dist/lifecycle/publish-record.d.ts.map +1 -0
- package/dist/lifecycle/publish-record.js +84 -0
- package/dist/lifecycle/publish-targets.d.ts +45 -0
- package/dist/lifecycle/publish-targets.d.ts.map +1 -0
- package/dist/lifecycle/publish-targets.js +85 -0
- package/dist/lifecycle/release-cut.d.ts +48 -1
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +116 -23
- package/dist/lifecycle/release-join.d.ts +95 -0
- package/dist/lifecycle/release-join.d.ts.map +1 -0
- package/dist/lifecycle/release-join.js +139 -0
- package/dist/lifecycle/release-publish.d.ts +312 -0
- package/dist/lifecycle/release-publish.d.ts.map +1 -0
- package/dist/lifecycle/release-publish.js +335 -0
- package/dist/lifecycle/release-revocation.d.ts +80 -0
- package/dist/lifecycle/release-revocation.d.ts.map +1 -0
- package/dist/lifecycle/release-revocation.js +123 -0
- package/dist/lifecycle/release-store.d.ts +12 -2
- package/dist/lifecycle/release-store.d.ts.map +1 -1
- package/dist/lifecycle/release-store.js +4 -2
- package/dist/lifecycle/release-verify.d.ts +61 -0
- package/dist/lifecycle/release-verify.d.ts.map +1 -0
- package/dist/lifecycle/release-verify.js +92 -0
- package/dist/lifecycle/release-workstation.d.ts +91 -0
- package/dist/lifecycle/release-workstation.d.ts.map +1 -0
- package/dist/lifecycle/release-workstation.js +180 -0
- package/dist/lifecycle/retention-policy.d.ts +45 -0
- package/dist/lifecycle/retention-policy.d.ts.map +1 -0
- package/dist/lifecycle/retention-policy.js +43 -0
- package/dist/lifecycle/retention.d.ts +185 -0
- package/dist/lifecycle/retention.d.ts.map +1 -0
- package/dist/lifecycle/retention.js +400 -0
- package/dist/plan-summary.d.ts.map +1 -1
- package/dist/plan-summary.js +8 -2
- package/dist/pr-loop.d.ts +7 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +23 -4
- package/dist/pr-report-url.d.ts +82 -0
- package/dist/pr-report-url.d.ts.map +1 -0
- package/dist/pr-report-url.js +174 -0
- package/dist/provenance.d.ts +2 -2
- package/dist/provenance.d.ts.map +1 -1
- package/dist/run-event-store.d.ts +29 -2
- package/dist/run-event-store.d.ts.map +1 -1
- package/dist/run-event-store.js +50 -3
- package/dist/run-event-stream.d.ts +2 -1
- package/dist/run-event-stream.d.ts.map +1 -1
- package/dist/run-event-stream.js +5 -1
- package/dist/run-event.d.ts +19 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/run-event.js +2 -0
- package/dist/wave-runtime.mjs +260 -229
- package/dist/workspace/__fixtures__/flag-workspace.d.ts +31 -0
- package/dist/workspace/__fixtures__/flag-workspace.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/flag-workspace.js +114 -0
- package/dist/workspace/change-set.schema.json +5 -1
- package/dist/workspace/check.schema.json +4 -2
- package/dist/workspace/checks/records.d.ts +9 -1
- package/dist/workspace/checks/records.d.ts.map +1 -1
- package/dist/workspace/checks/records.js +35 -1
- package/dist/workspace/checks.d.ts +1 -0
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/checks.js +2 -1
- package/dist/workspace/ci-green.d.ts +8 -0
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +10 -3
- package/dist/workspace/declaration.d.ts +16 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +26 -0
- package/dist/workspace/declaration.schema.json +64 -0
- package/dist/workspace/declared-kinds.d.ts +16 -0
- package/dist/workspace/declared-kinds.d.ts.map +1 -1
- package/dist/workspace/declared-kinds.js +25 -0
- package/dist/workspace/delivery-metrics.d.ts +91 -0
- package/dist/workspace/delivery-metrics.d.ts.map +1 -0
- package/dist/workspace/delivery-metrics.js +217 -0
- package/dist/workspace/delivery-metrics.schema.json +519 -0
- package/dist/workspace/flags-read.d.ts +37 -0
- package/dist/workspace/flags-read.d.ts.map +1 -0
- package/dist/workspace/flags-read.js +103 -0
- package/dist/workspace/flags.d.ts +100 -0
- package/dist/workspace/flags.d.ts.map +1 -0
- package/dist/workspace/flags.js +98 -0
- package/dist/workspace/graph-cli.js +1 -1
- package/dist/workspace/intent-cli.d.ts +11 -2
- package/dist/workspace/intent-cli.d.ts.map +1 -1
- package/dist/workspace/intent-cli.js +54 -5
- package/dist/workspace/intent-trace.d.ts +219 -0
- package/dist/workspace/intent-trace.d.ts.map +1 -0
- package/dist/workspace/intent-trace.js +314 -0
- package/dist/workspace/intent.d.ts +30 -6
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/intent.js +141 -21
- package/dist/workspace/intent.schema.json +702 -6
- package/dist/workspace/overlap.d.ts +146 -0
- package/dist/workspace/overlap.d.ts.map +1 -0
- package/dist/workspace/overlap.js +276 -0
- package/dist/workspace/reason-codes.d.ts +2 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +3 -0
- package/dist/workspace/records.d.ts +15 -2
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/records.js +32 -0
- package/dist/workspace/records.schema.json +21 -2
- package/dist/workspace/reference-kinds/flag/flag.kind.mjs +32 -0
- package/dist/workspace/reference-kinds/flag/flag.schema.json +53 -0
- package/dist/workspace/releases.d.ts +9 -0
- package/dist/workspace/releases.d.ts.map +1 -1
- package/dist/workspace/releases.js +9 -0
- package/dist/workspace/releases.schema.json +123 -1
- package/dist/workspace/run-event.schema.json +10 -3
- package/dist/workspace/status-gates.d.ts +8 -0
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status.d.ts +78 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/status.js +170 -3
- package/dist/workspace/status.schema.json +198 -1
- package/dist/workspace/wip.d.ts.map +1 -1
- package/dist/workspace/wip.js +11 -3
- package/package.json +1 -1
- package/src/build-params.test.ts +46 -0
- package/src/build-params.ts +55 -1
- package/src/change-set-graph.ts +10 -2
- package/src/change-set.ts +14 -3
- package/src/cli/build-params-cli.ts +22 -9
- package/src/cli/commands/build.ts +6 -3
- package/src/cli/handlers/approve-release.test.ts +5 -1
- package/src/cli/handlers/approve-revoked.test.ts +155 -0
- package/src/cli/handlers/approve.ts +47 -0
- package/src/cli/handlers/build.test.ts +15 -0
- package/src/cli/handlers/build.ts +17 -4
- package/src/cli/handlers/fan-out.test.ts +180 -1
- package/src/cli/handlers/fan-out.ts +38 -3
- package/src/cli/handlers/intent-trace.e2e.test.ts +201 -0
- package/src/cli/handlers/lifecycle-gc.test.ts +126 -0
- package/src/cli/handlers/lifecycle-gc.ts +146 -0
- package/src/cli/handlers/pr.test.ts +148 -1
- package/src/cli/handlers/pr.ts +139 -28
- package/src/cli/handlers/promote.test.ts +280 -2
- package/src/cli/handlers/promote.ts +210 -34
- package/src/cli/handlers/release-implicit.e2e.test.ts +12 -4
- package/src/cli/handlers/release-join.e2e.test.ts +185 -0
- package/src/cli/handlers/release-publish-targets.e2e.test.ts +295 -0
- package/src/cli/handlers/release-verify.e2e.test.ts +117 -0
- package/src/cli/handlers/release-workstation-ci.e2e.test.ts +135 -0
- package/src/cli/handlers/release.e2e.test.ts +146 -32
- package/src/cli/handlers/release.ts +415 -28
- package/src/cli/handlers/run-auto-release.test.ts +9 -0
- package/src/cli/handlers/run-release.test.ts +55 -0
- package/src/cli/handlers/run.ts +69 -5
- package/src/cli/main.test.ts +1 -0
- package/src/cli/main.ts +61 -10
- package/src/cli/parse-args.ts +19 -2
- package/src/cli/registry.ts +15 -3
- package/src/cli/run-events.ts +5 -2
- package/src/components/auto-release.test.ts +9 -0
- package/src/components/auto-release.ts +3 -0
- package/src/components/capability.ts +9 -0
- package/src/components/driver.test.ts +24 -0
- package/src/components/driver.ts +36 -0
- package/src/components/fan-out-inputs.test.ts +85 -0
- package/src/components/fan-out-inputs.ts +192 -0
- package/src/components/fan-out-record.test.ts +10 -0
- package/src/components/fan-out-record.ts +19 -0
- package/src/components/fan-out-run.ts +48 -0
- package/src/components/fan-out.ts +4 -0
- package/src/components/pr-pipeline.ts +35 -4
- package/src/components/promote.ts +68 -2
- package/src/components/release-compile.ts +17 -3
- package/src/components/release-gate.ts +18 -4
- package/src/components/wave-plan.ts +15 -2
- package/src/config.ts +8 -0
- package/src/flag-params.test.ts +144 -0
- package/src/flag-params.ts +134 -0
- package/src/lifecycle/__fixtures__/publish-fakes.ts +351 -0
- package/src/lifecycle/change-set-store.ts +2 -1
- package/src/lifecycle/delivery-metrics.ts +263 -0
- package/src/lifecycle/deploy-outcome.ts +147 -0
- package/src/lifecycle/gate-change-set.ts +37 -6
- package/src/lifecycle/gate-ledger.ts +2 -2
- package/src/lifecycle/git.ts +61 -8
- package/src/lifecycle/index.ts +4 -0
- package/src/lifecycle/mixed-environment.test.ts +97 -0
- package/src/lifecycle/mixed-environment.ts +204 -0
- package/src/lifecycle/publish-attachments.ts +196 -0
- package/src/lifecycle/publish-credentials.ts +84 -0
- package/src/lifecycle/publish-declaration.ts +95 -0
- package/src/lifecycle/publish-forge.ts +325 -0
- package/src/lifecycle/publish-npm.ts +259 -0
- package/src/lifecycle/publish-oci.ts +396 -0
- package/src/lifecycle/publish-record.ts +113 -0
- package/src/lifecycle/publish-resume.test.ts +168 -0
- package/src/lifecycle/publish-targets.test.ts +494 -0
- package/src/lifecycle/publish-targets.ts +100 -0
- package/src/lifecycle/release-cut.test.ts +74 -2
- package/src/lifecycle/release-cut.ts +158 -22
- package/src/lifecycle/release-flag.test.ts +112 -0
- package/src/lifecycle/release-join.test.ts +68 -0
- package/src/lifecycle/release-join.ts +182 -0
- package/src/lifecycle/release-publish.test.ts +225 -0
- package/src/lifecycle/release-publish.ts +568 -0
- package/src/lifecycle/release-revocation.ts +147 -0
- package/src/lifecycle/release-store.ts +15 -4
- package/src/lifecycle/release-verify.test.ts +110 -0
- package/src/lifecycle/release-verify.ts +120 -0
- package/src/lifecycle/release-workstation.test.ts +204 -0
- package/src/lifecycle/release-workstation.ts +216 -0
- package/src/lifecycle/retention-growth.e2e.test.ts +279 -0
- package/src/lifecycle/retention-policy.ts +63 -0
- package/src/lifecycle/retention.test.ts +363 -0
- package/src/lifecycle/retention.ts +508 -0
- package/src/plan-summary.test.ts +20 -0
- package/src/plan-summary.ts +8 -1
- package/src/pr-loop.ts +25 -4
- package/src/pr-report-url.test.ts +131 -0
- package/src/pr-report-url.ts +209 -0
- package/src/provenance.ts +2 -2
- package/src/run-event-store.ts +63 -3
- package/src/run-event-stream.ts +4 -1
- package/src/run-event.ts +21 -1
- package/src/workspace/__fixtures__/flag-workspace.ts +132 -0
- package/src/workspace/__fixtures__/older-records/change-set-984534ea9.json +100 -0
- package/src/workspace/__fixtures__/older-records/older-records.json +326 -0
- package/src/workspace/change-set.schema.json +5 -1
- package/src/workspace/check.schema.json +4 -2
- package/src/workspace/checks/records.ts +35 -1
- package/src/workspace/checks.ts +2 -1
- package/src/workspace/ci-green.ts +14 -3
- package/src/workspace/declaration.schema.json +64 -0
- package/src/workspace/declaration.test.ts +28 -0
- package/src/workspace/declaration.ts +38 -0
- package/src/workspace/declared-kinds.ts +40 -1
- package/src/workspace/delivery-metrics.schema.json +519 -0
- package/src/workspace/delivery-metrics.test.ts +236 -0
- package/src/workspace/delivery-metrics.ts +286 -0
- package/src/workspace/flags-read.ts +121 -0
- package/src/workspace/flags.test.ts +141 -0
- package/src/workspace/flags.ts +157 -0
- package/src/workspace/graph-cli.ts +1 -1
- package/src/workspace/intent-cli.ts +46 -5
- package/src/workspace/intent-trace.test.ts +173 -0
- package/src/workspace/intent-trace.ts +484 -0
- package/src/workspace/intent.schema.json +702 -6
- package/src/workspace/intent.ts +148 -25
- package/src/workspace/older-records.test.ts +412 -0
- package/src/workspace/overlap.test.ts +165 -0
- package/src/workspace/overlap.ts +340 -0
- package/src/workspace/read-contract.e2e.test.ts +2 -1
- package/src/workspace/reason-codes.test.ts +5 -0
- package/src/workspace/reason-codes.ts +3 -0
- package/src/workspace/record-assets.test.ts +2 -1
- package/src/workspace/records-contract.e2e.test.ts +2 -1
- package/src/workspace/records.schema.json +21 -2
- package/src/workspace/records.ts +36 -2
- package/src/workspace/reference-kinds/flag/flag.kind.mjs +32 -0
- package/src/workspace/reference-kinds/flag/flag.schema.json +53 -0
- package/src/workspace/releases.schema.json +123 -1
- package/src/workspace/releases.ts +11 -0
- package/src/workspace/run-event.schema.json +10 -3
- package/src/workspace/status-contract.test.ts +29 -0
- package/src/workspace/status-gates.ts +8 -0
- package/src/workspace/status-mixed.test.ts +152 -0
- package/src/workspace/status-revoked.test.ts +153 -0
- package/src/workspace/status.schema.json +198 -1
- package/src/workspace/status.ts +254 -3
- package/src/workspace/wip.ts +11 -2
|
@@ -179,6 +179,58 @@
|
|
|
179
179
|
"$ref": "#/$defs/ciGreen"
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
+
},
|
|
183
|
+
"retention": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"additionalProperties": false,
|
|
186
|
+
"patternProperties": {
|
|
187
|
+
"^x-": true
|
|
188
|
+
},
|
|
189
|
+
"description": "How long chant lifecycle gc keeps each kind of stored record (#4036). A kind or field left out keeps its default: changeSets 14 days; releases 14 days and the newest 10 of each member; runEvents 14 days and the newest 100. Whatever the policy, gc never prunes a release an environment runs, what a pending gate binds, or a change set a gate names with a kept release. Read from the declaration at base. Added in schema 1 by chant 0.124.29, so a declaration that uses it sets minReader to 0.124.29 or newer.",
|
|
190
|
+
"properties": {
|
|
191
|
+
"changeSets": {
|
|
192
|
+
"type": "object",
|
|
193
|
+
"additionalProperties": false,
|
|
194
|
+
"description": "Stored change sets, _change-sets/<digest>.json on chant/lifecycle.",
|
|
195
|
+
"properties": {
|
|
196
|
+
"days": { "$ref": "#/$defs/retentionDays" }
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"releases": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"additionalProperties": false,
|
|
202
|
+
"description": "Releases, _releases/<digest>.json on chant/lifecycle, with the template bytes only they name. A release stays promotable for days after its newest cut, and the newest keep releases of each member stay promotable at any age, unless their commit is revoked.",
|
|
203
|
+
"properties": {
|
|
204
|
+
"days": { "$ref": "#/$defs/retentionDays" },
|
|
205
|
+
"keep": { "$ref": "#/$defs/retentionKeep" }
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"runEvents": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"additionalProperties": false,
|
|
211
|
+
"description": "Run event files, <git-common-dir>/chant/run-events/<run>.jsonl on each host. A file is kept for days after its last write, and the newest keep files at any age.",
|
|
212
|
+
"properties": {
|
|
213
|
+
"days": { "$ref": "#/$defs/retentionDays" },
|
|
214
|
+
"keep": { "$ref": "#/$defs/retentionKeep" }
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"metrics": {
|
|
220
|
+
"type": "object",
|
|
221
|
+
"additionalProperties": false,
|
|
222
|
+
"patternProperties": {
|
|
223
|
+
"^x-": true
|
|
224
|
+
},
|
|
225
|
+
"description": "How chant workspace metrics counts the DORA metrics (#4039). Added in schema 1 by chant 0.124.29, so a declaration that uses it sets minReader to 0.124.29 or newer.",
|
|
226
|
+
"properties": {
|
|
227
|
+
"failureWindowDays": {
|
|
228
|
+
"type": "integer",
|
|
229
|
+
"minimum": 1,
|
|
230
|
+
"maximum": 365,
|
|
231
|
+
"description": "A deploy counts as failed when, within this many days after it, the commit it deployed is revoked or the environment is rolled back from it. The default is 7."
|
|
232
|
+
}
|
|
233
|
+
}
|
|
182
234
|
}
|
|
183
235
|
},
|
|
184
236
|
"patternProperties": {
|
|
@@ -186,6 +238,18 @@
|
|
|
186
238
|
},
|
|
187
239
|
"additionalProperties": false,
|
|
188
240
|
"$defs": {
|
|
241
|
+
"retentionDays": {
|
|
242
|
+
"type": "integer",
|
|
243
|
+
"minimum": 0,
|
|
244
|
+
"maximum": 36500,
|
|
245
|
+
"description": "Days a record is kept past its last write or use. 0 lets every record go that no never-prune rule keeps."
|
|
246
|
+
},
|
|
247
|
+
"retentionKeep": {
|
|
248
|
+
"type": "integer",
|
|
249
|
+
"minimum": 0,
|
|
250
|
+
"maximum": 100000,
|
|
251
|
+
"description": "How many of the newest are kept at any age."
|
|
252
|
+
},
|
|
189
253
|
"name": {
|
|
190
254
|
"type": "string",
|
|
191
255
|
"pattern": "^[a-z0-9][a-z0-9-]{0,39}$",
|
|
@@ -421,3 +421,31 @@ describe("diagram artifacts (#2764)", () => {
|
|
|
421
421
|
expect(failure(base([member([diagram({ render: "../out.svg" })])])).code).toBe("declaration-invalid");
|
|
422
422
|
});
|
|
423
423
|
});
|
|
424
|
+
|
|
425
|
+
describe("retention (#4036)", () => {
|
|
426
|
+
test("the block is read as written, without x- keys, and is null when absent", () => {
|
|
427
|
+
expect(parse(base([])).retention).toBeNull();
|
|
428
|
+
const d = parse(base([], { minReader: "0.80.0", retention: { changeSets: { days: 30 }, releases: { keep: 3 }, runEvents: { days: 2, keep: 5 }, "x-why": "audits" } }));
|
|
429
|
+
expect(d.retention).toEqual({ changeSets: { days: 30 }, releases: { keep: 3 }, runEvents: { days: 2, keep: 5 } });
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
test("an unknown kind or field, a negative or fractional number, and keep on changeSets are refused", () => {
|
|
433
|
+
for (const retention of [{ plans: { days: 1 } }, { releases: { days: -1 } }, { releases: { days: 1.5 } }, { changeSets: { keep: 2 } }, { runEvents: { hours: 2 } }]) {
|
|
434
|
+
expect(failure(base([], { retention })).code).toBe("declaration-invalid");
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
describe("metrics (#4039)", () => {
|
|
440
|
+
test("failureWindowDays is read as written, without x- keys, and the block is null when absent", () => {
|
|
441
|
+
expect(parse(base([])).metrics).toBeNull();
|
|
442
|
+
expect(parse(base([], { minReader: "0.80.0", metrics: { failureWindowDays: 14, "x-why": "weekly" } })).metrics).toEqual({ failureWindowDays: 14 });
|
|
443
|
+
expect(parse(base([], { metrics: {} })).metrics).toEqual({});
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
test("an unknown field, 0, a fraction and more than a year are refused", () => {
|
|
447
|
+
for (const metrics of [{ window: 7 }, { failureWindowDays: 0 }, { failureWindowDays: 1.5 }, { failureWindowDays: 366 }]) {
|
|
448
|
+
expect(failure(base([], { metrics })).code).toBe("declaration-invalid");
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
});
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* runs. The level-0 goldens (#2526) fail if a level-0 command loads it.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import { RETENTION_KINDS, type RetentionOverride } from "../lifecycle/retention-policy";
|
|
19
20
|
import schema from "./declaration.schema.json" with { type: "json" };
|
|
20
21
|
import { expandGlob } from "./glob";
|
|
21
22
|
import { EXAMPLES_KIND, holdsChantProject } from "./kinds";
|
|
@@ -601,6 +602,19 @@ export interface Declaration {
|
|
|
601
602
|
identity: IdentityPolicy | null;
|
|
602
603
|
/** What the workspace's CI decides about its commits (#3573), or null when the declaration has no `ci` block. */
|
|
603
604
|
ci: CiDeclaration | null;
|
|
605
|
+
/**
|
|
606
|
+
* The `retention` block as written (#4036): the kinds and fields it sets,
|
|
607
|
+
* which `resolveRetention` (../lifecycle/retention-policy.ts) lays over the
|
|
608
|
+
* defaults. Null when the declaration has no `retention` block.
|
|
609
|
+
*/
|
|
610
|
+
retention: RetentionOverride | null;
|
|
611
|
+
/**
|
|
612
|
+
* The `metrics` block (#4039): `failureWindowDays`, the days after a deploy
|
|
613
|
+
* in which a revocation or a rollback counts it as failed, when set. Null
|
|
614
|
+
* when the declaration has no `metrics` block; `chant workspace metrics`
|
|
615
|
+
* then uses 7.
|
|
616
|
+
*/
|
|
617
|
+
metrics: { failureWindowDays?: number } | null;
|
|
604
618
|
/** The file, relative to the workspace root's tree (`chant.workspace.json` or `.jsonc`). */
|
|
605
619
|
file: string;
|
|
606
620
|
}
|
|
@@ -977,6 +991,8 @@ export function parseDeclaration(text: string, file: string, reader: string = re
|
|
|
977
991
|
agents,
|
|
978
992
|
identity: identityOf(obj.identity),
|
|
979
993
|
ci,
|
|
994
|
+
retention: retentionOf(obj.retention),
|
|
995
|
+
metrics: metricsOf(obj.metrics),
|
|
980
996
|
file,
|
|
981
997
|
};
|
|
982
998
|
written.set(declaration, raw);
|
|
@@ -1047,6 +1063,28 @@ function identityOf(raw: unknown): IdentityPolicy | null {
|
|
|
1047
1063
|
* The `ci` block, already validated by the schema, with its defaults and the
|
|
1048
1064
|
* rule the schema can't say (#3573): every phase `require` names is declared.
|
|
1049
1065
|
*/
|
|
1066
|
+
/** The `metrics` block, already validated by the schema, without its `x-` keys (#4039). */
|
|
1067
|
+
function metricsOf(raw: unknown): { failureWindowDays?: number } | null {
|
|
1068
|
+
if (!raw || typeof raw !== "object") return null;
|
|
1069
|
+
const days = (raw as { failureWindowDays?: unknown }).failureWindowDays;
|
|
1070
|
+
return typeof days === "number" ? { failureWindowDays: days } : {};
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
/** The `retention` block, already validated by the schema, without its `x-` keys (#4036). */
|
|
1074
|
+
function retentionOf(raw: unknown): RetentionOverride | null {
|
|
1075
|
+
if (!raw || typeof raw !== "object") return null;
|
|
1076
|
+
const out: RetentionOverride = {};
|
|
1077
|
+
for (const kind of RETENTION_KINDS) {
|
|
1078
|
+
const k = (raw as Record<string, Record<string, unknown> | undefined>)[kind];
|
|
1079
|
+
if (!k) continue;
|
|
1080
|
+
out[kind] = {
|
|
1081
|
+
...(typeof k.days === "number" ? { days: k.days } : {}),
|
|
1082
|
+
...(typeof k.keep === "number" ? { keep: k.keep } : {}),
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
return out;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1050
1088
|
function ciOf(raw: unknown, at: (pointer: string, key?: boolean) => ErrorLocation): CiDeclaration | null {
|
|
1051
1089
|
if (raw === undefined) return null;
|
|
1052
1090
|
const block = raw as { green?: { branch: string; window?: string; phases: Record<string, string[] | { runs: string[]; skipped?: CiSkipped }>; require: string[]; signedSince?: string; source?: CiSource } };
|
|
@@ -43,6 +43,22 @@ export interface DeclaredKind {
|
|
|
43
43
|
* and when its records can't be read (`records` reports why).
|
|
44
44
|
*/
|
|
45
45
|
acceptance?: DeclaredAcceptance[];
|
|
46
|
+
/**
|
|
47
|
+
* For a flag kind (#4024), read with `flags: true`: each current flag
|
|
48
|
+
* record, with its `flag-stale` warning when it is due for removal. Absent
|
|
49
|
+
* for any other kind, when the kind wasn't loaded, and when its records
|
|
50
|
+
* can't be read (`records` reports why).
|
|
51
|
+
*/
|
|
52
|
+
flags?: DeclaredFlag[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** One flag record, as `check` reads it for WSP118 (#4024). */
|
|
56
|
+
export interface DeclaredFlag {
|
|
57
|
+
flag: string;
|
|
58
|
+
/** The record file on disk, absolute. */
|
|
59
|
+
file: string;
|
|
60
|
+
/** The record's `flag-stale` warning, when the flag is due for removal; null otherwise. */
|
|
61
|
+
stale: string | null;
|
|
46
62
|
}
|
|
47
63
|
|
|
48
64
|
/** One work record's acceptance criteria, counted, as `ls`, `status` and `check` read them (#2772). */
|
|
@@ -72,7 +88,7 @@ export async function loadDeclaredKinds(
|
|
|
72
88
|
declaration: Declaration,
|
|
73
89
|
tree: WorkspaceTree,
|
|
74
90
|
rootOnDisk: string,
|
|
75
|
-
options: { load?: boolean; acceptance?: boolean; at?: string } = {},
|
|
91
|
+
options: { load?: boolean; acceptance?: boolean; flags?: boolean; at?: string } = {},
|
|
76
92
|
): Promise<DeclaredKind[]> {
|
|
77
93
|
const declared = declaredRecordKinds(declaration);
|
|
78
94
|
if (declared.length === 0) return [];
|
|
@@ -96,6 +112,10 @@ export async function loadDeclaredKinds(
|
|
|
96
112
|
const counted = await countAcceptance(file, rootOnDisk, options.at);
|
|
97
113
|
if (counted) entry.acceptance = counted;
|
|
98
114
|
}
|
|
115
|
+
if (loaded.kind.flag && options.flags) {
|
|
116
|
+
const flags = await readFlags(file, rootOnDisk, options.at);
|
|
117
|
+
if (flags) entry.flags = flags;
|
|
118
|
+
}
|
|
99
119
|
out.push(entry);
|
|
100
120
|
} catch (err) {
|
|
101
121
|
if (!(err instanceof records.RecordReadError)) throw err;
|
|
@@ -128,6 +148,25 @@ async function countAcceptance(file: string, rootOnDisk: string, at: string | un
|
|
|
128
148
|
}
|
|
129
149
|
}
|
|
130
150
|
|
|
151
|
+
/** A flag kind's current records with their stale warnings (#4024), or undefined when they can't be read. */
|
|
152
|
+
async function readFlags(file: string, rootOnDisk: string, at: string | undefined): Promise<DeclaredFlag[] | undefined> {
|
|
153
|
+
const { readRecordsFor } = await import("./records-cli");
|
|
154
|
+
const { RecordReadError } = await import("./records");
|
|
155
|
+
try {
|
|
156
|
+
const read = await readRecordsFor({ kind: file, cwd: rootOnDisk, current: true, ...(at !== undefined ? { at } : {}) });
|
|
157
|
+
return read.result.records
|
|
158
|
+
.filter((r): r is typeof r & { id: string } => r.id !== null)
|
|
159
|
+
.map((r) => ({
|
|
160
|
+
flag: r.id,
|
|
161
|
+
file: join(read.root, ...r.path.split("/")),
|
|
162
|
+
stale: r.warnings.find((w) => w.code === "flag-stale")?.message ?? null,
|
|
163
|
+
}));
|
|
164
|
+
} catch (err) {
|
|
165
|
+
if (err instanceof RecordReadError) return undefined;
|
|
166
|
+
throw err;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
131
170
|
/** An answer kind's points file (ws-058), read from `tree` and validated as `points ask` reads it. */
|
|
132
171
|
async function checkPoints(abs: string, rootOnDisk: string, tree: WorkspaceTree): Promise<NonNullable<DeclaredKind["points"]>> {
|
|
133
172
|
const file = relative(rootOnDisk, abs).split(sep).join("/");
|