@intentius/chant 0.124.28 → 0.124.30
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 +18 -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 +67 -8
- 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 +91 -10
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +73 -2
- package/dist/cli/registry.d.ts +32 -4
- 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 +49 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +38 -4
- package/dist/components/pr-run.d.ts +20 -2
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +26 -13
- 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 +16 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +36 -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-ledger.d.ts +8 -3
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +2 -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/lifecycle/run-ledger.d.ts +1 -1
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +9 -0
- package/dist/op/activities/activity-contracts.d.ts +1 -0
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.js +1 -0
- package/dist/op/activities/shell.d.ts +6 -0
- package/dist/op/activities/shell.d.ts.map +1 -1
- package/dist/op/activities/shell.js +1 -1
- package/dist/op/local-executor.d.ts +23 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +9 -3
- package/dist/op/runtime.d.ts +27 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtime.js +20 -0
- package/dist/plan-summary.d.ts.map +1 -1
- package/dist/plan-summary.js +8 -2
- package/dist/pr-forge.d.ts +23 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +44 -0
- package/dist/pr-loop.d.ts +17 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +30 -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 +4 -3
- package/dist/run-event-stream.d.ts.map +1 -1
- package/dist/run-event-stream.js +7 -3
- package/dist/run-event.d.ts +34 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/run-event.js +4 -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-forge.d.ts +2 -0
- package/dist/workspace/ci-green-forge.d.ts.map +1 -1
- package/dist/workspace/ci-green.d.ts +10 -0
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +14 -5
- package/dist/workspace/ci-run.d.ts +222 -0
- package/dist/workspace/ci-run.d.ts.map +1 -0
- package/dist/workspace/ci-run.js +464 -0
- package/dist/workspace/ci-serve.d.ts +214 -0
- package/dist/workspace/ci-serve.d.ts.map +1 -0
- package/dist/workspace/ci-serve.js +412 -0
- 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/pr-report.schema.json +5 -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 +24 -6
- package/dist/workspace/status-gates.d.ts +8 -0
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status-stewards.d.ts +2 -0
- package/dist/workspace/status-stewards.d.ts.map +1 -1
- package/dist/workspace/status-stewards.js +1 -0
- 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 +210 -2
- 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 +30 -0
- package/src/cli/handlers/build.ts +20 -4
- package/src/cli/handlers/fan-out.test.ts +262 -1
- package/src/cli/handlers/fan-out.ts +72 -8
- 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 +144 -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 +91 -10
- package/src/cli/parse-args.ts +54 -2
- package/src/cli/registry.ts +32 -4
- 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 +67 -4
- package/src/components/pr-run.test.ts +127 -0
- package/src/components/pr-run.ts +32 -12
- 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 +45 -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-ledger.ts +9 -3
- 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/lifecycle/run-ledger.ts +7 -1
- package/src/op/activities/activity-contracts.ts +1 -0
- package/src/op/activities/shell.ts +7 -1
- package/src/op/local-executor.ts +27 -4
- package/src/op/runtime.ts +42 -0
- package/src/plan-summary.test.ts +20 -0
- package/src/plan-summary.ts +8 -1
- package/src/pr-forge.test.ts +25 -0
- package/src/pr-forge.ts +62 -0
- package/src/pr-loop.test.ts +13 -1
- package/src/pr-loop.ts +41 -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 +8 -4
- package/src/run-event.ts +38 -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-forge.ts +2 -0
- package/src/workspace/ci-green.ts +20 -5
- package/src/workspace/ci-run.test.ts +416 -0
- package/src/workspace/ci-run.ts +571 -0
- package/src/workspace/ci-serve.test.ts +268 -0
- package/src/workspace/ci-serve.ts +521 -0
- 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/pr-report.schema.json +5 -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 +24 -6
- 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-stewards.ts +3 -0
- package/src/workspace/status.schema.json +210 -2
- package/src/workspace/status.ts +254 -3
- package/src/workspace/wip.ts +11 -2
|
@@ -47,12 +47,14 @@
|
|
|
47
47
|
* environment has no deploy of the component). When they are all equal the
|
|
48
48
|
* member has no entries. When the environment's deploy names no release, or
|
|
49
49
|
* the release it names can't be read, the member has a hole: nothing says
|
|
50
|
-
* what the environment runs, so the change can't be shown empty.
|
|
50
|
+
* what the environment runs, so the change can't be shown empty. So does a
|
|
51
|
+
* component a promote, rollback or redeploy left failed or gated with nothing
|
|
52
|
+
* recorded since (#4035): its record names what ran before that run.
|
|
51
53
|
*/
|
|
52
54
|
import { deployContext, resolveComponentGraph, resolveStepInput } from "./driver.js";
|
|
53
55
|
import { componentPlanDigest } from "./gate-plan.js";
|
|
54
56
|
import { gateName, RELEASE_GATE_OP } from "../op/gate-name.js";
|
|
55
|
-
import { capabilitySteps, readComponentOutputs } from "./wave-plan.js";
|
|
57
|
+
import { capabilitySteps, planContext, readComponentOutputs } from "./wave-plan.js";
|
|
56
58
|
import { composeChangeSet, isEmptyChangeSet, } from "../change-set.js";
|
|
57
59
|
/** The gate ledger every release gate is recorded in: `_gates/release.jsonl`, under the member's prefix. */
|
|
58
60
|
export { RELEASE_GATE_OP };
|
|
@@ -140,6 +142,10 @@ export function chantComponentPart(input) {
|
|
|
140
142
|
},
|
|
141
143
|
],
|
|
142
144
|
});
|
|
145
|
+
if (input.unsettled !== undefined) {
|
|
146
|
+
member.holes.push({ address: name, type: RELEASE_COMPONENT_ENTRY_TYPE, reason: input.unsettled });
|
|
147
|
+
return { member, entries: [] };
|
|
148
|
+
}
|
|
143
149
|
if (!current) {
|
|
144
150
|
return entry("create", [
|
|
145
151
|
{ path: "artifact", after: digest },
|
|
@@ -193,7 +199,7 @@ export async function planReleaseChangeSet(input) {
|
|
|
193
199
|
const digest = input.digests.get(name) ?? "";
|
|
194
200
|
const plannable = capabilitySteps(component.deploy).filter((s) => registry.has(s.kind) && registry.resolve(s.kind).plan !== undefined);
|
|
195
201
|
if (plannable.length === 0) {
|
|
196
|
-
parts.push(chantComponentPart({ component, release, env, digest, current: input.current.get(name) }));
|
|
202
|
+
parts.push(chantComponentPart({ component, release, env, digest, current: input.current.get(name), unsettled: input.unsettled?.get(name) }));
|
|
197
203
|
continue;
|
|
198
204
|
}
|
|
199
205
|
const ctx = deployContext({ env }, name);
|
|
@@ -208,7 +214,7 @@ export async function planReleaseChangeSet(input) {
|
|
|
208
214
|
}
|
|
209
215
|
for (const step of plannable) {
|
|
210
216
|
const { kind, ...rest } = step;
|
|
211
|
-
const planned = await registry.resolve(kind).plan(ctx, resolveStepInput(rest, {}, outputs));
|
|
217
|
+
const planned = await registry.resolve(kind).plan(planContext(ctx, rest, outputs), resolveStepInput(rest, {}, outputs));
|
|
212
218
|
parts.push(planned.changeSet ?? {
|
|
213
219
|
member: {
|
|
214
220
|
member: planned.member,
|
|
@@ -39,6 +39,11 @@ export type WaveComponentPlan = {
|
|
|
39
39
|
};
|
|
40
40
|
/** Every capability step in a composition, nested phases included, gates left out. */
|
|
41
41
|
export declare function capabilitySteps(phases: readonly DriverPhase[]): DriverStep[];
|
|
42
|
+
/**
|
|
43
|
+
* The context a step is planned with: `ctx`, plus the components whose
|
|
44
|
+
* outputs the step reads and could not read yet (`unresolvedInputs`, #4084).
|
|
45
|
+
*/
|
|
46
|
+
export declare function planContext(ctx: DeployContext, stepInput: Record<string, unknown>, componentOutputs: Record<string, Record<string, unknown>>): DeployContext;
|
|
42
47
|
/** Plan one component against the outputs earlier waves produced. Never throws: a failure comes back as `error`. */
|
|
43
48
|
export declare function planWaveComponent(component: DriverComponent, registry: CapabilityRegistry, ctx: DeployContext, componentOutputs: Record<string, Record<string, unknown>>): Promise<WaveComponentPlan>;
|
|
44
49
|
/**
|
|
@@ -48,4 +53,15 @@ export declare function planWaveComponent(component: DriverComponent, registry:
|
|
|
48
53
|
* the components a planned one depends on, before anything has applied.
|
|
49
54
|
*/
|
|
50
55
|
export declare function readComponentOutputs(component: DriverComponent, registry: CapabilityRegistry, ctx: DeployContext, componentOutputs: Record<string, Record<string, unknown>>): Promise<Record<string, unknown> | undefined>;
|
|
56
|
+
/**
|
|
57
|
+
* Read the deployed outputs of each of `names` that `outputs` holds nothing
|
|
58
|
+
* for yet (#4104), through {@link readComponentOutputs}, and add them to
|
|
59
|
+
* `outputs`. A name that is not among `components`, or whose steps cannot
|
|
60
|
+
* say, is left out, so its dependents' references stay unresolved. Returns,
|
|
61
|
+
* per component read, the names of the outputs the read gave, sorted.
|
|
62
|
+
*
|
|
63
|
+
* `components` must be the whole graph, not the selection: the dependency a
|
|
64
|
+
* selected member reads is often one the change did not select.
|
|
65
|
+
*/
|
|
66
|
+
export declare function readDeployedOutputs(names: readonly string[], components: ReadonlyMap<string, DriverComponent>, registry: CapabilityRegistry, ctxOf: (component: string) => DeployContext, outputs: Record<string, Record<string, unknown>>): Promise<Record<string, string[]>>;
|
|
51
67
|
//# sourceMappingURL=wave-plan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wave-plan.d.ts","sourceRoot":"","sources":["../../src/components/wave-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"wave-plan.d.ts","sourceRoot":"","sources":["../../src/components/wave-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAA6C,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE9H,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GACzB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAA;CAAE,GACpG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAUzC,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG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.*`) resolves.
|
|
20
20
|
*/
|
|
21
|
-
import { resolveStepInput } from "./driver.js";
|
|
21
|
+
import { resolveStepInput, unresolvedWiringSources } from "./driver.js";
|
|
22
22
|
import { componentPlanDigest } from "./gate-plan.js";
|
|
23
23
|
/** A part with no entries, for a member whose planner describes no changes. */
|
|
24
24
|
function emptyPart(member) {
|
|
@@ -45,6 +45,14 @@ export function capabilitySteps(phases) {
|
|
|
45
45
|
walk(phase.steps);
|
|
46
46
|
return out;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The context a step is planned with: `ctx`, plus the components whose
|
|
50
|
+
* outputs the step reads and could not read yet (`unresolvedInputs`, #4084).
|
|
51
|
+
*/
|
|
52
|
+
export function planContext(ctx, stepInput, componentOutputs) {
|
|
53
|
+
const unresolved = unresolvedWiringSources(stepInput, componentOutputs);
|
|
54
|
+
return unresolved.length > 0 ? { ...ctx, unresolvedInputs: unresolved } : ctx;
|
|
55
|
+
}
|
|
48
56
|
/** Plan one component against the outputs earlier waves produced. Never throws: a failure comes back as `error`. */
|
|
49
57
|
export async function planWaveComponent(component, registry, ctx, componentOutputs) {
|
|
50
58
|
try {
|
|
@@ -57,7 +65,7 @@ export async function planWaveComponent(component, registry, ctx, componentOutpu
|
|
|
57
65
|
continue;
|
|
58
66
|
const { kind: _kind, ...rest } = step;
|
|
59
67
|
const input = resolveStepInput(rest, {}, componentOutputs);
|
|
60
|
-
const planned = await capability.plan(ctx, input);
|
|
68
|
+
const planned = await capability.plan(planContext(ctx, rest, componentOutputs), input);
|
|
61
69
|
const member = { member: planned.member, planDigest: planned.planDigest };
|
|
62
70
|
members.push(member);
|
|
63
71
|
parts.push(planned.changeSet ?? emptyPart(member));
|
|
@@ -100,3 +108,29 @@ export async function readComponentOutputs(component, registry, ctx, componentOu
|
|
|
100
108
|
}
|
|
101
109
|
return found;
|
|
102
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Read the deployed outputs of each of `names` that `outputs` holds nothing
|
|
113
|
+
* for yet (#4104), through {@link readComponentOutputs}, and add them to
|
|
114
|
+
* `outputs`. A name that is not among `components`, or whose steps cannot
|
|
115
|
+
* say, is left out, so its dependents' references stay unresolved. Returns,
|
|
116
|
+
* per component read, the names of the outputs the read gave, sorted.
|
|
117
|
+
*
|
|
118
|
+
* `components` must be the whole graph, not the selection: the dependency a
|
|
119
|
+
* selected member reads is often one the change did not select.
|
|
120
|
+
*/
|
|
121
|
+
export async function readDeployedOutputs(names, components, registry, ctxOf, outputs) {
|
|
122
|
+
const read = {};
|
|
123
|
+
for (const name of names) {
|
|
124
|
+
if (name in outputs || name in read)
|
|
125
|
+
continue;
|
|
126
|
+
const component = components.get(name);
|
|
127
|
+
if (!component)
|
|
128
|
+
continue;
|
|
129
|
+
const found = await readComponentOutputs(component, registry, ctxOf(name), outputs);
|
|
130
|
+
if (!found)
|
|
131
|
+
continue;
|
|
132
|
+
outputs[name] = found;
|
|
133
|
+
read[name] = Object.keys(found).sort();
|
|
134
|
+
}
|
|
135
|
+
return read;
|
|
136
|
+
}
|
package/dist/config.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { BuildParamsConfig } from "./build-params.js";
|
|
|
8
8
|
import type { BuildParamProvenance } from "./provenance.js";
|
|
9
9
|
import { type LexiconDeclaration } from "./lexicon-module.js";
|
|
10
10
|
import { type DecideConfig } from "./op/decide-config.js";
|
|
11
|
+
import { type PublishDeclaration } from "./lifecycle/publish-declaration.js";
|
|
11
12
|
/**
|
|
12
13
|
* One project-declared environment (chant #1166). Historically always a bare
|
|
13
14
|
* name (`"floci"`); an entry can now instead carry the endpoint that
|
|
@@ -119,6 +120,37 @@ export declare const ChantConfigSchema: z.ZodObject<{
|
|
|
119
120
|
}, z.core.$strip>>>;
|
|
120
121
|
release: z.ZodOptional<z.ZodObject<{
|
|
121
122
|
autoRecord: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
publish: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
124
|
+
type: z.ZodLiteral<"npm">;
|
|
125
|
+
packages: z.ZodArray<z.ZodString>;
|
|
126
|
+
registry: z.ZodOptional<z.ZodString>;
|
|
127
|
+
access: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
public: "public";
|
|
129
|
+
restricted: "restricted";
|
|
130
|
+
}>>;
|
|
131
|
+
sbom: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
132
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
133
|
+
type: z.ZodLiteral<"oci">;
|
|
134
|
+
image: z.ZodString;
|
|
135
|
+
repository: z.ZodString;
|
|
136
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
137
|
+
usernameEnv: z.ZodOptional<z.ZodString>;
|
|
138
|
+
passwordEnv: z.ZodOptional<z.ZodString>;
|
|
139
|
+
sbom: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
140
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
141
|
+
type: z.ZodLiteral<"forge">;
|
|
142
|
+
forge: z.ZodEnum<{
|
|
143
|
+
forgejo: "forgejo";
|
|
144
|
+
github: "github";
|
|
145
|
+
gitlab: "gitlab";
|
|
146
|
+
}>;
|
|
147
|
+
repo: z.ZodString;
|
|
148
|
+
api: z.ZodOptional<z.ZodString>;
|
|
149
|
+
assets: z.ZodArray<z.ZodString>;
|
|
150
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
151
|
+
tokenEnv: z.ZodOptional<z.ZodString>;
|
|
152
|
+
sbom: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
153
|
+
}, z.core.$strict>], "type">>>;
|
|
122
154
|
}, z.core.$strip>>;
|
|
123
155
|
run: z.ZodOptional<z.ZodObject<{
|
|
124
156
|
on: z.ZodOptional<z.ZodString>;
|
|
@@ -349,6 +381,12 @@ export interface ChantConfig {
|
|
|
349
381
|
release?: {
|
|
350
382
|
/** Set false to disable auto-emitting a release record after a successful component deploy project-wide. The `--no-release-record` CLI flag overrides this per-invocation. */
|
|
351
383
|
autoRecord?: boolean;
|
|
384
|
+
/**
|
|
385
|
+
* Where `chant release publish` publishes a cut release (#4047): npm
|
|
386
|
+
* packages, an image in an OCI registry, release assets on a forge. Run in
|
|
387
|
+
* the order given. See ./lifecycle/publish-declaration.ts.
|
|
388
|
+
*/
|
|
389
|
+
publish?: PublishDeclaration[];
|
|
352
390
|
};
|
|
353
391
|
/** Defaults for `chant run` and its subcommands (#2523). */
|
|
354
392
|
run?: {
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,EAA8D,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvH,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACh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ACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,uBAAuB,CAanF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAiB1E;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IACnB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM;IAAlD,YAAY,OAAO,EAAE,MAAM,EAAW,GAAG,CAAC,EAAE,MAAM,YAAA,EAEjD;CACF"}
|
package/dist/config.js
CHANGED
|
@@ -6,6 +6,7 @@ import { findProjectConfig } from "./project-root.js";
|
|
|
6
6
|
import { evaluateProjectConfig } from "./config-sandbox.js";
|
|
7
7
|
import { lexiconNames, pathLexiconRoot, registerLexiconDeclarations } from "./lexicon-module.js";
|
|
8
8
|
import { decideConfigSchema } from "./op/decide-config.js";
|
|
9
|
+
import { PublishDeclarationSchema } from "./lifecycle/publish-declaration.js";
|
|
9
10
|
/** The declared name of one `environments` entry, whichever form it takes. */
|
|
10
11
|
export function environmentName(entry) {
|
|
11
12
|
return typeof entry === "string" ? entry : entry.name;
|
|
@@ -129,6 +130,7 @@ export const ChantConfigSchema = z.object({
|
|
|
129
130
|
})).optional(),
|
|
130
131
|
release: z.object({
|
|
131
132
|
autoRecord: z.boolean().optional(),
|
|
133
|
+
publish: z.array(PublishDeclarationSchema).optional(),
|
|
132
134
|
}).optional(),
|
|
133
135
|
// Strict: a misspelt key here would leave Ops on the local runtime with
|
|
134
136
|
// nothing said (#2523).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-time parameters from workspace flags (#4024, decided in #4016).
|
|
3
|
+
*
|
|
4
|
+
* A member of a workspace may have flag records: records of a kind with a
|
|
5
|
+
* `flag` block, each naming the member, one of its declared build
|
|
6
|
+
* parameters and a value per environment (`workspace/flags.ts`). A build
|
|
7
|
+
* for an environment (`chant build --env <env>`, `chant run --components
|
|
8
|
+
* --env <env>`, and each environment a release cut compiles) reads them, and
|
|
9
|
+
* a flag-backed parameter takes the flag's value for that environment,
|
|
10
|
+
* recorded as `source: "flag:<name>"` on `BuildResult.buildParams` and on the
|
|
11
|
+
* release target's `params`.
|
|
12
|
+
*
|
|
13
|
+
* The precedence rule: where the environment has a gate, `--param`,
|
|
14
|
+
* `--params-file` and the parameter's env var can't set a flag-backed
|
|
15
|
+
* parameter, and the build refuses. An environment has a gate when a
|
|
16
|
+
* component enabled in it declares a gate step, the same test `components
|
|
17
|
+
* promote --release` uses to bind a release gate. The test runs only when one
|
|
18
|
+
* of those sources did set a flag-backed parameter, since it imports the
|
|
19
|
+
* member's components; a project with no components has no gate.
|
|
20
|
+
*
|
|
21
|
+
* Level 0 pays one upward `existsSync` walk here and nothing more. Workspace
|
|
22
|
+
* code is imported only once a declaration is found (#2525 rule 5, pinned by
|
|
23
|
+
* #2526's goldens).
|
|
24
|
+
*/
|
|
25
|
+
import { type BuildParamFlags, type BuildParamsConfig } from "./build-params.js";
|
|
26
|
+
import type { BuildParamProvenance } from "./provenance.js";
|
|
27
|
+
import { type CliBuildParamsArgs, type CliBuildParamsResolution } from "./cli/build-params-cli.js";
|
|
28
|
+
/** The flags backing parameters of the member at `projectDir` in `env`, or why they can't be read. `flags` is undefined outside a workspace, without an environment, or when no flag names the member. */
|
|
29
|
+
export declare function loadBuildParamFlags(projectDir: string, env: string | undefined): Promise<{
|
|
30
|
+
flags: BuildParamFlags | undefined;
|
|
31
|
+
errors: string[];
|
|
32
|
+
}>;
|
|
33
|
+
/** The parameters a flag backs that `--param`, `--params-file` or an env var set instead. */
|
|
34
|
+
export declare function overriddenFlagParams(provenance: readonly BuildParamProvenance[], flags: BuildParamFlags | undefined): BuildParamProvenance[];
|
|
35
|
+
/**
|
|
36
|
+
* The gates the member's components declare in the environment the process
|
|
37
|
+
* builds for (`CHANT_ENV`), with the parameters as resolved, or why the
|
|
38
|
+
* components can't be read. Only components enabled under those parameters
|
|
39
|
+
* count.
|
|
40
|
+
*/
|
|
41
|
+
export declare function environmentGates(projectDir: string, provenance: BuildParamProvenance[]): Promise<{
|
|
42
|
+
gates: string[];
|
|
43
|
+
} | {
|
|
44
|
+
error: string;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Resolve the build parameters of the project at `projectDir` for `env`,
|
|
48
|
+
* with the workspace's flags, as `resolveCliBuildParams` does without them.
|
|
49
|
+
* Refuses when a flag record can't be read, and when `--param`,
|
|
50
|
+
* `--params-file` or an env var sets a flag-backed parameter in an
|
|
51
|
+
* environment with a gate. Prints the summary line only on success.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveFlaggedBuildParams(projectDir: string, buildParamsConfig: BuildParamsConfig | undefined, args: CliBuildParamsArgs, env: string | undefined): Promise<CliBuildParamsResolution>;
|
|
54
|
+
//# sourceMappingURL=flag-params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-params.d.ts","sourceRoot":"","sources":["../src/flag-params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAmB,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC/F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAA0C,KAAK,kBAAkB,EAAE,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGxI,0MAA0M;AAC1M,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,eAAe,GAAG,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAmBxJ;AAED,6FAA6F;AAC7F,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,SAAS,oBAAoB,EAAE,EAAE,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,oBAAoB,EAAE,CAG5I;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAa/I;AAED;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EAClB,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,EAChD,IAAI,EAAE,kBAAkB,EACxB,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,OAAO,CAAC,wBAAwB,CAAC,CAyCnC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-time parameters from workspace flags (#4024, decided in #4016).
|
|
3
|
+
*
|
|
4
|
+
* A member of a workspace may have flag records: records of a kind with a
|
|
5
|
+
* `flag` block, each naming the member, one of its declared build
|
|
6
|
+
* parameters and a value per environment (`workspace/flags.ts`). A build
|
|
7
|
+
* for an environment (`chant build --env <env>`, `chant run --components
|
|
8
|
+
* --env <env>`, and each environment a release cut compiles) reads them, and
|
|
9
|
+
* a flag-backed parameter takes the flag's value for that environment,
|
|
10
|
+
* recorded as `source: "flag:<name>"` on `BuildResult.buildParams` and on the
|
|
11
|
+
* release target's `params`.
|
|
12
|
+
*
|
|
13
|
+
* The precedence rule: where the environment has a gate, `--param`,
|
|
14
|
+
* `--params-file` and the parameter's env var can't set a flag-backed
|
|
15
|
+
* parameter, and the build refuses. An environment has a gate when a
|
|
16
|
+
* component enabled in it declares a gate step, the same test `components
|
|
17
|
+
* promote --release` uses to bind a release gate. The test runs only when one
|
|
18
|
+
* of those sources did set a flag-backed parameter, since it imports the
|
|
19
|
+
* member's components; a project with no components has no gate.
|
|
20
|
+
*
|
|
21
|
+
* Level 0 pays one upward `existsSync` walk here and nothing more. Workspace
|
|
22
|
+
* code is imported only once a declaration is found (#2525 rule 5, pinned by
|
|
23
|
+
* #2526's goldens).
|
|
24
|
+
*/
|
|
25
|
+
import { findWorkspaceRoot } from "./project-root.js";
|
|
26
|
+
import { flagGateRefusal } from "./build-params.js";
|
|
27
|
+
import { echoBuildParams, resolveCliBuildParams } from "./cli/build-params-cli.js";
|
|
28
|
+
import { formatError } from "./cli/format.js";
|
|
29
|
+
/** The flags backing parameters of the member at `projectDir` in `env`, or why they can't be read. `flags` is undefined outside a workspace, without an environment, or when no flag names the member. */
|
|
30
|
+
export async function loadBuildParamFlags(projectDir, env) {
|
|
31
|
+
if (!env)
|
|
32
|
+
return { flags: undefined, errors: [] };
|
|
33
|
+
const found = findWorkspaceRoot(projectDir);
|
|
34
|
+
if (!found)
|
|
35
|
+
return { flags: undefined, errors: [] };
|
|
36
|
+
const { memberFlagBindings } = await import("./workspace/flags-read.js");
|
|
37
|
+
try {
|
|
38
|
+
const bindings = await memberFlagBindings(found.dir, projectDir, env);
|
|
39
|
+
if (!bindings)
|
|
40
|
+
return { flags: undefined, errors: [] };
|
|
41
|
+
if (bindings.errors.length > 0)
|
|
42
|
+
return { flags: undefined, errors: bindings.errors };
|
|
43
|
+
if (Object.keys(bindings.byParam).length === 0)
|
|
44
|
+
return { flags: undefined, errors: [] };
|
|
45
|
+
return { flags: { env, byParam: bindings.byParam }, errors: [] };
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
const { WorkspaceReadError } = await import("./workspace/declaration.js");
|
|
49
|
+
const { RecordReadError } = await import("./workspace/records.js");
|
|
50
|
+
if (err instanceof WorkspaceReadError || err instanceof RecordReadError) {
|
|
51
|
+
return { flags: undefined, errors: [`the workspace's flag records can't be read, so this build can't tell which parameters they set: ${err.message}`] };
|
|
52
|
+
}
|
|
53
|
+
throw err;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** The parameters a flag backs that `--param`, `--params-file` or an env var set instead. */
|
|
57
|
+
export function overriddenFlagParams(provenance, flags) {
|
|
58
|
+
if (!flags)
|
|
59
|
+
return [];
|
|
60
|
+
return provenance.filter((p) => flags.byParam[p.name] !== undefined && (p.source === "cli" || p.source === "params-file" || p.source === "env"));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The gates the member's components declare in the environment the process
|
|
64
|
+
* builds for (`CHANT_ENV`), with the parameters as resolved, or why the
|
|
65
|
+
* components can't be read. Only components enabled under those parameters
|
|
66
|
+
* count.
|
|
67
|
+
*/
|
|
68
|
+
export async function environmentGates(projectDir, provenance) {
|
|
69
|
+
const { discoverComponents } = await import("./components/discover.js");
|
|
70
|
+
const { withoutDisabled } = await import("./components/cli-support.js");
|
|
71
|
+
const { gateNamesOf } = await import("./components/release-gate.js");
|
|
72
|
+
try {
|
|
73
|
+
const discovered = await discoverComponents(projectDir, { buildParams: provenance });
|
|
74
|
+
if (discovered.errors.length > 0)
|
|
75
|
+
return { error: discovered.errors.map((e) => e.message).join("; ") };
|
|
76
|
+
const all = [...discovered.components.values()].map((d) => d.component);
|
|
77
|
+
const plain = all.map((c) => ({ name: c.name, dependsOn: c.dependsOn, deploy: c.deploy }));
|
|
78
|
+
return { gates: gateNamesOf(withoutDisabled(all, plain)) };
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Resolve the build parameters of the project at `projectDir` for `env`,
|
|
86
|
+
* with the workspace's flags, as `resolveCliBuildParams` does without them.
|
|
87
|
+
* Refuses when a flag record can't be read, and when `--param`,
|
|
88
|
+
* `--params-file` or an env var sets a flag-backed parameter in an
|
|
89
|
+
* environment with a gate. Prints the summary line only on success.
|
|
90
|
+
*/
|
|
91
|
+
export async function resolveFlaggedBuildParams(projectDir, buildParamsConfig, args, env) {
|
|
92
|
+
const loaded = await loadBuildParamFlags(projectDir, env);
|
|
93
|
+
if (loaded.errors.length > 0) {
|
|
94
|
+
return { success: false, provenance: [], errors: loaded.errors.map((message) => formatError({ message })) };
|
|
95
|
+
}
|
|
96
|
+
const { flags } = loaded;
|
|
97
|
+
const resolution = resolveCliBuildParams(buildParamsConfig, { ...args, ...(flags ? { flags } : {}), echo: false });
|
|
98
|
+
if (!resolution.success || !flags) {
|
|
99
|
+
if (resolution.success && args.echo !== false)
|
|
100
|
+
echoBuildParams(resolution.provenance, args.verbose);
|
|
101
|
+
return resolution;
|
|
102
|
+
}
|
|
103
|
+
const overridden = overriddenFlagParams(resolution.provenance, flags);
|
|
104
|
+
if (overridden.length > 0) {
|
|
105
|
+
const found = await environmentGates(projectDir, resolution.provenance);
|
|
106
|
+
if ("error" in found) {
|
|
107
|
+
return {
|
|
108
|
+
success: false,
|
|
109
|
+
provenance: [],
|
|
110
|
+
errors: [
|
|
111
|
+
formatError({
|
|
112
|
+
message: `${overridden.map((p) => `"${p.name}"`).join(", ")} ${overridden.length === 1 ? "is" : "are"} backed by a flag and set by ${[...new Set(overridden.map((p) => p.source))].join(", ")}, ` +
|
|
113
|
+
`and whether "${flags.env}" has a gate can't be told, because its components can't be read: ${found.error}`,
|
|
114
|
+
}),
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (found.gates.length > 0) {
|
|
119
|
+
const around = (p) => p.source === "cli" ? "--param" : p.source === "params-file" ? "--params-file" : `the env var ${buildParamsConfig?.[p.name]?.env ?? "(unknown)"}`;
|
|
120
|
+
return {
|
|
121
|
+
success: false,
|
|
122
|
+
provenance: [],
|
|
123
|
+
errors: overridden.map((p) => formatError({ message: `${flagGateRefusal(p.name, flags.byParam[p.name].flag, flags.env, around(p))} (gates: ${found.gates.join(", ")})` })),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (args.echo !== false)
|
|
128
|
+
echoBuildParams(resolution.provenance, args.verbose);
|
|
129
|
+
return resolution;
|
|
130
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test stand-ins for the publish targets (#4047): an OCI registry fake that
|
|
3
|
+
* listens on 127.0.0.1 inside the test process and answers with a Bearer
|
|
4
|
+
* challenge as GHCR and Docker Hub do, an OCI image layout writer, a fake
|
|
5
|
+
* `npm` that records each call and keeps a registry with dist-tags in a file,
|
|
6
|
+
* and a forge fake with draft releases (#4048). Nothing here reaches a network or a real
|
|
7
|
+
* registry, and every server a test starts is closed by it.
|
|
8
|
+
*/
|
|
9
|
+
export interface FakeRegistry {
|
|
10
|
+
/** `127.0.0.1:<port>`, for a repository reference. */
|
|
11
|
+
host: string;
|
|
12
|
+
blobs: Map<string, Buffer>;
|
|
13
|
+
manifests: Map<string, {
|
|
14
|
+
name: string;
|
|
15
|
+
type: string;
|
|
16
|
+
bytes: Buffer;
|
|
17
|
+
}>;
|
|
18
|
+
/** Each request: method, path and the authorization header it carried. */
|
|
19
|
+
requests: Array<{
|
|
20
|
+
method: string;
|
|
21
|
+
path: string;
|
|
22
|
+
authorization: string | null;
|
|
23
|
+
}>;
|
|
24
|
+
uploads: number;
|
|
25
|
+
close(): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
/** A registry fake with a Bearer token service that accepts `username` and `password`. */
|
|
28
|
+
export declare function startFakeRegistry(creds: {
|
|
29
|
+
username: string;
|
|
30
|
+
password: string;
|
|
31
|
+
token: string;
|
|
32
|
+
}): Promise<FakeRegistry>;
|
|
33
|
+
/** Write a one-image OCI layout at `dir`, returning the manifest's and the config's digests. */
|
|
34
|
+
export declare function writeOciLayout(dir: string, content?: string): {
|
|
35
|
+
digest: string;
|
|
36
|
+
configDigest: string;
|
|
37
|
+
};
|
|
38
|
+
/** What the fake npm's registry holds: each package's versions and dist-tags. */
|
|
39
|
+
export interface FakeNpmRegistry {
|
|
40
|
+
packages: Record<string, {
|
|
41
|
+
versions: string[];
|
|
42
|
+
distTags: Record<string, string>;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
/** The registry file a fake npm writing calls to `log` keeps its state in. */
|
|
46
|
+
export declare const fakeNpmRegistryFile: (log: string) => string;
|
|
47
|
+
/** Read the fake npm's registry. */
|
|
48
|
+
export declare function readFakeNpmRegistry(log: string): FakeNpmRegistry;
|
|
49
|
+
/** Seed the fake npm's registry, such as with an earlier version as `latest`. */
|
|
50
|
+
export declare function seedFakeNpmRegistry(log: string, registry: FakeNpmRegistry): void;
|
|
51
|
+
/**
|
|
52
|
+
* Write a fake `npm` at `<binDir>/npm` that appends `{ args, tokenSet }` to
|
|
53
|
+
* `log` for each call and prints the token it was given (so a test can show
|
|
54
|
+
* it is masked). It keeps a registry in `<log>.registry.json`, as npm's does:
|
|
55
|
+
*
|
|
56
|
+
* - `publish <dir|tgz> [--tag <t>]` adds the version under `<t>` (default
|
|
57
|
+
* `latest`), and refuses a version already there with a 403. As npm's
|
|
58
|
+
* registry does, a package's first version is also `latest`. It exits 1
|
|
59
|
+
* when the package path contains `$FAKE_NPM_FAIL`.
|
|
60
|
+
* - `view <name>@<version> version` prints the version when it is there.
|
|
61
|
+
* - `dist-tag add <name>@<version> <tag>` points the tag at a version that is
|
|
62
|
+
* there. It exits 1 when the name contains `$FAKE_NPM_FAIL_TAG`.
|
|
63
|
+
* - `install` (#4049) checks that every dependency in `./package.json` is in
|
|
64
|
+
* its registry at that version, and installs nothing.
|
|
65
|
+
* - `audit signatures` (#4049) prints what npm prints for verified
|
|
66
|
+
* signatures and attestations, and exits 1 when `$FAKE_NPM_AUDIT_FAIL` is set.
|
|
67
|
+
*/
|
|
68
|
+
export declare function writeFakeNpm(binDir: string, log: string): string;
|
|
69
|
+
/** A forge release as {@link startFakeForge} keeps it. */
|
|
70
|
+
export interface FakeForgeRelease {
|
|
71
|
+
id: number;
|
|
72
|
+
tag_name: string;
|
|
73
|
+
draft: boolean;
|
|
74
|
+
target: string;
|
|
75
|
+
assets: Array<{
|
|
76
|
+
name: string;
|
|
77
|
+
digest: string | null;
|
|
78
|
+
bytes: string;
|
|
79
|
+
}>;
|
|
80
|
+
}
|
|
81
|
+
/** A forge fake answering through `fetch`: GitHub or Forgejo with draft releases, or GitLab with releases, links and a generic package registry. */
|
|
82
|
+
export interface FakeForge {
|
|
83
|
+
fetch: (url: string, init: {
|
|
84
|
+
method: string;
|
|
85
|
+
headers: Record<string, string>;
|
|
86
|
+
body?: Uint8Array | string;
|
|
87
|
+
}) => Promise<{
|
|
88
|
+
ok: boolean;
|
|
89
|
+
status: number;
|
|
90
|
+
headers: {
|
|
91
|
+
get(name: string): string | null;
|
|
92
|
+
};
|
|
93
|
+
text(): Promise<string>;
|
|
94
|
+
}>;
|
|
95
|
+
calls: Array<{
|
|
96
|
+
method: string;
|
|
97
|
+
url: string;
|
|
98
|
+
headers: Record<string, string>;
|
|
99
|
+
body?: Uint8Array | string;
|
|
100
|
+
}>;
|
|
101
|
+
releases: FakeForgeRelease[];
|
|
102
|
+
/** GitLab: the package registry's files, by URL. */
|
|
103
|
+
packages: Map<string, string>;
|
|
104
|
+
/** The releases a consumer sees: published (not draft) ones, with their asset names. */
|
|
105
|
+
visible(): Array<{
|
|
106
|
+
tag: string;
|
|
107
|
+
assets: string[];
|
|
108
|
+
}>;
|
|
109
|
+
/** Make the next request whose `METHOD url` starts with `prefix` answer 500. */
|
|
110
|
+
failOnce(prefix: string): void;
|
|
111
|
+
}
|
|
112
|
+
/** A forge fake at `api` for `repo`, which holds `releases` to begin with. */
|
|
113
|
+
export declare function startFakeForge(forge: "github" | "forgejo" | "gitlab", api: string, repo: string, releases?: FakeForgeRelease[]): FakeForge;
|
|
114
|
+
/** A small SPDX document, as `npm sbom --sbom-format spdx` writes one. */
|
|
115
|
+
export declare function spdxDocument(name: string): string;
|
|
116
|
+
/** Write an npm package directory, with an `sbom.spdx.json` at its root unless `sbom` is false (#4049). */
|
|
117
|
+
export declare function writePackage(dir: string, name: string, version: string, sbom?: boolean): void;
|
|
118
|
+
/** Write a `package-lock.json` at `dir`, which the OCI and forge targets write their SBOM from (#4049). */
|
|
119
|
+
export declare function writeLockfile(dir: string): void;
|
|
120
|
+
//# sourceMappingURL=publish-fakes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-fakes.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/__fixtures__/publish-fakes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtE,0EAA0E;IAC1E,QAAQ,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,0FAA0F;AAC1F,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAmE3H;AAED,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,SAAgB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAqB7G;AAED,iFAAiF;AACjF,MAAM,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