@intentius/chant 0.124.55 → 0.124.57
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 +11 -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 -4
- 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/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +14 -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 +346 -36
- 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/auto-release.d.ts +5 -2
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +9 -4
- package/dist/components/capability.d.ts +47 -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/deploy-units.d.ts +12 -0
- package/dist/components/deploy-units.d.ts.map +1 -1
- package/dist/components/deploy-units.js +20 -1
- 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 +137 -5
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +164 -20
- 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/row-lease.d.ts +22 -1
- package/dist/components/row-lease.d.ts.map +1 -1
- package/dist/components/row-lease.js +32 -6
- 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 +47 -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 +55 -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/git.d.ts +39 -3
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +223 -15
- package/dist/lifecycle/lock-rows.d.ts +23 -0
- package/dist/lifecycle/lock-rows.d.ts.map +1 -1
- package/dist/lifecycle/lock-rows.js +47 -8
- 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/resource-lock.d.ts +70 -0
- package/dist/lifecycle/resource-lock.d.ts.map +1 -1
- package/dist/lifecycle/resource-lock.js +241 -5
- 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/gate.js +21 -4
- 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-port.js +1 -1
- package/dist/op/op-waves-release.d.ts +2 -1
- 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 +15 -2
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +195 -31
- 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 +53 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +62 -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 -4
- 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 +351 -328
- 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 +14 -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 -4
- 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/lifecycle.ts +13 -0
- package/src/cli/handlers/pr-before-merge.test.ts +1 -1
- package/src/cli/handlers/pr-deploy-inputs.test.ts +1 -1
- package/src/cli/handlers/pr-endpoint.test.ts +1 -1
- package/src/cli/handlers/pr-green.test.ts +1 -1
- 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 +1 -1
- package/src/cli/handlers/pr-record.test.ts +34 -2
- package/src/cli/handlers/pr-waves-blocked.test.ts +1 -1
- package/src/cli/handlers/pr-waves.test.ts +1 -1
- package/src/cli/handlers/pr.test.ts +1 -1
- package/src/cli/handlers/pr.ts +311 -32
- 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/auto-release.test.ts +4 -2
- package/src/components/auto-release.ts +9 -5
- package/src/components/capability.ts +60 -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/deploy-units.test.ts +18 -1
- package/src/components/deploy-units.ts +26 -1
- 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 +244 -20
- 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/row-lease.test.ts +61 -1
- package/src/components/row-lease.ts +48 -7
- 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 +49 -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 +57 -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/git.test.ts +155 -0
- package/src/lifecycle/git.ts +213 -17
- package/src/lifecycle/lock-rows.test.ts +6 -1
- package/src/lifecycle/lock-rows.ts +58 -7
- 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/resource-lock-wait.test.ts +292 -0
- package/src/lifecycle/resource-lock.ts +261 -7
- 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/gate.test.ts +7 -5
- package/src/op/gate.ts +20 -4
- package/src/op/index.ts +2 -0
- package/src/op/op-waves-after-plan.test.ts +11 -0
- package/src/op/op-waves-capability-spec.ts +20 -0
- package/src/op/op-waves-ledger-lock.test.ts +208 -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-port.ts +1 -1
- package/src/op/op-waves-release.ts +2 -3
- package/src/op/op-waves-run.ts +196 -31
- package/src/op/op-waves-stand-down.ts +1 -2
- package/src/op/op-waves.ts +81 -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 +0 -2
- package/src/pr-loop-narrowed.test.ts +63 -0
- package/src/pr-loop.ts +30 -4
- 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/src/op/op-waves.ts
CHANGED
|
@@ -95,10 +95,11 @@ import type { CloudTradeSpec } from "../ci-identity";
|
|
|
95
95
|
import { gatePointProblems, type GatePoint } from "./gate-point";
|
|
96
96
|
import { quorumProblems, type GateQuorumRule } from "./gate-quorum";
|
|
97
97
|
import { notifyConfigProblem, type NotifyConfig } from "../notify";
|
|
98
|
+
// Types only: the small bundles that carry this module stay without ../ci-respond.ts (#4629).
|
|
99
|
+
import type { CiResponses } from "../ci-respond";
|
|
98
100
|
import { WAVE_GATE_NAME_PATTERN, waveGateNameFrom, waveShare } from "../wave-layout";
|
|
99
101
|
import { waveOutcomeFileName } from "../wave-blocked";
|
|
100
|
-
import {
|
|
101
|
-
import { opWaveHoldsProblems, opWaveStepProblems, type OpWaveHolds, type OpWaveStep } from "./op-waves-capability-spec";
|
|
102
|
+
import { opWaveHoldsProblems, opWaveParallelismProblems, opWaveStepProblems, type OpWaveHolds, type OpWaveStep } from "./op-waves-capability-spec";
|
|
102
103
|
import { opWaveReleaseProblems, type OpWaveReleaseNames } from "./op-waves-release";
|
|
103
104
|
import { CONTROL_DISPATCH_JOB, CONTROL_NAME, controlSettingsProblems, resolveControlTarget, type ControlSettingsInput, type ControlTarget } from "../control/dispatch";
|
|
104
105
|
|
|
@@ -234,7 +235,7 @@ export const CHECK_HOOK_MOMENT = "check";
|
|
|
234
235
|
export type CiHookMoment = OpWaveHookMoment | typeof CHECK_HOOK_MOMENT;
|
|
235
236
|
|
|
236
237
|
/** The first chant that reads and runs `ci.hooks.check` (#4556). A declaration that uses it sets `minReader` to it. */
|
|
237
|
-
export const CI_CHECK_HOOK_FLOOR =
|
|
238
|
+
export const CI_CHECK_HOOK_FLOOR = "0.124.55";
|
|
238
239
|
|
|
239
240
|
/**
|
|
240
241
|
* Who runs the `before.apply` and `after.apply` hooks (#3804). `chant`: the
|
|
@@ -389,6 +390,8 @@ export interface OpWave {
|
|
|
389
390
|
hooks?: OpWaveHooks;
|
|
390
391
|
/** Where this wave's jobs run (#3914). Default: the spec's `runner`. */
|
|
391
392
|
runner?: OpWaveRunner;
|
|
393
|
+
/** How many of the wave's runs apply at once (#4625), over the spec's `parallelism`. */
|
|
394
|
+
parallelism?: number;
|
|
392
395
|
/**
|
|
393
396
|
* The OIDC tokens this wave's jobs get (#3914), as `{ <variable>: <audience> }`;
|
|
394
397
|
* see {@link OpWaveJobGroup.idTokens}. With `jobs`, these are the deciding
|
|
@@ -487,6 +490,13 @@ export interface OpWavesSpec {
|
|
|
487
490
|
* moved exits 4. See `./op-waves-capability.ts`.
|
|
488
491
|
*/
|
|
489
492
|
step?: OpWaveStep;
|
|
493
|
+
/**
|
|
494
|
+
* How many runs of a wave apply at once (#4625), a wave's own
|
|
495
|
+
* `parallelism` winning. Default 1, one at a time. Over 1 it needs `step`:
|
|
496
|
+
* a run whose wave lists one of its `dependsOn` before it waits for that
|
|
497
|
+
* one, and is blocked when it failed, as one at a time.
|
|
498
|
+
*/
|
|
499
|
+
parallelism?: number;
|
|
490
500
|
/**
|
|
491
501
|
* Holds the wave runs over its plans (#4545), read at the base commit
|
|
492
502
|
* with the policy: `policy` runs the workspace's `ci.policy` over each
|
|
@@ -554,6 +564,14 @@ export interface OpWavesSpec {
|
|
|
554
564
|
* `../notify.ts`.
|
|
555
565
|
*/
|
|
556
566
|
notify?: NotifyConfig;
|
|
567
|
+
/**
|
|
568
|
+
* The responses a wave job posts (#4629, `../ci-respond.ts`): a refused
|
|
569
|
+
* wave's diff (`wave-refused: diff`, on by default) and a failed apply's
|
|
570
|
+
* triage (`apply-failed: triage`, on by default), on the pull request the
|
|
571
|
+
* wave applies or a tracking issue. `off` turns one off. A job's
|
|
572
|
+
* `CHANT_RESPOND` sits under these.
|
|
573
|
+
*/
|
|
574
|
+
respond?: CiResponses;
|
|
557
575
|
/**
|
|
558
576
|
* The control repo (#4617, `@intentius/chant/ci-control`): once the last
|
|
559
577
|
* wave ran, a `control-dispatch` job tells the control repo how the waves
|
|
@@ -582,7 +600,7 @@ export interface OpWavesControl extends ControlSettingsInput {
|
|
|
582
600
|
}
|
|
583
601
|
|
|
584
602
|
/** The first chant whose Op waves specs take `control` (#4617). A product feature-detects this name. */
|
|
585
|
-
export const OP_WAVES_CONTROL_FLOOR =
|
|
603
|
+
export const OP_WAVES_CONTROL_FLOOR = "0.124.55";
|
|
586
604
|
|
|
587
605
|
/** The control dispatch job's name in an Op waves pipeline (#4617). */
|
|
588
606
|
export const OP_WAVES_CONTROL_JOB = CONTROL_DISPATCH_JOB;
|
|
@@ -633,6 +651,24 @@ export interface OpWavesDigest {
|
|
|
633
651
|
over?: "all" | "changing";
|
|
634
652
|
}
|
|
635
653
|
|
|
654
|
+
/**
|
|
655
|
+
* A wave job's default timeout in minutes (ruling for ci-products
|
|
656
|
+
* 2026-10-28, "Ledger lock"): three hours, a Forgejo runner's default, under
|
|
657
|
+
* GitHub's six. The generators write it on every wave job.
|
|
658
|
+
*/
|
|
659
|
+
export const OP_WAVE_JOB_TIMEOUT_MINUTES = 180;
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* The job's timeout, and the `CHANT_LOCK_WAIT` a wave job carries: the
|
|
663
|
+
* seconds a run on the `target` or `repo` grain waits for its row on the
|
|
664
|
+
* ledger, five minutes under the job's timeout (at least one minute), so the
|
|
665
|
+
* wait gives up by name before the forge stops the job.
|
|
666
|
+
*/
|
|
667
|
+
export function opWaveJobTimeout(minutes: number | undefined): { minutes: number; env: { CHANT_LOCK_WAIT: string } } {
|
|
668
|
+
const m = minutes !== undefined && Number.isFinite(minutes) && minutes > 0 ? Math.ceil(minutes) : OP_WAVE_JOB_TIMEOUT_MINUTES;
|
|
669
|
+
return { minutes: m, env: { CHANT_LOCK_WAIT: String(Math.max(60, (m - 5) * 60)) } };
|
|
670
|
+
}
|
|
671
|
+
|
|
636
672
|
export const OP_WAVES_DIGEST_OVER = ["all", "changing"] as const;
|
|
637
673
|
|
|
638
674
|
/** The default gate name pattern. */
|
|
@@ -757,6 +793,29 @@ export function opWavesRecordPlansCommand(specFile: string, bin?: string): strin
|
|
|
757
793
|
return [...opWaveBinArgv(bin), "run", "wave", "--spec", specFile, "--record-plans"];
|
|
758
794
|
}
|
|
759
795
|
|
|
796
|
+
/** The GitLab variable a pipeline schedule sets to `1` to post every open merge request's approval status (#4630). */
|
|
797
|
+
export const OP_WAVES_APPROVAL_STATUS_VAR = "CHANT_APPROVAL_STATUS";
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Whether a spec's pipeline records each head's plans and posts
|
|
801
|
+
* `<product>/approval` before merge (#4630): some wave takes its approval
|
|
802
|
+
* from the pull request, by its review (`pr-review`) or by its own approval
|
|
803
|
+
* (`pull-request`, under the 2026-10-28 ruling).
|
|
804
|
+
*/
|
|
805
|
+
export function opWavesPostsApprovalStatus(spec: Pick<OpWavesSpec, "waves">): boolean {
|
|
806
|
+
return spec.waves.some((w) => w.approval === "pr-review" || w.approval === "pull-request");
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* The command the approval status job runs (#4630), through the product's
|
|
811
|
+
* bin: `--pr`, `--head` and `--base` from the pull request event on GitHub
|
|
812
|
+
* and Forgejo, `--open` on GitLab.
|
|
813
|
+
*/
|
|
814
|
+
export function opWavesApprovalStatusCommand(specFile: string, forge: "github" | "gitlab" | "forgejo", bin?: string): string[] {
|
|
815
|
+
const at = forge === "gitlab" ? ["--open"] : ["--pr", '"$PR_NUMBER"', "--head", '"$HEAD_SHA"', "--base", '"$BASE_SHA"'];
|
|
816
|
+
return [...opWaveBinArgv(bin), "run", "wave", "--spec", specFile, "--approval-status", ...at, "--forge", forge];
|
|
817
|
+
}
|
|
818
|
+
|
|
760
819
|
/** The default apply command. */
|
|
761
820
|
export const OP_WAVE_DEFAULT_APPLY = ["chant", "run", "{op}", "--env", "{target}"];
|
|
762
821
|
|
|
@@ -935,10 +994,26 @@ export function assertOpWavesSpec(spec: OpWavesSpec): void {
|
|
|
935
994
|
}
|
|
936
995
|
if (spec.neverOverMcp !== undefined && typeof spec.neverOverMcp !== "boolean") throw new Error(`${where}: neverOverMcp must be true or false.`);
|
|
937
996
|
if (spec.runner !== undefined) assertOpWaveRunner(where, "runner", spec.runner);
|
|
997
|
+
{
|
|
998
|
+
const problems = opWaveParallelismProblems(spec);
|
|
999
|
+
if (problems.length > 0) throw new Error(`${where}: ${problems[0]}.`);
|
|
1000
|
+
}
|
|
938
1001
|
if (spec.notify !== undefined) {
|
|
939
1002
|
const problem = notifyConfigProblem(spec.notify, "notify");
|
|
940
1003
|
if (problem) throw new Error(`${where}: ${problem}`);
|
|
941
1004
|
}
|
|
1005
|
+
if (spec.respond !== undefined) {
|
|
1006
|
+
const respond = spec.respond as unknown;
|
|
1007
|
+
if (respond === null || typeof respond !== "object" || Array.isArray(respond)) throw new Error(`${where}: respond must be an object of event to mode, such as { "wave-refused": "off" }.`);
|
|
1008
|
+
// The wave events and their modes, as ../ci-respond.ts's CI_RESPONSES has them.
|
|
1009
|
+
const modes: Record<string, readonly string[]> = { "wave-refused": ["diff", "off"], "apply-failed": ["triage", "off"] };
|
|
1010
|
+
for (const [event, mode] of Object.entries(respond as Record<string, unknown>)) {
|
|
1011
|
+
if (event === "description") throw new Error(`${where}: respond: the description check runs in the plan-note job, so an op waves spec takes only wave-refused and apply-failed.`);
|
|
1012
|
+
const allowed = modes[event];
|
|
1013
|
+
if (!allowed) throw new Error(`${where}: respond names no event ${JSON.stringify(event)}; the events are wave-refused and apply-failed.`);
|
|
1014
|
+
if (typeof mode !== "string" || !allowed.includes(mode)) throw new Error(`${where}: respond: ${event} takes ${allowed.join(" or ")}, not ${JSON.stringify(mode)}.`);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
942
1017
|
const names = new Set<string>();
|
|
943
1018
|
for (const wave of spec.waves) {
|
|
944
1019
|
if (!NAME.test(wave.name)) {
|
|
@@ -1038,8 +1113,8 @@ const ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
|
1038
1113
|
/** The key each cloud of a `cloud` trade names its identity under (`IDENTITY_KEY` in ../ci-identity.ts, kept here so this module imports none of it). */
|
|
1039
1114
|
const CLOUD_IDENTITY_KEY: Record<string, string> = { aws: "role", gcp: "serviceAccount", azure: "clientId", pulumi: "token" };
|
|
1040
1115
|
|
|
1041
|
-
/** Refuse a `cloud` (#4332) the trade could not run: an unknown cloud, one that names no identity, or no audience. */
|
|
1042
|
-
function assertOpWaveCloud(where: string, field: string, cloud: unknown): void {
|
|
1116
|
+
/** Refuse a `cloud` (#4332) the trade could not run: an unknown cloud, one that names no identity, or no audience. Scheduled Ops check theirs with it too (#4631). */
|
|
1117
|
+
export function assertOpWaveCloud(where: string, field: string, cloud: unknown): void {
|
|
1043
1118
|
if (cloud === null || typeof cloud !== "object" || Array.isArray(cloud) || Object.keys(cloud).length === 0) throw new Error(`${where}: ${field} must name one or more of aws, gcp, azure and pulumi.`);
|
|
1044
1119
|
for (const [name, c] of Object.entries(cloud as Record<string, unknown>)) {
|
|
1045
1120
|
const key = CLOUD_IDENTITY_KEY[name];
|
package/src/op/runtime.ts
CHANGED
|
@@ -21,7 +21,6 @@ import type { StepRecord, OpRunResult } from "./local-executor";
|
|
|
21
21
|
import type { WaitingPoint } from "./steward-points";
|
|
22
22
|
import type { GateResolutionRecord } from "../lifecycle/gate-ledger";
|
|
23
23
|
import type { RunOrigin } from "../lifecycle/release-ledger";
|
|
24
|
-
import { NEXT_RELEASE } from "../release-floors";
|
|
25
24
|
import type { CapabilityTraceSpan } from "../otlp";
|
|
26
25
|
import type { RunComponentsOptions, RunComponentsResult } from "../components/cli-support";
|
|
27
26
|
|
|
@@ -284,7 +283,7 @@ export interface OpRunWavePlan {
|
|
|
284
283
|
}
|
|
285
284
|
|
|
286
285
|
/** The first chant that runs an after-plan hook in the wave job's process and writes {@link OpRunWave.plans} (#4614). */
|
|
287
|
-
export const OP_WAVE_AFTER_PLAN_FLOOR =
|
|
286
|
+
export const OP_WAVE_AFTER_PLAN_FLOOR = "0.124.55";
|
|
288
287
|
|
|
289
288
|
/** One run target's apply in an op wave job (#4555). */
|
|
290
289
|
export interface OpRunWaveTarget {
|
|
@@ -295,10 +294,14 @@ export interface OpRunWaveTarget {
|
|
|
295
294
|
attributes?: Record<string, string | number | boolean>;
|
|
296
295
|
/** The pieces the engine timed. */
|
|
297
296
|
spans?: CapabilityTraceSpan[];
|
|
297
|
+
/** The engine's error, when the apply failed (#4629): what the failed-apply triage posts. */
|
|
298
|
+
error?: string;
|
|
299
|
+
/** The resources the engine reported failed (#4629), by name or id. */
|
|
300
|
+
failedResources?: string[];
|
|
298
301
|
}
|
|
299
302
|
|
|
300
303
|
/** The first chant that writes {@link OpRunRecord.wave}, a run record per op wave job (#4551). */
|
|
301
|
-
export const OP_WAVE_RUN_RECORD_FLOOR =
|
|
304
|
+
export const OP_WAVE_RUN_RECORD_FLOOR = "0.124.55";
|
|
302
305
|
|
|
303
306
|
/** `value` as an {@link OpRunWave}, or undefined when it is not one, so a reader drops a malformed field and keeps the record. */
|
|
304
307
|
export function opRunWaveOf(value: unknown): OpRunWave | undefined {
|
package/src/otlp.ts
CHANGED
|
@@ -36,11 +36,10 @@
|
|
|
36
36
|
import { randomBytes } from "node:crypto";
|
|
37
37
|
import { activeProductWords } from "./ci-product-words";
|
|
38
38
|
import { CHANT_VERSION } from "./chant-version";
|
|
39
|
-
import { NEXT_RELEASE } from "./release-floors";
|
|
40
39
|
import type { RunEventBody, RunEventRun } from "./run-event";
|
|
41
40
|
|
|
42
41
|
/** The first chant with the OTLP exporter, op-wave run events and the product tool hook (#4555). */
|
|
43
|
-
export const OTLP_EXPORTER_FLOOR =
|
|
42
|
+
export const OTLP_EXPORTER_FLOOR = "0.124.55";
|
|
44
43
|
|
|
45
44
|
export type OtlpAttrValue = string | number | boolean;
|
|
46
45
|
export type OtlpAttrs = Record<string, OtlpAttrValue | undefined>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** The parallelism limit (#4625). Written for the ci-products post-merge pass. */
|
|
2
|
+
|
|
3
|
+
import { describe, expect, test } from "vitest";
|
|
4
|
+
import { mapLimited, parallelismProblem } from "./parallelism";
|
|
5
|
+
|
|
6
|
+
describe("mapLimited", () => {
|
|
7
|
+
test("never runs more than the limit at once, and keeps the order", async () => {
|
|
8
|
+
let running = 0;
|
|
9
|
+
let most = 0;
|
|
10
|
+
const out = await mapLimited([5, 1, 4, 2, 3], 2, async (n) => {
|
|
11
|
+
running++;
|
|
12
|
+
most = Math.max(most, running);
|
|
13
|
+
await new Promise((r) => setTimeout(r, n));
|
|
14
|
+
running--;
|
|
15
|
+
return n * 10;
|
|
16
|
+
});
|
|
17
|
+
expect(out).toEqual([50, 10, 40, 20, 30]);
|
|
18
|
+
expect(most).toBe(2);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test("no limit runs them all at once", async () => {
|
|
22
|
+
let most = 0;
|
|
23
|
+
let running = 0;
|
|
24
|
+
await mapLimited([1, 2, 3], undefined, async () => {
|
|
25
|
+
running++;
|
|
26
|
+
most = Math.max(most, running);
|
|
27
|
+
await Promise.resolve();
|
|
28
|
+
running--;
|
|
29
|
+
});
|
|
30
|
+
expect(most).toBe(3);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test("parallelismProblem", () => {
|
|
35
|
+
expect(parallelismProblem("parallelism", 4)).toBeUndefined();
|
|
36
|
+
expect(parallelismProblem("parallelism", 0)).toMatch(/whole number of 1 or more/);
|
|
37
|
+
expect(parallelismProblem("parallelism", 1.5)).toMatch(/whole number/);
|
|
38
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A limit on how many things run at once (#4625): members a pull request
|
|
3
|
+
* plans at once (`pr-plan --parallelism`), and runs an op wave applies at
|
|
4
|
+
* once (`parallelism` on the spec or a wave). A product's `parallelism`
|
|
5
|
+
* maps onto both.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** Why `value` is not a parallelism, or undefined when it is one: a whole number of 1 or more. */
|
|
9
|
+
export function parallelismProblem(field: string, value: unknown): string | undefined {
|
|
10
|
+
if (typeof value === "number" && Number.isInteger(value) && value >= 1) return undefined;
|
|
11
|
+
return `${field} is ${JSON.stringify(value)}; give a whole number of 1 or more, the most that run at once`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Run `fn` over `items` with at most `limit` in flight, results in the
|
|
16
|
+
* items' order. Items start in order, and `fn` is called synchronously when
|
|
17
|
+
* an item starts, so an item that awaits an earlier one's promise never
|
|
18
|
+
* waits on one that has not started. No limit, or one at least the number
|
|
19
|
+
* of items: all at once.
|
|
20
|
+
*/
|
|
21
|
+
export async function mapLimited<T, R>(items: readonly T[], limit: number | undefined, fn: (item: T, index: number) => Promise<R>): Promise<R[]> {
|
|
22
|
+
if (limit === undefined || limit >= items.length) return Promise.all(items.map((item, i) => fn(item, i)));
|
|
23
|
+
const out: R[] = new Array(items.length);
|
|
24
|
+
let next = 0;
|
|
25
|
+
const worker = async (): Promise<void> => {
|
|
26
|
+
while (next < items.length) {
|
|
27
|
+
const i = next++;
|
|
28
|
+
out[i] = await fn(items[i]!, i);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
await Promise.all(Array.from({ length: Math.max(1, limit) }, worker));
|
|
32
|
+
return out;
|
|
33
|
+
}
|
package/src/policy-source.ts
CHANGED
|
@@ -21,7 +21,6 @@ import { spawnSync } from "node:child_process";
|
|
|
21
21
|
import { mkdtempSync, rmSync } from "node:fs";
|
|
22
22
|
import { tmpdir } from "node:os";
|
|
23
23
|
import { join } from "node:path";
|
|
24
|
-
import { NEXT_RELEASE } from "./release-floors";
|
|
25
24
|
import { gitTree, type WorkspaceTree } from "./workspace/tree";
|
|
26
25
|
import type { GatePolicySource, ResolvedGatePolicySource } from "./gate-policy";
|
|
27
26
|
|
|
@@ -30,7 +29,7 @@ import type { GatePolicySource, ResolvedGatePolicySource } from "./gate-policy";
|
|
|
30
29
|
export { assertGatePolicySource, type GatePolicySource, type ResolvedGatePolicySource } from "./gate-policy";
|
|
31
30
|
|
|
32
31
|
/** The first chant that reads `ci.policy.source` and `ci.policy.packs`; a declaration that sets either needs this `minReader`. */
|
|
33
|
-
export const CI_POLICY_SOURCE_FLOOR =
|
|
32
|
+
export const CI_POLICY_SOURCE_FLOOR = "0.124.55";
|
|
34
33
|
|
|
35
34
|
/** A fetched source: its record, and its tree at the commit, rooted at the repository's top. */
|
|
36
35
|
export interface FetchedGatePolicySource {
|
|
@@ -34,7 +34,7 @@ describe("the pr-forge bundle", () => {
|
|
|
34
34
|
expect(inputs.filter((i) => pattern.test(i)), String(pattern)).toEqual([]);
|
|
35
35
|
}
|
|
36
36
|
expect(inputs.map((i) => i.replace(/^.*?packages\//, "packages/")).sort()).toEqual(["packages/core/src/pr-forge.ts"]);
|
|
37
|
-
// About
|
|
37
|
+
// About 55.9 KB today, after the pull request authors (#4000), pullRequestOpen for target locks (#4293), the four requires checks of an apply before merge (#4301) the approver filter (#4337) the approved fields (#4287) the plan job's GitLab note (#4328) and GitLab's open merge requests for stale notes (#4628).
|
|
38
38
|
expect(result.outputFiles.reduce((n, f) => n + f.contents.byteLength, 0)).toBeLessThan(56 * 1024);
|
|
39
39
|
});
|
|
40
40
|
});
|
package/src/pr-forge.ts
CHANGED
|
@@ -675,6 +675,11 @@ export class ForgeApiError extends Error {
|
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
+
/** The forge answered 404. */
|
|
679
|
+
const notFound = (err: unknown): boolean => err instanceof ForgeApiError && err.status === 404;
|
|
680
|
+
|
|
681
|
+
const byNumber = (a: { number: number }, b: { number: number }): number => a.number - b.number;
|
|
682
|
+
|
|
678
683
|
const DEFAULT_HOST: Record<ForgeKind, string | null> = { github: "github.com", gitlab: "gitlab.com", forgejo: null };
|
|
679
684
|
|
|
680
685
|
/** `<forge>:<login>` on the forge's default host, `<forge>@<host>:<login>` elsewhere, lower-cased (#3163's form). */
|
|
@@ -900,6 +905,22 @@ function githubShaped(kind: "github" | "forgejo", opts: GithubForgeOptions): Git
|
|
|
900
905
|
const url = str(v.html_url);
|
|
901
906
|
return { number, title: str(v.title) ?? "", body: str(v.body) ?? "", head: head ?? "", ...(base ? { base } : {}), ...(url ? { url } : {}) };
|
|
902
907
|
};
|
|
908
|
+
/**
|
|
909
|
+
* The open pull requests; GitHub takes `filter` server-side, Forgejo's list
|
|
910
|
+
* takes none and is matched by the caller. Forgejo answers the list with
|
|
911
|
+
* 404 while it still counts the repository as empty (just after the first
|
|
912
|
+
* push). That is no pull request; a repository that is really missing 404s
|
|
913
|
+
* on its own read too.
|
|
914
|
+
*/
|
|
915
|
+
const openPulls = async (filter: string): Promise<unknown[]> => {
|
|
916
|
+
try {
|
|
917
|
+
return await api.list(`${repo}/pulls?state=open${kind === "github" ? filter : ""}`, pageParams, pageSize);
|
|
918
|
+
} catch (err) {
|
|
919
|
+
if (kind !== "forgejo" || !notFound(err)) throw err;
|
|
920
|
+
await api.call("GET", repo);
|
|
921
|
+
return [];
|
|
922
|
+
}
|
|
923
|
+
};
|
|
903
924
|
/** A pull request whose head branch lives in this repository, not a fork. */
|
|
904
925
|
const fromHere = (v: unknown, head: string): boolean => {
|
|
905
926
|
if (!isObject(v) || !isObject(v.head) || v.head.ref !== head) return false;
|
|
@@ -950,7 +971,7 @@ function githubShaped(kind: "github" | "forgejo", opts: GithubForgeOptions): Git
|
|
|
950
971
|
try {
|
|
951
972
|
b = await api.call("GET", `${repo}/branches/${branch.split("/").map(encodeURIComponent).join("/")}`);
|
|
952
973
|
} catch (err) {
|
|
953
|
-
if (err
|
|
974
|
+
if (notFound(err)) return undefined;
|
|
954
975
|
throw err;
|
|
955
976
|
}
|
|
956
977
|
// GitHub names the commit `sha`, Forgejo `id`.
|
|
@@ -1084,7 +1105,7 @@ function githubShaped(kind: "github" | "forgejo", opts: GithubForgeOptions): Git
|
|
|
1084
1105
|
const got = await api.call("GET", `${repo}/pulls/${pr}`);
|
|
1085
1106
|
return isObject(got) && got.state === "open" && got.merged !== true;
|
|
1086
1107
|
} catch (err) {
|
|
1087
|
-
if (err
|
|
1108
|
+
if (notFound(err)) return false;
|
|
1088
1109
|
throw err;
|
|
1089
1110
|
}
|
|
1090
1111
|
},
|
|
@@ -1094,7 +1115,7 @@ function githubShaped(kind: "github" | "forgejo", opts: GithubForgeOptions): Git
|
|
|
1094
1115
|
const pr = await api.call("GET", `${repo}/commits/${sha}/pull`);
|
|
1095
1116
|
return isObject(pr) && typeof pr.number === "number" ? pr.number : null;
|
|
1096
1117
|
} catch (err) {
|
|
1097
|
-
if (err
|
|
1118
|
+
if (notFound(err)) return null;
|
|
1098
1119
|
throw err;
|
|
1099
1120
|
}
|
|
1100
1121
|
}
|
|
@@ -1121,33 +1142,12 @@ function githubShaped(kind: "github" | "forgejo", opts: GithubForgeOptions): Git
|
|
|
1121
1142
|
// GitHub filters by `owner:branch` server-side; Forgejo's list takes no
|
|
1122
1143
|
// head filter, so every open page is read and matched here.
|
|
1123
1144
|
const owner = opts.repo.split("/")[0];
|
|
1124
|
-
const
|
|
1125
|
-
|
|
1126
|
-
try {
|
|
1127
|
-
listed = await api.list(`${repo}/pulls${query}`, pageParams, pageSize);
|
|
1128
|
-
} catch (err) {
|
|
1129
|
-
// Forgejo answers the list with 404 while it still counts the repository
|
|
1130
|
-
// as empty (just after the first push). That is no pull request; a
|
|
1131
|
-
// repository that is really missing 404s on its own read too.
|
|
1132
|
-
if (kind !== "forgejo" || !(err instanceof ForgeApiError) || err.status !== 404) throw err;
|
|
1133
|
-
await api.call("GET", repo);
|
|
1134
|
-
return undefined;
|
|
1135
|
-
}
|
|
1136
|
-
const open = listed.filter((p) => fromHere(p, head));
|
|
1137
|
-
return open.map(pull).filter((p): p is PullRequest => p !== undefined).sort((a, b) => a.number - b.number)[0];
|
|
1145
|
+
const open = (await openPulls(`&head=${encodeURIComponent(`${owner}:${head}`)}`)).filter((p) => fromHere(p, head));
|
|
1146
|
+
return open.map(pull).filter((p): p is PullRequest => p !== undefined).sort(byNumber)[0];
|
|
1138
1147
|
},
|
|
1139
1148
|
async openPullRequests(base) {
|
|
1140
1149
|
// GitHub filters by base server-side; Forgejo's list is matched here.
|
|
1141
|
-
const
|
|
1142
|
-
let listed: unknown[];
|
|
1143
|
-
try {
|
|
1144
|
-
listed = await api.list(`${repo}/pulls${query}`, pageParams, pageSize);
|
|
1145
|
-
} catch (err) {
|
|
1146
|
-
// Forgejo answers 404 while it counts the repository as empty, as findPullRequest notes.
|
|
1147
|
-
if (kind !== "forgejo" || !(err instanceof ForgeApiError) || err.status !== 404) throw err;
|
|
1148
|
-
await api.call("GET", repo);
|
|
1149
|
-
return [];
|
|
1150
|
-
}
|
|
1150
|
+
const listed = await openPulls(`&base=${encodeURIComponent(base)}`);
|
|
1151
1151
|
const out: OpenPullRequest[] = [];
|
|
1152
1152
|
for (const v of listed) {
|
|
1153
1153
|
if (!isObject(v) || !isObject(v.head) || !isObject(v.base)) continue;
|
|
@@ -1160,7 +1160,7 @@ function githubShaped(kind: "github" | "forgejo", opts: GithubForgeOptions): Git
|
|
|
1160
1160
|
const author = isObject(v.user) ? str(v.user.login) : undefined;
|
|
1161
1161
|
out.push({ number, head, headSha, base: into, ...(baseSha ? { baseSha } : {}), ...(author ? { author } : {}), fork: !fromHere(v, head) });
|
|
1162
1162
|
}
|
|
1163
|
-
return out.sort(
|
|
1163
|
+
return out.sort(byNumber);
|
|
1164
1164
|
},
|
|
1165
1165
|
branchHead: branchTip,
|
|
1166
1166
|
async pullRequestHead(pr) {
|
|
@@ -1168,7 +1168,7 @@ function githubShaped(kind: "github" | "forgejo", opts: GithubForgeOptions): Git
|
|
|
1168
1168
|
try {
|
|
1169
1169
|
got = await api.call("GET", `${repo}/pulls/${pr}`);
|
|
1170
1170
|
} catch (err) {
|
|
1171
|
-
if (err
|
|
1171
|
+
if (notFound(err)) return undefined;
|
|
1172
1172
|
throw err;
|
|
1173
1173
|
}
|
|
1174
1174
|
if (!isObject(got) || !isObject(got.head)) return undefined;
|
|
@@ -1336,6 +1336,8 @@ export function gitlabForge(opts: GitlabForgeOptions): PrForge {
|
|
|
1336
1336
|
return { id, body: str(v.description) ?? "", ...(created ? { created } : {}), ...(str(v.title) !== undefined ? { title: str(v.title) } : {}), ...(author ? { author } : {}), ...(url ? { url } : {}) };
|
|
1337
1337
|
};
|
|
1338
1338
|
const notes = `${project}/merge_requests`;
|
|
1339
|
+
/** The open merge requests from (`source`) or into (`target`) `branch`. */
|
|
1340
|
+
const openMrs = (end: "source" | "target", branch: string): Promise<unknown[]> => api.list(`${notes}?state=opened&${end}_branch=${encodeURIComponent(branch)}`, pageParams, 100);
|
|
1339
1341
|
const mergeRequest = (v: unknown): PullRequest | undefined => {
|
|
1340
1342
|
if (!isObject(v)) return undefined;
|
|
1341
1343
|
const number = num(v.iid);
|
|
@@ -1457,7 +1459,7 @@ export function gitlabForge(opts: GitlabForgeOptions): PrForge {
|
|
|
1457
1459
|
try {
|
|
1458
1460
|
member = await api.call("GET", `${project}/members/all/${id}`);
|
|
1459
1461
|
} catch (err) {
|
|
1460
|
-
if (err
|
|
1462
|
+
if (notFound(err)) return `${login} is not a member`;
|
|
1461
1463
|
return `could not read ${login}'s access (${err instanceof Error ? err.message : String(err)})`;
|
|
1462
1464
|
}
|
|
1463
1465
|
const level = isObject(member) ? (num(member.access_level) ?? 0) : 0;
|
|
@@ -1510,7 +1512,7 @@ export function gitlabForge(opts: GitlabForgeOptions): PrForge {
|
|
|
1510
1512
|
const got = await api.call("GET", `${notes}/${mr}`);
|
|
1511
1513
|
return isObject(got) && got.state === "opened";
|
|
1512
1514
|
} catch (err) {
|
|
1513
|
-
if (err
|
|
1515
|
+
if (notFound(err)) return false;
|
|
1514
1516
|
throw err;
|
|
1515
1517
|
}
|
|
1516
1518
|
},
|
|
@@ -1528,13 +1530,13 @@ export function gitlabForge(opts: GitlabForgeOptions): PrForge {
|
|
|
1528
1530
|
return mergeRequest(made) ?? { number: 0, title, body: spec.body, head: spec.head, base };
|
|
1529
1531
|
},
|
|
1530
1532
|
async findPullRequest(head) {
|
|
1531
|
-
const open = await
|
|
1533
|
+
const open = await openMrs("source", head);
|
|
1532
1534
|
return open
|
|
1533
1535
|
// A fork's merge request into this project has another source project.
|
|
1534
1536
|
.filter((m) => isObject(m) && m.source_branch === head && (m.source_project_id === undefined || m.source_project_id === m.project_id))
|
|
1535
1537
|
.map(mergeRequest)
|
|
1536
1538
|
.filter((m): m is PullRequest => m !== undefined)
|
|
1537
|
-
.sort(
|
|
1539
|
+
.sort(byNumber)[0];
|
|
1538
1540
|
},
|
|
1539
1541
|
async scheduledRuns(q) {
|
|
1540
1542
|
// The variable the gitlab lexicon's generated Op file selects a scheduled job by.
|
|
@@ -1549,9 +1551,26 @@ export function gitlabForge(opts: GitlabForgeOptions): PrForge {
|
|
|
1549
1551
|
const last = newestTime(pipelines.map((p) => (isObject(p) ? str(p.created_at) : undefined)));
|
|
1550
1552
|
return { ...(last ? { last } : {}), ...(ours.length === 0 ? { noSchedule: true } : {}) };
|
|
1551
1553
|
},
|
|
1554
|
+
// #4628: the open merge requests into `base`, for the stale marking a push to it runs.
|
|
1555
|
+
async openPullRequests(base) {
|
|
1556
|
+
const out: OpenPullRequest[] = [];
|
|
1557
|
+
for (const m of await openMrs("target", base)) {
|
|
1558
|
+
if (!isObject(m)) continue;
|
|
1559
|
+
const number = num(m.iid);
|
|
1560
|
+
const head = str(m.source_branch);
|
|
1561
|
+
const headSha = str(m.sha);
|
|
1562
|
+
if (number === undefined || !head || !headSha || str(m.target_branch) !== base) continue;
|
|
1563
|
+
const refs = isObject(m.diff_refs) ? m.diff_refs : undefined;
|
|
1564
|
+
const baseSha = refs ? str(refs.base_sha) : undefined;
|
|
1565
|
+
const author = isObject(m.author) ? str(m.author.username) : undefined;
|
|
1566
|
+
const fork = num(m.source_project_id) !== undefined && num(m.source_project_id) !== num(m.target_project_id);
|
|
1567
|
+
out.push({ number, head, headSha, base, ...(baseSha ? { baseSha } : {}), ...(author ? { author } : {}), fork });
|
|
1568
|
+
}
|
|
1569
|
+
return out.sort(byNumber);
|
|
1570
|
+
},
|
|
1552
1571
|
async mergeRequestJobs(branch, job) {
|
|
1553
1572
|
const out: MergeRequestJob[] = [];
|
|
1554
|
-
const open = await
|
|
1573
|
+
const open = await openMrs("target", branch);
|
|
1555
1574
|
for (const m of open) {
|
|
1556
1575
|
if (!isObject(m)) continue;
|
|
1557
1576
|
const iid = num(m.iid);
|
|
@@ -1579,7 +1598,7 @@ export function gitlabForge(opts: GitlabForgeOptions): PrForge {
|
|
|
1579
1598
|
try {
|
|
1580
1599
|
got = await api.call("GET", `${notes}/${mr}`);
|
|
1581
1600
|
} catch (err) {
|
|
1582
|
-
if (err
|
|
1601
|
+
if (notFound(err)) return undefined;
|
|
1583
1602
|
throw err;
|
|
1584
1603
|
}
|
|
1585
1604
|
if (!isObject(got)) return undefined;
|
|
@@ -45,8 +45,6 @@ describe("the pull-request loop bundle", () => {
|
|
|
45
45
|
"packages/core/src/pr-migrations.ts",
|
|
46
46
|
// The Pulumi URN rule (#4548, the may-appear rows): no imports.
|
|
47
47
|
"packages/core/src/pulumi-urn.ts",
|
|
48
|
-
// The next-release floor constant (#4480): no imports.
|
|
49
|
-
"packages/core/src/release-floors.ts",
|
|
50
48
|
]);
|
|
51
49
|
// About 89 KB today, after the hooks line (#4288), the blocked set (#4291), the scheduled-run reads (#4289) the requires checks (#4301) and the migration notes (#4407), about 97 KB; with the group lines (#4446), about 100 KB.
|
|
52
50
|
// 120 KB (122,880 bytes) is the ruled ceiling: raised from 110 KB by the maintainer ruling of 2026-10-27 on #4481. It is not a figure to lower by trimming note text.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A narrowed plan in the note and the status (#4626): each narrowed
|
|
3
|
+
* member's row lists its addresses, a line says the plan on merge is of
|
|
4
|
+
* each member whole, and the status counts the narrowed members, in the
|
|
5
|
+
* product's words. Written for the ci-products post-merge pass.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, test } from "vitest";
|
|
8
|
+
import { composeChangeSet } from "./change-set";
|
|
9
|
+
import { memberCounts, PR_REPORT_SCHEMA_ID, prStatusDescription, renderPrNote, type PrReport } from "./pr-loop";
|
|
10
|
+
import { assertProductWords } from "./ci-product-words";
|
|
11
|
+
import { PLYWOOD } from "./__fixtures__/product-words";
|
|
12
|
+
|
|
13
|
+
const hex = (n: number) => n.toString(16).padStart(64, "0");
|
|
14
|
+
const URN = "urn:pulumi:dev::shop::aws:s3/bucket:Bucket::site";
|
|
15
|
+
const doc = composeChangeSet([
|
|
16
|
+
{
|
|
17
|
+
member: { member: "shop-dev", lexicon: "pulumi", planner: "pulumi", status: "planned", planDigest: `jcs1-sha256:${hex(1)}`, holes: [] },
|
|
18
|
+
entries: [{ member: "shop-dev", lexicon: "pulumi", planner: "pulumi", address: URN, type: "aws:s3/bucket:Bucket", action: "create", attributes: [] }],
|
|
19
|
+
},
|
|
20
|
+
]);
|
|
21
|
+
const report: PrReport = {
|
|
22
|
+
$schema: PR_REPORT_SCHEMA_ID,
|
|
23
|
+
contract: 1,
|
|
24
|
+
stage: "plan",
|
|
25
|
+
pr: 12,
|
|
26
|
+
env: "dev",
|
|
27
|
+
base: "1".repeat(40),
|
|
28
|
+
head: "2".repeat(40),
|
|
29
|
+
op: "pulumi-up",
|
|
30
|
+
gate: "up",
|
|
31
|
+
digest: doc.digest,
|
|
32
|
+
status: "planned",
|
|
33
|
+
approval: { status: "pending" },
|
|
34
|
+
selection: { changed: ["shop"], dependents: [], unclaimed: [], indeterminate: [], waves: [["shop"]] },
|
|
35
|
+
members: [{ member: "shop-dev", component: "shop", planDigest: `jcs1-sha256:${hex(1)}`, status: "planned", counts: memberCounts(doc, "shop-dev") }],
|
|
36
|
+
changeSet: doc,
|
|
37
|
+
};
|
|
38
|
+
const plywood = assertProductWords(PLYWOOD);
|
|
39
|
+
|
|
40
|
+
describe("a narrowed plan (#4626)", () => {
|
|
41
|
+
const narrowed: PrReport = { ...report, narrowed: { shop: [URN] } };
|
|
42
|
+
|
|
43
|
+
test("the member's row lists the addresses", () => {
|
|
44
|
+
const note = renderPrNote(narrowed, { words: plywood });
|
|
45
|
+
const row = note.split("\n").find((l) => l.startsWith("| `shop-dev`"))!;
|
|
46
|
+
expect(row).toContain(`narrowed to \`${URN}\``);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("a line says so in the product's words, and that the update on merge plans each stack whole", () => {
|
|
50
|
+
const note = renderPrNote(narrowed, { words: plywood });
|
|
51
|
+
expect(note).toContain(`This preview was narrowed with \`--target\`: \`shop\` to \`${URN}\`. The approval binds the narrowed plan. On merge each stack is previewed whole.`);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test("the status counts the narrowed members", () => {
|
|
55
|
+
expect(prStatusDescription(narrowed, plywood)).toMatch(/^1 stack \(1 narrowed with --target\): /);
|
|
56
|
+
expect(prStatusDescription(narrowed, plywood).length).toBeLessThanOrEqual(140);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test("a plan that was not narrowed says nothing of it", () => {
|
|
60
|
+
expect(renderPrNote(report, { words: plywood })).not.toContain("narrowed");
|
|
61
|
+
expect(prStatusDescription(report, plywood)).not.toContain("narrowed");
|
|
62
|
+
});
|
|
63
|
+
});
|