@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
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Engine check steps in the check stage (#4633). A lexicon gives the check
|
|
3
|
+
* stage steps of its own for the workspace members of its kinds
|
|
4
|
+
* (`LexiconPlugin.checkSteps`): the pulumi lexicon's `pulumi install`, a
|
|
5
|
+
* stack config check and `pulumi about --json` for each pulumi member. They
|
|
6
|
+
* run after the `ci.hooks.check` hooks (`./check-hooks.ts`), in the same
|
|
7
|
+
* check job, with the same environment: no forge token, no OIDC request
|
|
8
|
+
* variables, no cloud credentials ({@link checkHookEnv}).
|
|
9
|
+
*
|
|
10
|
+
* The steps are the lexicon's, so a product's check (`plywood check`,
|
|
11
|
+
* `terragucci check`) gets them through `chant ci check` with no change of
|
|
12
|
+
* its own. Each step's outcome goes in the check report beside the hooks',
|
|
13
|
+
* and a failed step fails the check with chant's `failed` code, naming the
|
|
14
|
+
* member and, where it has one, the stack.
|
|
15
|
+
*
|
|
16
|
+
* The members are read from the working tree's declaration. The hooks are
|
|
17
|
+
* read at base so a change cannot drop a required check; a step is part of
|
|
18
|
+
* the lexicon, so there is nothing for a change to remove.
|
|
19
|
+
*/
|
|
20
|
+
import { writeFileSync } from "node:fs";
|
|
21
|
+
import { join, relative, resolve } from "node:path";
|
|
22
|
+
import { readDeclaration } from "../workspace/declaration";
|
|
23
|
+
import { locateWorkspace } from "../workspace/which-chant";
|
|
24
|
+
import { CHECK_HOOKS_DIR, CHECK_HOOKS_REPORT_FILE, checkHookEnv, runCheckHooks, type CheckHooksReport, type RunCheckHooksOptions } from "./check-hooks";
|
|
25
|
+
|
|
26
|
+
/** A workspace member a lexicon's check steps run for. */
|
|
27
|
+
export interface CheckStageMember {
|
|
28
|
+
name: string;
|
|
29
|
+
/** The member's directory, absolute. */
|
|
30
|
+
dir: string;
|
|
31
|
+
kind: string;
|
|
32
|
+
/** The values the declaration sets for the kind's fields, or null. */
|
|
33
|
+
fields: Record<string, unknown> | null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** One check step's run, as the check report lists it. */
|
|
37
|
+
export interface CheckStepOutcome {
|
|
38
|
+
/** The lexicon that gave the step. */
|
|
39
|
+
lexicon: string;
|
|
40
|
+
/** The step's name, such as `pulumi-install`. */
|
|
41
|
+
step: string;
|
|
42
|
+
member: string;
|
|
43
|
+
/** The stack, for a step that runs per stack. */
|
|
44
|
+
stack?: string;
|
|
45
|
+
/** The engine's exit status, or 0 for a step that runs no command; 1 for a failure that ran none. */
|
|
46
|
+
exit: number;
|
|
47
|
+
outcome: "passed" | "failed" | "skipped";
|
|
48
|
+
/** Why it failed or was skipped, naming the member and stack. */
|
|
49
|
+
reason?: string;
|
|
50
|
+
/** What the step read, for the report (the engine, plugins and backend for `pulumi about`). */
|
|
51
|
+
detail?: unknown;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface CheckStepsContext {
|
|
55
|
+
/** The members of the adapter's kinds the check covers. */
|
|
56
|
+
members: CheckStageMember[];
|
|
57
|
+
/** The check job's working directory. */
|
|
58
|
+
cwd: string;
|
|
59
|
+
/** The environment a step runs with: {@link checkHookEnv} of the job's. */
|
|
60
|
+
env: Record<string, string>;
|
|
61
|
+
log: (line: string) => void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** What a lexicon gives the check stage. */
|
|
65
|
+
export interface CheckStepsAdapter {
|
|
66
|
+
/** The lexicon's name, for the report. */
|
|
67
|
+
lexicon: string;
|
|
68
|
+
/** The member kinds it has steps for. */
|
|
69
|
+
kinds: readonly string[];
|
|
70
|
+
/** Run the steps for each member, in order, and return every outcome. A step that fails does not stop another member's. */
|
|
71
|
+
run(ctx: CheckStepsContext): Promise<CheckStepOutcome[]>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The working tree's members a check covers: every member with a directory
|
|
76
|
+
* (a `repo` member has none), or those a target names by member name or
|
|
77
|
+
* directory when there are targets. Empty when there is no declaration.
|
|
78
|
+
*/
|
|
79
|
+
export function checkStageMembers(cwd: string, targets: readonly string[] = []): CheckStageMember[] {
|
|
80
|
+
let located: ReturnType<typeof locateWorkspace>;
|
|
81
|
+
let members: ReturnType<typeof readDeclaration>["members"];
|
|
82
|
+
try {
|
|
83
|
+
located = locateWorkspace(cwd);
|
|
84
|
+
members = readDeclaration(located.tree).members;
|
|
85
|
+
} catch {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
const wanted = new Set(targets.map((t) => t.replace(/^\.\//, "").replace(/\/+$/, "")));
|
|
89
|
+
return members
|
|
90
|
+
.filter((m) => m.kind !== "repo")
|
|
91
|
+
.filter((m) => wanted.size === 0 || wanted.has(m.name) || wanted.has(m.dir.replace(/^\.\//, "").replace(/\/+$/, "")))
|
|
92
|
+
.map((m) => ({ name: m.name, dir: resolve(located.rootOnDisk, m.dir), kind: m.kind, fields: m.fields }));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface RunCheckStepsOptions {
|
|
96
|
+
adapters: readonly CheckStepsAdapter[];
|
|
97
|
+
/** Default {@link checkStageMembers} of `cwd` and `targets`. */
|
|
98
|
+
members?: CheckStageMember[];
|
|
99
|
+
targets?: readonly string[];
|
|
100
|
+
cwd?: string;
|
|
101
|
+
/** Default {@link checkHookEnv} of the process's environment. */
|
|
102
|
+
env?: Record<string, string>;
|
|
103
|
+
log?: (line: string) => void;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Run every adapter's steps for the members of its kinds, adapter by adapter. */
|
|
107
|
+
export async function runCheckSteps(options: RunCheckStepsOptions): Promise<CheckStepOutcome[]> {
|
|
108
|
+
const cwd = options.cwd ?? process.cwd();
|
|
109
|
+
const log = options.log ?? ((line: string) => console.error(line));
|
|
110
|
+
const members = options.members ?? checkStageMembers(cwd, options.targets);
|
|
111
|
+
const env = options.env ?? checkHookEnv();
|
|
112
|
+
const out: CheckStepOutcome[] = [];
|
|
113
|
+
for (const adapter of options.adapters) {
|
|
114
|
+
const mine = members.filter((m) => adapter.kinds.includes(m.kind));
|
|
115
|
+
if (mine.length === 0) continue;
|
|
116
|
+
try {
|
|
117
|
+
out.push(...(await adapter.run({ members: mine, cwd, env, log })));
|
|
118
|
+
} catch (err) {
|
|
119
|
+
const why = err instanceof Error ? err.message : String(err);
|
|
120
|
+
for (const m of mine) out.push({ lexicon: adapter.lexicon, step: "check", member: m.name, exit: 1, outcome: "failed", reason: `the ${adapter.lexicon} check steps for ${m.name} could not run: ${why}` });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return out;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** The line a failed step gives the report's `failed`. */
|
|
127
|
+
function failedLine(steps: CheckStepOutcome[]): string | undefined {
|
|
128
|
+
const failed = steps.filter((s) => s.outcome === "failed");
|
|
129
|
+
if (failed.length === 0) return undefined;
|
|
130
|
+
return `a check step failed: ${failed.map((s) => s.reason ?? `${s.step} for ${s.member}${s.stack ? ` (stack ${s.stack})` : ""}`).join("; ")}`;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The check stage (#4556, #4633): the `ci.hooks.check` hooks at base, then,
|
|
135
|
+
* unless a hook failed, the lexicons' check steps. Writes one report with
|
|
136
|
+
* both under `dir` and returns it; `status` is `none` only when no hook is
|
|
137
|
+
* declared and no step ran.
|
|
138
|
+
*/
|
|
139
|
+
export async function runCheckStage(options: RunCheckHooksOptions & { adapters: readonly CheckStepsAdapter[]; members?: CheckStageMember[] }): Promise<CheckHooksReport> {
|
|
140
|
+
const cwd = options.cwd ?? process.cwd();
|
|
141
|
+
const log = options.log ?? ((line: string) => console.error(line));
|
|
142
|
+
const hooks = runCheckHooks(options);
|
|
143
|
+
if (hooks.status === "failed" || options.adapters.length === 0) return hooks;
|
|
144
|
+
const steps = await runCheckSteps({
|
|
145
|
+
adapters: options.adapters,
|
|
146
|
+
...(options.members ? { members: options.members } : {}),
|
|
147
|
+
targets: options.targets ?? [],
|
|
148
|
+
cwd,
|
|
149
|
+
env: { ...checkHookEnv(), ...options.env },
|
|
150
|
+
log,
|
|
151
|
+
});
|
|
152
|
+
if (steps.length === 0) return hooks;
|
|
153
|
+
const failed = failedLine(steps);
|
|
154
|
+
const report: CheckHooksReport = { ...hooks, status: failed ? "failed" : "passed", steps, ...(failed ? { failed } : {}) };
|
|
155
|
+
const dir = relative(cwd, resolve(cwd, options.dir ?? CHECK_HOOKS_DIR)) || ".";
|
|
156
|
+
writeFileSync(join(cwd, dir, CHECK_HOOKS_REPORT_FILE), JSON.stringify(report, null, 2) + "\n");
|
|
157
|
+
return report;
|
|
158
|
+
}
|
|
@@ -12,10 +12,9 @@
|
|
|
12
12
|
* never answer for one host.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { NEXT_RELEASE } from "../release-floors";
|
|
16
15
|
|
|
17
16
|
/** The first chant with `LexiconPlugin.ciServices` and this module (#4572). */
|
|
18
|
-
export const CI_SERVICES_FLOOR =
|
|
17
|
+
export const CI_SERVICES_FLOOR = "0.124.55";
|
|
19
18
|
|
|
20
19
|
/** One service a job starts. */
|
|
21
20
|
export interface CiService {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, test, expect } from "vitest";
|
|
2
|
-
import { deployUnits } from "./deploy-units";
|
|
2
|
+
import { deployUnits, pulumiStackUnit } from "./deploy-units";
|
|
3
3
|
import type { Phase } from "./component";
|
|
4
4
|
|
|
5
5
|
const phase = (name: string, steps: Phase["steps"]): Phase => ({ phase: name, steps });
|
|
@@ -48,6 +48,23 @@ describe("deployUnits (#1495 piece 1)", () => {
|
|
|
48
48
|
expect(deployUnits(deploy)).toEqual([{ unit: "web", lexicon: "aws" }]);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
test("a pulumi-up step's unit is its stack qualified by the project's directory (plywood#22)", () => {
|
|
52
|
+
const deploy = [
|
|
53
|
+
phase("up", [
|
|
54
|
+
{ kind: "pulumi-up", dir: ".", stack: "dev", member: "shop" },
|
|
55
|
+
{ kind: "pulumi-up", dir: "./infra/", stack: "dev", member: "infra" },
|
|
56
|
+
{ kind: "pulumi-up", dir: "infra", stack: "dev", member: "infra" },
|
|
57
|
+
{ kind: "pulumi-up", dir: "infra" },
|
|
58
|
+
]),
|
|
59
|
+
];
|
|
60
|
+
expect(deployUnits(deploy)).toEqual([
|
|
61
|
+
{ unit: "dev", lexicon: "pulumi" },
|
|
62
|
+
{ unit: "infra/dev", lexicon: "pulumi" },
|
|
63
|
+
]);
|
|
64
|
+
// The pulumi lexicon's changedUnits names stacks with the same strings.
|
|
65
|
+
expect([pulumiStackUnit(".", "prod-us"), pulumiStackUnit("", "prod-us"), pulumiStackUnit("apps/web", "qa")]).toEqual(["prod-us", "prod-us", "apps/web/qa"]);
|
|
66
|
+
});
|
|
67
|
+
|
|
51
68
|
test("an unlisted kind contributes no unit — the registry is the rule", () => {
|
|
52
69
|
const deploy = [phase("Apply", [{ kind: "gcloud-deploy", stack: "x" }])];
|
|
53
70
|
expect(deployUnits(deploy)).toEqual([]);
|
|
@@ -34,6 +34,22 @@ export interface DeployUnitRule {
|
|
|
34
34
|
field: string;
|
|
35
35
|
/** The lexicon whose `describeStackStatus` reads this kind of unit. */
|
|
36
36
|
lexicon: string;
|
|
37
|
+
/**
|
|
38
|
+
* The unit from the whole step, when `field` alone does not name it
|
|
39
|
+
* uniquely. Undefined skips the step, as a missing `field` does.
|
|
40
|
+
*/
|
|
41
|
+
unitOf?: (step: Record<string, unknown>) => string | undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A Pulumi stack's unit: `<dir>/<stack>`, or `<stack>` for a project at the
|
|
46
|
+
* project root. `dir` is where `Pulumi.yaml` is, relative to the project root,
|
|
47
|
+
* so two projects with a `dev` stack are two units. The pulumi lexicon's
|
|
48
|
+
* `changedUnits` answers with the same names.
|
|
49
|
+
*/
|
|
50
|
+
export function pulumiStackUnit(dir: string, stack: string): string {
|
|
51
|
+
const d = dir.replace(/\\/g, "/").replace(/^(\.\/)+/, "").replace(/\/+$/, "");
|
|
52
|
+
return d === "" || d === "." ? stack : `${d}/${stack}`;
|
|
37
53
|
}
|
|
38
54
|
|
|
39
55
|
/**
|
|
@@ -68,6 +84,15 @@ export const DEPLOY_UNIT_RULES: readonly DeployUnitRule[] = [
|
|
|
68
84
|
// change signal naming the member puts the component in the change. No
|
|
69
85
|
// lexicon observes it: the member's own pipeline reports its status.
|
|
70
86
|
{ kind: "member-outputs", field: "member", lexicon: "workspace" },
|
|
87
|
+
// A Pulumi stack (plywood#22). Its unit is the stack qualified by the
|
|
88
|
+
// project's directory (`pulumiStackUnit`), which the pulumi lexicon's
|
|
89
|
+
// `changedUnits` names for a changed stack config or program file.
|
|
90
|
+
{
|
|
91
|
+
kind: "pulumi-up",
|
|
92
|
+
field: "stack",
|
|
93
|
+
lexicon: "pulumi",
|
|
94
|
+
unitOf: (s) => (typeof s.stack === "string" && s.stack !== "" ? pulumiStackUnit(typeof s.dir === "string" ? s.dir : ".", s.stack) : undefined),
|
|
95
|
+
},
|
|
71
96
|
];
|
|
72
97
|
|
|
73
98
|
/** One resolved unit a component's deploy composition targets. */
|
|
@@ -99,7 +124,7 @@ export function deployUnits(deploy: readonly UnitBearingPhase[]): DeployUnit[] {
|
|
|
99
124
|
const s = step as { kind?: string } & Record<string, unknown>;
|
|
100
125
|
const rule = s.kind ? byKind.get(s.kind) : undefined;
|
|
101
126
|
if (!rule) continue;
|
|
102
|
-
const unit = s[rule.field];
|
|
127
|
+
const unit = rule.unitOf ? rule.unitOf(s) : s[rule.field];
|
|
103
128
|
if (typeof unit !== "string" || unit.length === 0) continue;
|
|
104
129
|
const key = `${rule.lexicon}\0${unit}`;
|
|
105
130
|
if (seen.has(key)) continue;
|
package/src/components/driver.ts
CHANGED
|
@@ -59,7 +59,7 @@ import { componentDeployInputs } from "./deploy-inputs";
|
|
|
59
59
|
import type { PendingGateRecord } from "../lifecycle/gate-ledger";
|
|
60
60
|
import type { CapabilityRegistry, DeployContext, GroupMemberStatus } from "./capability";
|
|
61
61
|
import type { FanOutGroup } from "./fan-out";
|
|
62
|
-
import { isPlanMovedError, PLAN_MOVED_EXIT_CODE, TargetsRefusedError, targetRefusal } from "./capability";
|
|
62
|
+
import { isPlanMovedError, PLAN_MOVED_EXIT_CODE, PlanFlagRefusedError, planFlagRefusal, TargetsRefusedError, targetRefusal } from "./capability";
|
|
63
63
|
import { isPromotedArtifact } from "./auto-release";
|
|
64
64
|
import type { ReleaseIdentity } from "../telemetry-attribution";
|
|
65
65
|
import type { RunProgressEvent } from "./run-progress";
|
|
@@ -1260,6 +1260,10 @@ export function deployContext(
|
|
|
1260
1260
|
vars?: Record<string, unknown>;
|
|
1261
1261
|
releaseIdentity?: (component: string) => ReleaseIdentity | undefined;
|
|
1262
1262
|
targets?: Readonly<Record<string, readonly string[]>>;
|
|
1263
|
+
/** `pr-plan --refresh` (#4627), for every step's `DeployContext.refresh`. */
|
|
1264
|
+
refresh?: boolean;
|
|
1265
|
+
/** `pr-plan --target-dependents` (#4627), for every step of a component with targets. */
|
|
1266
|
+
targetDependents?: boolean;
|
|
1263
1267
|
/** `ci.lockGrain` as declared at base (#4552), for every step's `DeployContext.lockGrain`. */
|
|
1264
1268
|
lockGrain?: LockGrain;
|
|
1265
1269
|
/** The commit policy is read at (#4613), for every step's `DeployContext.policyBase`. */
|
|
@@ -1280,9 +1284,39 @@ export function deployContext(
|
|
|
1280
1284
|
...(options.rowLease ? { rowLease: options.rowLease } : {}),
|
|
1281
1285
|
...(release ? { release: { ...release } } : {}),
|
|
1282
1286
|
...(targets && targets.length > 0 ? { targets: [...new Set(targets)].sort() } : {}),
|
|
1287
|
+
...(options.refresh ? { refresh: true } : {}),
|
|
1288
|
+
...(options.targetDependents && targets && targets.length > 0 ? { targetDependents: true } : {}),
|
|
1283
1289
|
};
|
|
1284
1290
|
}
|
|
1285
1291
|
|
|
1292
|
+
/**
|
|
1293
|
+
* Refuse a component asked to plan with `ctx.refresh` or
|
|
1294
|
+
* `ctx.targetDependents` (#4627) when one of its capability steps can't:
|
|
1295
|
+
* throws {@link PlanFlagRefusedError} naming the first such verb and the
|
|
1296
|
+
* flag. A step whose kind is not registered refuses too. Does nothing when
|
|
1297
|
+
* neither is set.
|
|
1298
|
+
*/
|
|
1299
|
+
export function assertPlanFlagsAccepted(component: DriverComponent, registry: CapabilityRegistry, ctx: Pick<DeployContext, "refresh" | "targetDependents">): void {
|
|
1300
|
+
const asked = (["refresh", "targetDependents"] as const).filter((f) => ctx[f] === true);
|
|
1301
|
+
if (asked.length === 0) return;
|
|
1302
|
+
const walk = (steps: DriverPhase["steps"]): void => {
|
|
1303
|
+
for (const step of steps) {
|
|
1304
|
+
if (typeof (step as DriverPhase).phase === "string" && Array.isArray((step as DriverPhase).steps)) {
|
|
1305
|
+
walk((step as DriverPhase).steps);
|
|
1306
|
+
continue;
|
|
1307
|
+
}
|
|
1308
|
+
const kind = (step as { kind?: unknown }).kind;
|
|
1309
|
+
if (kind === "gate" || typeof kind !== "string") continue;
|
|
1310
|
+
for (const flag of asked) {
|
|
1311
|
+
if (!registry.has(kind)) throw new PlanFlagRefusedError(component.name, kind, flag, `no capability is registered for ${kind}`);
|
|
1312
|
+
const reason = planFlagRefusal(registry.resolve(kind), flag);
|
|
1313
|
+
if (reason !== undefined) throw new PlanFlagRefusedError(component.name, kind, flag, reason);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
};
|
|
1317
|
+
for (const phase of component.deploy) walk(phase.steps);
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1286
1320
|
/**
|
|
1287
1321
|
* Refuse a component asked to narrow to `ctx.targets` (#4300) when one of its
|
|
1288
1322
|
* capability steps can't: throws {@link TargetsRefusedError} naming the first
|
package/src/components/groups.ts
CHANGED
|
@@ -31,6 +31,7 @@ import type { ChangeSetPart } from "../change-set";
|
|
|
31
31
|
import type { PlanShape } from "./covered-round";
|
|
32
32
|
import {
|
|
33
33
|
accumulateComponentOutputs,
|
|
34
|
+
assertPlanFlagsAccepted,
|
|
34
35
|
assertTargetsAccepted,
|
|
35
36
|
resolveComponentGraph,
|
|
36
37
|
resolveStepInput,
|
|
@@ -59,7 +60,7 @@ import {
|
|
|
59
60
|
type ReportedGroupRead,
|
|
60
61
|
} from "./capability";
|
|
61
62
|
import type { FanOutGroup, FanOutGroupFallback, FanOutPlan } from "./fan-out";
|
|
62
|
-
import { bindTargets, type WaveComponentPlan } from "./wave-plan";
|
|
63
|
+
import { bindPlanFlags, bindTargets, type WaveComponentPlan } from "./wave-plan";
|
|
63
64
|
import { resolvePlannedLock } from "../lifecycle/lock-rows";
|
|
64
65
|
import { groupLockRows, isLockRowsHeldError, type RowLease } from "./row-lease";
|
|
65
66
|
|
|
@@ -264,6 +265,7 @@ function groupMembers(
|
|
|
264
265
|
const { kind: _kind, ...step } = at.step;
|
|
265
266
|
const base = ctxOf(name);
|
|
266
267
|
assertTargetsAccepted(component, registry, base);
|
|
268
|
+
assertPlanFlagsAccepted(component, registry, base);
|
|
267
269
|
const reads = groupReadsOf(step, inGroup, name);
|
|
268
270
|
const dependsOn = component.dependsOn?.length ? { dependsOn: [...component.dependsOn] } : {};
|
|
269
271
|
if (!outside) return { component: name, step, reads, ...dependsOn, ctx: base };
|
|
@@ -665,7 +667,7 @@ export async function planComponentGroup(options: PlanComponentGroupOptions): Pr
|
|
|
665
667
|
for (const m of members) {
|
|
666
668
|
const own = planned.members[m.component];
|
|
667
669
|
if (!own) throw new Error(`${group.capability} planned the group ${group.components.join(", ")} without a plan for ${m.component}`);
|
|
668
|
-
bound.set(m.component, bindTargets(group.capability, m.ctx, own));
|
|
670
|
+
bound.set(m.component, bindPlanFlags(m.ctx, bindTargets(group.capability, m.ctx, own)));
|
|
669
671
|
}
|
|
670
672
|
const digest = groupDigest(
|
|
671
673
|
group.capability,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan flags through the capability contract (#4627): a capability says it
|
|
3
|
+
* takes `refresh` and `targetDependents`, a component is refused by name
|
|
4
|
+
* when one of its steps cannot, the context carries them, and the member's
|
|
5
|
+
* digest binds them. Written for the ci-products post-merge pass.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, test } from "vitest";
|
|
8
|
+
import { CapabilityRegistry, PlanFlagRefusedError, planFlagRefusal, type Capability, type CapabilityPlan } from "./capability";
|
|
9
|
+
import { assertPlanFlagsAccepted, deployContext, type DriverComponent } from "./driver";
|
|
10
|
+
import { bindPlanFlags } from "./wave-plan";
|
|
11
|
+
|
|
12
|
+
const cap = (kind: string, planFlags?: Capability<never, unknown>["planFlags"]) =>
|
|
13
|
+
({ kind, ...(planFlags ? { planFlags } : {}), async run() { return {}; } }) as unknown as Capability<never, unknown>;
|
|
14
|
+
const registry = new CapabilityRegistry().register(cap("both", { refresh: "accept", targetDependents: "accept" })).register(cap("refresh-only", { refresh: "accept", targetDependents: { refuse: "no flag for it" } })).register(cap("silent"));
|
|
15
|
+
const component = (kind: string): DriverComponent => ({ name: "c", dependsOn: [], deploy: [{ phase: "Apply", steps: [{ kind, root: "r" }] }] });
|
|
16
|
+
|
|
17
|
+
describe("plan flags (#4627)", () => {
|
|
18
|
+
test("a capability's refusal, its own reason or one naming the verb", () => {
|
|
19
|
+
expect(planFlagRefusal(cap("both", { refresh: "accept" }), "refresh")).toBeUndefined();
|
|
20
|
+
expect(planFlagRefusal(cap("x", { targetDependents: { refuse: "why" } }), "targetDependents")).toBe("why");
|
|
21
|
+
expect(planFlagRefusal(cap("silent"), "refresh")).toBe("silent does not say it can plan with --refresh");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test("a component is refused by name and flag", () => {
|
|
25
|
+
expect(() => assertPlanFlagsAccepted(component("both"), registry, { refresh: true, targetDependents: true })).not.toThrow();
|
|
26
|
+
expect(() => assertPlanFlagsAccepted(component("refresh-only"), registry, { targetDependents: true })).toThrow(PlanFlagRefusedError);
|
|
27
|
+
expect(() => assertPlanFlagsAccepted(component("refresh-only"), registry, { targetDependents: true })).toThrow('component "c": refresh-only refuses --target-dependents: no flag for it');
|
|
28
|
+
expect(() => assertPlanFlagsAccepted(component("silent"), registry, { refresh: true })).toThrow(/refuses --refresh/);
|
|
29
|
+
expect(() => assertPlanFlagsAccepted(component("silent"), registry, {})).not.toThrow();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("the context carries refresh for every component, and target dependents only with targets", () => {
|
|
33
|
+
expect(deployContext({ env: "dev", refresh: true, targetDependents: true, targets: { a: ["x"] } }, "a")).toMatchObject({ refresh: true, targetDependents: true, targets: ["x"] });
|
|
34
|
+
expect(deployContext({ env: "dev", refresh: true, targetDependents: true, targets: { a: ["x"] } }, "b")).toEqual({ env: "dev", component: "b", refresh: true });
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("the digest binds each flag, and a plain plan keeps its own", () => {
|
|
38
|
+
const planned = { member: "m", planDigest: "sha256:" + "1".repeat(64), changeSet: { member: { member: "m", lexicon: "x", planner: "chant", status: "planned" as const, planDigest: "sha256:" + "1".repeat(64), holes: [] }, entries: [] } } as unknown as CapabilityPlan;
|
|
39
|
+
expect(bindPlanFlags({}, planned)).toBe(planned);
|
|
40
|
+
const refreshed = bindPlanFlags({ refresh: true }, planned);
|
|
41
|
+
const widened = bindPlanFlags({ targetDependents: true }, planned);
|
|
42
|
+
expect(refreshed.planDigest).not.toBe(planned.planDigest);
|
|
43
|
+
expect(widened.planDigest).not.toBe(refreshed.planDigest);
|
|
44
|
+
expect(refreshed.changeSet!.member.planDigest).toBe(refreshed.planDigest);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The comment preview passes the comment's --target addresses to pr-plan
|
|
3
|
+
* (#4626): `pr-plan --comment-targets`, with the comment in
|
|
4
|
+
* CHANT_PREVIEW_COMMENT on GitHub and Forgejo and from the pipeline's
|
|
5
|
+
* variable on GitLab. Written for the ci-products post-merge pass.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, test } from "vitest";
|
|
8
|
+
import { PREVIEW_COMMENT_ENV, prCommentPreviewJob, prLoopJobs } from "./pr-pipeline";
|
|
9
|
+
import { PLYWOOD } from "../__fixtures__/product-words";
|
|
10
|
+
|
|
11
|
+
const words = { ...PLYWOOD, commands: { preview: "plan" as const } };
|
|
12
|
+
|
|
13
|
+
describe("the comment preview's targets (#4626)", () => {
|
|
14
|
+
test("GitHub and Forgejo: the plan reads the comment from a variable, never the shell line", () => {
|
|
15
|
+
for (const forge of ["github", "forgejo"] as const) {
|
|
16
|
+
const job = prCommentPreviewJob(forge, "prod", { previewComment: true, words }, undefined)!;
|
|
17
|
+
expect(job.plan.command).toContain("--comment-targets");
|
|
18
|
+
expect(job.plan.run.command).toContain("--comment-targets");
|
|
19
|
+
expect(job.plan.run.env[PREVIEW_COMMENT_ENV]).toBe("${{ github.event.comment.body }}");
|
|
20
|
+
expect(job.plan.run.command).not.toContain("comment.body");
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test("GitLab: the plan reads the pipeline's own variable", () => {
|
|
25
|
+
const job = prCommentPreviewJob("gitlab", "prod", { previewComment: true, words }, undefined)!;
|
|
26
|
+
expect(job.plan.run.command).toContain("--comment-targets");
|
|
27
|
+
expect(job.plan.run.env).not.toHaveProperty(PREVIEW_COMMENT_ENV);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("the pull request's own plan job reads no comment", () => {
|
|
31
|
+
const [plan] = prLoopJobs("github", "prod", { words });
|
|
32
|
+
expect(plan!.command).not.toContain("--comment-targets");
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
* `pushLifecycleReport` after, the two-step shape every ledger here uses.
|
|
11
11
|
*/
|
|
12
12
|
import { appendLedgerLine, readBlobFromPath, type LedgerLocation } from "../lifecycle/git";
|
|
13
|
-
import { NEXT_RELEASE } from "../release-floors";
|
|
14
13
|
import { PR_ENV_LEDGER_DIR, PR_ENV_LEDGER_FILE, parsePrEnvRecords, type PrEnvRecord } from "./pr-environment";
|
|
15
14
|
|
|
16
15
|
/** The first chant that exports {@link appendPrEnvRecord} and {@link readPrEnvRecords} (#4551). */
|
|
17
|
-
export const PR_ENV_APPEND_FLOOR =
|
|
16
|
+
export const PR_ENV_APPEND_FLOOR = "0.124.55";
|
|
18
17
|
|
|
19
18
|
/** A record {@link parsePrEnvRecords} would skip, so it is never appended. */
|
|
20
19
|
export class PrEnvRecordError extends Error {
|
|
@@ -26,38 +26,18 @@ describe("the pr-env-run bundle", () => {
|
|
|
26
26
|
});
|
|
27
27
|
const inputs = Object.keys(result.metafile.inputs).map((i) => i.replace(/^.*?packages\//, "packages/")).sort();
|
|
28
28
|
expect(inputs).toEqual([
|
|
29
|
-
"packages/core/src/change-set.ts",
|
|
30
29
|
"packages/core/src/ci-handover.ts",
|
|
31
30
|
"packages/core/src/ci-jobs.ts",
|
|
32
|
-
// The product's words (#4550): gate and status names, no imports.
|
|
33
|
-
"packages/core/src/ci-product-words.ts",
|
|
34
|
-
"packages/core/src/components/changed-files.ts",
|
|
35
31
|
"packages/core/src/components/pr-env-run.ts",
|
|
36
32
|
"packages/core/src/components/pr-environment.ts",
|
|
37
|
-
"packages/core/src/components/pr-pipeline.ts",
|
|
38
33
|
"packages/core/src/config-environments.ts",
|
|
39
|
-
"packages/core/src/content-digest.ts",
|
|
40
|
-
"packages/core/src/declarable.ts",
|
|
41
|
-
"packages/core/src/effect-receipt.ts",
|
|
42
34
|
// The exit-code table (#4553): no imports.
|
|
43
35
|
"packages/core/src/exit-codes.ts",
|
|
44
|
-
"packages/core/src/gated-waves.ts",
|
|
45
|
-
"packages/core/src/intrinsic.ts",
|
|
46
|
-
"packages/core/src/lifecycle/plan-digest.ts",
|
|
47
36
|
"packages/core/src/lifecycle/teardown.ts",
|
|
48
37
|
"packages/core/src/live-endpoint.ts",
|
|
49
38
|
"packages/core/src/observation.ts",
|
|
50
39
|
"packages/core/src/op/activity-runtime.ts",
|
|
51
40
|
"packages/core/src/op/emulator-lifecycle.ts",
|
|
52
|
-
"packages/core/src/plan-summary.ts",
|
|
53
|
-
"packages/core/src/pr-loop.ts",
|
|
54
|
-
"packages/core/src/pr-migrations.ts",
|
|
55
|
-
// The pull request's requires checks (#4607): type imports only.
|
|
56
|
-
"packages/core/src/pr-requires.ts",
|
|
57
|
-
// The Pulumi URN rule (#4548, the may-appear rows): no imports.
|
|
58
|
-
"packages/core/src/pulumi-urn.ts",
|
|
59
|
-
// The next-release floor constant (#4480): no imports.
|
|
60
|
-
"packages/core/src/release-floors.ts",
|
|
61
41
|
]);
|
|
62
42
|
expect(inputs.some((i) => /node_modules\/(ajv|js-yaml)\//.test(i) || i.endsWith("/op/gate.ts") || i.endsWith("/src/config.ts") || i.endsWith("/ts-loader.ts"))).toBe(false);
|
|
63
43
|
expect(result.outputFiles.reduce((n, f) => n + f.contents.byteLength, 0)).toBeLessThan(40 * 1024);
|
|
@@ -56,7 +56,7 @@ export const PR_ENV_LEDGER_DIR = "_pr-envs";
|
|
|
56
56
|
export const PR_ENV_LEDGER_FILE = "records.jsonl";
|
|
57
57
|
|
|
58
58
|
/** Where `pr-env` writes its report and note unless `--output` says. */
|
|
59
|
-
export { PR_ENV_REPORT_DIR } from "
|
|
59
|
+
export { PR_ENV_REPORT_DIR } from "../ci-jobs";
|
|
60
60
|
|
|
61
61
|
/** The file `pr-env up --no-push` writes its record to under `--output`, for `pr-env post` (#4295). */
|
|
62
62
|
export const PR_ENV_RECORD_FILE = "pr-env-record.json";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pull request loop's runners, variables, passed secrets and plan
|
|
3
|
+
* parallelism (#4625), in the job descriptors and through
|
|
4
|
+
* productPipelineJobs. Written for the ci-products post-merge pass.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { describe, expect, test } from "vitest";
|
|
8
|
+
import { prLoopJobs, prLoopJobStage, prLoopPassedEnv, prLoopRunner, prCommentPreviewJob } from "./pr-pipeline";
|
|
9
|
+
import { productPipelineJobs } from "./product-pipeline";
|
|
10
|
+
import { PLYWOOD } from "../__fixtures__/product-words";
|
|
11
|
+
import type { OpWavesSpec } from "../op/op-waves";
|
|
12
|
+
|
|
13
|
+
describe("runners by stage (#4625)", () => {
|
|
14
|
+
test("a stage's own runner, else the default", () => {
|
|
15
|
+
const runners = { plan: "big", default: ["self-hosted", "small"] };
|
|
16
|
+
expect(prLoopRunner({ runners }, "plan")).toBe("big");
|
|
17
|
+
expect(prLoopRunner({ runners }, "apply")).toEqual(["self-hosted", "small"]);
|
|
18
|
+
expect(prLoopRunner({}, "plan")).toBeUndefined();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test("the plan, apply and record descriptors carry their stage's runner", () => {
|
|
22
|
+
const [plan, apply, record] = prLoopJobs("github", "prod", { runners: { plan: "p", apply: "a" }, applyOnMerge: true });
|
|
23
|
+
expect(plan!.runner).toBe("p");
|
|
24
|
+
expect(apply!.runner).toBe("a");
|
|
25
|
+
expect(record!.runner).toBe("a");
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test("job names map onto stages, a member's prefix taken off", () => {
|
|
29
|
+
expect(prLoopJobStage("plan")).toBe("plan");
|
|
30
|
+
expect(prLoopJobStage("comment-preview")).toBe("plan");
|
|
31
|
+
expect(prLoopJobStage("apply-wave-2")).toBe("apply");
|
|
32
|
+
expect(prLoopJobStage("shop-record", "shop")).toBe("apply");
|
|
33
|
+
expect(prLoopJobStage("plan-note")).toBe("default");
|
|
34
|
+
expect(prLoopJobStage("comment-lock")).toBe("default");
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe("variables and passed secrets (#4625)", () => {
|
|
39
|
+
test("GitHub maps a secret from secrets.<name>; GitLab only when the names differ", () => {
|
|
40
|
+
expect(prLoopPassedEnv("github", { variables: { REGION: "eu" }, secrets: { DB_PASSWORD: "PROD_DB" } })).toEqual({ REGION: "eu", DB_PASSWORD: "${{ secrets.PROD_DB }}" });
|
|
41
|
+
expect(prLoopPassedEnv("gitlab", { secrets: { DB_PASSWORD: "PROD_DB", SAME: "SAME" } })).toEqual({ DB_PASSWORD: "$PROD_DB" });
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test("a forge token or a name the jobs set is refused", () => {
|
|
45
|
+
expect(() => prLoopPassedEnv("github", { secrets: { GITHUB_TOKEN: "PAT" } })).toThrow(/drops the forge tokens/);
|
|
46
|
+
expect(() => prLoopPassedEnv("github", { variables: { BASE_SHA: "x" } })).toThrow(/set or drop themselves/);
|
|
47
|
+
expect(() => prLoopPassedEnv("github", { variables: { "not a name": "x" } })).toThrow(/not a variable name/);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test("they reach the plan and the apply, and the plan still holds no forge token", () => {
|
|
51
|
+
const [plan, apply] = prLoopJobs("github", "prod", { variables: { REGION: "eu" }, secrets: { DB_PASSWORD: "PROD_DB" }, applyOnMerge: true });
|
|
52
|
+
expect(plan!.env).toMatchObject({ REGION: "eu", DB_PASSWORD: "${{ secrets.PROD_DB }}" });
|
|
53
|
+
expect(plan!.env).not.toHaveProperty("GITHUB_TOKEN");
|
|
54
|
+
expect(plan!.run.env).not.toHaveProperty("GITHUB_TOKEN");
|
|
55
|
+
expect(apply!.env).toMatchObject({ REGION: "eu", DB_PASSWORD: "${{ secrets.PROD_DB }}", GITHUB_TOKEN: "${{ github.token }}" });
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("the comment preview's plan gets them too", () => {
|
|
59
|
+
const preview = prCommentPreviewJob("github", "prod", { previewComment: true, variables: { REGION: "eu" }, words: PLYWOOD });
|
|
60
|
+
expect(preview!.plan.env).toMatchObject({ REGION: "eu" });
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe("parallelism (#4625)", () => {
|
|
65
|
+
test("the plan runs pr-plan --parallelism, and ci run passes it on", () => {
|
|
66
|
+
const [plan] = prLoopJobs("github", "prod", { parallelism: 4 });
|
|
67
|
+
expect(plan!.command).toContain("--parallelism 4");
|
|
68
|
+
expect(plan!.run.command).toContain("--parallelism 4");
|
|
69
|
+
expect(() => prLoopJobs("github", "prod", { parallelism: 0 })).toThrow(/whole number/);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test("productPipelineJobs puts the apply runner and the parallelism on a step spec that names neither", () => {
|
|
73
|
+
const waves: OpWavesSpec = { name: "up", op: "pulumi-up", step: { kind: "pulumi-up", stack: "{target}" }, waves: [{ name: "dev", runs: [{ target: "dev" }] }] };
|
|
74
|
+
const jobs = productPipelineJobs("github", "prod", { words: PLYWOOD, waves, locks: "plan", runners: { apply: "deployer", default: "small" }, parallelism: 3 });
|
|
75
|
+
expect(jobs.waves!.spec).toMatchObject({ runner: "deployer", parallelism: 3 });
|
|
76
|
+
expect(jobs.post.runner).toBe("small");
|
|
77
|
+
const own = productPipelineJobs("github", "prod", { words: PLYWOOD, waves: { ...waves, runner: "mine", parallelism: 1 }, locks: "plan", runners: { apply: "deployer" }, parallelism: 3 });
|
|
78
|
+
expect(own.waves!.spec).toMatchObject({ runner: "mine", parallelism: 1 });
|
|
79
|
+
});
|
|
80
|
+
});
|