@intentius/chant 0.124.27 → 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/README.md +1 -1
- package/dist/__golden__/wave-loop/fan-out-gated.json +8 -0
- package/dist/__golden__/wave-loop/fan-out-no-members.json +4 -0
- package/dist/__golden__/wave-loop/fan-out-only.json +6 -0
- package/dist/__golden__/wave-loop/op-by-apply-hold.json +2 -0
- package/dist/__golden__/wave-loop/op-cost-member.json +3 -0
- package/dist/__golden__/wave-loop/op-held-on-before-apply.json +1 -0
- package/dist/__golden__/wave-loop/op-held-on.json +2 -0
- package/dist/__golden__/wave-loop/op-hooks-held.json +2 -0
- package/dist/__golden__/wave-loop/op-hooks-hold-before-apply.json +2 -0
- package/dist/__golden__/wave-loop/op-hooks-refused-at-base.json +3 -0
- package/dist/__golden__/wave-loop/op-hooks-share.json +3 -0
- package/dist/__golden__/wave-loop/op-per-run.json +7 -0
- package/dist/__golden__/wave-loop/op-pr-review.json +7 -0
- package/dist/__golden__/wave-loop/op-sealed.json +3 -0
- package/dist/__golden__/wave-loop/op-spend.json +3 -0
- package/dist/__golden__/wave-loop/op-wave-commands.json +7 -0
- package/dist/__golden__/wave-loop/op-wide-waiting.json +4 -0
- 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 +63 -0
- package/dist/change-set-graph.d.ts.map +1 -0
- package/dist/change-set-graph.js +130 -0
- package/dist/change-set.d.ts +62 -3
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +36 -4
- package/dist/chant-version.d.ts +9 -0
- package/dist/chant-version.d.ts.map +1 -0
- package/dist/chant-version.js +16 -0
- 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 +8 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +15 -11
- package/dist/cli/commands/check-lexicon-docs.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-docs.js +30 -2
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.js +13 -2
- package/dist/cli/commands/init-lexicon/templates/docs.d.ts +4 -1
- package/dist/cli/commands/init-lexicon/templates/docs.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon/templates/docs.js +6 -6
- package/dist/cli/commands/init-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon.js +17 -8
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +64 -4
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +43 -4
- package/dist/cli/handlers/change-set.d.ts +10 -0
- package/dist/cli/handlers/change-set.d.ts.map +1 -1
- package/dist/cli/handlers/change-set.js +51 -1
- package/dist/cli/handlers/fan-out.d.ts +10 -1
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +54 -6
- 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 +16 -2
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +269 -37
- 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 +440 -28
- package/dist/cli/handlers/release.d.ts +91 -0
- package/dist/cli/handlers/release.d.ts.map +1 -0
- package/dist/cli/handlers/release.js +589 -0
- package/dist/cli/handlers/run.d.ts +38 -2
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +234 -16
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +143 -17
- package/dist/cli/mcp/workspace-tools.js +1 -1
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +73 -5
- package/dist/cli/registry.d.ts +43 -5
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/run-events.d.ts +30 -0
- package/dist/cli/run-events.d.ts.map +1 -0
- package/dist/cli/run-events.js +49 -0
- package/dist/cli/version.d.ts +3 -5
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +3 -13
- package/dist/codegen/docs-in-site.d.ts +71 -0
- package/dist/codegen/docs-in-site.d.ts.map +1 -0
- package/dist/codegen/docs-in-site.js +177 -0
- package/dist/codegen/docs-types.d.ts +14 -1
- package/dist/codegen/docs-types.d.ts.map +1 -1
- package/dist/codegen/docs.d.ts +18 -1
- package/dist/codegen/docs.d.ts.map +1 -1
- package/dist/codegen/docs.js +40 -7
- package/dist/codegen/rehype-base-url.mjs +15 -9
- package/dist/components/auto-release.d.ts +6 -1
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +3 -0
- package/dist/components/capability.d.ts +9 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +6 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +10 -9
- package/dist/components/driver.d.ts +50 -9
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +116 -54
- 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 +7 -0
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +85 -26
- 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/pr-run.d.ts +11 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +20 -1
- package/dist/components/promote-order.d.ts +38 -0
- package/dist/components/promote-order.d.ts.map +1 -0
- package/dist/components/promote-order.js +62 -0
- package/dist/components/promote.d.ts +38 -2
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +77 -2
- package/dist/components/release-compile.d.ts +142 -0
- package/dist/components/release-compile.d.ts.map +1 -0
- package/dist/components/release-compile.js +382 -0
- package/dist/components/release-gate.d.ts +135 -0
- package/dist/components/release-gate.d.ts.map +1 -0
- package/dist/components/release-gate.js +288 -0
- package/dist/components/release-promote.d.ts +96 -0
- package/dist/components/release-promote.d.ts.map +1 -0
- package/dist/components/release-promote.js +204 -0
- package/dist/components/run-progress.d.ts +7 -0
- package/dist/components/run-progress.d.ts.map +1 -1
- package/dist/components/wave-plan.d.ts +8 -1
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +11 -3
- package/dist/config.d.ts +45 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -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 +68 -0
- package/dist/lifecycle/change-set-store.d.ts.map +1 -0
- package/dist/lifecycle/change-set-store.js +97 -0
- package/dist/lifecycle/commit-sha.d.ts +13 -0
- package/dist/lifecycle/commit-sha.d.ts.map +1 -0
- package/dist/lifecycle/commit-sha.js +21 -0
- 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 +78 -0
- package/dist/lifecycle/gate-change-set.d.ts.map +1 -0
- package/dist/lifecycle/gate-change-set.js +138 -0
- package/dist/lifecycle/gate-ledger.d.ts +51 -4
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +18 -0
- 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 +154 -0
- package/dist/lifecycle/release-cut.d.ts.map +1 -0
- package/dist/lifecycle/release-cut.js +366 -0
- 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 +54 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +53 -20
- 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 +200 -0
- package/dist/lifecycle/release-store.d.ts.map +1 -0
- package/dist/lifecycle/release-store.js +320 -0
- 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 +4 -0
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +2 -0
- package/dist/op/activities/change-coverage.d.ts.map +1 -1
- package/dist/op/activities/change-coverage.js +4 -2
- package/dist/op/activities/source-release.d.ts.map +1 -1
- package/dist/op/activities/source-release.js +7 -3
- package/dist/op/activities/source-rollback.d.ts.map +1 -1
- package/dist/op/activities/source-rollback.js +7 -3
- package/dist/op/gate-name.d.ts +11 -2
- package/dist/op/gate-name.d.ts.map +1 -1
- package/dist/op/gate-name.js +12 -3
- package/dist/op/gate-run-locator.d.ts +22 -0
- package/dist/op/gate-run-locator.d.ts.map +1 -1
- package/dist/op/gate-run-locator.js +31 -0
- package/dist/op/gate.d.ts +27 -3
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +57 -3
- package/dist/op/local-executor.d.ts +36 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +158 -52
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +4 -0
- package/dist/op/run-live.d.ts +2 -0
- package/dist/op/run-live.d.ts.map +1 -1
- package/dist/op/run-live.js +1 -1
- package/dist/op/runtime.d.ts +46 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/op/runtimes/local.js +8 -0
- package/dist/plan-summary.d.ts.map +1 -1
- package/dist/plan-summary.js +8 -2
- package/dist/point-decision.d.ts +2 -0
- package/dist/point-decision.d.ts.map +1 -1
- package/dist/point-decision.js +9 -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 +104 -0
- package/dist/run-event-store.d.ts.map +1 -0
- package/dist/run-event-store.js +251 -0
- package/dist/run-event-stream.d.ts +133 -0
- package/dist/run-event-stream.d.ts.map +1 -0
- package/dist/run-event-stream.js +242 -0
- package/dist/run-event.d.ts +285 -0
- package/dist/run-event.d.ts.map +1 -0
- package/dist/run-event.js +209 -0
- package/dist/wave-runtime.mjs +262 -226
- 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/__fixtures__/run-event-check.d.ts +19 -0
- package/dist/workspace/__fixtures__/run-event-check.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/run-event-check.js +59 -0
- package/dist/workspace/change-set-show.d.ts +56 -0
- package/dist/workspace/change-set-show.d.ts.map +1 -0
- package/dist/workspace/change-set-show.js +54 -0
- package/dist/workspace/change-set-show.schema.json +102 -0
- package/dist/workspace/change-set.schema.json +32 -1
- package/dist/workspace/changes-cli.d.ts.map +1 -1
- package/dist/workspace/changes-cli.js +10 -1
- package/dist/workspace/changes.d.ts +37 -0
- package/dist/workspace/changes.d.ts.map +1 -1
- package/dist/workspace/changes.js +49 -2
- package/dist/workspace/changes.schema.json +135 -0
- 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-cli.d.ts +19 -4
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +75 -12
- package/dist/workspace/ci-green-forge.d.ts +20 -3
- package/dist/workspace/ci-green-forge.d.ts.map +1 -1
- package/dist/workspace/ci-green-forge.js +6 -4
- package/dist/workspace/ci-green-workflow.d.ts +11 -0
- package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
- package/dist/workspace/ci-green-workflow.js +6 -0
- package/dist/workspace/ci-green.d.ts +281 -13
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +456 -38
- package/dist/workspace/ci-last-green.schema.json +32 -2
- package/dist/workspace/ci-list.schema.json +525 -0
- package/dist/workspace/commit-links.d.ts +85 -0
- package/dist/workspace/commit-links.d.ts.map +1 -0
- package/dist/workspace/commit-links.js +163 -0
- package/dist/workspace/declaration.d.ts +35 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +27 -1
- package/dist/workspace/declaration.schema.json +76 -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/identity-gate-rule.d.ts +37 -0
- package/dist/workspace/identity-gate-rule.d.ts.map +1 -1
- package/dist/workspace/identity-gate-rule.js +72 -7
- package/dist/workspace/identity.d.ts +12 -0
- package/dist/workspace/identity.d.ts.map +1 -1
- package/dist/workspace/identity.js +13 -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 +36 -7
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/intent.js +192 -22
- package/dist/workspace/intent.schema.json +702 -6
- package/dist/workspace/ls.d.ts +4 -0
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/ls.js +2 -0
- package/dist/workspace/ls.schema.json +3 -1
- package/dist/workspace/member-pipeline.d.ts +6 -0
- package/dist/workspace/member-pipeline.d.ts.map +1 -1
- package/dist/workspace/member-pipeline.js +6 -0
- 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/promotion-order.d.ts +41 -0
- package/dist/workspace/promotion-order.d.ts.map +1 -0
- package/dist/workspace/promotion-order.js +95 -0
- package/dist/workspace/reason-codes.d.ts +4 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +7 -1
- 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 +81 -0
- package/dist/workspace/releases.d.ts.map +1 -0
- package/dist/workspace/releases.js +103 -0
- package/dist/workspace/releases.schema.json +513 -0
- package/dist/workspace/run-event.schema.json +295 -0
- package/dist/workspace/status-gates.d.ts +34 -1
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status-gates.js +31 -2
- package/dist/workspace/status-stewards.d.ts +4 -0
- package/dist/workspace/status-stewards.d.ts.map +1 -1
- package/dist/workspace/status-stewards.js +2 -0
- package/dist/workspace/status.d.ts +117 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/status.js +218 -4
- package/dist/workspace/status.schema.json +268 -2
- package/dist/workspace/trust/ci-tag-statement.d.ts +102 -0
- package/dist/workspace/trust/ci-tag-statement.d.ts.map +1 -0
- package/dist/workspace/trust/ci-tag-statement.js +123 -0
- package/dist/workspace/trust/op-run-statement.d.ts +91 -0
- package/dist/workspace/trust/op-run-statement.d.ts.map +1 -0
- package/dist/workspace/trust/op-run-statement.js +143 -0
- package/dist/workspace/trust/rotation.d.ts +18 -2
- package/dist/workspace/trust/rotation.d.ts.map +1 -1
- package/dist/workspace/trust/rotation.js +65 -16
- package/dist/workspace/trust/seal.d.ts +11 -0
- package/dist/workspace/trust/seal.d.ts.map +1 -1
- package/dist/workspace/trust/seal.js +9 -0
- package/dist/workspace/trust/ssh-commit.d.ts.map +1 -1
- package/dist/workspace/trust/ssh-commit.js +10 -10
- package/dist/workspace/wip.d.ts.map +1 -1
- package/dist/workspace/wip.js +11 -3
- package/package.json +1 -1
- package/src/__golden__/wave-loop/fan-out-gated.json +8 -0
- package/src/__golden__/wave-loop/fan-out-no-members.json +4 -0
- package/src/__golden__/wave-loop/fan-out-only.json +6 -0
- package/src/__golden__/wave-loop/op-by-apply-hold.json +2 -0
- package/src/__golden__/wave-loop/op-cost-member.json +3 -0
- package/src/__golden__/wave-loop/op-held-on-before-apply.json +1 -0
- package/src/__golden__/wave-loop/op-held-on.json +2 -0
- package/src/__golden__/wave-loop/op-hooks-held.json +2 -0
- package/src/__golden__/wave-loop/op-hooks-hold-before-apply.json +2 -0
- package/src/__golden__/wave-loop/op-hooks-refused-at-base.json +3 -0
- package/src/__golden__/wave-loop/op-hooks-share.json +3 -0
- package/src/__golden__/wave-loop/op-per-run.json +7 -0
- package/src/__golden__/wave-loop/op-pr-review.json +7 -0
- package/src/__golden__/wave-loop/op-sealed.json +3 -0
- package/src/__golden__/wave-loop/op-spend.json +3 -0
- package/src/__golden__/wave-loop/op-wave-commands.json +7 -0
- package/src/__golden__/wave-loop/op-wide-waiting.json +4 -0
- package/src/build-params.test.ts +46 -0
- package/src/build-params.ts +55 -1
- package/src/change-set-graph.test.ts +72 -0
- package/src/change-set-graph.ts +141 -0
- package/src/change-set.ts +87 -6
- package/src/chant-version.ts +16 -0
- package/src/cli/build-params-cli.ts +22 -9
- package/src/cli/commands/build.ts +25 -11
- package/src/cli/commands/check-lexicon-docs.test.ts +51 -0
- package/src/cli/commands/check-lexicon-docs.ts +39 -2
- package/src/cli/commands/check-lexicon.ts +14 -2
- package/src/cli/commands/init-lexicon/templates/docs.ts +7 -6
- package/src/cli/commands/init-lexicon.test.ts +25 -0
- package/src/cli/commands/init-lexicon.ts +18 -8
- package/src/cli/handlers/approve-release.test.ts +84 -0
- package/src/cli/handlers/approve-revoked.test.ts +155 -0
- package/src/cli/handlers/approve.ts +65 -2
- package/src/cli/handlers/build.test.ts +67 -0
- package/src/cli/handlers/build.ts +46 -4
- package/src/cli/handlers/change-set.ts +49 -1
- package/src/cli/handlers/fan-out.test.ts +228 -1
- package/src/cli/handlers/fan-out.ts +53 -6
- 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/operator.test.ts +37 -0
- package/src/cli/handlers/pr.test.ts +341 -0
- package/src/cli/handlers/pr.ts +292 -47
- package/src/cli/handlers/promote.test.ts +669 -7
- package/src/cli/handlers/promote.ts +464 -29
- package/src/cli/handlers/release-implicit.e2e.test.ts +161 -0
- 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 +199 -0
- package/src/cli/handlers/release.ts +593 -0
- package/src/cli/handlers/run-auto-release.test.ts +80 -0
- package/src/cli/handlers/run-events-cmd.test.ts +92 -0
- package/src/cli/handlers/run-release.test.ts +55 -0
- package/src/cli/handlers/run.test.ts +30 -0
- package/src/cli/handlers/run.ts +243 -18
- package/src/cli/main.test.ts +8 -0
- package/src/cli/main.ts +143 -17
- package/src/cli/mcp/never-over-mcp.test.ts +2 -0
- package/src/cli/mcp/workspace-tools.ts +1 -1
- package/src/cli/parse-args.ts +56 -5
- package/src/cli/registry.ts +43 -5
- package/src/cli/run-events.ts +57 -0
- package/src/cli/version.ts +3 -13
- package/src/codegen/docs-in-site.test.ts +166 -0
- package/src/codegen/docs-in-site.ts +182 -0
- package/src/codegen/docs-site/AgentPrompt.astro +26 -1
- package/src/codegen/docs-types.ts +14 -1
- package/src/codegen/docs.ts +60 -7
- package/src/codegen/rehype-base-url.d.mts +3 -1
- package/src/codegen/rehype-base-url.mjs +15 -9
- package/src/codegen/rehype-base-url.test.ts +34 -0
- package/src/components/auto-release.test.ts +30 -0
- package/src/components/auto-release.ts +9 -1
- package/src/components/capability.ts +9 -0
- package/src/components/cli-support.test.ts +82 -0
- package/src/components/cli-support.ts +16 -9
- package/src/components/driver.test.ts +24 -0
- package/src/components/driver.ts +165 -56
- 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 +104 -35
- package/src/components/fan-out.ts +4 -0
- package/src/components/pr-pipeline.ts +35 -4
- package/src/components/pr-run.ts +30 -1
- package/src/components/promote-order.test.ts +90 -0
- package/src/components/promote-order.ts +75 -0
- package/src/components/promote.test.ts +10 -1
- package/src/components/promote.ts +94 -3
- package/src/components/release-compile.test.ts +147 -0
- package/src/components/release-compile.ts +459 -0
- package/src/components/release-gate.test.ts +215 -0
- package/src/components/release-gate.ts +355 -0
- package/src/components/release-promote.test.ts +159 -0
- package/src/components/release-promote.ts +232 -0
- package/src/components/run-progress.ts +7 -0
- package/src/components/wave-plan.ts +16 -3
- package/src/config.ts +15 -1
- package/src/flag-params.test.ts +144 -0
- package/src/flag-params.ts +134 -0
- package/src/index.ts +2 -0
- package/src/lifecycle/__fixtures__/publish-fakes.ts +351 -0
- package/src/lifecycle/change-set-store.test.ts +217 -0
- package/src/lifecycle/change-set-store.ts +113 -0
- package/src/lifecycle/commit-sha.ts +23 -0
- package/src/lifecycle/delivery-metrics.ts +263 -0
- package/src/lifecycle/deploy-outcome.ts +147 -0
- package/src/lifecycle/gate-change-set.e2e.test.ts +122 -0
- package/src/lifecycle/gate-change-set.ts +164 -0
- package/src/lifecycle/gate-ledger.test.ts +33 -0
- package/src/lifecycle/gate-ledger.ts +68 -3
- 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-signed.test.ts +180 -0
- package/src/lifecycle/release-cut.test.ts +483 -0
- package/src/lifecycle/release-cut.ts +503 -0
- 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.test.ts +14 -0
- package/src/lifecycle/release-ledger.ts +85 -17
- 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 +434 -0
- 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.test.ts +10 -0
- package/src/lifecycle/run-ledger.ts +6 -0
- package/src/op/activities/change-coverage.ts +4 -1
- package/src/op/activities/source-release.ts +8 -3
- package/src/op/activities/source-rollback.ts +8 -4
- package/src/op/commit-run-gate-deploy-join.test.ts +117 -0
- package/src/op/gate-name.ts +13 -3
- package/src/op/gate-release.test.ts +126 -0
- package/src/op/gate-run-locator.test.ts +110 -0
- package/src/op/gate-run-locator.ts +35 -0
- package/src/op/gate.ts +88 -6
- package/src/op/local-executor.ts +207 -52
- package/src/op/op-waves-run.ts +4 -0
- package/src/op/run-events.test.ts +166 -0
- package/src/op/run-live.ts +1 -1
- package/src/op/runtime.ts +39 -0
- package/src/op/runtimes/local.test.ts +16 -0
- package/src/op/runtimes/local.ts +9 -0
- package/src/plan-summary.test.ts +20 -0
- package/src/plan-summary.ts +8 -1
- package/src/point-decision.ts +12 -2
- 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.test.ts +144 -0
- package/src/run-event-store.ts +273 -0
- package/src/run-event-stream.test.ts +175 -0
- package/src/run-event-stream.ts +309 -0
- package/src/run-event.test.ts +277 -0
- package/src/run-event.ts +471 -0
- package/src/wave-loop-golden.test.ts +9 -0
- 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/__fixtures__/run-event-check.ts +58 -0
- package/src/workspace/ancestry-index.test.ts +93 -0
- package/src/workspace/change-set-show.schema.json +102 -0
- package/src/workspace/change-set-show.ts +72 -0
- package/src/workspace/change-set.schema.json +32 -1
- package/src/workspace/changes-cli.ts +10 -1
- package/src/workspace/changes.schema.json +135 -0
- package/src/workspace/changes.test.ts +1 -1
- package/src/workspace/changes.ts +84 -2
- 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-cli.ts +75 -13
- package/src/workspace/ci-green-forge.ts +24 -4
- package/src/workspace/ci-green-runs.test.ts +242 -0
- package/src/workspace/ci-green-signed.test.ts +302 -0
- package/src/workspace/ci-green-workflow.test.ts +16 -0
- package/src/workspace/ci-green-workflow.ts +12 -0
- package/src/workspace/ci-green.test.ts +131 -2
- package/src/workspace/ci-green.ts +635 -42
- package/src/workspace/ci-last-green.schema.json +32 -2
- package/src/workspace/ci-list.schema.json +525 -0
- package/src/workspace/commit-links.test.ts +279 -0
- package/src/workspace/commit-links.ts +183 -0
- package/src/workspace/declaration.schema.json +76 -0
- package/src/workspace/declaration.test.ts +28 -0
- package/src/workspace/declaration.ts +60 -2
- 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/identity-gate-rule.ts +91 -7
- package/src/workspace/identity.ts +14 -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 +196 -26
- package/src/workspace/ls.schema.json +3 -1
- package/src/workspace/ls.ts +6 -0
- package/src/workspace/member-pipeline.test.ts +17 -0
- package/src/workspace/member-pipeline.ts +9 -0
- 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/promotion-order.ts +97 -0
- package/src/workspace/read-contract.e2e.test.ts +5 -1
- package/src/workspace/reason-codes.test.ts +7 -1
- package/src/workspace/reason-codes.ts +7 -1
- 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 +513 -0
- package/src/workspace/releases.test.ts +108 -0
- package/src/workspace/releases.ts +133 -0
- package/src/workspace/run-event.schema.json +295 -0
- package/src/workspace/status-contract.test.ts +81 -1
- package/src/workspace/status-gates.ts +64 -1
- package/src/workspace/status-mixed.test.ts +152 -0
- package/src/workspace/status-revoked.test.ts +153 -0
- package/src/workspace/status-stewards.ts +6 -0
- package/src/workspace/status.schema.json +268 -2
- package/src/workspace/status.ts +334 -4
- package/src/workspace/trust/ci-tag-statement.ts +151 -0
- package/src/workspace/trust/op-run-statement.ts +148 -0
- package/src/workspace/trust/rotation.ts +61 -14
- package/src/workspace/trust/seal.ts +10 -0
- package/src/workspace/trust/ssh-commit.ts +10 -9
- package/src/workspace/wip.ts +11 -2
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/astro.config.mjs +0 -14
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/package.json +0 -16
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content/docs/index.mdx +0 -8
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content.config.ts +0 -15
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/tsconfig.json +0 -10
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Join a commit, a release, its gates and its deploy records through the
|
|
3
|
+
* release digest (#4043, ws-104).
|
|
4
|
+
*
|
|
5
|
+
* The records already name one another. A release file holds its `commit`; a
|
|
6
|
+
* release gate's pending fact and resolution hold the `releaseDigest`; a deploy
|
|
7
|
+
* record holds the `releaseDigest` when the deploy was made from a release.
|
|
8
|
+
* From any one of the four, the others are one lookup away:
|
|
9
|
+
*
|
|
10
|
+
* commit to releases `_releases/*.json` `commit`
|
|
11
|
+
* release to gates `releaseDigest` on the records of `_gates/release.jsonl`
|
|
12
|
+
* release to deploys `releaseDigest` on the records of every `<env>/releases.jsonl`
|
|
13
|
+
*
|
|
14
|
+
* This is the one place that does it, for the readers that need the chain
|
|
15
|
+
* (the why chain of #4023, behold). Release plus a deploy record's `env`
|
|
16
|
+
* names the release target.
|
|
17
|
+
*
|
|
18
|
+
* Read-only. Reads the local `chant/lifecycle` branch; fetch it first for the
|
|
19
|
+
* remote's records. A release digest or commit that nothing recorded joins to
|
|
20
|
+
* an empty list rather than an error.
|
|
21
|
+
*/
|
|
22
|
+
import { type GateResolutionRecord, type PendingGateRecord } from "./gate-ledger.js";
|
|
23
|
+
import { type ReleaseRecord } from "./release-ledger.js";
|
|
24
|
+
import { type Release, type ReleaseCut } from "./release-store.js";
|
|
25
|
+
import type { LedgerLocation } from "./git.js";
|
|
26
|
+
/** Where a join starts. Each names the others one lookup away. */
|
|
27
|
+
export type ReleaseJoinStart =
|
|
28
|
+
/** A full commit sha, or a prefix of at least 7 characters. Joins to every release cut from it. */
|
|
29
|
+
{
|
|
30
|
+
commit: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Several full commit shas, or prefixes of at least 7 characters. Joins to
|
|
34
|
+
* every release cut from any of them, reading the ledgers once (#4023).
|
|
35
|
+
*/
|
|
36
|
+
| {
|
|
37
|
+
commits: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
/** A release's label or its `releaseDigest`. */
|
|
40
|
+
| {
|
|
41
|
+
release: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A deploy record. It joins through its `releaseDigest`; a record with none
|
|
45
|
+
* but an admission by the release gate joins through the resolution that
|
|
46
|
+
* admission names.
|
|
47
|
+
*/
|
|
48
|
+
| {
|
|
49
|
+
deploy: Pick<ReleaseRecord, "releaseDigest" | "admission">;
|
|
50
|
+
}
|
|
51
|
+
/** A release gate's pending fact or resolution. */
|
|
52
|
+
| {
|
|
53
|
+
gate: Pick<PendingGateRecord | GateResolutionRecord, "releaseDigest">;
|
|
54
|
+
};
|
|
55
|
+
/** One release with everything the digest joins to it. */
|
|
56
|
+
export interface JoinedRelease {
|
|
57
|
+
releaseDigest: string;
|
|
58
|
+
/** The label of the release, or null when it was cut with none. */
|
|
59
|
+
label: string | null;
|
|
60
|
+
/** The green commit the release was cut from. */
|
|
61
|
+
commit: string;
|
|
62
|
+
release: Release;
|
|
63
|
+
/** Every cut of the release, oldest first. */
|
|
64
|
+
cuts: ReleaseCut[];
|
|
65
|
+
/** The release gate's facts for this release (`_gates/release.jsonl`), oldest first. */
|
|
66
|
+
gates: {
|
|
67
|
+
pending: PendingGateRecord[];
|
|
68
|
+
resolutions: GateResolutionRecord[];
|
|
69
|
+
};
|
|
70
|
+
/** Every deploy record that names the release, across environments, oldest first: by its `releaseDigest`, or, without one, by the release gate resolution its admission names. Each record's `env` with the release names the target. */
|
|
71
|
+
deploys: ReleaseRecord[];
|
|
72
|
+
}
|
|
73
|
+
/** What {@link joinRelease} returns. */
|
|
74
|
+
export interface ReleaseJoin {
|
|
75
|
+
/** The releases the starting point joins to: one for a release, a gate or a deploy, any number for a commit. */
|
|
76
|
+
releases: JoinedRelease[];
|
|
77
|
+
/** Why `releases` is empty, when the starting point could not be followed. Absent otherwise. */
|
|
78
|
+
reason?: string;
|
|
79
|
+
}
|
|
80
|
+
/** The version of the shape above, for a reader that stores it. Chant 0.124.29 and newer. */
|
|
81
|
+
export declare const RELEASE_JOIN_VERSION = 1;
|
|
82
|
+
/**
|
|
83
|
+
* Follow one record to the rest of its chain. Never throws for an unknown
|
|
84
|
+
* starting point; a ledger that can't be read does throw, as those readers do.
|
|
85
|
+
*/
|
|
86
|
+
export declare function joinRelease(from: ReleaseJoinStart, loc?: LedgerLocation): Promise<ReleaseJoin>;
|
|
87
|
+
/**
|
|
88
|
+
* The release a deploy record names, over the release gate's resolutions
|
|
89
|
+
* already read: its own `releaseDigest`, else the one on the resolution its
|
|
90
|
+
* admission names. Undefined when it was not made from a release. The rule
|
|
91
|
+
* {@link joinRelease} follows, for a reader that holds the ledgers already,
|
|
92
|
+
* such as retention's garbage collection (#4036).
|
|
93
|
+
*/
|
|
94
|
+
export declare function releaseOfDeploy(record: Pick<ReleaseRecord, "releaseDigest" | "admission">, releaseGateResolutions: readonly Pick<GateResolutionRecord, "gate" | "timestamp" | "releaseDigest">[]): string | undefined;
|
|
95
|
+
//# sourceMappingURL=release-join.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-join.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-join.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAkB,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClG,OAAO,EAA8C,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAA6C,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC3G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,kEAAkE;AAClE,MAAM,MAAM,gBAAgB;AAC1B,mGAAmG;AACjG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;AACpB;;;GAGG;GACD;IAAE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE;AAChC,gDAAgD;GAC9C;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE;AACrB;;;;GAIG;GACD;IAAE,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,eAAe,GAAG,WAAW,CAAC,CAAA;CAAE;AAChE,mDAAmD;GACjD;IAAE,IAAI,EAAE,IAAI,CAAC,iBAAiB,GAAG,oBAAoB,EAAE,eAAe,CAAC,CAAA;CAAE,CAAC;AAE9E,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,wFAAwF;IACxF,KAAK,EAAE;QAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;QAAC,WAAW,EAAE,oBAAoB,EAAE,CAAA;KAAE,CAAC;IAC7E,yOAAyO;IACzO,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,wCAAwC;AACxC,MAAM,WAAW,WAAW;IAC1B,gHAAgH;IAChH,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,6FAA6F;AAC7F,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAItC;;;GAGG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,GAAE,cAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,CAwExG;AAaD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,eAAe,GAAG,WAAW,CAAC,EAC1D,sBAAsB,EAAE,SAAS,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,WAAW,GAAG,eAAe,CAAC,EAAE,GACpG,MAAM,GAAG,SAAS,CAKpB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Join a commit, a release, its gates and its deploy records through the
|
|
3
|
+
* release digest (#4043, ws-104).
|
|
4
|
+
*
|
|
5
|
+
* The records already name one another. A release file holds its `commit`; a
|
|
6
|
+
* release gate's pending fact and resolution hold the `releaseDigest`; a deploy
|
|
7
|
+
* record holds the `releaseDigest` when the deploy was made from a release.
|
|
8
|
+
* From any one of the four, the others are one lookup away:
|
|
9
|
+
*
|
|
10
|
+
* commit to releases `_releases/*.json` `commit`
|
|
11
|
+
* release to gates `releaseDigest` on the records of `_gates/release.jsonl`
|
|
12
|
+
* release to deploys `releaseDigest` on the records of every `<env>/releases.jsonl`
|
|
13
|
+
*
|
|
14
|
+
* This is the one place that does it, for the readers that need the chain
|
|
15
|
+
* (the why chain of #4023, behold). Release plus a deploy record's `env`
|
|
16
|
+
* names the release target.
|
|
17
|
+
*
|
|
18
|
+
* Read-only. Reads the local `chant/lifecycle` branch; fetch it first for the
|
|
19
|
+
* remote's records. A release digest or commit that nothing recorded joins to
|
|
20
|
+
* an empty list rather than an error.
|
|
21
|
+
*/
|
|
22
|
+
import { RELEASE_GATE_OP } from "../op/gate-name.js";
|
|
23
|
+
import { readGateLedger } from "./gate-ledger.js";
|
|
24
|
+
import { listReleaseEnvironments, readReleaseLedger } from "./release-ledger.js";
|
|
25
|
+
import { labelsByDigest, readAllReleases, readCuts } from "./release-store.js";
|
|
26
|
+
/** The version of the shape above, for a reader that stores it. Chant 0.124.29 and newer. */
|
|
27
|
+
export const RELEASE_JOIN_VERSION = 1;
|
|
28
|
+
const MIN_COMMIT_PREFIX = 7;
|
|
29
|
+
/**
|
|
30
|
+
* Follow one record to the rest of its chain. Never throws for an unknown
|
|
31
|
+
* starting point; a ledger that can't be read does throw, as those readers do.
|
|
32
|
+
*/
|
|
33
|
+
export async function joinRelease(from, loc = {}) {
|
|
34
|
+
const { releases } = await readAllReleases(loc);
|
|
35
|
+
const { cuts } = await readCuts(loc);
|
|
36
|
+
const labels = labelsByDigest(cuts);
|
|
37
|
+
let digests;
|
|
38
|
+
let reason;
|
|
39
|
+
if ("commit" in from) {
|
|
40
|
+
const sha = from.commit.toLowerCase();
|
|
41
|
+
if (sha.length < MIN_COMMIT_PREFIX) {
|
|
42
|
+
return { releases: [], reason: `a commit needs at least ${MIN_COMMIT_PREFIX} characters to join on` };
|
|
43
|
+
}
|
|
44
|
+
digests = releases.filter((r) => r.commit.toLowerCase().startsWith(sha)).map((r) => r.releaseDigest);
|
|
45
|
+
if (digests.length === 0)
|
|
46
|
+
reason = `no release was cut from commit ${from.commit}`;
|
|
47
|
+
}
|
|
48
|
+
else if ("commits" in from) {
|
|
49
|
+
const shas = from.commits.map((c) => c.toLowerCase());
|
|
50
|
+
if (shas.some((sha) => sha.length < MIN_COMMIT_PREFIX)) {
|
|
51
|
+
return { releases: [], reason: `a commit needs at least ${MIN_COMMIT_PREFIX} characters to join on` };
|
|
52
|
+
}
|
|
53
|
+
digests = releases.filter((r) => shas.some((sha) => r.commit.toLowerCase().startsWith(sha))).map((r) => r.releaseDigest);
|
|
54
|
+
if (digests.length === 0)
|
|
55
|
+
reason = shas.length === 0 ? "no commit was given to join on" : `no release was cut from ${shas.length === 1 ? `commit ${from.commits[0]}` : `any of ${shas.length} commits`}`;
|
|
56
|
+
}
|
|
57
|
+
else if ("release" in from) {
|
|
58
|
+
const ref = from.release;
|
|
59
|
+
const byDigest = releases.find((r) => r.releaseDigest === ref);
|
|
60
|
+
const byLabel = [...labels].find(([, label]) => label === ref)?.[0];
|
|
61
|
+
const found = byDigest?.releaseDigest ?? byLabel;
|
|
62
|
+
digests = found ? [found] : [];
|
|
63
|
+
if (digests.length === 0)
|
|
64
|
+
reason = `no release is labelled or digested "${ref}"`;
|
|
65
|
+
}
|
|
66
|
+
else if ("deploy" in from) {
|
|
67
|
+
const digest = from.deploy.releaseDigest ?? (await releaseOfAdmission(from.deploy.admission, loc));
|
|
68
|
+
digests = digest ? [digest] : [];
|
|
69
|
+
if (digests.length === 0)
|
|
70
|
+
reason = "the deploy record names no release: it was not made from one";
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const digest = from.gate.releaseDigest;
|
|
74
|
+
digests = digest ? [digest] : [];
|
|
75
|
+
if (digests.length === 0)
|
|
76
|
+
reason = "the gate binds no release: it is not a release gate";
|
|
77
|
+
}
|
|
78
|
+
const known = new Map(releases.map((r) => [r.releaseDigest, r]));
|
|
79
|
+
const wanted = [...new Set(digests)].filter((d) => known.has(d));
|
|
80
|
+
if (digests.length > 0 && wanted.length === 0)
|
|
81
|
+
reason = `release ${digests[0]} is named but its file is not on this checkout's chant/lifecycle`;
|
|
82
|
+
if (wanted.length === 0)
|
|
83
|
+
return { releases: [], ...(reason ? { reason } : {}) };
|
|
84
|
+
const gateLedger = await readGateLedger(RELEASE_GATE_OP, loc);
|
|
85
|
+
// A record names its release by `releaseDigest`, or, with none, through the
|
|
86
|
+
// release gate resolution its admission names (#4045), as releaseOfDeploy reads it.
|
|
87
|
+
const records = [];
|
|
88
|
+
for (const env of await listReleaseEnvironments(loc)) {
|
|
89
|
+
for (const record of (await readReleaseLedger(env, loc)).records) {
|
|
90
|
+
const digest = releaseOfDeploy(record, gateLedger.resolutions);
|
|
91
|
+
if (digest !== undefined && wanted.includes(digest))
|
|
92
|
+
records.push({ record, digest });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const byTime = (a, b) => (a.timestamp < b.timestamp ? -1 : a.timestamp > b.timestamp ? 1 : 0);
|
|
96
|
+
return {
|
|
97
|
+
releases: wanted.map((digest) => {
|
|
98
|
+
const release = known.get(digest);
|
|
99
|
+
return {
|
|
100
|
+
releaseDigest: digest,
|
|
101
|
+
label: labels.get(digest) ?? null,
|
|
102
|
+
commit: release.commit,
|
|
103
|
+
release,
|
|
104
|
+
cuts: cuts.filter((c) => c.releaseDigest === digest),
|
|
105
|
+
gates: {
|
|
106
|
+
pending: gateLedger.pending.filter((p) => p.releaseDigest === digest),
|
|
107
|
+
resolutions: gateLedger.resolutions.filter((r) => r.releaseDigest === digest),
|
|
108
|
+
},
|
|
109
|
+
deploys: records.filter((r) => r.digest === digest).map((r) => r.record).sort(byTime),
|
|
110
|
+
};
|
|
111
|
+
}),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The release a deploy record's admission names, when the record itself has no
|
|
116
|
+
* `releaseDigest`: the resolution it points at, in the release gate's ledger,
|
|
117
|
+
* carries one (#4045).
|
|
118
|
+
*/
|
|
119
|
+
async function releaseOfAdmission(admission, loc) {
|
|
120
|
+
if (!admission || admission.op !== RELEASE_GATE_OP)
|
|
121
|
+
return undefined;
|
|
122
|
+
const { resolutions } = await readGateLedger(RELEASE_GATE_OP, loc);
|
|
123
|
+
return releaseOfDeploy({ admission }, resolutions);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The release a deploy record names, over the release gate's resolutions
|
|
127
|
+
* already read: its own `releaseDigest`, else the one on the resolution its
|
|
128
|
+
* admission names. Undefined when it was not made from a release. The rule
|
|
129
|
+
* {@link joinRelease} follows, for a reader that holds the ledgers already,
|
|
130
|
+
* such as retention's garbage collection (#4036).
|
|
131
|
+
*/
|
|
132
|
+
export function releaseOfDeploy(record, releaseGateResolutions) {
|
|
133
|
+
if (record.releaseDigest !== undefined)
|
|
134
|
+
return record.releaseDigest;
|
|
135
|
+
const admission = record.admission;
|
|
136
|
+
if (!admission || admission.op !== RELEASE_GATE_OP)
|
|
137
|
+
return undefined;
|
|
138
|
+
return releaseGateResolutions.find((r) => r.gate === admission.gate && r.timestamp === admission.resolvedAt && r.releaseDigest !== undefined)?.releaseDigest;
|
|
139
|
+
}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import { type LegacyDigestFlag } from "./legacy-digest.js";
|
|
31
31
|
import { type LedgerLocation } from "./git.js";
|
|
32
|
+
import type { GateResolutionRecord } from "./gate-ledger.js";
|
|
32
33
|
export { validateReleaseRecord, parseReleaseLedger, releaseLedgerLines, readReleaseRecords, listReleaseEnvironmentsOn } from "./release-read.js";
|
|
33
34
|
export type { LedgerReadPort } from "./ledger-port.js";
|
|
34
35
|
/**
|
|
@@ -49,6 +50,35 @@ export interface RunOrigin {
|
|
|
49
50
|
/** Resolved link to the run, when the environment provided enough to build one. */
|
|
50
51
|
url?: string;
|
|
51
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The gate resolution that admitted a deploy (#4020): the gate's address in the
|
|
55
|
+
* gate ledger (`_gates/<op>.jsonl`, `op` and `gate`) and when the resolution
|
|
56
|
+
* was recorded. With `approver` on the same record it names the line a reader
|
|
57
|
+
* opens to see what was approved. Chant 0.124.28 and newer write it.
|
|
58
|
+
*/
|
|
59
|
+
export interface ReleaseAdmission {
|
|
60
|
+
/** The op, or for a component gate the component, whose gate ledger holds the resolution. */
|
|
61
|
+
op: string;
|
|
62
|
+
/** The gate's name. */
|
|
63
|
+
gate: string;
|
|
64
|
+
/** ISO-8601 time the resolution was recorded (`GateResolutionRecord.timestamp`). When several approvals counted, the newest one. */
|
|
65
|
+
resolvedAt: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The approver and admission a release records for the resolutions of its gate
|
|
69
|
+
* (#4020): those of `gate` on `op` bound to `planDigest`. The approver is the
|
|
70
|
+
* distinct `resolvedBy` names, comma joined, as `approver` has always been
|
|
71
|
+
* written by the release activities; `resolvedAt` is the newest one's time.
|
|
72
|
+
* Undefined when no resolution is bound to the plan.
|
|
73
|
+
*/
|
|
74
|
+
export declare function admissionOf(resolutions: readonly GateResolutionRecord[], at: {
|
|
75
|
+
op: string;
|
|
76
|
+
gate: string;
|
|
77
|
+
planDigest?: string;
|
|
78
|
+
}): {
|
|
79
|
+
approver: string;
|
|
80
|
+
admission: ReleaseAdmission;
|
|
81
|
+
} | undefined;
|
|
52
82
|
/**
|
|
53
83
|
* Points at one earlier release record (#2530, #2531, #2604). A record has no id of its own,
|
|
54
84
|
* so it is named by the environment whose ledger holds it plus the run id and
|
|
@@ -118,6 +148,13 @@ export interface ReleaseRecord {
|
|
|
118
148
|
* the one who triggered the deploy (separation of duties).
|
|
119
149
|
*/
|
|
120
150
|
approver?: string;
|
|
151
|
+
/**
|
|
152
|
+
* The gate resolution that admitted this deploy (#4020), for a gated change:
|
|
153
|
+
* which gate (`op` and `gate`) and when it was resolved. The approver is
|
|
154
|
+
* `approver`. Optional and omitted for an ungated change and for a record
|
|
155
|
+
* written before 0.124.28, whose gate cannot be recovered from the record.
|
|
156
|
+
*/
|
|
157
|
+
admission?: ReleaseAdmission;
|
|
121
158
|
/** Optional: the archive's own manifest digest (../components/verbs/build-archive.ts's `manifestDigest`), when the caller has it — lets a reader recover full build contents/provenance, not just the promoted image digest. */
|
|
122
159
|
manifestDigest?: string;
|
|
123
160
|
/**
|
|
@@ -167,6 +204,13 @@ export interface ReleaseRecord {
|
|
|
167
204
|
* partway. Absent on every other record.
|
|
168
205
|
*/
|
|
169
206
|
redeploys?: ReleaseRef;
|
|
207
|
+
/**
|
|
208
|
+
* Optional: the release this deploy came from (#4026, ws-104), the
|
|
209
|
+
* `releaseDigest` of `_releases/<releaseDigest>.json`. Written by
|
|
210
|
+
* `chant components promote --release` since 0.124.28. Absent on every
|
|
211
|
+
* deploy that was not made from a release.
|
|
212
|
+
*/
|
|
213
|
+
releaseDigest?: string;
|
|
170
214
|
}
|
|
171
215
|
/** Thrown by `appendReleaseRecord` when the record is missing a required field — a release record can never be recorded partially, since it is never editable afterward. */
|
|
172
216
|
export declare class InvalidReleaseRecordError extends Error {
|
|
@@ -200,6 +244,16 @@ export declare function resolveRunId(explicit?: string, env?: NodeJS.ProcessEnv)
|
|
|
200
244
|
runId: string;
|
|
201
245
|
runOrigin?: RunOrigin;
|
|
202
246
|
};
|
|
247
|
+
/**
|
|
248
|
+
* The CI run the environment names, with the origin that locates it, or
|
|
249
|
+
* undefined outside CI (#4020). `resolveRunId` takes its CI branches from
|
|
250
|
+
* here, and an Op run record takes its `runOrigin` from here, so a run and the
|
|
251
|
+
* deploy it made name the run the same way.
|
|
252
|
+
*/
|
|
253
|
+
export declare function resolveCiRun(env?: NodeJS.ProcessEnv): {
|
|
254
|
+
runId: string;
|
|
255
|
+
runOrigin: RunOrigin;
|
|
256
|
+
} | undefined;
|
|
203
257
|
/**
|
|
204
258
|
* Append one immutable release record to the `<env>` ledger on the
|
|
205
259
|
* `chant/lifecycle` orphan branch. Throws `InvalidReleaseRecordError` before
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAyC,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAwG,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"release-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/release-ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAyC,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAwG,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAElJ,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC9I,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;OAMG;IACH,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC;IAC5C,gHAAgH;IAChH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6FAA6F;IAC7F,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,oIAAoI;IACpI,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,SAAS,oBAAoB,EAAE,EAC5C,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,gBAAgB,CAAA;CAAE,GAAG,SAAS,CAO/D;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,4FAA4F;IAC5F,OAAO,EAAE,CAAC,CAAC;IACX,6FAA6F;IAC7F,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,iOAAiO;IACjO,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,gOAAgO;IAChO,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,4KAA4K;AAC5K,qBAAa,yBAA0B,SAAQ,KAAK;aACtB,OAAO,EAAE,MAAM,EAAE;IAA7C,YAA4B,OAAO,EAAE,MAAM,EAAE,EAG5C;CACF;AAED,gIAAgI;AAChI,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,CAAC,EAAE,MAAM,EACjB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,CAQ1C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAyBtH;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,kBAAkB,EACzB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC,CASpD;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAS1D;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAEtF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CASvF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,CAE1F"}
|
|
@@ -33,6 +33,22 @@ import { appendReleaseRecordLine, readReleaseLedgerLines, listLedgerEnvironments
|
|
|
33
33
|
import { parseReleaseLedger, validateReleaseRecord } from "./release-read.js";
|
|
34
34
|
// The pure readers live apart, so a bundle can import them without git (#3865).
|
|
35
35
|
export { validateReleaseRecord, parseReleaseLedger, releaseLedgerLines, readReleaseRecords, listReleaseEnvironmentsOn } from "./release-read.js";
|
|
36
|
+
/**
|
|
37
|
+
* The approver and admission a release records for the resolutions of its gate
|
|
38
|
+
* (#4020): those of `gate` on `op` bound to `planDigest`. The approver is the
|
|
39
|
+
* distinct `resolvedBy` names, comma joined, as `approver` has always been
|
|
40
|
+
* written by the release activities; `resolvedAt` is the newest one's time.
|
|
41
|
+
* Undefined when no resolution is bound to the plan.
|
|
42
|
+
*/
|
|
43
|
+
export function admissionOf(resolutions, at) {
|
|
44
|
+
const bound = resolutions.filter((r) => r.gate === at.gate && r.planDigest === at.planDigest);
|
|
45
|
+
if (bound.length === 0)
|
|
46
|
+
return undefined;
|
|
47
|
+
return {
|
|
48
|
+
approver: [...new Set(bound.map((r) => r.resolvedBy))].join(", "),
|
|
49
|
+
admission: { op: at.op, gate: at.gate, resolvedAt: bound.map((r) => r.timestamp).sort().at(-1) },
|
|
50
|
+
};
|
|
51
|
+
}
|
|
36
52
|
/** Thrown by `appendReleaseRecord` when the record is missing a required field — a release record can never be recorded partially, since it is never editable afterward. */
|
|
37
53
|
export class InvalidReleaseRecordError extends Error {
|
|
38
54
|
constructor(missing) {
|
|
@@ -63,31 +79,48 @@ export class InvalidReleaseRecordError extends Error {
|
|
|
63
79
|
* remove.
|
|
64
80
|
*/
|
|
65
81
|
export function resolveRunId(explicit, env = process.env) {
|
|
66
|
-
const
|
|
67
|
-
forge: "github",
|
|
68
|
-
...(env.GITHUB_REPOSITORY ? { repo: env.GITHUB_REPOSITORY } : {}),
|
|
69
|
-
...(env.GITHUB_SERVER_URL && env.GITHUB_REPOSITORY
|
|
70
|
-
? { url: `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${id}` }
|
|
71
|
-
: {}),
|
|
72
|
-
});
|
|
73
|
-
const gitlabOrigin = () => ({
|
|
74
|
-
forge: "gitlab",
|
|
75
|
-
...(env.CI_PROJECT_PATH ? { repo: env.CI_PROJECT_PATH } : {}),
|
|
76
|
-
...(env.CI_PIPELINE_URL ? { url: env.CI_PIPELINE_URL } : {}),
|
|
77
|
-
});
|
|
82
|
+
const ci = resolveCiRun(env);
|
|
78
83
|
if (explicit) {
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
81
|
-
if (env.CI_PIPELINE_ID && explicit === env.CI_PIPELINE_ID)
|
|
82
|
-
return { runId: explicit, runOrigin: gitlabOrigin() };
|
|
84
|
+
if (ci && explicit === ci.runId)
|
|
85
|
+
return ci;
|
|
83
86
|
return { runId: explicit };
|
|
84
87
|
}
|
|
85
|
-
if (
|
|
86
|
-
return
|
|
87
|
-
if (env.CI_PIPELINE_ID)
|
|
88
|
-
return { runId: env.CI_PIPELINE_ID, runOrigin: gitlabOrigin() };
|
|
88
|
+
if (ci)
|
|
89
|
+
return ci;
|
|
89
90
|
return { runId: `local-${Date.now()}`, runOrigin: { forge: "local" } };
|
|
90
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* The CI run the environment names, with the origin that locates it, or
|
|
94
|
+
* undefined outside CI (#4020). `resolveRunId` takes its CI branches from
|
|
95
|
+
* here, and an Op run record takes its `runOrigin` from here, so a run and the
|
|
96
|
+
* deploy it made name the run the same way.
|
|
97
|
+
*/
|
|
98
|
+
export function resolveCiRun(env = process.env) {
|
|
99
|
+
if (env.GITHUB_RUN_ID) {
|
|
100
|
+
const id = env.GITHUB_RUN_ID;
|
|
101
|
+
return {
|
|
102
|
+
runId: id,
|
|
103
|
+
runOrigin: {
|
|
104
|
+
forge: "github",
|
|
105
|
+
...(env.GITHUB_REPOSITORY ? { repo: env.GITHUB_REPOSITORY } : {}),
|
|
106
|
+
...(env.GITHUB_SERVER_URL && env.GITHUB_REPOSITORY
|
|
107
|
+
? { url: `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${id}` }
|
|
108
|
+
: {}),
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if (env.CI_PIPELINE_ID) {
|
|
113
|
+
return {
|
|
114
|
+
runId: env.CI_PIPELINE_ID,
|
|
115
|
+
runOrigin: {
|
|
116
|
+
forge: "gitlab",
|
|
117
|
+
...(env.CI_PROJECT_PATH ? { repo: env.CI_PROJECT_PATH } : {}),
|
|
118
|
+
...(env.CI_PIPELINE_URL ? { url: env.CI_PIPELINE_URL } : {}),
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
91
124
|
/**
|
|
92
125
|
* Append one immutable release record to the `<env>` ledger on the
|
|
93
126
|
* `chant/lifecycle` orphan branch. Throws `InvalidReleaseRecordError` before
|