@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
|
@@ -87,13 +87,19 @@
|
|
|
87
87
|
|
|
88
88
|
import type { ForgeKind } from "../pr-forge";
|
|
89
89
|
import { PR_APPLY_GATE } from "../pr-loop";
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
90
|
+
import { parseRequiresList } from "../pr-requires";
|
|
91
|
+
import { CI_IMAGE, GITHUB_JOB_TOKEN, githubSecret, PR_ENV_REPORT_DIR, type CiRunner } from "../ci-jobs";
|
|
92
|
+
import { FORGE_TOKEN_VARS, withoutForgeTokens } from "../ci-handover";
|
|
93
|
+
import { OIDC_REQUEST_VARS } from "../ci-identity";
|
|
94
|
+
import { parallelismProblem } from "../parallelism";
|
|
92
95
|
import { EMPTY_TREE_SHA } from "./changed-files";
|
|
93
96
|
import { layerWaves } from "../gated-waves";
|
|
94
97
|
import type { DriverComponent } from "./driver";
|
|
95
98
|
import type { GatedWavePipelineOptions } from "./gated-wave-pipeline";
|
|
96
99
|
import type { CloudTradeSpec, PipelineCloudIdentity } from "../ci-identity";
|
|
100
|
+
import { commentLine, resolveProductWords, type CiProductWords, type CiProductWordsInput } from "../ci-product-words";
|
|
101
|
+
import type { ControlTarget } from "../control/dispatch";
|
|
102
|
+
import { CI_RESPOND_ENV, respondList, type CiResponses } from "../ci-respond";
|
|
97
103
|
|
|
98
104
|
/** The variable `chant ci run` reads its runner key from (`RUNNER_KEY_ENV` in ../workspace/ci-green.ts). */
|
|
99
105
|
const RUNNER_KEY_ENV = "CHANT_RUNNER_KEY";
|
|
@@ -121,9 +127,25 @@ export const PR_LOOP_SETUP = [
|
|
|
121
127
|
"command -v tofu >/dev/null 2>&1 || (curl -fsSL https://get.opentofu.org/install-opentofu.sh -o /tmp/install-opentofu.sh && sh /tmp/install-opentofu.sh --install-method standalone)",
|
|
122
128
|
];
|
|
123
129
|
|
|
124
|
-
/**
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
/**
|
|
131
|
+
* The setup lines for a pipeline running in `image`: the install when it is
|
|
132
|
+
* the default image, none otherwise. `engine` is the lines the project's
|
|
133
|
+
* lexicons give (#4550, `LexiconPlugin.ciSetup`, {@link engineSetupLines}):
|
|
134
|
+
* Pulumi or plunge for a Pulumi member, OpenTofu for a Terraform one. Absent,
|
|
135
|
+
* OpenTofu, as before.
|
|
136
|
+
*/
|
|
137
|
+
export function prLoopSetup(image: string, engine?: readonly string[]): string[] {
|
|
138
|
+
if (image !== PR_LOOP_IMAGE) return [];
|
|
139
|
+
return engine && engine.length > 0 ? [...engine] : PR_LOOP_SETUP;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Join the setup lines each lexicon gives (#4550), each line once, in the
|
|
144
|
+
* order the lexicons come. A project whose lexicons give none gets none, and
|
|
145
|
+
* {@link prLoopSetup} then falls back to OpenTofu.
|
|
146
|
+
*/
|
|
147
|
+
export function engineSetupLines(perLexicon: ReadonlyArray<readonly string[] | undefined>): string[] {
|
|
148
|
+
return [...new Set(perLexicon.flatMap((lines) => lines ?? []))];
|
|
127
149
|
}
|
|
128
150
|
|
|
129
151
|
/**
|
|
@@ -162,6 +184,20 @@ export interface PrLoopPipelineOptions {
|
|
|
162
184
|
* `waveGate` nor `build`.
|
|
163
185
|
*/
|
|
164
186
|
applyBeforeMerge?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* The requires checks the apply before merge asks (#4607): a product's
|
|
189
|
+
* `apply.requires`, passed as `pr-apply --requires <list>`. Absent: all
|
|
190
|
+
* four. Only with `applyBeforeMerge`.
|
|
191
|
+
*/
|
|
192
|
+
applyRequires?: readonly string[];
|
|
193
|
+
/**
|
|
194
|
+
* Merge the pull request once its update before merge applied (#4636):
|
|
195
|
+
* `pr-apply --merge auto --merge-token-env <tokenEnv>`. The token is the
|
|
196
|
+
* merge's alone: on GitHub and Forgejo the job maps it from the secret of
|
|
197
|
+
* that name, on GitLab it is a protected variable the project sets. Only
|
|
198
|
+
* with `applyBeforeMerge`.
|
|
199
|
+
*/
|
|
200
|
+
applyMerge?: { tokenEnv: string; method?: "merge" | "squash" | "rebase" };
|
|
165
201
|
/**
|
|
166
202
|
* Stream each job's run events (#4007): `--events-json` on both commands,
|
|
167
203
|
* and `CHANT_RUN_EVENTS_DIR` set to {@link PR_LOOP_EVENTS_DIR}. Default false.
|
|
@@ -223,6 +259,14 @@ export interface PrLoopPipelineOptions {
|
|
|
223
259
|
* base; GitHub and Forgejo only. Absent: neither job.
|
|
224
260
|
*/
|
|
225
261
|
locks?: "plan";
|
|
262
|
+
/**
|
|
263
|
+
* `ci.lockGrain: repo` (#4552): one apply at a time in the repository.
|
|
264
|
+
* GitHub's apply jobs share the concurrency group `chant-apply-repo`,
|
|
265
|
+
* GitLab's the resource group of that name, and Forgejo's take the lock
|
|
266
|
+
* tag `refs/tags/chant-apply-lock` in the apply step (./repo-lock.ts). Set
|
|
267
|
+
* from the declaration at base. Absent: per environment and member.
|
|
268
|
+
*/
|
|
269
|
+
lockGrain?: "repo";
|
|
226
270
|
/**
|
|
227
271
|
* The cloud identity a pull request environment's jobs take (#4330), from
|
|
228
272
|
* `ci.identity.cloud` (`resolvePrEnvCloudIdentity` in ../ci-identity.ts):
|
|
@@ -232,6 +276,166 @@ export interface PrLoopPipelineOptions {
|
|
|
232
276
|
* Absent: they request no OIDC token.
|
|
233
277
|
*/
|
|
234
278
|
prEnvIdentity?: CloudTradeSpec;
|
|
279
|
+
/**
|
|
280
|
+
* The product's words (#4550, `@intentius/chant/ci-product`): the comment
|
|
281
|
+
* a job answers, and with `bin` the command every job runs in place of
|
|
282
|
+
* `chant`, whose bin passes the rest to chant in process with the words.
|
|
283
|
+
* The statuses and the note take the words in the running job, from the
|
|
284
|
+
* bin. Absent: chant's.
|
|
285
|
+
*/
|
|
286
|
+
words?: CiProductWordsInput | CiProductWords;
|
|
287
|
+
/** The engine install lines of the project's lexicons (#4550), for {@link prLoopSetup}. */
|
|
288
|
+
engineSetup?: string[];
|
|
289
|
+
/**
|
|
290
|
+
* The control repo (#4568, `@intentius/chant/ci-control`): after the last
|
|
291
|
+
* apply on merge succeeds, a `control-dispatch` job tells the control
|
|
292
|
+
* repo this member applied, and the control repo runs its dependents.
|
|
293
|
+
* The job maps the target's secret into `CHANT_CONTROL_TOKEN` for its one
|
|
294
|
+
* step; on GitLab, where a CI/CD variable reaches every job, the plan job
|
|
295
|
+
* unsets it with the forge tokens. `sentCheck` and `markSent` are the
|
|
296
|
+
* product's shell lines that find and set the commit's control status.
|
|
297
|
+
* Needs `applyOnMerge` or `waveGate`; ignored under `applyBeforeMerge`,
|
|
298
|
+
* which applies no default branch.
|
|
299
|
+
*/
|
|
300
|
+
control?: { target: ControlTarget; sentCheck?: string; markSent?: string };
|
|
301
|
+
/**
|
|
302
|
+
* A comment preview (#4620): `/<product> <plan word>` on a pull request
|
|
303
|
+
* plans its head again in a job that holds only a read token, and a job
|
|
304
|
+
* after it posts the note ({@link prCommentPreviewJob}). The words must
|
|
305
|
+
* name a `plan` command. Set from `--preview-comment` beside `--pr-loop`.
|
|
306
|
+
* Default false.
|
|
307
|
+
*/
|
|
308
|
+
previewComment?: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* Where the pull request loop's jobs run (#4625), by stage: `plan` for the
|
|
311
|
+
* plan and the comment preview, `apply` for the apply jobs, the record
|
|
312
|
+
* job and a pull request environment's up, down and sweep, and `default`
|
|
313
|
+
* for every other job (the note jobs, the lock jobs, the control
|
|
314
|
+
* dispatch) and for a stage left out. A plywood `runners` key maps
|
|
315
|
+
* `preview` onto `plan` and `up` onto `apply`. Absent: the forge's
|
|
316
|
+
* default runner.
|
|
317
|
+
*/
|
|
318
|
+
runners?: PrLoopRunners;
|
|
319
|
+
/**
|
|
320
|
+
* Variables for the jobs that plan or apply (#4625): the plan, the
|
|
321
|
+
* comment preview, the apply and the record. Values as the forge reads
|
|
322
|
+
* them; a name of a forge token or a token request variable is refused.
|
|
323
|
+
*/
|
|
324
|
+
variables?: Record<string, string>;
|
|
325
|
+
/**
|
|
326
|
+
* Secrets passed to the same jobs (#4625), as `{ <variable>: <secret> }`:
|
|
327
|
+
* the repository secret named `<secret>` as `<variable>`. GitHub and
|
|
328
|
+
* Forgejo map `secrets.<secret>`; GitLab, where every job has the CI/CD
|
|
329
|
+
* variables, maps `$<secret>` when the names differ. The plan job still
|
|
330
|
+
* drops the forge tokens before the change's code runs, and a passed name
|
|
331
|
+
* of a forge token is refused.
|
|
332
|
+
*/
|
|
333
|
+
secrets?: Record<string, string>;
|
|
334
|
+
/**
|
|
335
|
+
* How many members of a wave the plan job plans at once (#4625): `pr-plan
|
|
336
|
+
* --parallelism <n>`, on the plan and the comment preview. Absent: all of
|
|
337
|
+
* a wave's members at once.
|
|
338
|
+
*/
|
|
339
|
+
parallelism?: number;
|
|
340
|
+
/**
|
|
341
|
+
* The plan narrows to the `--target` addresses of the preview comment
|
|
342
|
+
* (#4626): `pr-plan --comment-targets`, which reads the comment from
|
|
343
|
+
* {@link PREVIEW_COMMENT_ENV}. {@link prCommentPreviewJob} sets it on its
|
|
344
|
+
* own plan; a caller never needs to.
|
|
345
|
+
*/
|
|
346
|
+
commentTargets?: boolean;
|
|
347
|
+
/**
|
|
348
|
+
* The plan and the comment preview refresh each step's state first
|
|
349
|
+
* (#4627): `pr-plan --refresh`, pulumi/actions' `refresh`. A member whose
|
|
350
|
+
* capability cannot is refused by name. Default false.
|
|
351
|
+
*/
|
|
352
|
+
refresh?: boolean;
|
|
353
|
+
/**
|
|
354
|
+
* Stale marking (#4628): the plan note carries the target branch's commit
|
|
355
|
+
* it was posted against, and a `stale-notes` job on each push to the
|
|
356
|
+
* target branch marks every open pull request's note posted against
|
|
357
|
+
* another commit stale, naming the plan comment under `previewComment`,
|
|
358
|
+
* and sets its plan status back to pending ({@link prStaleJob}). Set
|
|
359
|
+
* from `--stale-notes` beside `--pr-loop`. Default false.
|
|
360
|
+
*/
|
|
361
|
+
staleNotes?: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* The responses to pipeline events (#4629, ../ci-respond.ts), from
|
|
364
|
+
* `chant build --pr-loop --respond <list>`: the apply job and the
|
|
365
|
+
* plan-note job carry the list as `CHANT_RESPOND`. Absent, or every event
|
|
366
|
+
* at its default: neither job sets it.
|
|
367
|
+
*/
|
|
368
|
+
respond?: CiResponses;
|
|
369
|
+
/**
|
|
370
|
+
* The decide service the description check asks (#4629), from
|
|
371
|
+
* `--decide-backend` and `--decide-model`: the plan-note job passes both
|
|
372
|
+
* to `pr-post`. Needed with `respond.description: "check"`.
|
|
373
|
+
*/
|
|
374
|
+
decide?: { backend: string; model: string };
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** The `CHANT_RESPOND` value of `respond` (#4629), or undefined when every event is at its default. Throws on a description check with no decide service. */
|
|
378
|
+
export function prLoopRespondEnv(options: Pick<PrLoopPipelineOptions, "respond" | "decide">): Record<string, string> {
|
|
379
|
+
if (options.respond?.description === "check" && !options.decide) throw new Error("respond.description: check asks a decide service, so the pipeline needs decide: { backend, model }");
|
|
380
|
+
const list = options.respond ? respondList(options.respond) : "";
|
|
381
|
+
return list ? { [CI_RESPOND_ENV]: list } : {};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/** The variable the comment preview's plan reads the comment from (#4626); never a shell argument. */
|
|
385
|
+
export const PREVIEW_COMMENT_ENV = "CHANT_PREVIEW_COMMENT";
|
|
386
|
+
|
|
387
|
+
/** Where the pull request loop's jobs run, by stage (#4625). */
|
|
388
|
+
export interface PrLoopRunners {
|
|
389
|
+
plan?: CiRunner;
|
|
390
|
+
apply?: CiRunner;
|
|
391
|
+
default?: CiRunner;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/** A pull request loop job's stage for its runner (#4625). */
|
|
395
|
+
export type PrLoopRunnerStage = keyof PrLoopRunners;
|
|
396
|
+
|
|
397
|
+
/** The runner of `stage` (#4625): the stage's own, else `default`, else undefined for the forge's default. */
|
|
398
|
+
export function prLoopRunner(options: Pick<PrLoopPipelineOptions, "runners">, stage: PrLoopRunnerStage): CiRunner | undefined {
|
|
399
|
+
return options.runners?.[stage] ?? options.runners?.default;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* The runner stage of a pull request loop job by its name (#4625), with a
|
|
404
|
+
* workspace member's `<member>-` prefix taken off first: the plan and the
|
|
405
|
+
* comment preview plan; the apply jobs, the record job and a pull request
|
|
406
|
+
* environment's up, down and sweep apply; every other job runs on the
|
|
407
|
+
* default.
|
|
408
|
+
*/
|
|
409
|
+
export function prLoopJobStage(name: string, member?: string): PrLoopRunnerStage {
|
|
410
|
+
const bare = member && name.startsWith(`${member}-`) ? name.slice(member.length + 1) : name;
|
|
411
|
+
if (bare === "plan" || bare === PR_COMMENT_PREVIEW_JOB) return "plan";
|
|
412
|
+
if (bare === "apply" || bare === "record" || /^apply-wave-\d+$/.test(bare) || bare === "env-up" || bare === "env-down" || bare === "env-sweep") return "apply";
|
|
413
|
+
return "default";
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* The variables and passed secrets of the jobs that plan or apply (#4625),
|
|
418
|
+
* as the forge spells them. Throws on a name the loop sets itself or a
|
|
419
|
+
* forge token, which the plan must be able to drop.
|
|
420
|
+
*/
|
|
421
|
+
export function prLoopPassedEnv(forge: ForgeKind, options: Pick<PrLoopPipelineOptions, "variables" | "secrets">): Record<string, string> {
|
|
422
|
+
const reserved = new Set<string>([...FORGE_TOKEN_VARS, ...OIDC_REQUEST_VARS, "BASE_SHA", "PR_NUMBER", "HEAD_SHA", "GREEN_SHA", "CHANT_RUN_EVENTS_DIR", "CHANT_RUNNER_KEY"]);
|
|
423
|
+
const out: Record<string, string> = {};
|
|
424
|
+
const name = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
425
|
+
for (const [key, value] of Object.entries(options.variables ?? {})) {
|
|
426
|
+
if (!name.test(key)) throw new Error(`the pull request jobs' variable ${JSON.stringify(key)} is not a variable name`);
|
|
427
|
+
if (reserved.has(key)) throw new Error(`the pull request jobs' variable ${key} is one the jobs set or drop themselves; give it another name`);
|
|
428
|
+
out[key] = value;
|
|
429
|
+
}
|
|
430
|
+
for (const [key, secret] of Object.entries(options.secrets ?? {})) {
|
|
431
|
+
if (!name.test(key) || !name.test(secret)) throw new Error(`the passed secret ${JSON.stringify(key)}: ${JSON.stringify(secret)} must map a variable name to a secret name`);
|
|
432
|
+
if (reserved.has(key)) throw new Error(`the passed secret ${key} is a name the jobs set or drop themselves, and the plan job drops the forge tokens before the change's code runs; pass it under another name`);
|
|
433
|
+
if (key in out) throw new Error(`${key} is both a variable and a passed secret of the pull request jobs; give one`);
|
|
434
|
+
if (forge === "gitlab") {
|
|
435
|
+
if (key !== secret) out[key] = `$${secret}`;
|
|
436
|
+
} else out[key] = githubSecret(secret);
|
|
437
|
+
}
|
|
438
|
+
return out;
|
|
235
439
|
}
|
|
236
440
|
|
|
237
441
|
/** The lock job's step names and commands (#4327), shared by the GitHub-shaped generators. */
|
|
@@ -246,6 +450,178 @@ export function prLockCommand(forge: ForgeKind): string {
|
|
|
246
450
|
/** `chant unlock` for the pull request that closed; reads `PR_NUMBER`. */
|
|
247
451
|
export const PR_UNLOCK_COMMAND = 'chant unlock --pr "$PR_NUMBER"';
|
|
248
452
|
|
|
453
|
+
/** The job answering `/<product> lock` (#4588). */
|
|
454
|
+
export const PR_COMMENT_LOCK_JOB = "comment-lock";
|
|
455
|
+
/** The job answering `/<product> unlock` (#4588). */
|
|
456
|
+
export const PR_COMMENT_UNLOCK_JOB = "comment-unlock";
|
|
457
|
+
|
|
458
|
+
/** The GitLab variables a pipeline of the target branch is started with to lock or unlock a merge request (#4588), as `CHANT_APPLY_PR` applies one. */
|
|
459
|
+
export const GITLAB_LOCK_PR_VAR = "CHANT_LOCK_PR";
|
|
460
|
+
export const GITLAB_UNLOCK_PR_VAR = "CHANT_UNLOCK_PR";
|
|
461
|
+
|
|
462
|
+
/** A comment lock or unlock job (#4588): the comment it answers, its command, and the values the command reads. */
|
|
463
|
+
export interface PrCommentLockJob {
|
|
464
|
+
jobName: typeof PR_COMMENT_LOCK_JOB | typeof PR_COMMENT_UNLOCK_JOB;
|
|
465
|
+
/** Which comment command it answers. */
|
|
466
|
+
command: "lock" | "unlock";
|
|
467
|
+
/** The comment, `/<product> <word>`. */
|
|
468
|
+
comment: string;
|
|
469
|
+
/** The command line. Reads `$PR_NUMBER`. */
|
|
470
|
+
line: string;
|
|
471
|
+
/** The values it reads, as the forge spells them. On GitLab `PR_NUMBER` comes from {@link GITLAB_LOCK_PR_VAR} or {@link GITLAB_UNLOCK_PR_VAR}. */
|
|
472
|
+
env: Record<string, string>;
|
|
473
|
+
/** On GitLab, the variable a pipeline of the target branch is started with. */
|
|
474
|
+
gitlabVar?: string;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* The comment lock and unlock jobs (#4588), under `ci.locks: plan` when the
|
|
479
|
+
* words name the `lock` and `unlock` commands. `/<product> lock` runs `chant
|
|
480
|
+
* lock --keep`, which keeps the locks the pull request's plan took until it
|
|
481
|
+
* closes; `/<product> unlock` runs `chant unlock`, which releases them. Both
|
|
482
|
+
* run at the target branch's commit, so no code of the change runs, and
|
|
483
|
+
* GitHub asks for a commenter who can write as it does for the apply
|
|
484
|
+
* comment. GitLab starts no pipeline on a note, so there each job runs in a
|
|
485
|
+
* pipeline of the target branch started with {@link GITLAB_LOCK_PR_VAR} or
|
|
486
|
+
* {@link GITLAB_UNLOCK_PR_VAR} set to the merge request's iid.
|
|
487
|
+
*/
|
|
488
|
+
export function prCommentLockJobs(forge: ForgeKind, options: Pick<PrLoopPipelineOptions, "locks" | "words"> = {}): PrCommentLockJob[] {
|
|
489
|
+
if (options.locks !== "plan") return [];
|
|
490
|
+
const words = resolveProductWords(options.words);
|
|
491
|
+
const github = forge !== "gitlab";
|
|
492
|
+
const out: PrCommentLockJob[] = [];
|
|
493
|
+
for (const command of ["lock", "unlock"] as const) {
|
|
494
|
+
const comment = commentLine(words, command);
|
|
495
|
+
if (!comment) continue;
|
|
496
|
+
const gitlabVar = command === "lock" ? GITLAB_LOCK_PR_VAR : GITLAB_UNLOCK_PR_VAR;
|
|
497
|
+
const line = command === "lock" ? ["chant", "lock", "--keep", "--pr", '"$PR_NUMBER"', "--forge", forge].join(" ") : PR_UNLOCK_COMMAND;
|
|
498
|
+
out.push({
|
|
499
|
+
jobName: command === "lock" ? PR_COMMENT_LOCK_JOB : PR_COMMENT_UNLOCK_JOB,
|
|
500
|
+
command,
|
|
501
|
+
comment,
|
|
502
|
+
line: withProductBin(line, words.bin),
|
|
503
|
+
env: github ? { PR_NUMBER: "${{ github.event.issue.number }}", GITHUB_TOKEN: GITHUB_JOB_TOKEN } : { PR_NUMBER: `$${gitlabVar}` },
|
|
504
|
+
...(github ? {} : { gitlabVar }),
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
return out;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/** The job answering `/<product> <plan word>` (#4620). */
|
|
511
|
+
export const PR_COMMENT_PREVIEW_JOB = "comment-preview";
|
|
512
|
+
/** The job that posts the comment preview's note and status (#4620). */
|
|
513
|
+
export const PR_COMMENT_PREVIEW_NOTE_JOB = "comment-preview-note";
|
|
514
|
+
/** The GitLab variable a pipeline of the target branch is started with to preview a merge request again (#4620). */
|
|
515
|
+
export const GITLAB_PREVIEW_PR_VAR = "CHANT_PREVIEW_PR";
|
|
516
|
+
/** The variable the GitHub-shaped preview job's checkout script reads the pull request's head ref from (#4620). */
|
|
517
|
+
export const PREVIEW_REF_ENV = "CHANT_PREVIEW_REF";
|
|
518
|
+
/** The preview job's output that carries the commit it checked out, set before any of the change's code runs (#4620). */
|
|
519
|
+
export const PREVIEW_HEAD_OUTPUT = "head";
|
|
520
|
+
|
|
521
|
+
/** The comment preview's two jobs (#4620): the plan at the pull request's head, and the post after it. */
|
|
522
|
+
export interface PrCommentPreviewJob {
|
|
523
|
+
jobName: typeof PR_COMMENT_PREVIEW_JOB;
|
|
524
|
+
noteJobName: typeof PR_COMMENT_PREVIEW_NOTE_JOB;
|
|
525
|
+
/** The comment it answers, `/<product> <plan word>`. */
|
|
526
|
+
comment: string;
|
|
527
|
+
/**
|
|
528
|
+
* The plan job's command, as the pull request's plan job runs it, with
|
|
529
|
+
* `PR_NUMBER` from the comment (or {@link GITLAB_PREVIEW_PR_VAR}) and
|
|
530
|
+
* `BASE_SHA` left to {@link base}.
|
|
531
|
+
*/
|
|
532
|
+
plan: PrLoopJob;
|
|
533
|
+
/** The shell line that sets `BASE_SHA` to the target branch's commit, run after the checkout. */
|
|
534
|
+
base: string;
|
|
535
|
+
/**
|
|
536
|
+
* GitHub and Forgejo: the ref the checkout script fetches through
|
|
537
|
+
* {@link PREVIEW_REF_ENV}. GitLab: the line that checks out the merge
|
|
538
|
+
* request's head, in the job's own clone.
|
|
539
|
+
*/
|
|
540
|
+
head: { ref: string } | { line: string };
|
|
541
|
+
/** The post job's command, the values it reads, and on GitLab the line that finds the head it posts for. */
|
|
542
|
+
post: { command: string; env: Record<string, string>; setup?: string[] };
|
|
543
|
+
/** On GitLab, the variable a pipeline of the target branch is started with. */
|
|
544
|
+
gitlabVar?: string;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* The comment preview (#4620), with `previewComment`: `/<product> <plan
|
|
549
|
+
* word>` on an open pull request runs the plan job's `pr-plan` again at the
|
|
550
|
+
* pull request's head, in a job that holds only a read token and drops it
|
|
551
|
+
* before the change's code runs, as the plan job does (#4295). The job after
|
|
552
|
+
* it checks out the target branch's commit, takes the report back and posts
|
|
553
|
+
* the note and the plan status with `pr-post`, as `plan-note` does.
|
|
554
|
+
*
|
|
555
|
+
* On GitHub the commenter must be able to write, as for the lock and unlock
|
|
556
|
+
* comments (#4588); Forgejo's payload says nothing of the commenter. GitLab
|
|
557
|
+
* starts no pipeline on a note, so there both jobs run in a pipeline of the
|
|
558
|
+
* target branch started with {@link GITLAB_PREVIEW_PR_VAR} set to the merge
|
|
559
|
+
* request's iid. The plan job unsets the forge tokens before it checks out
|
|
560
|
+
* the merge request's head, and the post job finds that head again with `git
|
|
561
|
+
* ls-remote`; a report for another head is refused by `pr-post`.
|
|
562
|
+
*
|
|
563
|
+
* Undefined without `previewComment`. Throws when the words name no `plan`
|
|
564
|
+
* command, since no comment would start the job.
|
|
565
|
+
*/
|
|
566
|
+
export function prCommentPreviewJob(forge: ForgeKind, env: string, options: PrLoopPipelineOptions = {}, member?: string): PrCommentPreviewJob | undefined {
|
|
567
|
+
if (!options.previewComment) return undefined;
|
|
568
|
+
const words = resolveProductWords(options.words);
|
|
569
|
+
const comment = commentLine(words, "plan");
|
|
570
|
+
if (!comment) throw new Error(`--preview-comment answers /${words.product} <plan command>, and the words name no plan command; name one in the words' commands, or drop --preview-comment`);
|
|
571
|
+
// The plan job's own command: the apply side's options never reach it, so they are left out here.
|
|
572
|
+
const { applyBeforeMerge: _early, applyRequires: _requires, applyMerge: _merge, applyOnMerge: _onMerge, respond: _respond, decide: _decide, ...planSide } = options;
|
|
573
|
+
// #4626: the comment's --target addresses narrow the preview, read from the comment in a variable.
|
|
574
|
+
const [plan] = prLoopJobs(forge, env, { ...planSide, commentTargets: true }, member);
|
|
575
|
+
const github = forge !== "gitlab";
|
|
576
|
+
const prNumber = github ? "${{ github.event.issue.number }}" : `$${GITLAB_PREVIEW_PR_VAR}`;
|
|
577
|
+
// GitLab: whoever starts the target-branch pipeline passes the comment as CHANT_PREVIEW_COMMENT, a pipeline variable every job has.
|
|
578
|
+
const fromComment = (jobEnv: Record<string, string>): Record<string, string> => {
|
|
579
|
+
const { BASE_SHA: _base, ...rest } = jobEnv;
|
|
580
|
+
return github ? { ...rest, PR_NUMBER: prNumber, [PREVIEW_COMMENT_ENV]: "${{ github.event.comment.body }}" } : { ...rest, PR_NUMBER: prNumber, BASE_SHA: "$CI_COMMIT_SHA" };
|
|
581
|
+
};
|
|
582
|
+
const branch = options.branch ?? "main";
|
|
583
|
+
const base = github
|
|
584
|
+
? `BASE_SHA="$(git rev-parse --verify "refs/remotes/origin/${branch.replace(/"/g, "")}^{commit}")" && export BASE_SHA`
|
|
585
|
+
: 'BASE_SHA="$CI_COMMIT_SHA" && export BASE_SHA';
|
|
586
|
+
const postCommand = withProductBin(
|
|
587
|
+
[
|
|
588
|
+
"chant", "components", "pr-post", "--pr", '"$PR_NUMBER"', "--head", '"$HEAD_SHA"',
|
|
589
|
+
"--env", env, "--output", PR_LOOP_REPORT_DIR, "--forge", forge,
|
|
590
|
+
...(member ? ["--member", member] : []),
|
|
591
|
+
...(github ? ["--result", '"$PLAN_RESULT"'] : []),
|
|
592
|
+
// #4628: the target branch's commit the preview measured from, for the note's tip line.
|
|
593
|
+
...(options.staleNotes ? ["--tip", '"$TIP_SHA"'] : []),
|
|
594
|
+
].join(" "),
|
|
595
|
+
words.bin,
|
|
596
|
+
);
|
|
597
|
+
const tipEnv: Record<string, string> = options.staleNotes ? { TIP_SHA: github ? "${{ github.sha }}" : "$CI_COMMIT_SHA" } : {};
|
|
598
|
+
return {
|
|
599
|
+
jobName: PR_COMMENT_PREVIEW_JOB,
|
|
600
|
+
noteJobName: PR_COMMENT_PREVIEW_NOTE_JOB,
|
|
601
|
+
comment,
|
|
602
|
+
plan: { ...plan!, env: fromComment(plan!.env), run: { ...plan!.run, env: fromComment(plan!.run.env) } },
|
|
603
|
+
base,
|
|
604
|
+
head: github ? { ref: `refs/pull/${prNumber}/head` } : { line: pullRequestCheckout("gitlab") },
|
|
605
|
+
post: github
|
|
606
|
+
? {
|
|
607
|
+
command: postCommand,
|
|
608
|
+
env: {
|
|
609
|
+
PR_NUMBER: prNumber,
|
|
610
|
+
HEAD_SHA: `\${{ needs.${PR_COMMENT_PREVIEW_JOB}.outputs.${PREVIEW_HEAD_OUTPUT} }}`,
|
|
611
|
+
PLAN_RESULT: `\${{ needs.${PR_COMMENT_PREVIEW_JOB}.result }}`,
|
|
612
|
+
...tipEnv,
|
|
613
|
+
GITHUB_TOKEN: GITHUB_JOB_TOKEN,
|
|
614
|
+
},
|
|
615
|
+
}
|
|
616
|
+
: {
|
|
617
|
+
command: postCommand,
|
|
618
|
+
env: { PR_NUMBER: prNumber, ...tipEnv },
|
|
619
|
+
setup: ['HEAD_SHA="$(git ls-remote origin "refs/merge-requests/$PR_NUMBER/head" | cut -f1)" && export HEAD_SHA'],
|
|
620
|
+
},
|
|
621
|
+
...(github ? {} : { gitlabVar: GITLAB_PREVIEW_PR_VAR }),
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
|
|
249
625
|
/** One job's command and the forge values it reads, as environment variables for its step. */
|
|
250
626
|
export interface PrLoopJob {
|
|
251
627
|
/** `plan`, `apply` or `record` (#4168). */
|
|
@@ -288,6 +664,8 @@ export interface PrLoopJob {
|
|
|
288
664
|
* pipeline never gets.
|
|
289
665
|
*/
|
|
290
666
|
run: { command: string; env: Record<string, string> };
|
|
667
|
+
/** Where the job runs (#4625), from the loop's `runners`: the plan's or the apply's, else `default`. Absent: the forge's default. */
|
|
668
|
+
runner?: CiRunner;
|
|
291
669
|
}
|
|
292
670
|
|
|
293
671
|
/** The lines `build` (#4088) runs before a job's command: the build, then the lint. Empty without the option. */
|
|
@@ -308,6 +686,14 @@ export function prLoopJobs(forge: ForgeKind, env: string, options: PrLoopPipelin
|
|
|
308
686
|
if (early && options.applyOnMerge) throw new Error("--apply-before-merge applies an open pull request and a merge records, so it takes no --apply-on-merge; pass one of them");
|
|
309
687
|
if (early && options.waveGate) throw new Error("--apply-before-merge applies the pull request's plan in one job, so it takes no --wave-gate");
|
|
310
688
|
if (early && (options.build || options.buildCommand)) throw new Error("--apply-before-merge runs no build before its requires checks, so it takes no --pr-build or --pr-build-command yet");
|
|
689
|
+
if (options.applyRequires && !early) throw new Error("--requires names the checks of an apply before merge, so it needs --apply-before-merge");
|
|
690
|
+
const asked = options.applyRequires ? parseRequiresList(options.applyRequires) : undefined;
|
|
691
|
+
if (asked && "error" in asked) throw new Error(asked.error);
|
|
692
|
+
const requires = early && asked ? ["--requires", asked.checks.join(",")] : [];
|
|
693
|
+
if (options.applyMerge && !early) throw new Error("--merge auto merges a pull request after its update before merge, so it needs --apply-before-merge");
|
|
694
|
+
if (options.applyMerge && !/^[A-Za-z_][A-Za-z0-9_]*$/.test(options.applyMerge.tokenEnv)) throw new Error(`the merge token variable ${JSON.stringify(options.applyMerge.tokenEnv)} is not a variable name`);
|
|
695
|
+
// #4636: the merge after the update, with its own token.
|
|
696
|
+
const merge = early && options.applyMerge ? ["--merge", "auto", "--merge-token-env", options.applyMerge.tokenEnv, ...(options.applyMerge.method ? ["--merge-method", options.applyMerge.method] : [])] : [];
|
|
311
697
|
const common = [
|
|
312
698
|
"--env", env, "--gate", gate, "--output", PR_LOOP_REPORT_DIR, "--forge", forge,
|
|
313
699
|
...(member ? ["--member", member] : []),
|
|
@@ -317,15 +703,27 @@ export function prLoopJobs(forge: ForgeKind, env: string, options: PrLoopPipelin
|
|
|
317
703
|
const github = forge !== "gitlab";
|
|
318
704
|
const buildLines = prLoopBuildLines(env, options);
|
|
319
705
|
const build = buildLines.length > 0 ? { build: buildLines } : {};
|
|
706
|
+
// #4625: the caller's variables and passed secrets, in every job that plans or applies.
|
|
320
707
|
const jobEnv: Record<string, string> = {
|
|
708
|
+
...prLoopPassedEnv(forge, options),
|
|
321
709
|
...(github ? { GITHUB_TOKEN: GITHUB_JOB_TOKEN } : {}),
|
|
322
710
|
...(options.events ? { CHANT_RUN_EVENTS_DIR: PR_LOOP_EVENTS_DIR } : {}),
|
|
323
711
|
};
|
|
712
|
+
const planRunner = prLoopRunner(options, "plan");
|
|
713
|
+
if (options.parallelism !== undefined) {
|
|
714
|
+
const problem = parallelismProblem("parallelism", options.parallelism);
|
|
715
|
+
if (problem) throw new Error(`the pull request plan's ${problem}`);
|
|
716
|
+
}
|
|
717
|
+
const parallelism = options.parallelism !== undefined ? ["--parallelism", String(options.parallelism)] : [];
|
|
718
|
+
const applyRunner = prLoopRunner(options, "apply");
|
|
324
719
|
// #4156: the flags `chant ci run` rebuilds `command` from. It finds the member from the directory it runs in.
|
|
325
720
|
const ciRun = (job: PrLoopJob["jobName"]): string[] => [
|
|
326
721
|
"chant", "ci", "run", job, "--in-place", ...(job === "plan" ? ["--no-push"] : []),
|
|
327
722
|
...(job === "apply" && !early ? [] : ["--base", '"$BASE_SHA"']), ...(job === "plan" || (job === "apply" && early) ? ["--pr", '"$PR_NUMBER"'] : []),
|
|
328
|
-
...(job === "apply" && early ? ["--apply-before-merge"] : []),
|
|
723
|
+
...(job === "apply" && early ? ["--apply-before-merge", ...requires, ...merge] : []),
|
|
724
|
+
...(job === "plan" ? parallelism : []),
|
|
725
|
+
...(job === "plan" && options.commentTargets ? ["--comment-targets"] : []),
|
|
726
|
+
...(job === "plan" && options.refresh ? ["--refresh"] : []),
|
|
329
727
|
"--env", env, "--gate", gate, "--forge", forge,
|
|
330
728
|
...(job !== "record" && options.waveGate ? ["--wave-gate", options.waveGate] : []),
|
|
331
729
|
...(job !== "plan" && options.branch ? ["--branch", JSON.stringify(options.branch)] : []),
|
|
@@ -343,8 +741,9 @@ export function prLoopJobs(forge: ForgeKind, env: string, options: PrLoopPipelin
|
|
|
343
741
|
const greenBranch = github ? JSON.stringify(options.branch ?? "main") : options.branch ? JSON.stringify(options.branch) : "$CI_DEFAULT_BRANCH";
|
|
344
742
|
const applyEnv = github ? { BASE_SHA: "${{ github.event.before }}", ...jobEnv } : { BASE_SHA: "$CI_COMMIT_BEFORE_SHA", ...jobEnv };
|
|
345
743
|
// #4301: the apply before merge runs in a job of the target branch, whose commit is the base, at the pull request's head.
|
|
744
|
+
const mergeSecret = github && options.applyMerge ? { [options.applyMerge.tokenEnv]: `\${{ secrets.${options.applyMerge.tokenEnv} }}` } : {};
|
|
346
745
|
const earlyEnv = github
|
|
347
|
-
? { BASE_SHA: "${{ github.sha }}", PR_NUMBER: "${{ github.event.issue.number }}", ...jobEnv }
|
|
746
|
+
? { BASE_SHA: "${{ github.sha }}", PR_NUMBER: "${{ github.event.issue.number }}", ...jobEnv, ...mergeSecret }
|
|
348
747
|
: { BASE_SHA: "$CI_COMMIT_SHA", PR_NUMBER: `$${GITLAB_APPLY_PR_VAR}`, ...jobEnv };
|
|
349
748
|
const greenApply: PrLoopJob = {
|
|
350
749
|
// #4168 step 9: the apply applies the newest green commit, measured from the one applied before it.
|
|
@@ -358,6 +757,7 @@ export function prLoopJobs(forge: ForgeKind, env: string, options: PrLoopPipelin
|
|
|
358
757
|
env: jobEnv,
|
|
359
758
|
checkout: [greenCheckout(greenBranch)],
|
|
360
759
|
greenBranch,
|
|
760
|
+
...(applyRunner !== undefined ? { runner: applyRunner } : {}),
|
|
361
761
|
...build,
|
|
362
762
|
run: { command: ciRun("apply").join(" "), env: runEnv(jobEnv) },
|
|
363
763
|
};
|
|
@@ -365,34 +765,42 @@ export function prLoopJobs(forge: ForgeKind, env: string, options: PrLoopPipelin
|
|
|
365
765
|
// #4301: the requires checks run inside pr-apply, before any of the head's code loads.
|
|
366
766
|
jobName: "apply",
|
|
367
767
|
command: [
|
|
368
|
-
"chant", "components", "pr-apply", "--before-merge", "--base", '"$BASE_SHA"', "--pr", '"$PR_NUMBER"', ...common,
|
|
768
|
+
"chant", "components", "pr-apply", "--before-merge", ...requires, ...merge, "--base", '"$BASE_SHA"', "--pr", '"$PR_NUMBER"', ...common,
|
|
369
769
|
...(options.requireReview === true ? ["--require-review"] : []),
|
|
370
770
|
"--resume", PR_APPLY_RECORD,
|
|
371
771
|
].join(" "),
|
|
372
772
|
env: earlyEnv,
|
|
373
773
|
checkout: [pullRequestCheckout(forge)],
|
|
774
|
+
...(applyRunner !== undefined ? { runner: applyRunner } : {}),
|
|
374
775
|
run: { command: ciRun("apply").join(" "), env: runEnv(earlyEnv) },
|
|
375
776
|
};
|
|
777
|
+
const bin = options.words?.bin;
|
|
778
|
+
// #4629: the apply posts a failed apply's triage and a refused one's diff as CHANT_RESPOND says.
|
|
779
|
+
const respondEnv = prLoopRespondEnv(options);
|
|
780
|
+
const withRespond = (job: PrLoopJob): PrLoopJob => (Object.keys(respondEnv).length > 0 ? { ...job, env: { ...job.env, ...respondEnv }, run: { ...job.run, env: { ...job.run.env, ...respondEnv } } } : job);
|
|
376
781
|
return [
|
|
377
782
|
{
|
|
378
783
|
jobName: "plan",
|
|
379
784
|
// With `waveGate` the plan's note says the later waves may stop at their own gates (#4003).
|
|
380
|
-
command: ["chant", "components", "pr-plan", "--base", '"$BASE_SHA"', "--pr", '"$PR_NUMBER"', ...common, ...(options.waveGate ? ["--wave-gate", options.waveGate] : []), "--no-status"].join(" "),
|
|
785
|
+
command: ["chant", "components", "pr-plan", "--base", '"$BASE_SHA"', "--pr", '"$PR_NUMBER"', ...common, ...(options.waveGate ? ["--wave-gate", options.waveGate] : []), ...parallelism, ...(options.commentTargets ? ["--comment-targets"] : []), ...(options.refresh ? ["--refresh"] : []), "--no-status"].join(" "),
|
|
381
786
|
env: planEnv,
|
|
382
787
|
...build,
|
|
788
|
+
...(planRunner !== undefined ? { runner: planRunner } : {}),
|
|
383
789
|
// #4328: no runner key either. The step drops it, but the job's environment is the pull request's code's too.
|
|
384
790
|
run: { command: ciRun("plan").join(" "), env: planEnv },
|
|
385
791
|
},
|
|
386
|
-
early ? earlyApply : greenApply,
|
|
792
|
+
withRespond(early ? earlyApply : greenApply),
|
|
387
793
|
{
|
|
388
794
|
jobName: "record",
|
|
389
795
|
command: ["chant", "components", "pr-record", "--base", '"$BASE_SHA"', ...common].join(" "),
|
|
390
796
|
env: applyEnv,
|
|
391
797
|
setup: [github ? githubBaseFallback(options.branch) : gitlabBaseFallback(options.branch)],
|
|
392
798
|
...build,
|
|
799
|
+
// The record runs on merge, where the apply would.
|
|
800
|
+
...(applyRunner !== undefined ? { runner: applyRunner } : {}),
|
|
393
801
|
run: { command: ciRun("record").join(" "), env: runEnv(applyEnv) },
|
|
394
802
|
},
|
|
395
|
-
];
|
|
803
|
+
].map((job) => jobWithBin(job as PrLoopJob, bin));
|
|
396
804
|
}
|
|
397
805
|
|
|
398
806
|
/** The name of the job that posts the plan's note and status (#4295). */
|
|
@@ -414,11 +822,21 @@ export const PR_PLAN_NOTE_JOB = "plan-note";
|
|
|
414
822
|
* asks GitLab for each open merge request's plan job and reads its report
|
|
415
823
|
* from the job's artifacts.
|
|
416
824
|
*/
|
|
417
|
-
export function prLoopPostJob(forge: ForgeKind, env: string, member?: string): { command: string; env: Record<string, string> } {
|
|
825
|
+
export function prLoopPostJob(forge: ForgeKind, env: string, member?: string, words?: Pick<CiProductWordsInput, "bin">, opts: { staleNotes?: boolean } & Pick<PrLoopPipelineOptions, "respond" | "decide"> = {}): { command: string; env: Record<string, string> } {
|
|
826
|
+
// #4629: the responses as CHANT_RESPOND, and with the description check its decide service on the line.
|
|
827
|
+
const respondEnv = prLoopRespondEnv(opts);
|
|
828
|
+
const decide = opts.respond?.description === "check" && opts.decide ? ` --decide-backend ${JSON.stringify(opts.decide.backend)} --decide-model ${JSON.stringify(opts.decide.model)}` : "";
|
|
829
|
+
const job = prLoopPostJobBase(forge, env, member, words, opts);
|
|
830
|
+
return decide || Object.keys(respondEnv).length > 0 ? { command: `${job.command}${decide}`, env: { ...job.env, ...respondEnv } } : job;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
function prLoopPostJobBase(forge: ForgeKind, env: string, member: string | undefined, words: Pick<CiProductWordsInput, "bin"> | undefined, opts: { staleNotes?: boolean }): { command: string; env: Record<string, string> } {
|
|
834
|
+
// #4628: with staleNotes the note carries the target branch's commit, so a later push can mark it stale.
|
|
835
|
+
const tip = opts.staleNotes ? ["--tip", '"$TIP_SHA"'] : [];
|
|
418
836
|
if (forge === "gitlab") {
|
|
419
837
|
return {
|
|
420
|
-
command: ["chant", "components", "pr-post", "--open", "--env", env, "--output", PR_LOOP_REPORT_DIR, "--forge", forge, ...(member ? ["--member", member] : [])].join(" "),
|
|
421
|
-
env: {},
|
|
838
|
+
command: withProductBin(["chant", "components", "pr-post", "--open", "--env", env, "--output", PR_LOOP_REPORT_DIR, "--forge", forge, ...(member ? ["--member", member] : []), ...tip].join(" "), words?.bin),
|
|
839
|
+
env: opts.staleNotes ? { TIP_SHA: "$CI_COMMIT_SHA" } : {},
|
|
422
840
|
};
|
|
423
841
|
}
|
|
424
842
|
const command = [
|
|
@@ -426,10 +844,42 @@ export function prLoopPostJob(forge: ForgeKind, env: string, member?: string): {
|
|
|
426
844
|
"--env", env, "--output", PR_LOOP_REPORT_DIR, "--forge", forge,
|
|
427
845
|
...(member ? ["--member", member] : []),
|
|
428
846
|
"--result", '"$PLAN_RESULT"',
|
|
847
|
+
...tip,
|
|
429
848
|
].join(" ");
|
|
430
849
|
return {
|
|
431
|
-
command,
|
|
432
|
-
env: {
|
|
850
|
+
command: withProductBin(command, words?.bin),
|
|
851
|
+
env: {
|
|
852
|
+
PR_NUMBER: "${{ github.event.pull_request.number }}",
|
|
853
|
+
HEAD_SHA: "${{ github.sha }}",
|
|
854
|
+
PLAN_RESULT: "${{ needs.plan.result }}",
|
|
855
|
+
...(opts.staleNotes ? { TIP_SHA: "${{ github.event.pull_request.base.sha }}" } : {}),
|
|
856
|
+
GITHUB_TOKEN: GITHUB_JOB_TOKEN,
|
|
857
|
+
},
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/** The job that marks the open pull requests' notes stale after a push to the target branch (#4628). */
|
|
862
|
+
export const PR_STALE_JOB = "stale-notes";
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* The stale job's command and the values it reads (#4628), with
|
|
866
|
+
* `staleNotes`: on a push to the target branch, at its commit, `pr-post
|
|
867
|
+
* --stale` marks each open pull request's note posted against another
|
|
868
|
+
* commit stale and sets its plan status back to pending. It names the plan
|
|
869
|
+
* comment with `previewComment`. Undefined without `staleNotes`.
|
|
870
|
+
*/
|
|
871
|
+
export function prStaleJob(forge: ForgeKind, env: string, options: Pick<PrLoopPipelineOptions, "staleNotes" | "previewComment" | "branch" | "words"> = {}, member?: string): { command: string; env: Record<string, string> } | undefined {
|
|
872
|
+
if (!options.staleNotes) return undefined;
|
|
873
|
+
const words = resolveProductWords(options.words);
|
|
874
|
+
const command = [
|
|
875
|
+
"chant", "components", "pr-post", "--stale", "--tip", '"$TIP_SHA"', "--env", env, "--forge", forge,
|
|
876
|
+
...(options.branch ? ["--branch", JSON.stringify(options.branch)] : []),
|
|
877
|
+
...(member ? ["--member", member] : []),
|
|
878
|
+
...(options.previewComment ? ["--preview-comment"] : []),
|
|
879
|
+
].join(" ");
|
|
880
|
+
return {
|
|
881
|
+
command: withProductBin(command, words.bin),
|
|
882
|
+
env: forge === "gitlab" ? { TIP_SHA: "$CI_COMMIT_SHA" } : { TIP_SHA: "${{ github.sha }}", GITHUB_TOKEN: GITHUB_JOB_TOKEN },
|
|
433
883
|
};
|
|
434
884
|
}
|
|
435
885
|
|
|
@@ -555,6 +1005,37 @@ export const GITLAB_APPLY_PR_VAR = "CHANT_APPLY_PR";
|
|
|
555
1005
|
/** The comment that starts the apply before merge on GitHub and Forgejo (#4301). */
|
|
556
1006
|
export const APPLY_COMMENT = "/chant apply";
|
|
557
1007
|
|
|
1008
|
+
/** The comment that starts the apply before merge under the pipeline's words (#4550): `/plywood up`, else {@link APPLY_COMMENT}. */
|
|
1009
|
+
export function prApplyComment(options: Pick<PrLoopPipelineOptions, "words"> = {}): string {
|
|
1010
|
+
return commentLine(resolveProductWords(options.words), "apply") ?? APPLY_COMMENT;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
/** `chant` at the start of a command, or after a shell `$(`, `(`, `&&` or space. */
|
|
1014
|
+
const CHANT_WORD = /(^|[\s"(]|\$\()chant (?=[a-z])/g;
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* A command line with the product's bin in place of `chant` (#4550): `npx
|
|
1018
|
+
* --no-install plywood components pr-plan ...`. A `chant ci run` line also
|
|
1019
|
+
* passes `--chant <bin>`, so the command it runs goes through the bin too.
|
|
1020
|
+
*/
|
|
1021
|
+
export function withProductBin(line: string, bin: string | undefined): string {
|
|
1022
|
+
if (!bin) return line;
|
|
1023
|
+
const swapped = line.replace(CHANT_WORD, (_m, before: string) => `${before}${bin} `);
|
|
1024
|
+
return swapped.replace(new RegExp(`^${bin.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")} ci run ([a-z-]+) `), (m) => `${m}--chant ${JSON.stringify(bin)} `);
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/** Every command of `job` through {@link withProductBin}. */
|
|
1028
|
+
function jobWithBin<T extends Pick<PrLoopJob, "command" | "run"> & Partial<Pick<PrLoopJob, "build" | "checkout" | "setup">>>(job: T, bin: string | undefined): T {
|
|
1029
|
+
if (!bin) return job;
|
|
1030
|
+
return {
|
|
1031
|
+
...job,
|
|
1032
|
+
command: withProductBin(job.command, bin),
|
|
1033
|
+
run: { ...job.run, command: withProductBin(job.run.command, bin) },
|
|
1034
|
+
...(job.build ? { build: job.build.map((l) => withProductBin(l, bin)) } : {}),
|
|
1035
|
+
...(job.checkout ? { checkout: job.checkout.map((l) => withProductBin(l, bin)) } : {}),
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
|
|
558
1039
|
/**
|
|
559
1040
|
* The line that checks out pull request `$PR_NUMBER`'s head (#4301) in a job
|
|
560
1041
|
* of the target branch: the forge's `refs/pull/<n>/head`, or GitLab's
|
|
@@ -608,8 +1089,7 @@ export function githubBaseFallback(branch?: string): string {
|
|
|
608
1089
|
return pushBaseFallback(JSON.stringify(branch ?? "main"), "$GITHUB_SHA");
|
|
609
1090
|
}
|
|
610
1091
|
|
|
611
|
-
|
|
612
|
-
export const PR_ENV_REPORT_DIR = ".chant/pr-env";
|
|
1092
|
+
export { PR_ENV_REPORT_DIR } from "../ci-jobs";
|
|
613
1093
|
|
|
614
1094
|
/** The cron the generated `env-sweep` job runs on (#4298): hourly, at a minute off the hour. */
|
|
615
1095
|
export const PR_ENV_SWEEP_CRON = "17 * * * *";
|