@intentius/chant 0.124.55 → 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/ci-agent.d.ts.map +1 -1
- package/dist/ci-agent.js +1 -2
- 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.map +1 -1
- package/dist/ci-control.js +3 -4
- package/dist/ci-estate.d.ts +24 -0
- package/dist/ci-estate.d.ts.map +1 -1
- package/dist/ci-estate.js +1 -2
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +2 -3
- 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 +7 -1
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +38 -4
- package/dist/ci-product.d.ts +35 -0
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +38 -3
- 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/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 +81 -0
- 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.map +1 -1
- package/dist/cli/handlers/ci-check.js +38 -9
- 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/pr.d.ts +5 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +259 -4
- package/dist/cli/handlers/run-wave.js +89 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +56 -2
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +107 -0
- package/dist/cli/registry.d.ts +38 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/adoption.d.ts.map +1 -1
- package/dist/components/adoption.js +1 -2
- package/dist/components/capability.d.ts +37 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/capability.js +25 -0
- package/dist/components/check-hooks.d.ts +4 -1
- package/dist/components/check-hooks.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/components/ci-services.js +1 -2
- package/dist/components/driver.d.ts +12 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +35 -1
- package/dist/components/groups.d.ts.map +1 -1
- package/dist/components/groups.js +4 -3
- package/dist/components/pr-env-ledger.d.ts.map +1 -1
- package/dist/components/pr-env-ledger.js +1 -2
- package/dist/components/pr-environment.d.ts +1 -1
- package/dist/components/pr-environment.d.ts.map +1 -1
- package/dist/components/pr-environment.js +1 -1
- package/dist/components/pr-pipeline.d.ts +129 -3
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +153 -17
- package/dist/components/pr-run.d.ts +8 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +9 -4
- package/dist/components/product-pipeline.d.ts +35 -2
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +24 -5
- package/dist/components/wave-plan.d.ts +8 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +18 -2
- 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/exit-codes.d.ts +7 -1
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +7 -1
- package/dist/lexicon.d.ts +46 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +2 -3
- package/dist/lifecycle/gated-request.d.ts.map +1 -1
- package/dist/lifecycle/gated-request.js +1 -2
- package/dist/lifecycle/query.d.ts.map +1 -1
- package/dist/lifecycle/query.js +4 -5
- package/dist/lifecycle/release-catalog.d.ts.map +1 -1
- package/dist/lifecycle/release-catalog.js +1 -1
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +1 -2
- package/dist/lifecycle/release-status.d.ts +20 -0
- package/dist/lifecycle/release-status.d.ts.map +1 -1
- package/dist/lifecycle/release-status.js +1 -22
- 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/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/index.d.ts +1 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -1
- package/dist/op/op-waves-capability-spec.d.ts +8 -0
- package/dist/op/op-waves-capability-spec.d.ts.map +1 -1
- package/dist/op/op-waves-capability-spec.js +21 -0
- package/dist/op/op-waves-release.d.ts.map +1 -1
- package/dist/op/op-waves-release.js +1 -2
- package/dist/op/op-waves-run.d.ts +7 -2
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +96 -4
- package/dist/op/op-waves-stand-down.d.ts.map +1 -1
- package/dist/op/op-waves-stand-down.js +1 -2
- package/dist/op/op-waves.d.ts +35 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +46 -6
- package/dist/op/runtime.d.ts +4 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtime.js +2 -3
- package/dist/otlp.d.ts.map +1 -1
- package/dist/otlp.js +1 -2
- package/dist/parallelism.d.ts +17 -0
- package/dist/parallelism.d.ts.map +1 -0
- package/dist/parallelism.js +33 -0
- package/dist/policy-source.d.ts.map +1 -1
- package/dist/policy-source.js +1 -2
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +56 -39
- package/dist/pr-loop.d.ts +9 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +22 -3
- 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 +70 -1
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +116 -5
- package/dist/pr-report-url.d.ts.map +1 -1
- package/dist/pr-report-url.js +1 -2
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/run-event.js +1 -2
- 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/wave-runtime.mjs +340 -327
- package/dist/workspace/ci-lock-grain.d.ts +5 -0
- package/dist/workspace/ci-lock-grain.d.ts.map +1 -1
- package/dist/workspace/ci-lock-grain.js +1 -7
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +5 -1
- package/dist/workspace/pr-report.schema.json +5 -0
- package/package.json +1 -1
- package/src/ci-agent.ts +1 -2
- 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 +3 -4
- package/src/ci-estate.ts +1 -2
- package/src/ci-identity-database.test.ts +2 -3
- package/src/ci-identity-targets.test.ts +1 -3
- package/src/ci-identity.ts +2 -3
- 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.ts +35 -6
- package/src/ci-product.ts +55 -3
- 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/cli/handlers/audit-log.ts +74 -0
- package/src/cli/handlers/build-pr-loop-flags.test.ts +98 -0
- package/src/cli/handlers/build.ts +69 -0
- 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 +38 -8
- package/src/cli/handlers/e2e-safe-run.ts +27 -0
- 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.ts +228 -4
- package/src/cli/handlers/run-wave.ts +79 -1
- package/src/cli/main.test.ts +1 -1
- package/src/cli/main.ts +56 -2
- package/src/cli/parse-args.ts +77 -0
- package/src/cli/registry.ts +38 -0
- package/src/components/adoption.ts +1 -2
- package/src/components/capability.ts +50 -0
- package/src/components/check-hooks.ts +4 -1
- package/src/components/check-steps.test.ts +70 -0
- package/src/components/check-steps.ts +158 -0
- package/src/components/ci-services.ts +1 -2
- package/src/components/driver.ts +35 -1
- package/src/components/groups.ts +4 -2
- package/src/components/plan-flags.test.ts +46 -0
- package/src/components/pr-comment-preview-targets.test.ts +34 -0
- package/src/components/pr-env-ledger.ts +1 -2
- package/src/components/pr-env-run-bundle.test.ts +0 -20
- package/src/components/pr-environment.ts +1 -1
- package/src/components/pr-pipeline-runners.test.ts +80 -0
- package/src/components/pr-pipeline.ts +232 -17
- package/src/components/pr-run.ts +17 -6
- package/src/components/pr-stale-job.test.ts +34 -0
- package/src/components/product-pipeline.ts +50 -8
- package/src/components/wave-plan.ts +18 -2
- 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/exit-codes.test.ts +3 -2
- package/src/exit-codes.ts +7 -1
- package/src/gate-decision-bundle.test.ts +0 -2
- package/src/lexicon.ts +48 -0
- package/src/lifecycle/control-entries-ledger.test.ts +2 -3
- package/src/lifecycle/gate-ledger.ts +2 -3
- package/src/lifecycle/gated-request.ts +1 -2
- package/src/lifecycle/query.ts +4 -5
- package/src/lifecycle/release-catalog.test.ts +3 -4
- package/src/lifecycle/release-catalog.ts +1 -1
- package/src/lifecycle/release-ledger.ts +1 -2
- package/src/lifecycle/release-status.test.ts +3 -4
- package/src/lifecycle/release-status.ts +1 -2
- package/src/lifecycle/wave-plans.ts +33 -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/index.ts +2 -0
- package/src/op/op-waves-after-plan.test.ts +12 -0
- package/src/op/op-waves-capability-spec.ts +20 -0
- package/src/op/op-waves-parallelism.test.ts +89 -0
- package/src/op/op-waves-pull-request.test.ts +78 -1
- package/src/op/op-waves-release.ts +1 -2
- package/src/op/op-waves-run.ts +94 -4
- package/src/op/op-waves-stand-down.ts +1 -2
- package/src/op/op-waves.ts +63 -6
- package/src/op/runtime.ts +6 -3
- package/src/otlp.ts +1 -2
- package/src/parallelism.test.ts +38 -0
- package/src/parallelism.ts +33 -0
- package/src/policy-source.ts +1 -2
- package/src/pr-forge-bundle.test.ts +1 -1
- package/src/pr-forge.ts +54 -35
- package/src/pr-loop-bundle.test.ts +1 -1
- package/src/pr-loop-narrowed.test.ts +63 -0
- package/src/pr-loop.ts +30 -3
- 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 +159 -5
- package/src/pr-report-url.ts +1 -2
- package/src/product-subpaths-plain-node.e2e.test.ts +1 -0
- package/src/release-floors.ts +1 -1
- package/src/run-event.ts +1 -2
- package/src/scheduled-op-cloud.ts +68 -0
- package/src/stage-hooks-bundle.test.ts +0 -2
- package/src/workspace/ci-lock-grain.ts +1 -2
- package/src/workspace/ci-run.ts +5 -1
- package/src/workspace/pr-report.schema.json +5 -0
package/dist/ci-product.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-product.d.ts","sourceRoot":"","sources":["../src/ci-product.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,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AC;AAEhI;;;;;;GAMG;AACH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AACtK,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,aAAsB,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EACL,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,YAAY,GAClB,MAAM,QAAQ,CAAC"}
|
package/dist/ci-product.js
CHANGED
|
@@ -16,24 +16,59 @@ import { OTLP_EXPORTER_FLOOR } from "./otlp.js";
|
|
|
16
16
|
* words })`, the lexicons' `ciSetup`, and the member detail sections of the
|
|
17
17
|
* note (#4573).
|
|
18
18
|
*/
|
|
19
|
-
export const CI_PRODUCT_FLOOR =
|
|
19
|
+
export const CI_PRODUCT_FLOOR = "0.124.55";
|
|
20
20
|
export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, } from "./ci-product-words.js";
|
|
21
21
|
export { driftNotifyFields, productNotifySource, productNotifyWords, productSendOptions } from "./notify-product.js";
|
|
22
22
|
/** The first chant with `chant notify relay` and the notify relay buttons (#4611). */
|
|
23
|
-
export const NOTIFY_RELAY_FLOOR =
|
|
23
|
+
export const NOTIFY_RELAY_FLOOR = "0.124.55";
|
|
24
24
|
/**
|
|
25
25
|
* The first chant whose product pipeline has the comment preview
|
|
26
26
|
* (`previewComment`, `build --pr-loop --preview-comment`) and whose
|
|
27
27
|
* `components pr-plan` takes `--target` (#4620). A product feature-detects
|
|
28
28
|
* `prCommentPreviewJob` and this constant together.
|
|
29
29
|
*/
|
|
30
|
-
export const PR_PREVIEW_FLOOR =
|
|
30
|
+
export const PR_PREVIEW_FLOOR = "0.124.55";
|
|
31
31
|
export { decideRelayClick, handleRelayRequest, relayPrincipalFor, RELAY_ENV, slackRelayClick, slackSignature, startRelayServer, teamsRelayClick, teamsSignature, verifySlackRequest, verifyTeamsRequest, } from "./notify-relay.js";
|
|
32
32
|
export { componentWaveOutputsFile, componentWaveSteps, componentWavesSpec, productAgentSpec, productCommand, productDriftAgent, productPipelineJobs, productWavesSpec, productWavesSpecFile, PRODUCT_WAVES_SPEC_DIR, } from "./components/product-pipeline.js";
|
|
33
33
|
export { prApplyComment, prCommentLockJobs, prCommentPreviewJob, prLoopSetup, engineSetupLines, withProductBin } from "./components/pr-pipeline.js";
|
|
34
34
|
export { CI_SERVICES_FLOOR, engineServices, githubServices, gitlabServices, serviceWaitLine, servicesJobEnv } from "./components/ci-services.js";
|
|
35
35
|
export { renderPrNote, prStatusContext, prApproveCommand, prApproveCommands, prApproveTargets, prMergeSentence } from "./pr-loop.js";
|
|
36
36
|
export { upsertPlanNote } from "./pr-post.js";
|
|
37
|
+
/**
|
|
38
|
+
* The approval status before merge (#4630): under a `pr-review` wave, the
|
|
39
|
+
* op waves generators add a job that posts `<product>/approval` on each
|
|
40
|
+
* open pull request's head. A product feature-detects on
|
|
41
|
+
* `APPROVAL_STATUS_FLOOR`.
|
|
42
|
+
*/
|
|
43
|
+
export const APPROVAL_STATUS_FLOOR = NEXT_RELEASE;
|
|
44
|
+
/**
|
|
45
|
+
* The approval status for `pull-request` waves too (#4630, 2026-10-28
|
|
46
|
+
* ruling): the generators add the record-plans and approval-status jobs for
|
|
47
|
+
* a spec whose waves take the pull request's own approval, and the status
|
|
48
|
+
* reads that approval's coverage of each wave's change set. A product such
|
|
49
|
+
* as plywood, whose waves all take `approval: pull-request`, feature-detects
|
|
50
|
+
* on this floor.
|
|
51
|
+
*/
|
|
52
|
+
export const APPROVAL_STATUS_PULL_REQUEST_FLOOR = NEXT_RELEASE;
|
|
53
|
+
export { opWavesPostsApprovalStatus } from "./op/op-waves.js";
|
|
54
|
+
export { approvalStatusOf, headWaveHolds, postApprovalStatus, postOpenApprovalStatuses } from "./op/approval-status.js";
|
|
55
|
+
/**
|
|
56
|
+
* Responses to pipeline events (#4629): a refused wave's diff, a failed
|
|
57
|
+
* apply's triage and the pull request description check, in the product's
|
|
58
|
+
* words. `productPipelineJobs(forge, env, { words, respond, decide })` turns
|
|
59
|
+
* them on and off; a product feature-detects on `CI_RESPOND_FLOOR`.
|
|
60
|
+
*/
|
|
61
|
+
export const CI_RESPOND_FLOOR = NEXT_RELEASE;
|
|
62
|
+
/**
|
|
63
|
+
* `chant build --pr-loop` carries `--merge auto --merge-token-env <VAR>
|
|
64
|
+
* [--merge-method <m>]` (#4636), `--respond <list>`, `--decide-backend` and
|
|
65
|
+
* `--decide-model` (#4629) into the generated pull request jobs. Before it
|
|
66
|
+
* the build parsed them and wrote jobs without them; a product that writes
|
|
67
|
+
* its pull request jobs with the build feature-detects on this floor.
|
|
68
|
+
*/
|
|
69
|
+
export const PR_LOOP_BUILD_FLAGS_FLOOR = NEXT_RELEASE;
|
|
70
|
+
export { CI_RESPOND_DEFAULTS, CI_RESPOND_ENV, CI_RESPONSES, parseRespondList, renderRefusedDiff, renderTriage, respondList, resolveResponses, } from "./ci-respond.js";
|
|
71
|
+
export { respondDescription, respondOpWave, respondPrApply, triageOfOpWave, triageOfPrReport, refusedOfOpWave, refusedOfPrReport } from "./ci-respond-run.js";
|
|
37
72
|
/**
|
|
38
73
|
* Run one chant command line in this process with the product's words
|
|
39
74
|
* (ruling C): what a product's bin calls for every command its verbs map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the responses of #4629 hook in: a `pr-apply` report, an op wave
|
|
3
|
+
* job's outcome, and the plan-note job's report. Each reads what the run
|
|
4
|
+
* already has (the report, the run's result, the change sets stored on
|
|
5
|
+
* `chant/lifecycle`) and posts through `./ci-respond.ts`. Nothing here
|
|
6
|
+
* throws or changes an exit code.
|
|
7
|
+
*/
|
|
8
|
+
import type { ChangeSetDocument } from "./change-set.js";
|
|
9
|
+
import { type CiProductWords } from "./ci-product-words.js";
|
|
10
|
+
import type { PrForge } from "./pr-forge.js";
|
|
11
|
+
import type { PrReport } from "./pr-loop.js";
|
|
12
|
+
import type { OpWavesSpec } from "./op/op-waves.js";
|
|
13
|
+
import type { RunOpWaveResult } from "./op/op-waves-run.js";
|
|
14
|
+
import type { OpWaveOutcome } from "./op/op-waves-notify.js";
|
|
15
|
+
import { type CiResponses, type DescriptionAsk, type DescriptionFinding, type FailedApply, type RefusedDiff, type RespondPlace, type RespondPost } from "./ci-respond.js";
|
|
16
|
+
/** Reads a change set stored under its digest; undefined when none is stored or it cannot be read. */
|
|
17
|
+
export type ChangeSetReader = (digest: string) => Promise<ChangeSetDocument | undefined>;
|
|
18
|
+
/** The ledger's reader: `chant/lifecycle`'s `_change-sets`, loaded on first call. */
|
|
19
|
+
export declare const ledgerChangeSetReader: ChangeSetReader;
|
|
20
|
+
/** A failed `pr-apply` report as a triage, or undefined when it did not fail. */
|
|
21
|
+
export declare function triageOfPrReport(report: PrReport, words?: CiProductWords): FailedApply | undefined;
|
|
22
|
+
/** A refused `pr-apply` report as a refused diff, or undefined when it was not refused for a moved plan or a holder. */
|
|
23
|
+
export declare function refusedOfPrReport(report: PrReport, read?: ChangeSetReader, words?: CiProductWords): Promise<RefusedDiff | undefined>;
|
|
24
|
+
/** The responses a `pr-apply` report calls for, posted on its pull request. */
|
|
25
|
+
export declare function respondPrApply(forge: Pick<PrForge, "upsertComment" | "trackIssue"> | undefined, report: PrReport, given?: CiResponses, opts?: {
|
|
26
|
+
read?: ChangeSetReader;
|
|
27
|
+
env?: Record<string, string | undefined>;
|
|
28
|
+
words?: CiProductWords;
|
|
29
|
+
}): Promise<RespondPost[]>;
|
|
30
|
+
/** What a failed op wave job's run record says failed, or undefined when it did not fail. */
|
|
31
|
+
export declare function triageOfOpWave(spec: OpWavesSpec, k: number, outcome: OpWaveOutcome, words?: CiProductWords): FailedApply | undefined;
|
|
32
|
+
/** A refused op wave job (moved, held or declined) as a refused diff, or undefined when it was not refused. */
|
|
33
|
+
export declare function refusedOfOpWave(spec: OpWavesSpec, k: number, result: RunOpWaveResult, read?: ChangeSetReader, words?: CiProductWords): Promise<RefusedDiff | undefined>;
|
|
34
|
+
/** The forge and place an op wave job posts on: its pull request when it has one, else a tracking issue. */
|
|
35
|
+
export declare function opWavePlace(forge: Pick<PrForge, "pullRequestFor">, result: RunOpWaveResult | undefined, head: string | undefined): Promise<RespondPlace | undefined>;
|
|
36
|
+
/**
|
|
37
|
+
* The responses an op wave job's outcome calls for (#4629): the spec's
|
|
38
|
+
* `respond`, over `CHANT_RESPOND`. Posted on the pull request the wave
|
|
39
|
+
* applies (its review, its `pr-<n>` op, or the one that merged `head`),
|
|
40
|
+
* else on a tracking issue per spec and wave.
|
|
41
|
+
*/
|
|
42
|
+
export declare function respondOpWave(spec: OpWavesSpec, k: number, outcome: OpWaveOutcome, opts?: {
|
|
43
|
+
forge?: Pick<PrForge, "upsertComment" | "trackIssue" | "pullRequestFor">;
|
|
44
|
+
head?: string;
|
|
45
|
+
read?: ChangeSetReader;
|
|
46
|
+
env?: Record<string, string | undefined>;
|
|
47
|
+
words?: CiProductWords;
|
|
48
|
+
}): Promise<RespondPost[]>;
|
|
49
|
+
/** The description check's settings: the decide backend and model, and the threshold. */
|
|
50
|
+
export interface DescriptionCheckSettings {
|
|
51
|
+
ask: DescriptionAsk;
|
|
52
|
+
threshold?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The description check on a plan report's change set (#4629), from the
|
|
56
|
+
* plan-note job: the pull request's title and body read from the forge,
|
|
57
|
+
* the finding posted as its own comment. A clear answer edits an earlier
|
|
58
|
+
* finding away. Never throws.
|
|
59
|
+
*/
|
|
60
|
+
export declare function respondDescription(forge: Pick<PrForge, "upsertComment" | "findComment" | "trackIssue" | "pullRequestHead" | "findPullRequest">, report: Pick<PrReport, "pr" | "env" | "member" | "changeSet" | "status">, settings: DescriptionCheckSettings, words?: CiProductWords): Promise<DescriptionFinding | undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* A {@link DescriptionAsk} over a `decide.backends` entry: the Noul
|
|
63
|
+
* question posted to the backend's `/v1/systemone`. The backend's module
|
|
64
|
+
* loads on first call.
|
|
65
|
+
*/
|
|
66
|
+
export declare function backendDescriptionAsk(backend: import("./op/decide-config.js").DecideBackend, opts: {
|
|
67
|
+
name: string;
|
|
68
|
+
model: string;
|
|
69
|
+
cwd: string;
|
|
70
|
+
env?: NodeJS.ProcessEnv;
|
|
71
|
+
transport?: typeof fetch;
|
|
72
|
+
}): DescriptionAsk;
|
|
73
|
+
//# sourceMappingURL=ci-respond-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-respond-run.d.ts","sourceRoot":"","sources":["../src/ci-respond-run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAuC,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE9F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,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AE,wBAAwB,EAClC,KAAK,GAAE,cAAqC,GAC3C,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CA2BzC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,oBAAoB,EAAE,aAAa,EAAE,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CAAE,GAAG,cAAc,CAYhN"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the responses of #4629 hook in: a `pr-apply` report, an op wave
|
|
3
|
+
* job's outcome, and the plan-note job's report. Each reads what the run
|
|
4
|
+
* already has (the report, the run's result, the change sets stored on
|
|
5
|
+
* `chant/lifecycle`) and posts through `./ci-respond.ts`. Nothing here
|
|
6
|
+
* throws or changes an exit code.
|
|
7
|
+
*/
|
|
8
|
+
import { activeProductWords, notifyWaveLabel } from "./ci-product-words.js";
|
|
9
|
+
import { CHANT_EXIT } from "./exit-codes.js";
|
|
10
|
+
import { changeSetDiff, checkDescription, DESCRIPTION_QUESTION, digestDiff, postResponse, renderRefusedDiff, renderTriage, resolveResponses, respondMarker, } from "./ci-respond.js";
|
|
11
|
+
/** The ledger's reader: `chant/lifecycle`'s `_change-sets`, loaded on first call. */
|
|
12
|
+
export const ledgerChangeSetReader = async (digest) => {
|
|
13
|
+
try {
|
|
14
|
+
const { readStoredChangeSet } = await import("./lifecycle/change-set-store.js");
|
|
15
|
+
const read = await readStoredChangeSet(digest);
|
|
16
|
+
return read.status === "found" ? read.document : undefined;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const log = (line) => {
|
|
23
|
+
process.stderr.write(line + "\n");
|
|
24
|
+
};
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// pr-apply
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
/** How a `pr-apply` post names the change. */
|
|
29
|
+
function applyLabel(report, words) {
|
|
30
|
+
const what = report.pr !== null ? `the ${words.verbs.apply[0]} of pull request ${report.pr}` : `the ${words.verbs.apply[0]} of ${report.op}`;
|
|
31
|
+
return report.member ? `${what} (${report.member})` : what;
|
|
32
|
+
}
|
|
33
|
+
/** A failed `pr-apply` report as a triage, or undefined when it did not fail. */
|
|
34
|
+
export function triageOfPrReport(report, words = activeProductWords()) {
|
|
35
|
+
if (report.stage !== "apply" || report.status !== "failed")
|
|
36
|
+
return undefined;
|
|
37
|
+
const members = report.members.filter((m) => m.status === "failed").map((m) => ({ member: m.member, ...(m.error ? { error: m.error } : {}) }));
|
|
38
|
+
return {
|
|
39
|
+
label: applyLabel(report, words),
|
|
40
|
+
exitCode: 1,
|
|
41
|
+
members,
|
|
42
|
+
...(members.length === 0 && report.message ? { error: report.message } : {}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** A refused `pr-apply` report as a refused diff, or undefined when it was not refused for a moved plan or a holder. */
|
|
46
|
+
export async function refusedOfPrReport(report, read = ledgerChangeSetReader, words = activeProductWords()) {
|
|
47
|
+
if (report.stage !== "apply" || report.status !== "refused")
|
|
48
|
+
return undefined;
|
|
49
|
+
const label = applyLabel(report, words);
|
|
50
|
+
if (report.refusal === "plan-changed" || report.refusal === "wave-plan-changed") {
|
|
51
|
+
const approvedDigest = report.approval.approved ?? null;
|
|
52
|
+
const approved = approvedDigest ? await read(approvedDigest) : undefined;
|
|
53
|
+
return { label, reason: "moved", approved: approvedDigest, current: report.digest, members: changeSetDiff(approved, report.changeSet) };
|
|
54
|
+
}
|
|
55
|
+
if (report.refusal === "locked")
|
|
56
|
+
return { label, reason: "held", approved: report.digest, current: report.digest, members: [], ...(report.message ? { detail: firstLine(report.message) } : {}) };
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
/** The responses a `pr-apply` report calls for, posted on its pull request. */
|
|
60
|
+
export async function respondPrApply(forge, report, given, opts = {}) {
|
|
61
|
+
if (!forge || report.pr === null)
|
|
62
|
+
return [];
|
|
63
|
+
const responses = resolveResponses(given, opts.env, log);
|
|
64
|
+
const words = opts.words ?? activeProductWords();
|
|
65
|
+
const place = `${report.op}:${report.env}${report.member ? `:${report.member}` : ""}`;
|
|
66
|
+
const posts = [];
|
|
67
|
+
try {
|
|
68
|
+
if (responses["apply-failed"] === "triage") {
|
|
69
|
+
const triage = triageOfPrReport(report, words);
|
|
70
|
+
if (triage)
|
|
71
|
+
posts.push(await postResponse(forge, "apply-failed", place, { pr: report.pr }, renderTriage(triage, words)));
|
|
72
|
+
}
|
|
73
|
+
if (responses["wave-refused"] === "diff") {
|
|
74
|
+
const refused = await refusedOfPrReport(report, opts.read, words);
|
|
75
|
+
if (refused)
|
|
76
|
+
posts.push(await postResponse(forge, "wave-refused", place, { pr: report.pr }, renderRefusedDiff(refused, words)));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
posts.push({ posted: false, warning: `the responses were not posted: ${err instanceof Error ? err.message : String(err)}` });
|
|
81
|
+
}
|
|
82
|
+
for (const p of posts)
|
|
83
|
+
if (p.warning)
|
|
84
|
+
log(p.warning);
|
|
85
|
+
return posts;
|
|
86
|
+
}
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
// op waves
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
/** What a failed op wave job's run record says failed, or undefined when it did not fail. */
|
|
91
|
+
export function triageOfOpWave(spec, k, outcome, words = activeProductWords()) {
|
|
92
|
+
const name = spec.waves[k - 1]?.name;
|
|
93
|
+
const label = notifyWaveLabel(words, { k, ...(name ? { name } : {}), spec: spec.name });
|
|
94
|
+
if (outcome.error !== undefined)
|
|
95
|
+
return { label, exitCode: CHANT_EXIT.failed, members: [], error: outcome.error };
|
|
96
|
+
const result = outcome.result;
|
|
97
|
+
if (result.exitCode !== CHANT_EXIT.failed)
|
|
98
|
+
return undefined;
|
|
99
|
+
const members = result.failed.map((target) => {
|
|
100
|
+
const t = result.targets?.[target];
|
|
101
|
+
return { member: target, ...(t?.error ? { error: t.error } : {}), ...(t?.failedResources?.length ? { resources: [...t.failedResources] } : {}) };
|
|
102
|
+
});
|
|
103
|
+
const hooks = result.hooks.filter((h) => h.outcome === "failed").map((h) => `${h.moment} hook ${h.name}${h.target ? ` (${h.target})` : ""} failed`);
|
|
104
|
+
return { label, exitCode: result.exitCode, members, ...(members.length === 0 && hooks.length > 0 ? { error: hooks.join("\n") } : {}) };
|
|
105
|
+
}
|
|
106
|
+
/** A refused op wave job (moved, held or declined) as a refused diff, or undefined when it was not refused. */
|
|
107
|
+
export async function refusedOfOpWave(spec, k, result, read = ledgerChangeSetReader, words = activeProductWords()) {
|
|
108
|
+
const name = spec.waves[k - 1]?.name;
|
|
109
|
+
const label = notifyWaveLabel(words, { k, ...(name ? { name } : {}), spec: spec.name });
|
|
110
|
+
const d = result.decision;
|
|
111
|
+
if (result.exitCode === CHANT_EXIT.moved) {
|
|
112
|
+
// The share job refused the runs whose plan moved since the decision: the decision's digests against the plans the job read.
|
|
113
|
+
const approved = Object.fromEntries((d?.members ?? []).filter((m) => result.moved.includes(m.member)).map((m) => [m.member, m.planDigest ?? null]));
|
|
114
|
+
const current = Object.fromEntries(result.moved.map((t) => [t, result.plans?.[t]?.planDigest ?? null]));
|
|
115
|
+
for (const t of result.moved)
|
|
116
|
+
if (!(t in approved))
|
|
117
|
+
approved[t] = null;
|
|
118
|
+
return { label, reason: "moved", approved: d?.digest ?? null, current: null, members: digestDiff(approved, current) };
|
|
119
|
+
}
|
|
120
|
+
if (result.exitCode === CHANT_EXIT.waiting && d?.via === undefined && d?.coveredBy?.digest && d.coveredBy.digest !== d.digest) {
|
|
121
|
+
// Under `pull-request` approvals a wave whose plan the approved change set no longer covers waits at its own gate.
|
|
122
|
+
const [approved, current] = await Promise.all([read(d.coveredBy.digest), read(d.digest)]);
|
|
123
|
+
return { label, reason: "moved", approved: d.coveredBy.digest, current: d.digest, members: changeSetDiff(approved, current, d.members.map((m) => m.member)) };
|
|
124
|
+
}
|
|
125
|
+
if (result.exitCode === CHANT_EXIT.held && result.outcome?.outcome === "held") {
|
|
126
|
+
const holder = result.outcome.holder;
|
|
127
|
+
return { label, reason: "held", approved: d?.digest ?? null, current: d?.digest ?? null, members: [], ...(holder ? { detail: `held by ${holder.run}` } : result.outcome.reason ? { detail: result.outcome.reason } : {}) };
|
|
128
|
+
}
|
|
129
|
+
if (result.exitCode === CHANT_EXIT.declined && d?.refused?.reason === "point") {
|
|
130
|
+
const answer = d.point?.answer?.answer;
|
|
131
|
+
return { label, reason: "declined", approved: d.digest, current: d.digest, members: [], detail: `${d.point?.name ?? "the point"} answered ${JSON.stringify(answer ?? null)}` };
|
|
132
|
+
}
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
/** The forge and place an op wave job posts on: its pull request when it has one, else a tracking issue. */
|
|
136
|
+
export async function opWavePlace(forge, result, head) {
|
|
137
|
+
const pr = result?.decision?.review?.pr ?? pullRequestOfOpName(result?.decision?.op);
|
|
138
|
+
if (pr !== undefined)
|
|
139
|
+
return { pr };
|
|
140
|
+
if (head) {
|
|
141
|
+
try {
|
|
142
|
+
const found = await forge.pullRequestFor(head);
|
|
143
|
+
if (found !== null)
|
|
144
|
+
return { pr: found };
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
/* fall through to the issue */
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
/** `pr-12` and `pr-12-<member>` name pull request 12. */
|
|
153
|
+
function pullRequestOfOpName(op) {
|
|
154
|
+
const m = op ? /^pr-(\d+)(?:-|$)/.exec(op) : null;
|
|
155
|
+
return m ? Number(m[1]) : undefined;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The responses an op wave job's outcome calls for (#4629): the spec's
|
|
159
|
+
* `respond`, over `CHANT_RESPOND`. Posted on the pull request the wave
|
|
160
|
+
* applies (its review, its `pr-<n>` op, or the one that merged `head`),
|
|
161
|
+
* else on a tracking issue per spec and wave.
|
|
162
|
+
*/
|
|
163
|
+
export async function respondOpWave(spec, k, outcome, opts = {}) {
|
|
164
|
+
const forge = opts.forge;
|
|
165
|
+
if (!forge)
|
|
166
|
+
return [];
|
|
167
|
+
const responses = resolveResponses(spec.respond, opts.env, log);
|
|
168
|
+
const words = opts.words ?? activeProductWords();
|
|
169
|
+
const posts = [];
|
|
170
|
+
try {
|
|
171
|
+
const triage = responses["apply-failed"] === "triage" ? triageOfOpWave(spec, k, outcome, words) : undefined;
|
|
172
|
+
const refused = responses["wave-refused"] === "diff" && outcome.result ? await refusedOfOpWave(spec, k, outcome.result, opts.read, words) : undefined;
|
|
173
|
+
if (!triage && !refused)
|
|
174
|
+
return [];
|
|
175
|
+
const place = `${spec.name}:wave-${k}`;
|
|
176
|
+
const where = (await opWavePlace(forge, outcome.result, opts.head)) ?? { issue: `${words.product}: ${spec.name} wave ${k}` };
|
|
177
|
+
if (triage)
|
|
178
|
+
posts.push(await postResponse(forge, "apply-failed", place, where, renderTriage(triage, words)));
|
|
179
|
+
if (refused)
|
|
180
|
+
posts.push(await postResponse(forge, "wave-refused", place, where, renderRefusedDiff(refused, words)));
|
|
181
|
+
}
|
|
182
|
+
catch (err) {
|
|
183
|
+
posts.push({ posted: false, warning: `the responses were not posted: ${err instanceof Error ? err.message : String(err)}` });
|
|
184
|
+
}
|
|
185
|
+
for (const p of posts)
|
|
186
|
+
if (p.warning)
|
|
187
|
+
log(p.warning);
|
|
188
|
+
return posts;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* The description check on a plan report's change set (#4629), from the
|
|
192
|
+
* plan-note job: the pull request's title and body read from the forge,
|
|
193
|
+
* the finding posted as its own comment. A clear answer edits an earlier
|
|
194
|
+
* finding away. Never throws.
|
|
195
|
+
*/
|
|
196
|
+
export async function respondDescription(forge, report, settings, words = activeProductWords()) {
|
|
197
|
+
if (report.pr === null || report.status === "nothing")
|
|
198
|
+
return undefined;
|
|
199
|
+
try {
|
|
200
|
+
const head = await forge.pullRequestHead?.(report.pr);
|
|
201
|
+
const pull = head ? await forge.findPullRequest(head.branch) : undefined;
|
|
202
|
+
if (!pull) {
|
|
203
|
+
log(`description check: could not read pull request ${report.pr}'s title and description`);
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
const finding = await checkDescription({ doc: report.changeSet, title: pull.title, description: pull.body ?? "", ask: settings.ask, ...(settings.threshold !== undefined ? { threshold: settings.threshold } : {}), words });
|
|
207
|
+
const place = `${report.env}${report.member ? `:${report.member}` : ""}`;
|
|
208
|
+
if (finding.status === "flagged" && finding.body) {
|
|
209
|
+
const posted = await postResponse(forge, "description", place, { pr: report.pr }, finding.body);
|
|
210
|
+
if (posted.warning)
|
|
211
|
+
log(posted.warning);
|
|
212
|
+
}
|
|
213
|
+
else if (finding.status === "clear") {
|
|
214
|
+
// An earlier finding on this pull request no longer holds: say so in its place.
|
|
215
|
+
if (await forge.findComment(report.pr, respondMarker("description", place))) {
|
|
216
|
+
await postResponse(forge, "description", place, { pr: report.pr }, `The description now covers what the ${words.verbs.plan[0]} destroys and replaces.`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
else if (finding.status === "error") {
|
|
220
|
+
log(`description check: the decide service did not answer: ${finding.reason}`);
|
|
221
|
+
}
|
|
222
|
+
return finding;
|
|
223
|
+
}
|
|
224
|
+
catch (err) {
|
|
225
|
+
log(`description check: ${err instanceof Error ? err.message : String(err)}`);
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* A {@link DescriptionAsk} over a `decide.backends` entry: the Noul
|
|
231
|
+
* question posted to the backend's `/v1/systemone`. The backend's module
|
|
232
|
+
* loads on first call.
|
|
233
|
+
*/
|
|
234
|
+
export function backendDescriptionAsk(backend, opts) {
|
|
235
|
+
return async (state) => {
|
|
236
|
+
const { postQuestion } = await import("./op/decide-backend.js");
|
|
237
|
+
const { model, answer } = await postQuestion(backend, opts.name, { point: "description", backend: opts.name, model: opts.model, question: { type: "noul", instructions: DESCRIPTION_INSTRUCTIONS, criteria: { ...DESCRIPTION_CRITERIA } }, state: state }, { cwd: opts.cwd, ...(opts.env ? { env: opts.env } : {}), ...(opts.transport ? { transport: opts.transport } : {}) });
|
|
238
|
+
if (answer.type !== "noul" || typeof answer.noul !== "number")
|
|
239
|
+
throw new Error(`${opts.name} answered the description question with a ${answer.type} answer, not a noul`);
|
|
240
|
+
return { model, probability: answer.noul, ...(answer.reason ? { reason: answer.reason } : {}) };
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
const DESCRIPTION_INSTRUCTIONS = DESCRIPTION_QUESTION.instructions;
|
|
244
|
+
const DESCRIPTION_CRITERIA = DESCRIPTION_QUESTION.criteria;
|
|
245
|
+
function firstLine(text) {
|
|
246
|
+
return text.split("\n")[0].trim();
|
|
247
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Responses to pipeline events (#4629), in CI core so terragucci and plywood
|
|
3
|
+
* answer the same events the same way, each in its own words.
|
|
4
|
+
*
|
|
5
|
+
* - `wave-refused: diff`: a wave that applied nothing because its plan moved
|
|
6
|
+
* since the approval, another run held it, or its decision point declined
|
|
7
|
+
* it posts which members moved and what moved in them, from the approved
|
|
8
|
+
* change set and the current one.
|
|
9
|
+
* - `apply-failed: triage`: a failed apply posts the members and resources
|
|
10
|
+
* that failed with the engine's error, from the run record (an op wave's)
|
|
11
|
+
* or the apply report (`pr-apply`'s).
|
|
12
|
+
* - `description: check`: with a decide service set, the plan-note job asks
|
|
13
|
+
* whether the pull request's title and description leave out what its
|
|
14
|
+
* change set destroys or replaces, and posts the finding. It never
|
|
15
|
+
* approves, gates or blocks anything.
|
|
16
|
+
*
|
|
17
|
+
* The first two are on by default and the third is off. Each one is turned
|
|
18
|
+
* off (or on) with a list such as `wave-refused=off,description=check`: the
|
|
19
|
+
* `--respond` flag, the `CHANT_RESPOND` variable a generated job sets, or an
|
|
20
|
+
* op waves spec's `respond`.
|
|
21
|
+
*
|
|
22
|
+
* Every post is one comment per event and place, found again by its marker,
|
|
23
|
+
* so a job that runs twice edits its comment. Delivery never throws and never
|
|
24
|
+
* changes a job's exit code.
|
|
25
|
+
*/
|
|
26
|
+
import type { ChangeSetDocument, ChangeSetEntry } from "./change-set.js";
|
|
27
|
+
import { type CiProductWords } from "./ci-product-words.js";
|
|
28
|
+
import type { PrForge } from "./pr-forge.js";
|
|
29
|
+
/** The events chant answers. */
|
|
30
|
+
export type CiRespondEvent = "wave-refused" | "apply-failed" | "description";
|
|
31
|
+
/** Each event's modes; the first is its default. */
|
|
32
|
+
export declare const CI_RESPONSES: {
|
|
33
|
+
readonly "wave-refused": readonly ["diff", "off"];
|
|
34
|
+
readonly "apply-failed": readonly ["triage", "off"];
|
|
35
|
+
readonly description: readonly ["off", "check"];
|
|
36
|
+
};
|
|
37
|
+
export type CiResponses = {
|
|
38
|
+
[E in CiRespondEvent]?: (typeof CI_RESPONSES)[E][number];
|
|
39
|
+
};
|
|
40
|
+
/** The variable a generated job carries its responses in. */
|
|
41
|
+
export declare const CI_RESPOND_ENV = "CHANT_RESPOND";
|
|
42
|
+
/** Every event at its default. */
|
|
43
|
+
export declare const CI_RESPOND_DEFAULTS: Required<CiResponses>;
|
|
44
|
+
/** `wave-refused=off,description=check` as responses, or why it is not a list of them. */
|
|
45
|
+
export declare function parseRespondList(text: string | readonly string[]): CiResponses | {
|
|
46
|
+
error: string;
|
|
47
|
+
};
|
|
48
|
+
/** The list form of `responses`, for `--respond` and {@link CI_RESPOND_ENV}. Empty when every event is at its default. */
|
|
49
|
+
export declare function respondList(responses: CiResponses): string;
|
|
50
|
+
/**
|
|
51
|
+
* The responses in force: the defaults, then `CHANT_RESPOND`, then the
|
|
52
|
+
* spec's or the flag's. A malformed variable is ignored with a warning,
|
|
53
|
+
* since a response never stops a job.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveResponses(given: CiResponses | undefined, env?: Record<string, string | undefined>, warn?: (line: string) => void): Required<CiResponses>;
|
|
56
|
+
/** The hidden marker of one response's comment. */
|
|
57
|
+
export declare function respondMarker(event: CiRespondEvent, place: string): string;
|
|
58
|
+
/** Why a wave applied nothing. */
|
|
59
|
+
export type RefusedReason = "moved" | "held" | "declined";
|
|
60
|
+
/** One entry whose plan moved between the approved change set and the current one. */
|
|
61
|
+
export interface RefusedEntryDiff {
|
|
62
|
+
address: string;
|
|
63
|
+
/** Its action in the approved plan; absent when the entry is new. */
|
|
64
|
+
was?: string;
|
|
65
|
+
/** Its action now; absent when it is gone. */
|
|
66
|
+
now?: string;
|
|
67
|
+
/** Attributes whose planned value differs. */
|
|
68
|
+
attributes: string[];
|
|
69
|
+
}
|
|
70
|
+
/** One member whose plan moved. */
|
|
71
|
+
export interface RefusedMemberDiff {
|
|
72
|
+
member: string;
|
|
73
|
+
approved: string | null;
|
|
74
|
+
current: string | null;
|
|
75
|
+
/** Entry by entry, when both change sets were read; empty otherwise. */
|
|
76
|
+
changes: RefusedEntryDiff[];
|
|
77
|
+
}
|
|
78
|
+
export interface RefusedDiff {
|
|
79
|
+
/** How the post names the wave or the apply, such as `wave 2 (prod) of plywood-up`. */
|
|
80
|
+
label: string;
|
|
81
|
+
reason: RefusedReason;
|
|
82
|
+
approved: string | null;
|
|
83
|
+
current: string | null;
|
|
84
|
+
members: RefusedMemberDiff[];
|
|
85
|
+
/** The holder or the decision, for `held` and `declined`. */
|
|
86
|
+
detail?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The members whose plan digest differs between the approved change set and
|
|
90
|
+
* the current one, entry by entry. `only` narrows to the members a wave
|
|
91
|
+
* holds. A member that planned the same in both is left out.
|
|
92
|
+
*/
|
|
93
|
+
export declare function changeSetDiff(approved: ChangeSetDocument | undefined, current: ChangeSetDocument | undefined, only?: readonly string[]): RefusedMemberDiff[];
|
|
94
|
+
/** The members whose plan digest differs, when only the digests are known (an op wave's decision against its share job's plans). */
|
|
95
|
+
export declare function digestDiff(approved: Readonly<Record<string, string | null>>, current: Readonly<Record<string, string | null>>): RefusedMemberDiff[];
|
|
96
|
+
/** A digest's first 12 hex characters past its scheme; `none` when there is none. */
|
|
97
|
+
export declare const shortDigest: (d: string | null | undefined) => string;
|
|
98
|
+
/** The post for a refused wave or apply, in the product's words. */
|
|
99
|
+
export declare function renderRefusedDiff(d: RefusedDiff, words?: CiProductWords): string;
|
|
100
|
+
/** One member that failed to apply. */
|
|
101
|
+
export interface FailedMember {
|
|
102
|
+
member: string;
|
|
103
|
+
/** The engine's error, as the run record or the report has it. */
|
|
104
|
+
error?: string;
|
|
105
|
+
/** The resources the engine reported failed, when it reports per resource. */
|
|
106
|
+
resources?: string[];
|
|
107
|
+
}
|
|
108
|
+
export interface FailedApply {
|
|
109
|
+
label: string;
|
|
110
|
+
exitCode: number;
|
|
111
|
+
members: FailedMember[];
|
|
112
|
+
/** A failure outside any member: a hook, the job's own error. */
|
|
113
|
+
error?: string;
|
|
114
|
+
}
|
|
115
|
+
/** The post for a failed apply, in the product's words. */
|
|
116
|
+
export declare function renderTriage(f: FailedApply, words?: CiProductWords): string;
|
|
117
|
+
/** What the model reads: the pull request's text and the change set's summary. No planned values. */
|
|
118
|
+
export interface DescriptionState {
|
|
119
|
+
title: string;
|
|
120
|
+
description: string;
|
|
121
|
+
plan: {
|
|
122
|
+
counts: Record<"create" | "update" | "replace" | "delete", number>;
|
|
123
|
+
destroys: string[];
|
|
124
|
+
replacements: string[];
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/** The destroys and replacements of a change set. */
|
|
128
|
+
export declare function destructiveEntries(doc: ChangeSetDocument): {
|
|
129
|
+
destroys: ChangeSetEntry[];
|
|
130
|
+
replacements: ChangeSetEntry[];
|
|
131
|
+
};
|
|
132
|
+
export declare function descriptionState(doc: ChangeSetDocument, title: string, description: string): DescriptionState;
|
|
133
|
+
/** The destroys and replacements the text does not mention; every one when it names them all, since the model found the text leaves something out. */
|
|
134
|
+
export declare function unmentioned(doc: ChangeSetDocument, text: string): ChangeSetEntry[];
|
|
135
|
+
/** The question asked. A Noul: the probability the answer is yes. */
|
|
136
|
+
export declare const DESCRIPTION_QUESTION: {
|
|
137
|
+
readonly type: "noul";
|
|
138
|
+
readonly instructions: "Read the pull request's title and description and the summary of its plan. Answer true when the plan destroys or replaces resources that the title and description do not mention or that they contradict. Answer false when the text covers every destroy and replacement, or the plan has none.";
|
|
139
|
+
readonly criteria: {
|
|
140
|
+
readonly true: "the plan destroys or replaces something the text leaves out or contradicts";
|
|
141
|
+
readonly false: "the text describes every destroy and replacement, or there are none";
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
/** The default probability a yes needs before the finding is posted. */
|
|
145
|
+
export declare const DESCRIPTION_THRESHOLD = 0.8;
|
|
146
|
+
/** The model call: the backend's answer to {@link DESCRIPTION_QUESTION} over the state, as a probability of yes. */
|
|
147
|
+
export type DescriptionAsk = (state: DescriptionState) => Promise<{
|
|
148
|
+
model: string;
|
|
149
|
+
probability: number;
|
|
150
|
+
reason?: string;
|
|
151
|
+
}>;
|
|
152
|
+
export interface DescriptionFinding {
|
|
153
|
+
/** `flagged`: the finding was posted. `clear`: the model said no, or not confidently. `skipped`: nothing to check. `error`: the service did not answer. */
|
|
154
|
+
status: "flagged" | "clear" | "skipped" | "error";
|
|
155
|
+
probability?: number;
|
|
156
|
+
model?: string;
|
|
157
|
+
reason?: string;
|
|
158
|
+
unmentioned: string[];
|
|
159
|
+
/** The post, when flagged. */
|
|
160
|
+
body?: string;
|
|
161
|
+
}
|
|
162
|
+
/** Ask whether the description leaves out a destroy or replacement. Never throws. */
|
|
163
|
+
export declare function checkDescription(input: {
|
|
164
|
+
doc: ChangeSetDocument;
|
|
165
|
+
title: string;
|
|
166
|
+
description: string;
|
|
167
|
+
ask: DescriptionAsk;
|
|
168
|
+
threshold?: number;
|
|
169
|
+
words?: CiProductWords;
|
|
170
|
+
}): Promise<DescriptionFinding>;
|
|
171
|
+
/** Where a response goes: a pull request, or a tracking issue when the run has none. */
|
|
172
|
+
export type RespondPlace = {
|
|
173
|
+
pr: number;
|
|
174
|
+
} | {
|
|
175
|
+
issue: string;
|
|
176
|
+
};
|
|
177
|
+
/** What {@link postResponse} did. */
|
|
178
|
+
export interface RespondPost {
|
|
179
|
+
posted: boolean;
|
|
180
|
+
url?: string;
|
|
181
|
+
warning?: string;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Post one response's body, editing its earlier comment. On a pull request
|
|
185
|
+
* the comment carries the marker as its first line; with no pull request it
|
|
186
|
+
* goes to a tracking issue titled `issue`. Never throws.
|
|
187
|
+
*/
|
|
188
|
+
export declare function postResponse(forge: Pick<PrForge, "upsertComment" | "trackIssue">, event: CiRespondEvent, place: string, where: RespondPlace, body: string): Promise<RespondPost>;
|
|
189
|
+
//# sourceMappingURL=ci-respond.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-respond.d.ts","sourceRoot":"","sources":["../src/ci-respond.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAsB,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,gCAAgC;AAChC,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,aAAa,CAAC;AAE7E,oDAAoD;AACpD,eAAO,MAAM,YAAY;;;;CAIqC,CAAC;AAE/D,MAAM,MAAM,WAAW,GA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