@intentius/chant 0.124.54 → 0.124.56
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/__fixtures__/estate-ledger.d.ts +13 -0
- package/dist/__fixtures__/estate-ledger.d.ts.map +1 -0
- package/dist/__fixtures__/estate-ledger.js +67 -0
- package/dist/__fixtures__/oidc-emulator.d.ts +11 -1
- package/dist/__fixtures__/oidc-emulator.d.ts.map +1 -1
- package/dist/__fixtures__/oidc-emulator.js +26 -2
- package/dist/__fixtures__/product-words.d.ts +78 -0
- package/dist/__fixtures__/product-words.d.ts.map +1 -0
- package/dist/__fixtures__/product-words.js +43 -0
- package/dist/__golden__/wave-loop/op-by-apply-after-fails.json +10 -2
- package/dist/__golden__/wave-loop/op-by-apply-hold.json +20 -4
- package/dist/__golden__/wave-loop/op-by-apply-ignored.json +10 -2
- package/dist/__golden__/wave-loop/op-by-apply-pass.json +10 -2
- package/dist/__golden__/wave-loop/op-by-apply-skip.json +10 -2
- package/dist/__golden__/wave-loop/op-discover-rest-stops.json +22 -6
- package/dist/__golden__/wave-loop/op-discover-rest.json +44 -12
- package/dist/__golden__/wave-loop/op-discover-wide.json +12 -3
- package/dist/__golden__/wave-loop/op-held-on.json +28 -7
- package/dist/__golden__/wave-loop/op-hooks-apply-fails.json +22 -6
- package/dist/__golden__/wave-loop/op-hooks-fail-after-apply.json +22 -6
- package/dist/__golden__/wave-loop/op-hooks-fail-before-apply.json +4 -2
- package/dist/__golden__/wave-loop/op-hooks-held.json +26 -8
- package/dist/__golden__/wave-loop/op-hooks-hold-before-apply.json +18 -4
- package/dist/__golden__/wave-loop/op-hooks-pass.json +22 -6
- package/dist/__golden__/wave-loop/op-hooks-share.json +20 -7
- package/dist/__golden__/wave-loop/op-outcome-held.json +12 -3
- package/dist/__golden__/wave-loop/op-outcome-replan-approved.json +16 -5
- package/dist/__golden__/wave-loop/op-outcome-replan-forever.json +48 -21
- package/dist/__golden__/wave-loop/op-outcome-replan.json +16 -5
- package/dist/__golden__/wave-loop/op-outcome-stood-down.json +12 -3
- package/dist/__golden__/wave-loop/op-outcome-unreadable.json +12 -3
- package/dist/__golden__/wave-loop/op-overridden.json +28 -7
- package/dist/__golden__/wave-loop/op-per-run.json +20 -4
- package/dist/__golden__/wave-loop/op-point.json +18 -4
- package/dist/__golden__/wave-loop/op-pr-review.json +10 -2
- package/dist/__golden__/wave-loop/op-spend-change-only.json +10 -2
- package/dist/__golden__/wave-loop/op-spend.json +10 -2
- package/dist/__golden__/wave-loop/op-wave-commands.json +56 -13
- package/dist/__golden__/wave-loop/op-wide.json +20 -4
- package/dist/bucket-check/azure.d.ts +108 -0
- package/dist/bucket-check/azure.d.ts.map +1 -0
- package/dist/bucket-check/azure.js +258 -0
- package/dist/bucket-check/fixtures/azure.json +153 -0
- package/dist/bucket-check/fixtures/gcs.json +148 -0
- package/dist/bucket-check/fixtures/s3.json +277 -0
- package/dist/bucket-check/gcs.d.ts +77 -0
- package/dist/bucket-check/gcs.d.ts.map +1 -0
- package/dist/bucket-check/gcs.js +202 -0
- package/dist/bucket-check/index.d.ts +48 -0
- package/dist/bucket-check/index.d.ts.map +1 -0
- package/dist/bucket-check/index.js +44 -0
- package/dist/bucket-check/s3.d.ts +116 -0
- package/dist/bucket-check/s3.d.ts.map +1 -0
- package/dist/bucket-check/s3.js +362 -0
- package/dist/bucket-check/types.d.ts +66 -0
- package/dist/bucket-check/types.d.ts.map +1 -0
- package/dist/bucket-check/types.js +31 -0
- package/dist/bucket-check/wire.d.ts +27 -0
- package/dist/bucket-check/wire.d.ts.map +1 -0
- package/dist/bucket-check/wire.js +32 -0
- package/dist/bucket-check.d.ts +6 -0
- package/dist/bucket-check.d.ts.map +1 -0
- package/dist/bucket-check.js +5 -0
- package/dist/capabilities/templates.d.ts.map +1 -1
- package/dist/capabilities/templates.js +1 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +2 -3
- package/dist/ci-agent.d.ts +381 -0
- package/dist/ci-agent.d.ts.map +1 -0
- package/dist/ci-agent.js +832 -0
- package/dist/ci-audit/attribution.d.ts +111 -0
- package/dist/ci-audit/attribution.d.ts.map +1 -0
- package/dist/ci-audit/attribution.js +194 -0
- package/dist/ci-audit/audit-log.d.ts +144 -0
- package/dist/ci-audit/audit-log.d.ts.map +1 -0
- package/dist/ci-audit/audit-log.js +149 -0
- package/dist/ci-audit/index.d.ts +12 -0
- package/dist/ci-audit/index.d.ts.map +1 -0
- package/dist/ci-audit/index.js +12 -0
- package/dist/ci-audit/unrecorded.d.ts +74 -0
- package/dist/ci-audit/unrecorded.d.ts.map +1 -0
- package/dist/ci-audit/unrecorded.js +95 -0
- package/dist/ci-audit.d.ts +3 -0
- package/dist/ci-audit.d.ts.map +1 -0
- package/dist/ci-audit.js +2 -0
- package/dist/ci-control.d.ts +42 -0
- package/dist/ci-control.d.ts.map +1 -0
- package/dist/ci-control.js +41 -0
- package/dist/ci-estate/delivery.d.ts +137 -0
- package/dist/ci-estate/delivery.d.ts.map +1 -0
- package/dist/ci-estate/delivery.js +311 -0
- package/dist/ci-estate/overdue.d.ts +34 -0
- package/dist/ci-estate/overdue.d.ts.map +1 -0
- package/dist/ci-estate/overdue.js +58 -0
- package/dist/ci-estate/page.d.ts +134 -0
- package/dist/ci-estate/page.d.ts.map +1 -0
- package/dist/ci-estate/page.js +233 -0
- package/dist/ci-estate/rows.d.ts +118 -0
- package/dist/ci-estate/rows.d.ts.map +1 -0
- package/dist/ci-estate/rows.js +126 -0
- package/dist/ci-estate.d.ts +92 -0
- package/dist/ci-estate.d.ts.map +1 -0
- package/dist/ci-estate.js +82 -0
- package/dist/ci-handover.d.ts +29 -5
- package/dist/ci-handover.d.ts.map +1 -1
- package/dist/ci-handover.js +50 -16
- package/dist/ci-identity.d.ts +82 -7
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +86 -15
- package/dist/ci-job-guard.d.ts +139 -0
- package/dist/ci-job-guard.d.ts.map +1 -0
- package/dist/ci-job-guard.js +287 -0
- package/dist/ci-jobs.d.ts +7 -0
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +7 -0
- package/dist/ci-product-words.d.ts +296 -0
- package/dist/ci-product-words.d.ts.map +1 -0
- package/dist/ci-product-words.js +407 -0
- package/dist/ci-product.d.ts +117 -0
- package/dist/ci-product.d.ts.map +1 -0
- package/dist/ci-product.js +113 -0
- package/dist/ci-respond-run.d.ts +73 -0
- package/dist/ci-respond-run.d.ts.map +1 -0
- package/dist/ci-respond-run.js +247 -0
- package/dist/ci-respond.d.ts +189 -0
- package/dist/ci-respond.d.ts.map +1 -0
- package/dist/ci-respond.js +285 -0
- package/dist/cli/commands/audit.d.ts +2 -2
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +3 -2
- package/dist/cli/commands/carve.js +2 -2
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +1 -1
- package/dist/cli/handlers/agent.d.ts +17 -0
- package/dist/cli/handlers/agent.d.ts.map +1 -0
- package/dist/cli/handlers/agent.js +114 -0
- package/dist/cli/handlers/approve-confirm.d.ts +84 -0
- package/dist/cli/handlers/approve-confirm.d.ts.map +1 -0
- package/dist/cli/handlers/approve-confirm.js +142 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +19 -1
- package/dist/cli/handlers/audit-log.d.ts +12 -0
- package/dist/cli/handlers/audit-log.d.ts.map +1 -0
- package/dist/cli/handlers/audit-log.js +81 -0
- package/dist/cli/handlers/build.d.ts +7 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +124 -1
- package/dist/cli/handlers/ci-check-job.d.ts +11 -0
- package/dist/cli/handlers/ci-check-job.d.ts.map +1 -0
- package/dist/cli/handlers/ci-check-job.js +27 -0
- package/dist/cli/handlers/ci-check.d.ts +3 -0
- package/dist/cli/handlers/ci-check.d.ts.map +1 -0
- package/dist/cli/handlers/ci-check.js +63 -0
- package/dist/cli/handlers/ci-forge-check.d.ts +3 -0
- package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -0
- package/dist/cli/handlers/ci-forge-check.js +89 -0
- package/dist/cli/handlers/e2e-safe-run.d.ts +12 -0
- package/dist/cli/handlers/e2e-safe-run.d.ts.map +1 -0
- package/dist/cli/handlers/e2e-safe-run.js +23 -0
- package/dist/cli/handlers/fan-out.js +4 -0
- package/dist/cli/handlers/gate-pending.d.ts +11 -0
- package/dist/cli/handlers/gate-pending.d.ts.map +1 -0
- package/dist/cli/handlers/gate-pending.js +44 -0
- package/dist/cli/handlers/init.d.ts.map +1 -1
- package/dist/cli/handlers/init.js +1 -0
- package/dist/cli/handlers/ledger.js +1 -1
- package/dist/cli/handlers/lifecycle-drift.d.ts +6 -2
- package/dist/cli/handlers/lifecycle-drift.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle-drift.js +7 -2
- package/dist/cli/handlers/lock.d.ts.map +1 -1
- package/dist/cli/handlers/lock.js +64 -5
- package/dist/cli/handlers/notify-relay.d.ts +15 -0
- package/dist/cli/handlers/notify-relay.d.ts.map +1 -0
- package/dist/cli/handlers/notify-relay.js +130 -0
- package/dist/cli/handlers/pr-env.d.ts.map +1 -1
- package/dist/cli/handlers/pr-env.js +42 -11
- package/dist/cli/handlers/pr.d.ts +43 -3
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +908 -205
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +21 -2
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +3 -0
- package/dist/cli/handlers/run-wave.d.ts +8 -0
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +160 -2
- package/dist/cli/handlers/run.d.ts +6 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +86 -1
- package/dist/cli/handlers/serve.d.ts.map +1 -1
- package/dist/cli/handlers/serve.js +10 -1
- package/dist/cli/main.d.ts +11 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +178 -13
- package/dist/cli/mcp/ledger-tools.d.ts +36 -0
- package/dist/cli/mcp/ledger-tools.d.ts.map +1 -0
- package/dist/cli/mcp/ledger-tools.js +122 -0
- package/dist/cli/mcp/product-tools.d.ts +78 -0
- package/dist/cli/mcp/product-tools.d.ts.map +1 -0
- package/dist/cli/mcp/product-tools.js +93 -0
- package/dist/cli/mcp/read-only.d.ts +34 -0
- package/dist/cli/mcp/read-only.d.ts.map +1 -0
- package/dist/cli/mcp/read-only.js +61 -0
- package/dist/cli/mcp/report-tools.d.ts +48 -0
- package/dist/cli/mcp/report-tools.d.ts.map +1 -0
- package/dist/cli/mcp/report-tools.js +128 -0
- package/dist/cli/mcp/server.d.ts +28 -1
- package/dist/cli/mcp/server.d.ts.map +1 -1
- package/dist/cli/mcp/server.js +86 -15
- package/dist/cli/mcp-config.d.ts +9 -2
- package/dist/cli/mcp-config.d.ts.map +1 -1
- package/dist/cli/mcp-config.js +8 -3
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +164 -3
- package/dist/cli/registry.d.ts +73 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cloud-lister/sigv4.d.ts +42 -7
- package/dist/cloud-lister/sigv4.d.ts.map +1 -1
- package/dist/cloud-lister/sigv4.js +72 -22
- package/dist/components/adoption.d.ts +69 -0
- package/dist/components/adoption.d.ts.map +1 -0
- package/dist/components/adoption.js +92 -0
- package/dist/components/apply-lease.d.ts +19 -0
- package/dist/components/apply-lease.d.ts.map +1 -0
- package/dist/components/apply-lease.js +41 -0
- package/dist/components/capability.d.ts +159 -5
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/capability.js +39 -6
- package/dist/components/check-hooks.d.ts +116 -0
- package/dist/components/check-hooks.d.ts.map +1 -0
- package/dist/components/check-hooks.js +192 -0
- package/dist/components/check-steps.d.ts +74 -0
- package/dist/components/check-steps.d.ts.map +1 -0
- package/dist/components/check-steps.js +102 -0
- package/dist/components/ci-services.d.ts +57 -0
- package/dist/components/ci-services.d.ts.map +1 -0
- package/dist/components/ci-services.js +60 -0
- package/dist/components/cli-support.d.ts +13 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +10 -2
- package/dist/components/driver.d.ts +32 -3
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +59 -5
- package/dist/components/fan-out-run.d.ts +12 -0
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +56 -16
- package/dist/components/groups.d.ts.map +1 -1
- package/dist/components/groups.js +23 -5
- package/dist/components/pr-env-ledger.d.ts +32 -0
- package/dist/components/pr-env-ledger.d.ts.map +1 -0
- package/dist/components/pr-env-ledger.js +38 -0
- package/dist/components/pr-env-ports.d.ts +12 -0
- package/dist/components/pr-env-ports.d.ts.map +1 -1
- package/dist/components/pr-env-ports.js +13 -3
- package/dist/components/pr-env-run.d.ts +6 -0
- package/dist/components/pr-env-run.d.ts.map +1 -1
- package/dist/components/pr-env-run.js +3 -2
- package/dist/components/pr-environment.d.ts +32 -4
- package/dist/components/pr-environment.d.ts.map +1 -1
- package/dist/components/pr-environment.js +26 -8
- package/dist/components/pr-pipeline.d.ts +297 -5
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +329 -18
- package/dist/components/pr-policy.d.ts +26 -2
- package/dist/components/pr-policy.d.ts.map +1 -1
- package/dist/components/pr-policy.js +41 -7
- package/dist/components/pr-run.d.ts +71 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +91 -7
- package/dist/components/pr-targets.d.ts +24 -0
- package/dist/components/pr-targets.d.ts.map +1 -0
- package/dist/components/pr-targets.js +48 -0
- package/dist/components/product-pipeline.d.ts +250 -0
- package/dist/components/product-pipeline.d.ts.map +1 -0
- package/dist/components/product-pipeline.js +212 -0
- package/dist/components/promote.d.ts +6 -0
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +4 -1
- package/dist/components/release-compile.d.ts +22 -1
- package/dist/components/release-compile.d.ts.map +1 -1
- package/dist/components/release-compile.js +85 -0
- package/dist/components/release-promote.d.ts +15 -1
- package/dist/components/release-promote.d.ts.map +1 -1
- package/dist/components/release-promote.js +67 -2
- package/dist/components/repo-lock.d.ts +27 -0
- package/dist/components/repo-lock.d.ts.map +1 -0
- package/dist/components/repo-lock.js +49 -0
- package/dist/components/row-lease.d.ts +84 -0
- package/dist/components/row-lease.d.ts.map +1 -0
- package/dist/components/row-lease.js +110 -0
- package/dist/components/wave-plan.d.ts +42 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +72 -4
- package/dist/control/applied.d.ts +89 -0
- package/dist/control/applied.d.ts.map +1 -0
- package/dist/control/applied.js +175 -0
- package/dist/control/consumers.d.ts +78 -0
- package/dist/control/consumers.d.ts.map +1 -0
- package/dist/control/consumers.js +172 -0
- package/dist/control/dispatch.d.ts +334 -0
- package/dist/control/dispatch.d.ts.map +1 -0
- package/dist/control/dispatch.js +519 -0
- package/dist/control/edges.d.ts +75 -0
- package/dist/control/edges.d.ts.map +1 -0
- package/dist/control/edges.js +133 -0
- package/dist/control/reconcile.d.ts +120 -0
- package/dist/control/reconcile.d.ts.map +1 -0
- package/dist/control/reconcile.js +178 -0
- package/dist/control/records.d.ts +187 -0
- package/dist/control/records.d.ts.map +1 -0
- package/dist/control/records.js +307 -0
- package/dist/discovery/sandbox/bundle.d.ts.map +1 -1
- package/dist/discovery/sandbox/bundle.js +25 -1
- package/dist/e2e-harness/bucket.d.ts +21 -0
- package/dist/e2e-harness/bucket.d.ts.map +1 -0
- package/dist/e2e-harness/bucket.js +61 -0
- package/dist/e2e-harness/claim.d.ts +70 -0
- package/dist/e2e-harness/claim.d.ts.map +1 -0
- package/dist/e2e-harness/claim.js +98 -0
- package/dist/e2e-harness/driver.d.ts +64 -0
- package/dist/e2e-harness/driver.d.ts.map +1 -0
- package/dist/e2e-harness/driver.js +243 -0
- package/dist/e2e-harness/forgejo.d.ts +77 -0
- package/dist/e2e-harness/forgejo.d.ts.map +1 -0
- package/dist/e2e-harness/forgejo.js +205 -0
- package/dist/e2e-harness/git.d.ts +32 -0
- package/dist/e2e-harness/git.d.ts.map +1 -0
- package/dist/e2e-harness/git.js +67 -0
- package/dist/e2e-harness/index.d.ts +22 -0
- package/dist/e2e-harness/index.d.ts.map +1 -0
- package/dist/e2e-harness/index.js +48 -0
- package/dist/e2e-harness/jobs.d.ts +8 -0
- package/dist/e2e-harness/jobs.d.ts.map +1 -0
- package/dist/e2e-harness/jobs.js +34 -0
- package/dist/e2e-harness/pins.d.ts +45 -0
- package/dist/e2e-harness/pins.d.ts.map +1 -0
- package/dist/e2e-harness/pins.js +44 -0
- package/dist/e2e-harness/ports.d.ts +113 -0
- package/dist/e2e-harness/ports.d.ts.map +1 -0
- package/dist/e2e-harness/ports.js +4 -0
- package/dist/e2e-harness/reports.d.ts +45 -0
- package/dist/e2e-harness/reports.d.ts.map +1 -0
- package/dist/e2e-harness/reports.js +57 -0
- package/dist/e2e-harness/safe-run-cli.d.ts +17 -0
- package/dist/e2e-harness/safe-run-cli.d.ts.map +1 -0
- package/dist/e2e-harness/safe-run-cli.js +43 -0
- package/dist/e2e-harness/safe-run.d.ts +61 -0
- package/dist/e2e-harness/safe-run.d.ts.map +1 -0
- package/dist/e2e-harness/safe-run.js +172 -0
- package/dist/e2e-harness/scenario.d.ts +11 -0
- package/dist/e2e-harness/scenario.d.ts.map +1 -0
- package/dist/e2e-harness/scenario.js +89 -0
- package/dist/e2e-harness/schemas/demo-cycle.schema.json +282 -0
- package/dist/e2e-harness/schemas/demo-step.schema.json +245 -0
- package/dist/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
- package/dist/e2e-harness/schemas/e2e-claims.schema.json +18 -0
- package/dist/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
- package/dist/e2e-harness/schemas/index.d.ts +191 -0
- package/dist/e2e-harness/schemas/index.d.ts.map +1 -0
- package/dist/e2e-harness/schemas/index.js +62 -0
- package/dist/e2e-harness/stack.d.ts +124 -0
- package/dist/e2e-harness/stack.d.ts.map +1 -0
- package/dist/e2e-harness/stack.js +207 -0
- package/dist/e2e-harness/steps.d.ts +11 -0
- package/dist/e2e-harness/steps.d.ts.map +1 -0
- package/dist/e2e-harness/steps.js +22 -0
- package/dist/e2e-harness.d.ts +3 -0
- package/dist/e2e-harness.d.ts.map +1 -0
- package/dist/e2e-harness.js +2 -0
- package/dist/engine-facts.d.ts.map +1 -1
- package/dist/engine-facts.js +1 -2
- package/dist/exit-codes.d.ts +54 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +55 -0
- package/dist/forge-check/check.d.ts +63 -0
- package/dist/forge-check/check.d.ts.map +1 -0
- package/dist/forge-check/check.js +139 -0
- package/dist/forge-check/contract.d.ts +152 -0
- package/dist/forge-check/contract.d.ts.map +1 -0
- package/dist/forge-check/contract.js +118 -0
- package/dist/forge-check/forge.d.ts +42 -0
- package/dist/forge-check/forge.d.ts.map +1 -0
- package/dist/forge-check/forge.js +338 -0
- package/dist/forge-check/index.d.ts +24 -0
- package/dist/forge-check/index.d.ts.map +1 -0
- package/dist/forge-check/index.js +23 -0
- package/dist/forge-check/pulumi.d.ts +44 -0
- package/dist/forge-check/pulumi.d.ts.map +1 -0
- package/dist/forge-check/pulumi.js +184 -0
- package/dist/forge-check/read-only.d.ts +26 -0
- package/dist/forge-check/read-only.d.ts.map +1 -0
- package/dist/forge-check/read-only.js +53 -0
- package/dist/forge-check/trust.d.ts +94 -0
- package/dist/forge-check/trust.d.ts.map +1 -0
- package/dist/forge-check/trust.js +532 -0
- package/dist/forge-check/types.d.ts +80 -0
- package/dist/forge-check/types.d.ts.map +1 -0
- package/dist/forge-check/types.js +18 -0
- package/dist/forge-check.d.ts +6 -0
- package/dist/forge-check.d.ts.map +1 -0
- package/dist/forge-check.js +5 -0
- package/dist/gate-decision.d.ts +1 -0
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +2 -0
- package/dist/gate-policy.d.ts +47 -1
- package/dist/gate-policy.d.ts.map +1 -1
- package/dist/gate-policy.js +50 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lexicon.d.ts +152 -6
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/adoption-file.d.ts +24 -0
- package/dist/lifecycle/adoption-file.d.ts.map +1 -1
- package/dist/lifecycle/adoption-file.js +1 -2
- package/dist/lifecycle/cloud-index.d.ts.map +1 -1
- package/dist/lifecycle/cloud-index.js +1 -2
- package/dist/lifecycle/gate-applied.d.ts +6 -0
- package/dist/lifecycle/gate-applied.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +29 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +10 -1
- package/dist/lifecycle/gate-pending-by-plan.d.ts +75 -0
- package/dist/lifecycle/gate-pending-by-plan.d.ts.map +1 -0
- package/dist/lifecycle/gate-pending-by-plan.js +96 -0
- package/dist/lifecycle/gated-request-digest.d.ts +28 -0
- package/dist/lifecycle/gated-request-digest.d.ts.map +1 -0
- package/dist/lifecycle/gated-request-digest.js +35 -0
- package/dist/lifecycle/gated-request.d.ts +126 -0
- package/dist/lifecycle/gated-request.d.ts.map +1 -0
- package/dist/lifecycle/gated-request.js +204 -0
- package/dist/lifecycle/identity-match.d.ts +15 -0
- package/dist/lifecycle/identity-match.d.ts.map +1 -1
- package/dist/lifecycle/identity-match.js +11 -6
- package/dist/lifecycle/index-diff.d.ts +40 -0
- package/dist/lifecycle/index-diff.d.ts.map +1 -1
- package/dist/lifecycle/index-diff.js +1 -2
- package/dist/lifecycle/index-document.d.ts.map +1 -1
- package/dist/lifecycle/index-document.js +1 -2
- package/dist/lifecycle/index-import.d.ts +4 -1
- package/dist/lifecycle/index-import.d.ts.map +1 -1
- package/dist/lifecycle/index-import.js +29 -32
- package/dist/lifecycle/ledger-read.d.ts.map +1 -1
- package/dist/lifecycle/ledger-read.js +7 -3
- package/dist/lifecycle/lock-rows.d.ts +76 -0
- package/dist/lifecycle/lock-rows.d.ts.map +1 -0
- package/dist/lifecycle/lock-rows.js +140 -0
- package/dist/lifecycle/query.d.ts +50 -3
- package/dist/lifecycle/query.d.ts.map +1 -1
- package/dist/lifecycle/query.js +97 -7
- package/dist/lifecycle/release-catalog-site.d.ts +66 -0
- package/dist/lifecycle/release-catalog-site.d.ts.map +1 -0
- package/dist/lifecycle/release-catalog-site.js +232 -0
- package/dist/lifecycle/release-catalog.d.ts +201 -0
- package/dist/lifecycle/release-catalog.d.ts.map +1 -0
- package/dist/lifecycle/release-catalog.js +198 -0
- package/dist/lifecycle/release-changelog.d.ts +41 -0
- package/dist/lifecycle/release-changelog.d.ts.map +1 -0
- package/dist/lifecycle/release-changelog.js +38 -0
- package/dist/lifecycle/release-cut.d.ts +1 -0
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +1 -1
- package/dist/lifecycle/release-ledger.d.ts +16 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +9 -0
- package/dist/lifecycle/release-publish.d.ts +43 -22
- package/dist/lifecycle/release-publish.d.ts.map +1 -1
- package/dist/lifecycle/release-read.d.ts.map +1 -1
- package/dist/lifecycle/release-read.js +3 -0
- package/dist/lifecycle/release-status.d.ts +106 -0
- package/dist/lifecycle/release-status.d.ts.map +1 -0
- package/dist/lifecycle/release-status.js +115 -0
- package/dist/lifecycle/resource-lock.d.ts +120 -0
- package/dist/lifecycle/resource-lock.d.ts.map +1 -0
- package/dist/lifecycle/resource-lock.js +317 -0
- package/dist/lifecycle/retention.d.ts.map +1 -1
- package/dist/lifecycle/retention.js +3 -0
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +9 -1
- package/dist/lifecycle/snapshot-store-s3.d.ts +36 -3
- package/dist/lifecycle/snapshot-store-s3.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store-s3.js +9 -44
- package/dist/lifecycle/snapshot-store.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store.js +1 -2
- package/dist/lifecycle/target-lock.d.ts +15 -0
- package/dist/lifecycle/target-lock.d.ts.map +1 -1
- package/dist/lifecycle/target-lock.js +25 -10
- package/dist/lifecycle/wave-plans.d.ts +23 -7
- package/dist/lifecycle/wave-plans.d.ts.map +1 -1
- package/dist/lifecycle/wave-plans.js +9 -2
- package/dist/mcp/types.d.ts +7 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/notify-product.d.ts +43 -0
- package/dist/notify-product.d.ts.map +1 -0
- package/dist/notify-product.js +58 -0
- package/dist/notify-relay.d.ts +197 -0
- package/dist/notify-relay.d.ts.map +1 -0
- package/dist/notify-relay.js +321 -0
- package/dist/notify.d.ts +44 -4
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +77 -14
- package/dist/object-store/azure-blob.d.ts +129 -0
- package/dist/object-store/azure-blob.d.ts.map +1 -0
- package/dist/object-store/azure-blob.js +341 -0
- package/dist/object-store/common.d.ts +108 -0
- package/dist/object-store/common.d.ts.map +1 -0
- package/dist/object-store/common.js +80 -0
- package/dist/object-store/errors.d.ts +28 -0
- package/dist/object-store/errors.d.ts.map +1 -0
- package/dist/object-store/errors.js +21 -0
- package/dist/object-store/from-env.d.ts +18 -0
- package/dist/object-store/from-env.d.ts.map +1 -0
- package/dist/object-store/from-env.js +22 -0
- package/dist/object-store/gcs.d.ts +106 -0
- package/dist/object-store/gcs.d.ts.map +1 -0
- package/dist/object-store/gcs.js +393 -0
- package/dist/object-store/index.d.ts +9 -0
- package/dist/object-store/index.d.ts.map +1 -0
- package/dist/object-store/index.js +8 -0
- package/dist/object-store/s3.d.ts +146 -0
- package/dist/object-store/s3.d.ts.map +1 -0
- package/dist/object-store/s3.js +306 -0
- package/dist/op/activities/converge.d.ts.map +1 -1
- package/dist/op/activities/converge.js +2 -1
- package/dist/op/activities/index.d.ts +1 -1
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/index.js +1 -1
- package/dist/op/activities/review-agent.d.ts +55 -2
- package/dist/op/activities/review-agent.d.ts.map +1 -1
- package/dist/op/activities/review-agent.js +65 -5
- package/dist/op/approval-status.d.ts +103 -0
- package/dist/op/approval-status.d.ts.map +1 -0
- package/dist/op/approval-status.js +197 -0
- package/dist/op/gate.d.ts +29 -1
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +59 -23
- package/dist/op/generate-pipeline.d.ts.map +1 -1
- package/dist/op/generate-pipeline.js +7 -1
- package/dist/op/index.d.ts +12 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +7 -1
- package/dist/op/op-waves-after-plan.d.ts +137 -0
- package/dist/op/op-waves-after-plan.d.ts.map +1 -0
- package/dist/op/op-waves-after-plan.js +163 -0
- package/dist/op/op-waves-capability-spec.d.ts +63 -0
- package/dist/op/op-waves-capability-spec.d.ts.map +1 -0
- package/dist/op/op-waves-capability-spec.js +115 -0
- package/dist/op/op-waves-capability.d.ts +197 -0
- package/dist/op/op-waves-capability.d.ts.map +1 -0
- package/dist/op/op-waves-capability.js +311 -0
- package/dist/op/op-waves-events.d.ts +54 -0
- package/dist/op/op-waves-events.d.ts.map +1 -0
- package/dist/op/op-waves-events.js +122 -0
- package/dist/op/op-waves-notify.d.ts +7 -1
- package/dist/op/op-waves-notify.d.ts.map +1 -1
- package/dist/op/op-waves-notify.js +35 -16
- package/dist/op/op-waves-release-port.d.ts +18 -0
- package/dist/op/op-waves-release-port.d.ts.map +1 -0
- package/dist/op/op-waves-release-port.js +61 -0
- package/dist/op/op-waves-release.d.ts +92 -0
- package/dist/op/op-waves-release.d.ts.map +1 -0
- package/dist/op/op-waves-release.js +96 -0
- package/dist/op/op-waves-run.d.ts +182 -6
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +1076 -44
- package/dist/op/op-waves-stand-down.d.ts +60 -0
- package/dist/op/op-waves-stand-down.d.ts.map +1 -0
- package/dist/op/op-waves-stand-down.js +96 -0
- package/dist/op/op-waves.d.ts +187 -8
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +203 -19
- package/dist/op/runtime.d.ts +95 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtime.js +18 -0
- package/dist/op/stage-hooks.d.ts +45 -7
- package/dist/op/stage-hooks.d.ts.map +1 -1
- package/dist/op/stage-hooks.js +61 -3
- package/dist/op/steward-beside.d.ts.map +1 -1
- package/dist/op/steward-beside.js +2 -1
- package/dist/op/types.d.ts +2 -2
- package/dist/op/types.d.ts.map +1 -1
- package/dist/op/types.js +3 -2
- package/dist/otlp-metrics.d.ts +38 -0
- package/dist/otlp-metrics.d.ts.map +1 -0
- package/dist/otlp-metrics.js +82 -0
- package/dist/otlp.d.ts +249 -0
- package/dist/otlp.d.ts.map +1 -0
- package/dist/otlp.js +425 -0
- package/dist/override-gate.d.ts.map +1 -1
- package/dist/override-gate.js +5 -0
- package/dist/parallelism.d.ts +17 -0
- package/dist/parallelism.d.ts.map +1 -0
- package/dist/parallelism.js +33 -0
- package/dist/policy-packs.d.ts +69 -0
- package/dist/policy-packs.d.ts.map +1 -0
- package/dist/policy-packs.js +205 -0
- package/dist/policy-source.d.ts +51 -0
- package/dist/policy-source.d.ts.map +1 -0
- package/dist/policy-source.js +102 -0
- package/dist/pr-forge.d.ts +40 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +146 -37
- package/dist/pr-loop.d.ts +158 -11
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +302 -44
- package/dist/pr-merge.d.ts +64 -0
- package/dist/pr-merge.d.ts.map +1 -0
- package/dist/pr-merge.js +78 -0
- package/dist/pr-post.d.ts +86 -1
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +141 -5
- package/dist/pr-report-url.d.ts +32 -4
- package/dist/pr-report-url.d.ts.map +1 -1
- package/dist/pr-report-url.js +45 -5
- package/dist/pr-requires.d.ts +13 -2
- package/dist/pr-requires.d.ts.map +1 -1
- package/dist/pr-requires.js +14 -0
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/run-event.d.ts +26 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/run-event.js +3 -1
- package/dist/scheduled-op-cloud.d.ts +32 -0
- package/dist/scheduled-op-cloud.d.ts.map +1 -0
- package/dist/scheduled-op-cloud.js +69 -0
- package/dist/sorted-json.d.ts +10 -0
- package/dist/sorted-json.d.ts.map +1 -0
- package/dist/sorted-json.js +14 -0
- package/dist/terraform/credentials.d.ts +59 -0
- package/dist/terraform/credentials.d.ts.map +1 -0
- package/dist/terraform/credentials.js +149 -0
- package/dist/utils.d.ts +1 -4
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -9
- package/dist/wave-runtime.d.ts +1 -1
- package/dist/wave-runtime.js +2 -2
- package/dist/wave-runtime.mjs +405 -287
- package/dist/workspace/chant-migrations/chud-lexicon-exit.d.ts.map +1 -1
- package/dist/workspace/chant-migrations/chud-lexicon-exit.js +4 -1
- package/dist/workspace/ci-lock-grain.d.ts +17 -0
- package/dist/workspace/ci-lock-grain.d.ts.map +1 -0
- package/dist/workspace/ci-lock-grain.js +21 -0
- package/dist/workspace/ci-run.d.ts +2 -1
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +10 -3
- package/dist/workspace/declaration.d.ts +16 -4
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +5 -2
- package/dist/workspace/declaration.schema.json +27 -3
- package/dist/workspace/drift-cli.d.ts.map +1 -1
- package/dist/workspace/drift-cli.js +8 -3
- package/dist/workspace/exit-cli.d.ts +1 -1
- package/dist/workspace/exit-cli.d.ts.map +1 -1
- package/dist/workspace/exit-cli.js +2 -1
- package/dist/workspace/import-fetch.d.ts +4 -2
- package/dist/workspace/import-fetch.d.ts.map +1 -1
- package/dist/workspace/import-fetch.js +4 -2
- package/dist/workspace/import-init.d.ts.map +1 -1
- package/dist/workspace/import-init.js +4 -2
- package/dist/workspace/ledger.schema.json +7 -3
- package/dist/workspace/lineage-upgrade-cli.d.ts +1 -1
- package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade-cli.js +2 -1
- package/dist/workspace/pr-report.schema.json +79 -3
- package/dist/workspace/promote.d.ts +1 -1
- package/dist/workspace/promote.d.ts.map +1 -1
- package/dist/workspace/promote.js +2 -1
- package/dist/workspace/records-cli.d.ts +2 -2
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-cli.js +3 -2
- package/dist/workspace/release-catalog.schema.json +277 -0
- package/dist/workspace/run-event.schema.json +18 -1
- package/dist/workspace/work-cli.d.ts +3 -1
- package/dist/workspace/work-cli.d.ts.map +1 -1
- package/dist/workspace/work-cli.js +7 -2
- package/dist/workspace/workspace-run.d.ts.map +1 -1
- package/dist/workspace/workspace-run.js +2 -1
- package/package.json +21 -1
- package/src/__fixtures__/estate-ledger.ts +101 -0
- package/src/__fixtures__/oidc-emulator.ts +31 -2
- package/src/__fixtures__/product-words.ts +44 -0
- package/src/__golden__/wave-loop/op-by-apply-after-fails.json +10 -2
- package/src/__golden__/wave-loop/op-by-apply-hold.json +20 -4
- package/src/__golden__/wave-loop/op-by-apply-ignored.json +10 -2
- package/src/__golden__/wave-loop/op-by-apply-pass.json +10 -2
- package/src/__golden__/wave-loop/op-by-apply-skip.json +10 -2
- package/src/__golden__/wave-loop/op-discover-rest-stops.json +22 -6
- package/src/__golden__/wave-loop/op-discover-rest.json +44 -12
- package/src/__golden__/wave-loop/op-discover-wide.json +12 -3
- package/src/__golden__/wave-loop/op-held-on.json +28 -7
- package/src/__golden__/wave-loop/op-hooks-apply-fails.json +22 -6
- package/src/__golden__/wave-loop/op-hooks-fail-after-apply.json +22 -6
- package/src/__golden__/wave-loop/op-hooks-fail-before-apply.json +4 -2
- package/src/__golden__/wave-loop/op-hooks-held.json +26 -8
- package/src/__golden__/wave-loop/op-hooks-hold-before-apply.json +18 -4
- package/src/__golden__/wave-loop/op-hooks-pass.json +22 -6
- package/src/__golden__/wave-loop/op-hooks-share.json +20 -7
- package/src/__golden__/wave-loop/op-outcome-held.json +12 -3
- package/src/__golden__/wave-loop/op-outcome-replan-approved.json +16 -5
- package/src/__golden__/wave-loop/op-outcome-replan-forever.json +48 -21
- package/src/__golden__/wave-loop/op-outcome-replan.json +16 -5
- package/src/__golden__/wave-loop/op-outcome-stood-down.json +12 -3
- package/src/__golden__/wave-loop/op-outcome-unreadable.json +12 -3
- package/src/__golden__/wave-loop/op-overridden.json +28 -7
- package/src/__golden__/wave-loop/op-per-run.json +20 -4
- package/src/__golden__/wave-loop/op-point.json +18 -4
- package/src/__golden__/wave-loop/op-pr-review.json +10 -2
- package/src/__golden__/wave-loop/op-spend-change-only.json +10 -2
- package/src/__golden__/wave-loop/op-spend.json +10 -2
- package/src/__golden__/wave-loop/op-wave-commands.json +56 -13
- package/src/__golden__/wave-loop/op-wide.json +20 -4
- package/src/bucket-check/azure.ts +307 -0
- package/src/bucket-check/bucket-check.test.ts +210 -0
- package/src/bucket-check/fixtures/azure.json +153 -0
- package/src/bucket-check/fixtures/gcs.json +148 -0
- package/src/bucket-check/fixtures/s3.json +277 -0
- package/src/bucket-check/gcs.ts +257 -0
- package/src/bucket-check/index.ts +61 -0
- package/src/bucket-check/s3.ts +433 -0
- package/src/bucket-check/types.ts +75 -0
- package/src/bucket-check/wire.ts +50 -0
- package/src/bucket-check.ts +5 -0
- package/src/capabilities/templates.test.ts +2 -3
- package/src/capabilities/templates.ts +1 -2
- package/src/cdk/advise.test.ts +1 -1
- package/src/change-set-bundle.test.ts +0 -1
- package/src/change-set.ts +2 -3
- package/src/ci-agent.test.ts +348 -0
- package/src/ci-agent.ts +1025 -0
- package/src/ci-audit/__fixtures__/cloudtrail-lookup-bucket.json +37 -0
- package/src/ci-audit/__fixtures__/cloudtrail-writes-window.json +59 -0
- package/src/ci-audit/attribution.ts +260 -0
- package/src/ci-audit/audit-log.ts +220 -0
- package/src/ci-audit/ci-audit.test.ts +175 -0
- package/src/ci-audit/index.ts +15 -0
- package/src/ci-audit/unrecorded.ts +140 -0
- package/src/ci-audit.ts +2 -0
- package/src/ci-control.ts +173 -0
- package/src/ci-estate/delivery.ts +433 -0
- package/src/ci-estate/overdue.ts +81 -0
- package/src/ci-estate/page.ts +343 -0
- package/src/ci-estate/rows.ts +251 -0
- package/src/ci-estate.test.ts +281 -0
- package/src/ci-estate.ts +175 -0
- package/src/ci-handover.ts +67 -16
- package/src/ci-identity-database.test.ts +54 -0
- package/src/ci-identity-pulumi.test.ts +163 -0
- package/src/ci-identity-targets.test.ts +3 -1
- package/src/ci-identity.ts +123 -22
- package/src/ci-job-guard.test.ts +154 -0
- package/src/ci-job-guard.ts +319 -0
- package/src/ci-jobs.ts +8 -0
- package/src/ci-product-comment-targets.test.ts +45 -0
- package/src/ci-product-words.test.ts +101 -0
- package/src/ci-product-words.ts +565 -0
- package/src/ci-product.ts +226 -0
- package/src/ci-respond-run.ts +291 -0
- package/src/ci-respond.test.ts +264 -0
- package/src/ci-respond.ts +412 -0
- package/src/ci-shared-reads.test.ts +145 -0
- package/src/cli/commands/audit.test.ts +1 -1
- package/src/cli/commands/audit.ts +3 -2
- package/src/cli/commands/carve.test.ts +1 -1
- package/src/cli/commands/carve.ts +2 -2
- package/src/cli/commands/init.ts +3 -1
- package/src/cli/component-wave-args.test.ts +16 -0
- package/src/cli/handlers/agent.ts +126 -0
- package/src/cli/handlers/approve-confirm.test.ts +276 -0
- package/src/cli/handlers/approve-confirm.ts +200 -0
- package/src/cli/handlers/approve.ts +18 -1
- package/src/cli/handlers/audit-log.ts +74 -0
- package/src/cli/handlers/build-pr-loop-flags.test.ts +98 -0
- package/src/cli/handlers/build.test.ts +7 -0
- package/src/cli/handlers/build.ts +113 -1
- package/src/cli/handlers/ci-check-job.test.ts +114 -0
- package/src/cli/handlers/ci-check-job.ts +33 -0
- package/src/cli/handlers/ci-check.ts +63 -0
- package/src/cli/handlers/ci-forge-check.ts +91 -0
- package/src/cli/handlers/e2e-safe-run.ts +27 -0
- package/src/cli/handlers/fan-out.test.ts +10 -10
- package/src/cli/handlers/fan-out.ts +5 -0
- package/src/cli/handlers/gate-pending.ts +46 -0
- package/src/cli/handlers/init.ts +1 -0
- package/src/cli/handlers/ledger.ts +1 -1
- package/src/cli/handlers/lifecycle-drift.ts +7 -2
- package/src/cli/handlers/lock.test.ts +29 -2
- package/src/cli/handlers/lock.ts +66 -6
- package/src/cli/handlers/notify-relay.ts +130 -0
- package/src/cli/handlers/pr-before-merge.test.ts +2 -1
- package/src/cli/handlers/pr-deploy-inputs.test.ts +7 -7
- package/src/cli/handlers/pr-env.ts +48 -11
- package/src/cli/handlers/pr-plan-comment-targets.test.ts +166 -0
- package/src/cli/handlers/pr-plan-flags.test.ts +161 -0
- package/src/cli/handlers/pr-plan-targets.test.ts +155 -0
- package/src/cli/handlers/pr-waves-blocked.test.ts +5 -0
- package/src/cli/handlers/pr-waves.test.ts +8 -2
- package/src/cli/handlers/pr.test.ts +8 -8
- package/src/cli/handlers/pr.ts +879 -205
- package/src/cli/handlers/promote.test.ts +5 -5
- package/src/cli/handlers/promote.ts +22 -2
- package/src/cli/handlers/release.ts +2 -0
- package/src/cli/handlers/run-components-exit.test.ts +7 -7
- package/src/cli/handlers/run-wave.ts +144 -2
- package/src/cli/handlers/run.test.ts +6 -4
- package/src/cli/handlers/run.ts +86 -1
- package/src/cli/handlers/serve.ts +10 -1
- package/src/cli/main.test.ts +1 -1
- package/src/cli/main.ts +180 -13
- package/src/cli/mcp/ledger-tools.ts +126 -0
- package/src/cli/mcp/product-tools.test.ts +123 -0
- package/src/cli/mcp/product-tools.ts +129 -0
- package/src/cli/mcp/read-only.test.ts +134 -0
- package/src/cli/mcp/read-only.ts +68 -0
- package/src/cli/mcp/report-tools.ts +135 -0
- package/src/cli/mcp/server.test.ts +5 -4
- package/src/cli/mcp/server.ts +90 -16
- package/src/cli/mcp-config.ts +8 -3
- package/src/cli/parse-args.ts +119 -2
- package/src/cli/registry.ts +73 -0
- package/src/cloud-lister/sigv4.ts +80 -23
- package/src/components/adoption.test.ts +140 -0
- package/src/components/adoption.ts +140 -0
- package/src/components/apply-lease.ts +49 -0
- package/src/components/capability.ts +180 -6
- package/src/components/check-hooks.test.ts +66 -0
- package/src/components/check-hooks.ts +255 -0
- package/src/components/check-steps.test.ts +70 -0
- package/src/components/check-steps.ts +158 -0
- package/src/components/ci-services.test.ts +51 -0
- package/src/components/ci-services.ts +82 -0
- package/src/components/cli-support.ts +23 -2
- package/src/components/driver.test.ts +3 -3
- package/src/components/driver.ts +73 -6
- package/src/components/fan-out-run.ts +68 -18
- package/src/components/groups.ts +21 -4
- package/src/components/plan-flags.test.ts +46 -0
- package/src/components/pr-comment-preview-targets.test.ts +34 -0
- package/src/components/pr-comment-preview.test.ts +54 -0
- package/src/components/pr-env-ledger.test.ts +9 -0
- package/src/components/pr-env-ledger.ts +42 -0
- package/src/components/pr-env-ports.ts +29 -4
- package/src/components/pr-env-run-bundle.test.ts +2 -14
- package/src/components/pr-env-run.test.ts +19 -0
- package/src/components/pr-env-run.ts +12 -2
- package/src/components/pr-environment.test.ts +29 -0
- package/src/components/pr-environment.ts +40 -8
- package/src/components/pr-pipeline-runners.test.ts +80 -0
- package/src/components/pr-pipeline.test.ts +15 -0
- package/src/components/pr-pipeline.ts +498 -18
- package/src/components/pr-policy.ts +45 -7
- package/src/components/pr-run.test.ts +1 -1
- package/src/components/pr-run.ts +138 -11
- package/src/components/pr-stale-job.test.ts +34 -0
- package/src/components/pr-targets.test.ts +35 -0
- package/src/components/pr-targets.ts +45 -0
- package/src/components/product-pipeline.test.ts +200 -0
- package/src/components/product-pipeline.ts +383 -0
- package/src/components/promote.ts +10 -1
- package/src/components/release-compile.ts +87 -1
- package/src/components/release-promote.ts +65 -1
- package/src/components/repo-lock.ts +52 -0
- package/src/components/row-lease.test.ts +490 -0
- package/src/components/row-lease.ts +167 -0
- package/src/components/wave-plan-policy.test.ts +19 -0
- package/src/components/wave-plan.ts +96 -6
- package/src/control/__fixtures__/consumers/apps/consumers.json +15 -0
- package/src/control/__fixtures__/consumers/infra/consumers.json +23 -0
- package/src/control/applied.test.ts +148 -0
- package/src/control/applied.ts +191 -0
- package/src/control/consumers.test.ts +129 -0
- package/src/control/consumers.ts +192 -0
- package/src/control/control.test.ts +302 -0
- package/src/control/dispatch.ts +699 -0
- package/src/control/edges.test.ts +112 -0
- package/src/control/edges.ts +164 -0
- package/src/control/note-checkout.test.ts +91 -0
- package/src/control/reconcile.ts +250 -0
- package/src/control/records.ts +395 -0
- package/src/discovery/sandbox/bundle.ts +25 -1
- package/src/e2e-harness/__project__/chant.config.ts +4 -0
- package/src/e2e-harness/__project__/src/compose.ts +33 -0
- package/src/e2e-harness/bucket.ts +69 -0
- package/src/e2e-harness/claim.test.ts +150 -0
- package/src/e2e-harness/claim.ts +140 -0
- package/src/e2e-harness/driver.test.ts +304 -0
- package/src/e2e-harness/driver.ts +294 -0
- package/src/e2e-harness/forgejo.ts +267 -0
- package/src/e2e-harness/git.ts +96 -0
- package/src/e2e-harness/index.ts +50 -0
- package/src/e2e-harness/jobs.ts +35 -0
- package/src/e2e-harness/pins.ts +52 -0
- package/src/e2e-harness/ports.ts +130 -0
- package/src/e2e-harness/reports.ts +79 -0
- package/src/e2e-harness/safe-run-cli.test.ts +102 -0
- package/src/e2e-harness/safe-run-cli.ts +54 -0
- package/src/e2e-harness/safe-run.ts +198 -0
- package/src/e2e-harness/scenario.ts +89 -0
- package/src/e2e-harness/schemas/README.md +62 -0
- package/src/e2e-harness/schemas/demo-cycle.schema.json +282 -0
- package/src/e2e-harness/schemas/demo-step.schema.json +245 -0
- package/src/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
- package/src/e2e-harness/schemas/e2e-claims.schema.json +18 -0
- package/src/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
- package/src/e2e-harness/schemas/index.ts +220 -0
- package/src/e2e-harness/schemas.test.ts +145 -0
- package/src/e2e-harness/stack.test.ts +124 -0
- package/src/e2e-harness/stack.ts +306 -0
- package/src/e2e-harness/steps.ts +30 -0
- package/src/e2e-harness.ts +2 -0
- package/src/engine-facts.test.ts +2 -3
- package/src/engine-facts.ts +1 -2
- package/src/exit-codes.test.ts +32 -0
- package/src/exit-codes.ts +61 -0
- package/src/forge-check/check.ts +155 -0
- package/src/forge-check/contract.ts +215 -0
- package/src/forge-check/forge-check.test.ts +427 -0
- package/src/forge-check/forge.ts +318 -0
- package/src/forge-check/index.ts +43 -0
- package/src/forge-check/pulumi.ts +192 -0
- package/src/forge-check/read-only.ts +56 -0
- package/src/forge-check/trust.ts +527 -0
- package/src/forge-check/types.ts +78 -0
- package/src/forge-check.ts +5 -0
- package/src/gate-decision-bundle.test.ts +11 -0
- package/src/gate-decision.ts +3 -0
- package/src/gate-policy.ts +92 -3
- package/src/gated-waves-bundle.test.ts +0 -1
- package/src/index.ts +2 -0
- package/src/lexicon.ts +143 -6
- package/src/lifecycle/adoption-file.ts +1 -2
- package/src/lifecycle/cloud-index.test.ts +2 -3
- package/src/lifecycle/cloud-index.ts +1 -2
- package/src/lifecycle/control-entries-ledger.test.ts +69 -0
- package/src/lifecycle/gate-applied.ts +6 -0
- package/src/lifecycle/gate-ledger.ts +35 -1
- package/src/lifecycle/gate-pending-by-plan.test.ts +69 -0
- package/src/lifecycle/gate-pending-by-plan.ts +133 -0
- package/src/lifecycle/gated-request-digest.ts +49 -0
- package/src/lifecycle/gated-request-ledger.test.ts +53 -0
- package/src/lifecycle/gated-request.ts +279 -0
- package/src/lifecycle/identity-match.ts +25 -6
- package/src/lifecycle/index-diff.ts +1 -2
- package/src/lifecycle/index-document.ts +1 -2
- package/src/lifecycle/index-import.test.ts +14 -0
- package/src/lifecycle/index-import.ts +54 -34
- package/src/lifecycle/ledger-read.ts +7 -3
- package/src/lifecycle/lock-rows.test.ts +109 -0
- package/src/lifecycle/lock-rows.ts +167 -0
- package/src/lifecycle/publish-target-context.test.ts +108 -0
- package/src/lifecycle/query.test.ts +2 -3
- package/src/lifecycle/query.ts +109 -8
- package/src/lifecycle/release-catalog-site.test.ts +142 -0
- package/src/lifecycle/release-catalog-site.ts +291 -0
- package/src/lifecycle/release-catalog.test.ts +192 -0
- package/src/lifecycle/release-catalog.ts +353 -0
- package/src/lifecycle/release-changelog.test.ts +70 -0
- package/src/lifecycle/release-changelog.ts +71 -0
- package/src/lifecycle/release-cut.ts +2 -2
- package/src/lifecycle/release-ledger.ts +19 -0
- package/src/lifecycle/release-publish.ts +45 -22
- package/src/lifecycle/release-read.ts +2 -0
- package/src/lifecycle/release-status.test.ts +185 -0
- package/src/lifecycle/release-status.ts +175 -0
- package/src/lifecycle/resource-lock.test.ts +175 -0
- package/src/lifecycle/resource-lock.ts +354 -0
- package/src/lifecycle/retention.ts +2 -0
- package/src/lifecycle/run-ledger.ts +7 -1
- package/src/lifecycle/snapshot-store-s3.ts +9 -45
- package/src/lifecycle/snapshot-store.ts +1 -2
- package/src/lifecycle/target-lock.ts +24 -9
- package/src/lifecycle/wave-plans.ts +33 -5
- package/src/mcp/types.ts +7 -0
- package/src/notify-product.ts +76 -0
- package/src/notify-relay.test.ts +213 -0
- package/src/notify-relay.ts +407 -0
- package/src/notify.ts +95 -14
- package/src/object-store/azure-blob.ts +374 -0
- package/src/object-store/common.ts +133 -0
- package/src/object-store/errors.ts +26 -0
- package/src/object-store/from-env.ts +36 -0
- package/src/object-store/gcs.ts +436 -0
- package/src/object-store/index.ts +8 -0
- package/src/object-store/object-store.test.ts +130 -0
- package/src/object-store/s3.ts +350 -0
- package/src/op/activities/converge.ts +2 -1
- package/src/op/activities/index.ts +1 -1
- package/src/op/activities/review-agent.open.test.ts +78 -0
- package/src/op/activities/review-agent.test.ts +13 -0
- package/src/op/activities/review-agent.ts +89 -5
- package/src/op/approval-status.test.ts +134 -0
- package/src/op/approval-status.ts +235 -0
- package/src/op/gate-review.test.ts +2 -1
- package/src/op/gate.ts +81 -22
- package/src/op/generate-pipeline.ts +7 -1
- package/src/op/index.ts +23 -0
- package/src/op/op-waves-after-plan.test.ts +288 -0
- package/src/op/op-waves-after-plan.ts +238 -0
- package/src/op/op-waves-capability-spec.ts +133 -0
- package/src/op/op-waves-capability.test.ts +217 -0
- package/src/op/op-waves-capability.ts +370 -0
- package/src/op/op-waves-events.ts +135 -0
- package/src/op/op-waves-notify-words.test.ts +149 -0
- package/src/op/op-waves-notify.ts +41 -16
- package/src/op/op-waves-parallelism.test.ts +89 -0
- package/src/op/op-waves-pull-request.test.ts +219 -0
- package/src/op/op-waves-release-port.ts +64 -0
- package/src/op/op-waves-release.test.ts +209 -0
- package/src/op/op-waves-release.ts +132 -0
- package/src/op/op-waves-run-record.test.ts +32 -0
- package/src/op/op-waves-run.ts +1235 -52
- package/src/op/op-waves-stand-down.test.ts +240 -0
- package/src/op/op-waves-stand-down.ts +107 -0
- package/src/op/op-waves-trace.test.ts +205 -0
- package/src/op/op-waves.test.ts +112 -0
- package/src/op/op-waves.ts +320 -22
- package/src/op/runtime.ts +107 -0
- package/src/op/stage-hooks-hold-record.test.ts +41 -0
- package/src/op/stage-hooks.ts +91 -12
- package/src/op/steward-beside.ts +2 -1
- package/src/op/types.ts +3 -2
- package/src/otlp-metrics.ts +96 -0
- package/src/otlp.test.ts +243 -0
- package/src/otlp.ts +543 -0
- package/src/override-gate-bundle.test.ts +2 -0
- package/src/override-gate.ts +4 -0
- package/src/parallelism.test.ts +38 -0
- package/src/parallelism.ts +33 -0
- package/src/policy-packs.ts +230 -0
- package/src/policy-source.test.ts +256 -0
- package/src/policy-source.ts +111 -0
- package/src/pr-forge-bundle.test.ts +1 -1
- package/src/pr-forge.ts +175 -33
- package/src/pr-loop-bundle.test.ts +7 -3
- package/src/pr-loop-narrowed.test.ts +63 -0
- package/src/pr-loop-words.test.ts +155 -0
- package/src/pr-loop.ts +398 -52
- package/src/pr-merge.test.ts +100 -0
- package/src/pr-merge.ts +105 -0
- package/src/pr-post-stale.test.ts +163 -0
- package/src/pr-post.ts +190 -5
- package/src/pr-report-url.ts +61 -6
- package/src/pr-requires.test.ts +37 -1
- package/src/pr-requires.ts +16 -2
- package/src/product-subpaths-plain-node.e2e.test.ts +212 -0
- package/src/release-floors.ts +1 -1
- package/src/run-event.ts +28 -1
- package/src/scheduled-op-cloud.ts +68 -0
- package/src/sorted-json.ts +17 -0
- package/src/stage-hooks-bundle.test.ts +6 -0
- package/src/terraform/credentials.test.ts +77 -0
- package/src/terraform/credentials.ts +162 -0
- package/src/utils.ts +2 -11
- package/src/wave-loop-golden.test.ts +2 -1
- package/src/wave-runtime.ts +2 -2
- package/src/workspace/chant-migrations/chud-lexicon-exit.ts +4 -1
- package/src/workspace/ci-lock-grain.test.ts +31 -0
- package/src/workspace/ci-lock-grain.ts +29 -0
- package/src/workspace/ci-report-url.test.ts +1 -1
- package/src/workspace/ci-run.test.ts +1 -1
- package/src/workspace/ci-run.ts +10 -3
- package/src/workspace/declaration.schema.json +27 -3
- package/src/workspace/declaration.test.ts +1 -1
- package/src/workspace/declaration.ts +26 -10
- package/src/workspace/drift-cli.ts +8 -3
- package/src/workspace/exit-cli.ts +2 -1
- package/src/workspace/import-fetch.ts +4 -2
- package/src/workspace/import-init.ts +4 -2
- package/src/workspace/ledger.schema.json +7 -3
- package/src/workspace/lineage-upgrade-cli.ts +2 -1
- package/src/workspace/pr-report.schema.json +79 -3
- package/src/workspace/promote.ts +2 -1
- package/src/workspace/records-cli.ts +3 -2
- package/src/workspace/release-catalog.schema.json +277 -0
- package/src/workspace/run-event.schema.json +18 -1
- package/src/workspace/work-cli.ts +8 -2
- package/src/workspace/workspace-run.ts +2 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { formatError } from "../format";
|
|
2
|
+
import type { CommandContext } from "../registry";
|
|
3
|
+
|
|
4
|
+
const USAGE = "chant e2e safe-run [--scan <dir>]... -- <command...>";
|
|
5
|
+
|
|
6
|
+
/** `chant e2e <word>` with a word that is not a verb. */
|
|
7
|
+
export async function runE2eUnknown(ctx: CommandContext): Promise<number> {
|
|
8
|
+
console.error(formatError({ message: `Unknown e2e command: ${ctx.args.path}`, hint: USAGE }));
|
|
9
|
+
return 2;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `chant e2e safe-run [--scan <dir>]... -- <command...>` (chant#4587, C1): the
|
|
14
|
+
* harness's no-real-cloud wrapper (`../../e2e-harness/safe-run.ts`) for a
|
|
15
|
+
* driver that is not TypeScript. Exit codes: the command's own code after a
|
|
16
|
+
* CLEAN scan, 3 when the scan rejects the run, 2 for a usage error or a
|
|
17
|
+
* refused environment.
|
|
18
|
+
*/
|
|
19
|
+
export async function runE2eSafeRun(ctx: CommandContext): Promise<number> {
|
|
20
|
+
const command = (ctx.args.positionals ?? []).slice(1);
|
|
21
|
+
if (command.length === 0) {
|
|
22
|
+
console.error(formatError({ message: "chant e2e safe-run needs a command after --", hint: USAGE }));
|
|
23
|
+
return 2;
|
|
24
|
+
}
|
|
25
|
+
const { runSafeRunCommand } = await import("../../e2e-harness/safe-run-cli");
|
|
26
|
+
return runSafeRunCommand({ command, scan: ctx.args.scanDirs ?? [] });
|
|
27
|
+
}
|
|
@@ -334,17 +334,17 @@ describe("proof: a mid-run failure blocks its subtree and leaves the independent
|
|
|
334
334
|
});
|
|
335
335
|
});
|
|
336
336
|
|
|
337
|
-
describe("a step that refuses its plan because the plan moved exits
|
|
338
|
-
test("marked planMoved: exit
|
|
337
|
+
describe("a step that refuses its plan because the plan moved exits 4 (#3997, #4553)", () => {
|
|
338
|
+
test("marked planMoved: exit 4, and its subtree is blocked as for any failure", async () => {
|
|
339
339
|
refusal = { "cluster-a": planMovedError("cluster-a") };
|
|
340
|
-
expect(await runComponentsFanOut(ctx({ base: "main", env: "test" }))).toBe(
|
|
340
|
+
expect(await runComponentsFanOut(ctx({ base: "main", env: "test" }))).toBe(4);
|
|
341
341
|
expect(ran).not.toContain("app-one");
|
|
342
342
|
expect(ran).toContain("app-three");
|
|
343
343
|
});
|
|
344
344
|
|
|
345
|
-
test("an exitCode of 3 on the step's error is the same mark", async () => {
|
|
345
|
+
test("an exitCode of 3 on the step's error, the moved code before #4553, is the same mark", async () => {
|
|
346
346
|
refusal = { "cluster-a": exitCodeError("cluster-a", 3) };
|
|
347
|
-
expect(await runComponentsFanOut(ctx({ base: "main", env: "test" }))).toBe(
|
|
347
|
+
expect(await runComponentsFanOut(ctx({ base: "main", env: "test" }))).toBe(4);
|
|
348
348
|
});
|
|
349
349
|
|
|
350
350
|
test("any other exitCode is ignored, and the failure exits 1", async () => {
|
|
@@ -352,10 +352,10 @@ describe("a step that refuses its plan because the plan moved exits 3 (#3997)",
|
|
|
352
352
|
expect(await runComponentsFanOut(ctx({ base: "main", env: "test" }))).toBe(1);
|
|
353
353
|
});
|
|
354
354
|
|
|
355
|
-
test("one moved plan beside another failure still exits
|
|
355
|
+
test("one moved plan beside another failure still exits 4", async () => {
|
|
356
356
|
refusal = { "cluster-a": planMovedError("cluster-a") };
|
|
357
357
|
failing = ["cluster-b"];
|
|
358
|
-
expect(await runComponentsFanOut(ctx({ base: "main", env: "test" }))).toBe(
|
|
358
|
+
expect(await runComponentsFanOut(ctx({ base: "main", env: "test" }))).toBe(4);
|
|
359
359
|
});
|
|
360
360
|
});
|
|
361
361
|
|
|
@@ -601,11 +601,11 @@ describe("gated waves (#3049): one gate per wave, bound to the wave's set digest
|
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
test.each([
|
|
604
|
-
["marked planMoved",
|
|
605
|
-
["with exitCode 3",
|
|
604
|
+
["marked planMoved", 4, () => planMovedError("net")],
|
|
605
|
+
["with exitCode 3", 4, () => exitCodeError("net", 3)],
|
|
606
606
|
["with exitCode 7", 1, () => exitCodeError("net", 7)],
|
|
607
607
|
["unmarked", 1, () => new Error("net failed")],
|
|
608
|
-
])("an approved wave whose step fails with an error %s exits %i (#3997)", async (_label, code, error) => {
|
|
608
|
+
])("an approved wave whose step fails with an error %s exits %i (#3997, #4553)", async (_label, code, error) => {
|
|
609
609
|
const run = () => runComponentsFanOut(ctx({ base: "main", env: "test", waveGate: "release" }));
|
|
610
610
|
await approveWave1(run);
|
|
611
611
|
refusal = { net: error() };
|
|
@@ -458,10 +458,15 @@ async function fanOut(ctx: CommandContext, projectPath: string, config: ChantCon
|
|
|
458
458
|
// wave and apply as one group; under --wave-gate none forms (ruling 1).
|
|
459
459
|
const runPlan = await formRunGroups({ components: derived.components, plan: derived.plan, registry, env, ...(waveGate ? { waveGate: true } : {}) });
|
|
460
460
|
|
|
461
|
+
// #4594: ci.lockGrain, and on the resource grain the row lease each step, group or gated wave takes in the pull-request loop's rows file.
|
|
462
|
+
const { applyLeaseOptions } = await import("../../components/apply-lease");
|
|
463
|
+
const leasing = await applyLeaseOptions(process.cwd());
|
|
464
|
+
|
|
461
465
|
let result;
|
|
462
466
|
try {
|
|
463
467
|
result = await runFanOut(runPlan, derived.components, registry, {
|
|
464
468
|
env,
|
|
469
|
+
...leasing,
|
|
465
470
|
...(runPlan.groups?.length ? { planGroupsAtWave: true } : {}),
|
|
466
471
|
releaseIdentity: () => (revision ? { revision } : {}),
|
|
467
472
|
componentOutputs,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant run pending --plan <digest> [--op <op>] [--json]` (#4607): the
|
|
3
|
+
* standing pending gates waiting on a plan digest, with the pull request a
|
|
4
|
+
* pull request gate belongs to. A product's approve verb runs it (or calls
|
|
5
|
+
* `pendingGatesByPlan` from `@intentius/chant/ci-product`) to find the op and
|
|
6
|
+
* gate a digest waits at, so a person types the digest the note showed and
|
|
7
|
+
* nothing else.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { CommandContext } from "../registry";
|
|
11
|
+
import { formatError, formatInfo } from "../format";
|
|
12
|
+
import { requireLifecycleLedger } from "../../lifecycle/git";
|
|
13
|
+
import { pendingGatesByPlan, type PendingGateByPlan } from "../../lifecycle/gate-pending-by-plan";
|
|
14
|
+
|
|
15
|
+
function describe(g: PendingGateByPlan): string {
|
|
16
|
+
const where = g.pr !== undefined ? ` (pull request ${g.pr}${g.member ? `, member ${g.member}` : ""})` : "";
|
|
17
|
+
const env = g.environment ? ` in ${g.environment}` : "";
|
|
18
|
+
const by = g.matched === "changeSet" ? " by its change set" : "";
|
|
19
|
+
return `${g.op} / ${g.gate}${env}${where} waits on this plan${by}, since ${g.timestamp}, until ${g.expiresAt}`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function runPendingCommand(ctx: CommandContext): Promise<number> {
|
|
23
|
+
const { args } = ctx;
|
|
24
|
+
const digest = args.plan;
|
|
25
|
+
if (!digest) {
|
|
26
|
+
console.error(formatError({ message: "chant run pending needs the digest a plan printed: --plan <digest>" }));
|
|
27
|
+
return 1;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
await requireLifecycleLedger();
|
|
31
|
+
} catch (err) {
|
|
32
|
+
console.error(formatError({ message: `Cannot read the gate ledgers: ${err instanceof Error ? err.message : String(err)}` }));
|
|
33
|
+
return 1;
|
|
34
|
+
}
|
|
35
|
+
const gates = await pendingGatesByPlan(digest, args.op ? { op: args.op } : {});
|
|
36
|
+
if (args.json) {
|
|
37
|
+
console.log(JSON.stringify({ plan: digest, gates }, null, 2));
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
if (gates.length === 0) {
|
|
41
|
+
console.error(formatInfo(`No gate is waiting on ${digest}: it was approved, it expired, or no run reached a gate with it.`));
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
for (const g of gates) console.error(formatInfo(describe(g)));
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
package/src/cli/handlers/init.ts
CHANGED
|
@@ -22,6 +22,7 @@ export async function runInit(ctx: CommandContext): Promise<number> {
|
|
|
22
22
|
skill: args.skill,
|
|
23
23
|
force: args.force,
|
|
24
24
|
skipMcp: args.skipMcp,
|
|
25
|
+
mcpReadOnly: args.mcpReadOnly,
|
|
25
26
|
skipInstall: true,
|
|
26
27
|
});
|
|
27
28
|
await printInitResult(result, { skipInstall: false, cwd: args.path });
|
|
@@ -11,7 +11,7 @@ import { formatError, formatWarning } from "../format";
|
|
|
11
11
|
import type { CommandContext } from "../registry";
|
|
12
12
|
import { queryLedgers } from "./query";
|
|
13
13
|
|
|
14
|
-
const USAGE = "chant ledger <resources|snapshots|runs|gates|deploys|releases|cuts> [dir] [--member <name>] [--where <field><op><value>]... [--since <time>] [--at <rev>] [--json]";
|
|
14
|
+
const USAGE = "chant ledger <resources|snapshots|runs|gates|deploys|releases|cuts|applies|pr_envs|control_entries|release_status> [dir] [--member <name>] [--where <field><op><value>]... [--since <time>] [--at <rev>] [--json]";
|
|
15
15
|
|
|
16
16
|
const cell = (v: unknown): string => (v === null || v === undefined ? "" : typeof v === "object" ? JSON.stringify(v) : String(v));
|
|
17
17
|
|
|
@@ -20,13 +20,18 @@
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
import { basename, resolve } from "node:path";
|
|
23
|
+
import { CHANT_EXIT } from "../../exit-codes";
|
|
23
24
|
import { loadChantConfig } from "../../config";
|
|
24
25
|
import { DRIFT_READS, encodeDriftLine, type DriftLine, type DriftRead, type ReadDriftRefusalCode } from "../../drift-record";
|
|
25
26
|
import { formatError } from "../format";
|
|
26
27
|
import type { CommandContext } from "../registry";
|
|
27
28
|
|
|
28
|
-
/**
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* The exit status of a refused read: `CHANT_EXIT.failed` (#4553; 3 before).
|
|
31
|
+
* The `{"refused": ...}` line on stdout says why, and `chant workspace drift`
|
|
32
|
+
* reads that line, so the code carries nothing more.
|
|
33
|
+
*/
|
|
34
|
+
export const DRIFT_REFUSED_EXIT = CHANT_EXIT.failed;
|
|
30
35
|
|
|
31
36
|
const USAGE = "chant lifecycle drift [--member <name>] [--read <state|plan|refresh|live-read|ownership>] [--resource <addr>]";
|
|
32
37
|
|
|
@@ -58,13 +58,13 @@ afterEach(() => {
|
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
describe("chant lock and chant unlock", () => {
|
|
61
|
-
test("lock takes named targets, a second pull request exits
|
|
61
|
+
test("lock takes named targets, a second pull request exits 5 naming the holder, unlock frees them", async () => {
|
|
62
62
|
const taken = await run(["lock", "web", "api", "--pr", "1", "--by", "alice", "--json"]);
|
|
63
63
|
expect(taken.code).toBe(0);
|
|
64
64
|
expect(JSON.parse(taken.out)).toMatchObject({ gate: "pr-apply", pr: 1, ok: true, stage: "lock", taken: ["api", "web"] });
|
|
65
65
|
|
|
66
66
|
const held = await run(["lock", "web", "--pr", "2", "--by", "bob"]);
|
|
67
|
-
expect(held.code).toBe(
|
|
67
|
+
expect(held.code).toBe(5);
|
|
68
68
|
expect(held.err).toContain("web is locked by pull request 1 (locked with chant lock by alice), so pull request 2 is not locked");
|
|
69
69
|
|
|
70
70
|
const listed = await run(["lock", "--list", "--json"]);
|
|
@@ -88,6 +88,33 @@ describe("chant lock and chant unlock", () => {
|
|
|
88
88
|
expect(wrong.err).toContain("is the report of pull request 4, not 5");
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
+
test("--list shows the apply rows of the gate with the run that holds each (#4594)", async () => {
|
|
92
|
+
const { takeLockRows } = await import("../../lifecycle/resource-lock");
|
|
93
|
+
const holder = { run: "4711", at: "2026-10-27T10:00:00.000Z", url: "https://forge.example/acme/infra/actions/runs/4711" };
|
|
94
|
+
const rows = [
|
|
95
|
+
{ key: "urn urn:pulumi:dev::site::aws:s3/bucket:Bucket::logs", target: "site", address: "logs" },
|
|
96
|
+
{ key: "estate e01 aws_s3_bucket.logs", target: "e01", address: "aws_s3_bucket.logs" },
|
|
97
|
+
];
|
|
98
|
+
expect(await takeLockRows("pr-apply", rows, holder, { cwd: repo, alive: async () => "alive" })).toMatchObject({ ok: true });
|
|
99
|
+
|
|
100
|
+
const text = await run(["lock", "--list"]);
|
|
101
|
+
expect(text.code).toBe(0);
|
|
102
|
+
expect(text.out).toContain("estate e01 aws_s3_bucket.logs\trun 4711\t2026-10-27T10:00:00.000Z\thttps://forge.example/acme/infra/actions/runs/4711");
|
|
103
|
+
expect(text.out).toContain("urn urn:pulumi:dev::site::aws:s3/bucket:Bucket::logs\trun 4711");
|
|
104
|
+
expect(text.err).toContain("no target locks on pr-apply");
|
|
105
|
+
|
|
106
|
+
const json = JSON.parse((await run(["lock", "--list", "--json"])).out);
|
|
107
|
+
expect(json.rowsPath).toBe("_locks/rows/pr-apply.json");
|
|
108
|
+
expect(Object.keys(json.rows)).toEqual(["estate e01 aws_s3_bucket.logs", "urn urn:pulumi:dev::site::aws:s3/bucket:Bucket::logs"]);
|
|
109
|
+
expect(json.rows["estate e01 aws_s3_bucket.logs"]).toEqual(holder);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("--list says no apply rows are held when the rows file is empty (#4594)", async () => {
|
|
113
|
+
const listed = await run(["lock", "--list", "--json"]);
|
|
114
|
+
expect(JSON.parse(listed.out)).toMatchObject({ gate: "pr-apply", rows: {} });
|
|
115
|
+
expect((await run(["lock", "--list"])).err).toContain("no apply rows held on pr-apply");
|
|
116
|
+
});
|
|
117
|
+
|
|
91
118
|
test("refuses without --pr or targets, an unknown stage, and a gate that is not a file name", async () => {
|
|
92
119
|
expect((await run(["lock", "web"])).err).toContain("--pr <n>");
|
|
93
120
|
expect((await run(["lock", "--pr", "1"])).err).toContain("needs the targets");
|
package/src/cli/handlers/lock.ts
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* ```
|
|
6
6
|
* chant lock <target>... --pr <n> [--stage plan|apply|lock] [--head <sha>] [--by <who>] [--gate <name>] [--forge <kind>] [--json]
|
|
7
7
|
* chant lock --from-report <pr-plan.json> --pr <n> [--stage plan] [--forge <kind>] [--json]
|
|
8
|
+
* chant lock --keep --pr <n> [--head <sha>] [--gate <name>] [--forge <kind>] [--json]
|
|
8
9
|
* chant lock --list [--gate <name>] [--json]
|
|
10
|
+
* chant lock --alive <run>
|
|
9
11
|
* chant unlock --pr <n> [<target>...] [--gate <name>] [--json]
|
|
10
12
|
* ```
|
|
11
13
|
*
|
|
@@ -13,7 +15,25 @@
|
|
|
13
15
|
* which are what `pr-apply` checks under `ci.locks`, or any other name a
|
|
14
16
|
* pipeline locks by. `--from-report` reads them from a pull-request report
|
|
15
17
|
* (`selection.waves`), so a lock job that runs the target branch's code can
|
|
16
|
-
* lock what the plan job, which ran the pull request's code, selected.
|
|
18
|
+
* lock what the plan job, which ran the pull request's code, selected. When
|
|
19
|
+
* a member is on the resource lock grain (#4552) the report carries
|
|
20
|
+
* `lockTargets`, its row keys, and those are locked instead.
|
|
21
|
+
*
|
|
22
|
+
* `--list` prints the target locks, then the apply rows of the gate's rows
|
|
23
|
+
* file (#4552, #4594), each with the run that holds it and when it took it.
|
|
24
|
+
*
|
|
25
|
+
* `--keep` (#4588) takes again, at stage `lock`, every lock the pull request
|
|
26
|
+
* holds now: the components (or row keys) its plan locked under `ci.locks:
|
|
27
|
+
* plan`. A plan lock is let go when a later plan no longer reaches the
|
|
28
|
+
* target; a kept one stays until the pull request closes or `chant unlock`.
|
|
29
|
+
* It is what a `/<product> lock` comment runs, on the target branch's
|
|
30
|
+
* commit, so no code of the change runs. A pull request that holds no lock
|
|
31
|
+
* yet fails with a line saying its plan has to run first.
|
|
32
|
+
*
|
|
33
|
+
* `--alive <run>` prints `alive` or `dead` for a run that holds rows or the
|
|
34
|
+
* Forgejo repo lock tag (#4552): `dead` when the forge says the run
|
|
35
|
+
* finished, `alive` while it runs or when nobody can say. The lock tag's
|
|
36
|
+
* shell asks it before taking a lease over.
|
|
17
37
|
*
|
|
18
38
|
* `--forge` reads which holders are still open, so a lock whose pull
|
|
19
39
|
* request merged or closed is taken over, and, with `--head`, posts the
|
|
@@ -23,6 +43,7 @@
|
|
|
23
43
|
* request holds a target (nothing is locked), 1 on an error.
|
|
24
44
|
*/
|
|
25
45
|
import { readFileSync } from "node:fs";
|
|
46
|
+
import { CHANT_EXIT } from "../../exit-codes";
|
|
26
47
|
import { resolve } from "node:path";
|
|
27
48
|
import type { CommandContext } from "../registry";
|
|
28
49
|
import { formatError, formatInfo, formatSuccess, formatWarning } from "../format";
|
|
@@ -39,8 +60,8 @@ import {
|
|
|
39
60
|
type TargetLockStage,
|
|
40
61
|
} from "../../lifecycle/target-lock";
|
|
41
62
|
|
|
42
|
-
/** The exit for a target another open pull request holds:
|
|
43
|
-
const HELD_EXIT_CODE =
|
|
63
|
+
/** The exit for a target another open pull request holds: `CHANT_EXIT.held`, 5 (#4553). */
|
|
64
|
+
const HELD_EXIT_CODE = CHANT_EXIT.held;
|
|
44
65
|
|
|
45
66
|
/** The status `chant lock --head <sha> --forge <kind>` posts. */
|
|
46
67
|
export const LOCK_STATUS_CONTEXT = "chant/lock";
|
|
@@ -76,13 +97,17 @@ const prName = (forge: PrForge | undefined) => (n: number) => (forge?.kind === "
|
|
|
76
97
|
|
|
77
98
|
/** The components a `pr-plan.json` selected, and the head it planned, checked against `--pr`. */
|
|
78
99
|
function fromReport(file: string, pr: number): { targets: string[]; head?: string } | { error: string } {
|
|
79
|
-
let doc: { pr?: unknown; head?: unknown; selection?: { waves?: unknown } };
|
|
100
|
+
let doc: { pr?: unknown; head?: unknown; selection?: { waves?: unknown }; lockTargets?: unknown };
|
|
80
101
|
try {
|
|
81
102
|
doc = JSON.parse(readFileSync(resolve(file), "utf8"));
|
|
82
103
|
} catch (err) {
|
|
83
104
|
return { error: `--from-report: could not read "${file}": ${err instanceof Error ? err.message : String(err)}` };
|
|
84
105
|
}
|
|
85
106
|
if (doc.pr !== pr) return { error: `--from-report: "${file}" is the report of ${doc.pr === null || doc.pr === undefined ? "no pull request" : `pull request ${String(doc.pr)}`}, not ${pr}` };
|
|
107
|
+
// #4552: a member on the resource grain locks its row keys, which the report lists.
|
|
108
|
+
if (Array.isArray(doc.lockTargets) && doc.lockTargets.every((t) => typeof t === "string" && t !== "")) {
|
|
109
|
+
return { targets: doc.lockTargets as string[], ...(typeof doc.head === "string" ? { head: doc.head } : {}) };
|
|
110
|
+
}
|
|
86
111
|
const waves = doc.selection?.waves;
|
|
87
112
|
if (!Array.isArray(waves) || !waves.every((w) => Array.isArray(w) && w.every((n) => typeof n === "string"))) {
|
|
88
113
|
return { error: `--from-report: "${file}" has no selection.waves; pass a pr-plan.json that chant components pr-plan wrote` };
|
|
@@ -105,21 +130,45 @@ export async function runLock(ctx: CommandContext): Promise<number> {
|
|
|
105
130
|
const gate = gateOf(ctx);
|
|
106
131
|
if (typeof gate !== "string") return fail(gate.error);
|
|
107
132
|
|
|
133
|
+
if (args.aliveRun !== undefined) {
|
|
134
|
+
const { forgeLockLiveness } = await import("../../lifecycle/resource-lock");
|
|
135
|
+
// The lease's age is the caller's to judge (the tag carries its own), so only the forge and the process are asked here.
|
|
136
|
+
const verdict = await forgeLockLiveness(process.env)({ run: args.aliveRun, at: new Date().toISOString() });
|
|
137
|
+
console.log(verdict);
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
108
141
|
if (args.list) {
|
|
109
142
|
if (targetsOf(ctx).length > 0 || args.pr !== undefined) return fail("--list prints every lock; drop the targets and --pr");
|
|
110
143
|
let file;
|
|
144
|
+
let held;
|
|
111
145
|
try {
|
|
112
146
|
file = await readTargetLocks(gate);
|
|
147
|
+
// #4594: the apply rows of the gate (#4552), each with the run that holds it.
|
|
148
|
+
const { readLockRows } = await import("../../lifecycle/resource-lock");
|
|
149
|
+
held = await readLockRows(gate);
|
|
113
150
|
} catch (err) {
|
|
114
151
|
return fail(err instanceof Error ? err.message : String(err));
|
|
115
152
|
}
|
|
116
153
|
const rows = Object.entries(file.locks).sort(([a], [b]) => a.localeCompare(b));
|
|
154
|
+
const leased = Object.entries(held.rows)
|
|
155
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
156
|
+
.map(([key, run]) => ({ key, holder: held.holders[run]! }));
|
|
117
157
|
if (args.json) {
|
|
118
|
-
|
|
158
|
+
const { lockRowsPath } = await import("../../lifecycle/resource-lock");
|
|
159
|
+
console.log(
|
|
160
|
+
JSON.stringify(
|
|
161
|
+
{ gate, path: await targetLockPathAt(gate), locks: Object.fromEntries(rows), rowsPath: lockRowsPath(gate), rows: Object.fromEntries(leased.map((r) => [r.key, r.holder])) },
|
|
162
|
+
null,
|
|
163
|
+
2,
|
|
164
|
+
),
|
|
165
|
+
);
|
|
119
166
|
return 0;
|
|
120
167
|
}
|
|
121
168
|
if (rows.length === 0) console.error(formatInfo(`no target locks on ${gate}`));
|
|
122
169
|
for (const [target, l] of rows) console.log(`${target}\tpull request ${l.pr}\t${l.stage}\t${l.by}\t${l.at}`);
|
|
170
|
+
if (leased.length === 0) console.error(formatInfo(`no apply rows held on ${gate}`));
|
|
171
|
+
for (const { key, holder } of leased) console.log(`${key}\trun ${holder.run}\t${holder.at}${holder.url ? `\t${holder.url}` : ""}`);
|
|
123
172
|
return 0;
|
|
124
173
|
}
|
|
125
174
|
|
|
@@ -129,7 +178,18 @@ export async function runLock(ctx: CommandContext): Promise<number> {
|
|
|
129
178
|
|
|
130
179
|
let targets = targetsOf(ctx);
|
|
131
180
|
let head = args.head;
|
|
132
|
-
if (args.
|
|
181
|
+
if (args.keepLocks) {
|
|
182
|
+
if (targets.length > 0 || args.fromReport) return fail("--keep keeps the locks the pull request holds; drop the names and --from-report");
|
|
183
|
+
let file;
|
|
184
|
+
try {
|
|
185
|
+
file = await readTargetLocks(gate);
|
|
186
|
+
} catch (err) {
|
|
187
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
188
|
+
}
|
|
189
|
+
targets = Object.entries(file.locks).filter(([, l]) => l.pr === args.pr).map(([target]) => target).sort();
|
|
190
|
+
head ??= Object.values(file.locks).find((l) => l.pr === args.pr)?.head;
|
|
191
|
+
if (targets.length === 0) return fail(`pull request ${args.pr} holds no lock on ${gate} yet, so there is nothing to keep`, "Its plan takes the locks under ci.locks: plan; comment again once the plan job ran.");
|
|
192
|
+
} else if (args.fromReport) {
|
|
133
193
|
if (targets.length > 0) return fail("--from-report reads the targets from the report; drop the names");
|
|
134
194
|
const read = fromReport(args.fromReport, args.pr);
|
|
135
195
|
if ("error" in read) return fail(read.error);
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant notify relay` (#4611): serve the relay that turns a chat click into
|
|
3
|
+
* a `chant approve` (../../notify-relay.ts), from a checkout of the repo.
|
|
4
|
+
*
|
|
5
|
+
* ```
|
|
6
|
+
* CHANT_RELAY_KEY=... SLACK_SIGNING_SECRET=... chant notify relay
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Settings come from the environment (`RELAY_ENV`), as a container or
|
|
10
|
+
* function host sets them: the relay key, the Slack signing secret, the
|
|
11
|
+
* Teams HMAC key, the relay's principal (default `<product>-relay`), the
|
|
12
|
+
* maximum age of a button (default a day), and the host and port (default
|
|
13
|
+
* 127.0.0.1:8787). The relay refuses to start with neither chat secret, or
|
|
14
|
+
* with no relay key, since it could then verify nothing.
|
|
15
|
+
*
|
|
16
|
+
* Each click fetches `chant/lifecycle`, reads the signers file at base, and
|
|
17
|
+
* records through `recordGateApproval`, one click at a time, so two clicks
|
|
18
|
+
* never race on the ledger.
|
|
19
|
+
*/
|
|
20
|
+
import { activeProductWords } from "../../ci-product-words";
|
|
21
|
+
import { CHANT_EXIT } from "../../exit-codes";
|
|
22
|
+
import { DEFAULT_RELAY_MAX_AGE_SECONDS } from "../../notify";
|
|
23
|
+
import { DEFAULT_RELAY_HOST, DEFAULT_RELAY_PORT, RELAY_ENV, startRelayServer, type RelayDeps, type RelayPending, type RelaySettings } from "../../notify-relay";
|
|
24
|
+
import { formatError, formatInfo } from "../format";
|
|
25
|
+
import type { CommandContext } from "../registry";
|
|
26
|
+
|
|
27
|
+
/** The relay's settings, read from `env`, or the first problem with them. */
|
|
28
|
+
export function relaySettingsFromEnv(env: NodeJS.ProcessEnv): { settings: RelaySettings; host: string; port: number } | { error: string } {
|
|
29
|
+
const key = env[RELAY_ENV.key];
|
|
30
|
+
if (!key) return { error: `${RELAY_ENV.key} is not set; it holds the key notify signs the buttons with (notify.relay on the sending side)` };
|
|
31
|
+
const slackSecret = env[RELAY_ENV.slackSecret] || undefined;
|
|
32
|
+
const teamsSecret = env[RELAY_ENV.teamsSecret] || undefined;
|
|
33
|
+
if (!slackSecret && !teamsSecret) return { error: `set ${RELAY_ENV.slackSecret}, ${RELAY_ENV.teamsSecret} or both, so the relay can verify a click` };
|
|
34
|
+
const maxAgeText = env[RELAY_ENV.maxAge];
|
|
35
|
+
const maxAge = maxAgeText === undefined || maxAgeText === "" ? DEFAULT_RELAY_MAX_AGE_SECONDS : Number(maxAgeText);
|
|
36
|
+
if (!Number.isInteger(maxAge) || maxAge <= 0) return { error: `${RELAY_ENV.maxAge} is a whole number of seconds (got ${JSON.stringify(maxAgeText)})` };
|
|
37
|
+
const portText = env[RELAY_ENV.port];
|
|
38
|
+
const port = portText === undefined || portText === "" ? DEFAULT_RELAY_PORT : Number(portText);
|
|
39
|
+
if (!Number.isInteger(port) || port < 0 || port > 65535) return { error: `${RELAY_ENV.port} is a port number (got ${JSON.stringify(portText)})` };
|
|
40
|
+
const slackResponse = env[RELAY_ENV.slackResponse]?.split(",").map((s) => s.trim()).filter(Boolean);
|
|
41
|
+
return {
|
|
42
|
+
settings: { key, ...(slackSecret ? { slackSecret } : {}), ...(teamsSecret ? { teamsSecret } : {}), maxAgeSeconds: maxAge, ...(slackResponse?.length ? { slackResponse } : {}) },
|
|
43
|
+
host: env[RELAY_ENV.host] || DEFAULT_RELAY_HOST,
|
|
44
|
+
port,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** One at a time: each click's ledger read and write finish before the next starts. */
|
|
49
|
+
function serial(): <T>(fn: () => Promise<T>) => Promise<T> {
|
|
50
|
+
let tail: Promise<unknown> = Promise.resolve();
|
|
51
|
+
return <T>(fn: () => Promise<T>) => {
|
|
52
|
+
const run = tail.then(fn, fn);
|
|
53
|
+
tail = run.catch(() => undefined);
|
|
54
|
+
return run;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** The relay's reads and writes against the checkout at `cwd`. */
|
|
59
|
+
export function checkoutRelayDeps(cwd: string, principal: string): RelayDeps {
|
|
60
|
+
const words = activeProductWords();
|
|
61
|
+
const one = serial();
|
|
62
|
+
return {
|
|
63
|
+
principal,
|
|
64
|
+
words,
|
|
65
|
+
async signers() {
|
|
66
|
+
const { scopeSource } = await import("../../workspace/write-scope");
|
|
67
|
+
const policy = scopeSource(cwd).policy;
|
|
68
|
+
return { signers: policy.signers, path: policy.signersPath };
|
|
69
|
+
},
|
|
70
|
+
pending: (digest) =>
|
|
71
|
+
one(async () => {
|
|
72
|
+
const { fetchLifecycle } = await import("../../lifecycle/git");
|
|
73
|
+
const { pendingGatesByPlan } = await import("../../lifecycle/gate-pending-by-plan");
|
|
74
|
+
const { readGateLedger } = await import("../../lifecycle/gate-ledger");
|
|
75
|
+
const { latestPendingGate } = await import("../../lifecycle/gate-ledger-select");
|
|
76
|
+
await fetchLifecycle({ cwd });
|
|
77
|
+
const out: RelayPending[] = [];
|
|
78
|
+
for (const p of await pendingGatesByPlan(digest, { cwd })) {
|
|
79
|
+
const digestAsked = p.planDigest ?? p.changeSet;
|
|
80
|
+
if (!digestAsked) continue;
|
|
81
|
+
const fact = latestPendingGate((await readGateLedger(p.op, { cwd })).pending.filter((f) => f.environment === p.environment), p.gate);
|
|
82
|
+
out.push({ op: p.op, gate: p.gate, digest: digestAsked, ...(p.environment !== undefined ? { environment: p.environment } : {}), ...(fact?.request ? { request: fact.request } : {}) });
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}),
|
|
86
|
+
approve: (input) =>
|
|
87
|
+
one(async () => {
|
|
88
|
+
const { recordGateApproval } = await import("./approve");
|
|
89
|
+
// chant approve prints why it refused; the relay sends that line to the thread.
|
|
90
|
+
const said: string[] = [];
|
|
91
|
+
const was = console.error;
|
|
92
|
+
console.error = (...parts: unknown[]) => {
|
|
93
|
+
said.push(parts.map(String).join(" "));
|
|
94
|
+
was(...parts);
|
|
95
|
+
};
|
|
96
|
+
try {
|
|
97
|
+
const out = await recordGateApproval(input.op, input.gate, {
|
|
98
|
+
origin: "cli",
|
|
99
|
+
actor: input.actor,
|
|
100
|
+
relayedBy: input.relayedBy,
|
|
101
|
+
plan: input.digest,
|
|
102
|
+
...(input.environment !== undefined ? { environment: input.environment } : {}),
|
|
103
|
+
cwd,
|
|
104
|
+
});
|
|
105
|
+
if (out.ok) return { ok: true as const };
|
|
106
|
+
// eslint-disable-next-line no-control-regex
|
|
107
|
+
const reason = said.map((l) => l.replace(/\u001b\[[0-9;]*m/g, "").trim()).filter(Boolean)[0];
|
|
108
|
+
return { ok: false as const, error: reason ?? `chant approve ${input.op} ${input.gate} refused the approval` };
|
|
109
|
+
} finally {
|
|
110
|
+
console.error = was;
|
|
111
|
+
}
|
|
112
|
+
}),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** `chant notify relay`. Runs until the process is stopped. */
|
|
117
|
+
export async function runNotifyRelay(_ctx: CommandContext): Promise<number> {
|
|
118
|
+
const read = relaySettingsFromEnv(process.env);
|
|
119
|
+
if ("error" in read) {
|
|
120
|
+
console.error(formatError({ message: `chant notify relay did not start: ${read.error}` }));
|
|
121
|
+
return CHANT_EXIT.failed;
|
|
122
|
+
}
|
|
123
|
+
const words = activeProductWords();
|
|
124
|
+
const principal = process.env[RELAY_ENV.principal]?.trim() || `${words.product}-relay`;
|
|
125
|
+
const deps = checkoutRelayDeps(process.cwd(), principal);
|
|
126
|
+
const { url } = await startRelayServer(read.settings, deps, { host: read.host, port: read.port, log: (line) => console.error(formatInfo(line)) });
|
|
127
|
+
console.error(formatInfo(`${words.product} notify relay listens at ${url} (POST /slack, POST /teams, GET /healthz), recording approvals relayed by ${principal}`));
|
|
128
|
+
await new Promise<void>(() => {});
|
|
129
|
+
return 0;
|
|
130
|
+
}
|
|
@@ -270,7 +270,8 @@ describe("pr-apply --before-merge (#4301)", () => {
|
|
|
270
270
|
onRun = (r) => void ran.push(r);
|
|
271
271
|
expect(await runComponentsPrApply(ctx({}))).toBe(0);
|
|
272
272
|
expect(ran).toEqual(["net", "app"]);
|
|
273
|
-
|
|
273
|
+
// #4552: the lock targets go to the lock file sorted (lockTargetsOf).
|
|
274
|
+
expect(taken).toEqual([{ gate: "pr-apply", targets: ["app", "net"], holder: expect.objectContaining({ pr: 12, stage: "apply", head: HEAD }) }]);
|
|
274
275
|
expect(await applyReport()).toMatchObject({ status: "applied", beforeMerge: { requires: expect.any(Array) } });
|
|
275
276
|
});
|
|
276
277
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* #4155: a pull request's approval binds the files a step without a `plan`
|
|
3
3
|
* deploys from. A chart changed after approval, or a function's sources
|
|
4
|
-
* beside a planning step, moves the digest and pr-apply exits
|
|
4
|
+
* beside a planning step, moves the digest and pr-apply exits 4 (moved, #4553). A build
|
|
5
5
|
* whose output differs every time does not.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -148,10 +148,10 @@ describe("a Helm chart changed after approval (#4155)", () => {
|
|
|
148
148
|
expect(await runComponentsPrApply(ctx({ pr: 12 }))).toBe(0);
|
|
149
149
|
});
|
|
150
150
|
|
|
151
|
-
test("a file in the chart changed: pr-apply exits
|
|
151
|
+
test("a file in the chart changed: pr-apply exits 4 and applies nothing", async () => {
|
|
152
152
|
await planAndApprove();
|
|
153
153
|
await write("chart/templates/deployment.yaml", "replicas: 20\n");
|
|
154
|
-
expect(await runComponentsPrApply(ctx({ pr: 12 }))).toBe(
|
|
154
|
+
expect(await runComponentsPrApply(ctx({ pr: 12 }))).toBe(4);
|
|
155
155
|
const report = JSON.parse(await readFile(join(dir, "pr-apply.json"), "utf8"));
|
|
156
156
|
expect(report.status).not.toBe("applied");
|
|
157
157
|
});
|
|
@@ -159,10 +159,10 @@ describe("a Helm chart changed after approval (#4155)", () => {
|
|
|
159
159
|
test("a file added to the chart, or a changed values file, does the same", async () => {
|
|
160
160
|
await planAndApprove();
|
|
161
161
|
await write("chart/templates/service.yaml", "port: 80\n");
|
|
162
|
-
expect(await runComponentsPrApply(ctx({ pr: 12 }))).toBe(
|
|
162
|
+
expect(await runComponentsPrApply(ctx({ pr: 12 }))).toBe(4);
|
|
163
163
|
await planAndApprove();
|
|
164
164
|
await write("values-prod.yaml", "image: other\n");
|
|
165
|
-
expect(await runComponentsPrApply(ctx({ pr: 12 }))).toBe(
|
|
165
|
+
expect(await runComponentsPrApply(ctx({ pr: 12 }))).toBe(4);
|
|
166
166
|
});
|
|
167
167
|
});
|
|
168
168
|
|
|
@@ -186,10 +186,10 @@ describe("a function's sources beside a planning step (#4155)", () => {
|
|
|
186
186
|
expect(JSON.stringify(plan)).toContain("api#inputs");
|
|
187
187
|
});
|
|
188
188
|
|
|
189
|
-
test("a changed source moves the digest: pr-apply exits
|
|
189
|
+
test("a changed source moves the digest: pr-apply exits 4", async () => {
|
|
190
190
|
await planAndApprove();
|
|
191
191
|
await write("fn/index.js", "export const handler = () => 2;\n");
|
|
192
|
-
expect(await runComponentsPrApply(ctx({ pr: 12 }))).toBe(
|
|
192
|
+
expect(await runComponentsPrApply(ctx({ pr: 12 }))).toBe(4);
|
|
193
193
|
});
|
|
194
194
|
|
|
195
195
|
test("an unchanged rebuild whose output differs every run still applies under the approval", async () => {
|