@intentius/chant 0.124.87 → 0.124.89
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/action-pins.d.ts +1 -0
- package/dist/action-pins.d.ts.map +1 -1
- package/dist/action-pins.js +2 -0
- package/dist/actor.d.ts +47 -0
- package/dist/actor.d.ts.map +1 -0
- package/dist/actor.js +56 -0
- package/dist/bundle-check.d.ts +20 -5
- package/dist/bundle-check.d.ts.map +1 -1
- package/dist/bundle-check.js +20 -5
- package/dist/chant-install.d.ts +98 -0
- package/dist/chant-install.d.ts.map +1 -1
- package/dist/chant-install.js +203 -2
- package/dist/ci-base.d.ts +30 -0
- package/dist/ci-base.d.ts.map +1 -0
- package/dist/ci-base.js +33 -0
- package/dist/ci-comment-commands.d.ts +177 -0
- package/dist/ci-comment-commands.d.ts.map +1 -0
- package/dist/ci-comment-commands.js +325 -0
- package/dist/ci-comment-replies.d.ts +40 -0
- package/dist/ci-comment-replies.d.ts.map +1 -0
- package/dist/ci-comment-replies.js +59 -0
- package/dist/ci-commit.d.ts +1 -1
- package/dist/ci-commit.d.ts.map +1 -1
- package/dist/ci-commit.js +1 -2
- package/dist/ci-control.d.ts +1 -1
- package/dist/ci-control.d.ts.map +1 -1
- package/dist/ci-control.js +1 -1
- package/dist/ci-evidence-claims.d.ts +59 -0
- package/dist/ci-evidence-claims.d.ts.map +1 -0
- package/dist/ci-evidence-claims.js +87 -0
- package/dist/ci-evidence-from-job.d.ts +128 -0
- package/dist/ci-evidence-from-job.d.ts.map +1 -0
- package/dist/ci-evidence-from-job.js +203 -0
- package/dist/ci-evidence-jobs.d.ts +68 -4
- package/dist/ci-evidence-jobs.d.ts.map +1 -1
- package/dist/ci-evidence-jobs.js +82 -5
- package/dist/ci-handover.d.ts +12 -0
- package/dist/ci-handover.d.ts.map +1 -1
- package/dist/ci-handover.js +15 -3
- package/dist/ci-identity.d.ts +32 -6
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +40 -8
- package/dist/ci-image.d.ts +65 -10
- package/dist/ci-image.d.ts.map +1 -1
- package/dist/ci-image.js +101 -22
- package/dist/ci-jobs.d.ts +1 -1
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +7 -2
- package/dist/ci-login.d.ts +75 -13
- package/dist/ci-login.d.ts.map +1 -1
- package/dist/ci-login.js +89 -37
- package/dist/ci-note-commands.d.ts +63 -3
- package/dist/ci-note-commands.d.ts.map +1 -1
- package/dist/ci-note-commands.js +69 -35
- package/dist/ci-product-words.d.ts +62 -1
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +52 -1
- package/dist/ci-product.d.ts +52 -2
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +51 -2
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +29 -2
- package/dist/cli/handlers/approve-confirm.d.ts +14 -0
- package/dist/cli/handlers/approve-confirm.d.ts.map +1 -1
- package/dist/cli/handlers/approve-confirm.js +46 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +2 -1
- package/dist/cli/handlers/build.d.ts +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +22 -1
- package/dist/cli/handlers/ci-check.d.ts +1 -1
- package/dist/cli/handlers/ci-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-check.js +37 -7
- package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
- package/dist/cli/handlers/ci-evidence.js +255 -20
- package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-forge-check.js +34 -17
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/components.js +3 -1
- package/dist/cli/handlers/generated-check.d.ts +11 -0
- package/dist/cli/handlers/generated-check.d.ts.map +1 -0
- package/dist/cli/handlers/generated-check.js +71 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +3 -0
- package/dist/cli/handlers/local-chant.d.ts +13 -0
- package/dist/cli/handlers/local-chant.d.ts.map +1 -1
- package/dist/cli/handlers/local-chant.js +42 -1
- package/dist/cli/handlers/lock.d.ts.map +1 -1
- package/dist/cli/handlers/lock.js +121 -4
- package/dist/cli/handlers/pr-comment.d.ts +21 -0
- package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
- package/dist/cli/handlers/pr-comment.js +112 -0
- package/dist/cli/handlers/pr-env.d.ts.map +1 -1
- package/dist/cli/handlers/pr-env.js +6 -3
- package/dist/cli/handlers/pr.d.ts +23 -1
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +97 -14
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +2 -1
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +11 -2
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +36 -2
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +2 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +60 -4
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +82 -0
- package/dist/cli/registry.d.ts +35 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +2 -1
- package/dist/components/check-hooks.d.ts +10 -0
- package/dist/components/check-hooks.d.ts.map +1 -1
- package/dist/components/check-hooks.js +18 -0
- package/dist/components/pr-checks.d.ts +169 -0
- package/dist/components/pr-checks.d.ts.map +1 -0
- package/dist/components/pr-checks.js +180 -0
- package/dist/components/pr-pipeline.d.ts +38 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +6 -1
- package/dist/components/product-pipeline.d.ts +58 -2
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +76 -9
- package/dist/components/product-plan.d.ts +445 -7
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +426 -15
- package/dist/config.d.ts +10 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -6
- package/dist/control/consumers.d.ts +6 -0
- package/dist/control/consumers.d.ts.map +1 -1
- package/dist/control/consumers.js +6 -0
- package/dist/dead-guards.d.ts.map +1 -1
- package/dist/dead-guards.js +9 -6
- package/dist/discovery/files.d.ts +1 -1
- package/dist/discovery/files.js +1 -1
- package/dist/drift-issue.d.ts +20 -3
- package/dist/drift-issue.d.ts.map +1 -1
- package/dist/drift-issue.js +16 -0
- package/dist/drift-record.d.ts +52 -5
- package/dist/drift-record.d.ts.map +1 -1
- package/dist/drift-record.js +46 -6
- package/dist/floor-table.d.ts +6 -6
- package/dist/floor-table.d.ts.map +1 -1
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +81 -21
- package/dist/floor-table.js +10 -7
- package/dist/forge-check/contract.d.ts +19 -1
- package/dist/forge-check/contract.d.ts.map +1 -1
- package/dist/forge-check/contract.js +8 -2
- package/dist/forge-check/index.d.ts +4 -0
- package/dist/forge-check/index.d.ts.map +1 -1
- package/dist/forge-check/index.js +4 -0
- package/dist/forge-flags.d.ts +10 -0
- package/dist/forge-flags.d.ts.map +1 -1
- package/dist/forge-flags.js +31 -0
- package/dist/forge-remote.d.ts +47 -0
- package/dist/forge-remote.d.ts.map +1 -0
- package/dist/forge-remote.js +69 -0
- package/dist/gate-resume-run.d.ts +9 -1
- package/dist/gate-resume-run.d.ts.map +1 -1
- package/dist/gate-resume-run.js +26 -3
- package/dist/generated-check.d.ts +88 -0
- package/dist/generated-check.d.ts.map +1 -0
- package/dist/generated-check.js +248 -0
- package/dist/image-pins.d.ts +26 -0
- package/dist/image-pins.d.ts.map +1 -0
- package/dist/image-pins.js +19 -0
- package/dist/lexicon.d.ts +27 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +11 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +30 -3
- package/dist/lifecycle/publish-npm.d.ts +26 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +76 -4
- package/dist/lifecycle/reach-locks.d.ts +131 -0
- package/dist/lifecycle/reach-locks.d.ts.map +1 -0
- package/dist/lifecycle/reach-locks.js +118 -0
- package/dist/lifecycle/release-cut.d.ts +3 -1
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +15 -0
- package/dist/lifecycle/release-images.d.ts +22 -1
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +26 -3
- package/dist/lifecycle/release-ledger.d.ts +4 -3
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +3 -2
- package/dist/local-chant.d.ts +57 -3
- package/dist/local-chant.d.ts.map +1 -1
- package/dist/local-chant.js +122 -13
- package/dist/notify-product.d.ts +12 -3
- package/dist/notify-product.d.ts.map +1 -1
- package/dist/notify-product.js +10 -6
- package/dist/op/activities/source-release.d.ts.map +1 -1
- package/dist/op/activities/source-release.js +2 -1
- package/dist/op/activities/source-rollback.d.ts.map +1 -1
- package/dist/op/activities/source-rollback.js +2 -1
- package/dist/op/index.d.ts +2 -0
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -0
- package/dist/op/op-waves-evidence-jobs.d.ts +97 -0
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -0
- package/dist/op/op-waves-evidence-jobs.js +118 -0
- package/dist/op/op-waves-evidence.d.ts +12 -1
- package/dist/op/op-waves-evidence.d.ts.map +1 -1
- package/dist/op/op-waves-evidence.js +23 -2
- package/dist/op/op-waves-render-spec.d.ts +100 -0
- package/dist/op/op-waves-render-spec.d.ts.map +1 -0
- package/dist/op/op-waves-render-spec.js +162 -0
- package/dist/op/op-waves-run.d.ts +14 -1
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +56 -4
- package/dist/op/op-waves.d.ts +12 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +14 -1
- package/dist/op/schedule-overdue.d.ts +39 -2
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +148 -10
- package/dist/op/wave-stop.d.ts +64 -0
- package/dist/op/wave-stop.d.ts.map +1 -0
- package/dist/op/wave-stop.js +127 -0
- package/dist/planned-files.d.ts +76 -0
- package/dist/planned-files.d.ts.map +1 -0
- package/dist/planned-files.js +108 -0
- package/dist/pr-forge-job.d.ts +22 -0
- package/dist/pr-forge-job.d.ts.map +1 -0
- package/dist/pr-forge-job.js +46 -0
- package/dist/pr-forge-reads.d.ts +21 -1
- package/dist/pr-forge-reads.d.ts.map +1 -1
- package/dist/pr-forge-reads.js +19 -1
- package/dist/pr-forge.d.ts +7 -1
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +7 -2
- package/dist/pr-loop.d.ts +3 -6
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +4 -81
- package/dist/pr-plan-note.d.ts +121 -0
- package/dist/pr-plan-note.d.ts.map +1 -1
- package/dist/pr-plan-note.js +104 -1
- package/dist/pr-plan-record.d.ts +47 -0
- package/dist/pr-plan-record.d.ts.map +1 -0
- package/dist/pr-plan-record.js +89 -0
- package/dist/pr-post.d.ts +68 -3
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +218 -13
- package/dist/pr-requires.d.ts +8 -0
- package/dist/pr-requires.d.ts.map +1 -1
- package/dist/pr-requires.js +3 -1
- package/dist/pr-status.d.ts +16 -0
- package/dist/pr-status.d.ts.map +1 -0
- package/dist/pr-status.js +90 -0
- package/dist/ref-gate-init.d.ts +90 -0
- package/dist/ref-gate-init.d.ts.map +1 -0
- package/dist/ref-gate-init.js +155 -0
- package/dist/ref-gate-rules.d.ts +19 -0
- package/dist/ref-gate-rules.d.ts.map +1 -0
- package/dist/ref-gate-rules.js +17 -0
- package/dist/release-floors.d.ts +100 -16
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +101 -17
- package/dist/render-module.d.ts +15 -0
- package/dist/render-module.d.ts.map +1 -0
- package/dist/render-module.js +73 -0
- package/dist/state-migration.d.ts +24 -1
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +39 -4
- package/dist/state-unlock.d.ts +32 -1
- package/dist/state-unlock.d.ts.map +1 -1
- package/dist/state-unlock.js +31 -0
- package/dist/wave-runtime.mjs +307 -297
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +15 -8
- package/dist/workspace/drift-cli.d.ts +1 -1
- package/dist/workspace/drift-cli.d.ts.map +1 -1
- package/dist/workspace/drift-cli.js +5 -12
- package/dist/workspace/forge-work.d.ts +3 -2
- package/dist/workspace/forge-work.d.ts.map +1 -1
- package/dist/workspace/forge-work.js +7 -17
- package/dist/workspace/lexicon-outputs.js +2 -2
- package/dist/workspace/release-train.d.ts.map +1 -1
- package/dist/workspace/release-train.js +2 -1
- package/dist/workspace/release-workflow.d.ts +27 -3
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +52 -7
- package/dist/workspace/trust/check-evidence-report.d.ts +25 -2
- package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence-report.js +28 -8
- package/dist/workspace/trust/check-evidence.d.ts +13 -1
- package/dist/workspace/trust/check-evidence.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence.js +8 -3
- package/dist/workspace/trust/evidence.d.ts +5 -0
- package/dist/workspace/trust/evidence.d.ts.map +1 -1
- package/dist/workspace/trust/evidence.js +5 -0
- package/dist/workspace/trust/open-evidence.d.ts +67 -0
- package/dist/workspace/trust/open-evidence.d.ts.map +1 -0
- package/dist/workspace/trust/open-evidence.js +92 -0
- package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
- package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate-cli.js +93 -11
- package/dist/workspace/trust/ref-gate.d.ts +61 -2
- package/dist/workspace/trust/ref-gate.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate.js +72 -7
- package/dist/workspace/workspace-run.d.ts.map +1 -1
- package/dist/workspace/workspace-run.js +2 -1
- package/package.json +1 -1
- package/src/action-pins.ts +2 -0
- package/src/actor.test.ts +78 -0
- package/src/actor.ts +79 -0
- package/src/bundle-check.test.ts +22 -0
- package/src/bundle-check.ts +33 -5
- package/src/chant-install.test.ts +108 -1
- package/src/chant-install.ts +242 -2
- package/src/ci-base.test.ts +41 -0
- package/src/ci-base.ts +43 -0
- package/src/ci-comment-commands.test.ts +376 -0
- package/src/ci-comment-commands.ts +389 -0
- package/src/ci-comment-replies.ts +78 -0
- package/src/ci-commit.test.ts +51 -6
- package/src/ci-commit.ts +1 -2
- package/src/ci-control.ts +1 -0
- package/src/ci-evidence-claims.ts +102 -0
- package/src/ci-evidence-from-job.test.ts +165 -0
- package/src/ci-evidence-from-job.ts +251 -0
- package/src/ci-evidence-jobs.ts +88 -6
- package/src/ci-handover.ts +16 -3
- package/src/ci-identity.test.ts +3 -3
- package/src/ci-identity.ts +51 -11
- package/src/ci-image.test.ts +187 -16
- package/src/ci-image.ts +157 -25
- package/src/ci-jobs.ts +7 -2
- package/src/ci-login.test.ts +131 -3
- package/src/ci-login.token-drop.test.ts +204 -0
- package/src/ci-login.ts +137 -39
- package/src/ci-note-commands.ts +104 -41
- package/src/ci-product-words.ts +89 -0
- package/src/ci-product.ts +62 -1
- package/src/cli/commands/__fixtures__/source-dir-root/migrations/0001-init/backfill.ts +3 -0
- package/src/cli/commands/build.test.ts +41 -0
- package/src/cli/commands/build.ts +27 -2
- package/src/cli/handlers/approve-confirm.test.ts +35 -0
- package/src/cli/handlers/approve-confirm.ts +44 -0
- package/src/cli/handlers/approve.ts +2 -1
- package/src/cli/handlers/build-source-dir.test.ts +4 -0
- package/src/cli/handlers/build.ts +20 -2
- package/src/cli/handlers/ci-check.ts +37 -7
- package/src/cli/handlers/ci-evidence-open.test.ts +164 -0
- package/src/cli/handlers/ci-evidence.ts +233 -18
- package/src/cli/handlers/ci-forge-check.ts +22 -9
- package/src/cli/handlers/components.ts +3 -1
- package/src/cli/handlers/generated-check.ts +69 -0
- package/src/cli/handlers/lifecycle.test.ts +20 -0
- package/src/cli/handlers/lifecycle.ts +4 -0
- package/src/cli/handlers/local-chant.ts +39 -1
- package/src/cli/handlers/lock-reach.test.ts +103 -0
- package/src/cli/handlers/lock.ts +100 -4
- package/src/cli/handlers/pr-comment.ts +104 -0
- package/src/cli/handlers/pr-env.ts +6 -3
- package/src/cli/handlers/pr-record.test.ts +1 -1
- package/src/cli/handlers/pr.ts +93 -15
- package/src/cli/handlers/promote.ts +2 -1
- package/src/cli/handlers/release.e2e.test.ts +35 -0
- package/src/cli/handlers/release.ts +14 -2
- package/src/cli/handlers/run-wave.ts +35 -2
- package/src/cli/handlers/run.ts +2 -1
- package/src/cli/main.ts +60 -4
- package/src/cli/parse-args.ts +58 -0
- package/src/cli/registry.ts +35 -0
- package/src/components/auto-release.ts +2 -1
- package/src/components/check-hooks.ts +22 -0
- package/src/components/check-report-summary.test.ts +78 -0
- package/src/components/pr-checks.ts +254 -0
- package/src/components/pr-pipeline.ts +43 -1
- package/src/components/product-pipeline.ts +113 -9
- package/src/components/product-plan.test.ts +140 -1
- package/src/components/product-plan.ts +707 -20
- package/src/config.ts +13 -8
- package/src/control/consumers.ts +7 -0
- package/src/dead-guards.test.ts +27 -5
- package/src/dead-guards.ts +9 -6
- package/src/discovery/files.ts +1 -1
- package/src/drift-issue.test.ts +29 -1
- package/src/drift-issue.ts +28 -3
- package/src/drift-record.test.ts +45 -0
- package/src/drift-record.ts +71 -6
- package/src/floor-table.data.ts +81 -21
- package/src/floor-table.ts +12 -9
- package/src/forge-check/contract.ts +23 -2
- package/src/forge-check/forge-check.test.ts +25 -0
- package/src/forge-check/index.ts +4 -0
- package/src/forge-flags.test.ts +25 -1
- package/src/forge-flags.ts +34 -0
- package/src/forge-remote.test.ts +37 -0
- package/src/forge-remote.ts +79 -0
- package/src/gate-resume-run.ts +27 -3
- package/src/generated-check.e2e.test.ts +118 -0
- package/src/generated-check.test.ts +170 -0
- package/src/generated-check.ts +310 -0
- package/src/image-pins.ts +31 -0
- package/src/lexicon.ts +28 -0
- package/src/lifecycle/git.test.ts +48 -0
- package/src/lifecycle/git.ts +27 -4
- package/src/lifecycle/publish-npm.ts +87 -4
- package/src/lifecycle/reach-locks.test.ts +87 -0
- package/src/lifecycle/reach-locks.ts +169 -0
- package/src/lifecycle/release-catalog.test.ts +2 -2
- package/src/lifecycle/release-cut.ts +17 -1
- package/src/lifecycle/release-images-dockerfile.test.ts +20 -0
- package/src/lifecycle/release-images.test.ts +100 -0
- package/src/lifecycle/release-images.ts +38 -3
- package/src/lifecycle/release-ledger.ts +4 -3
- package/src/local-chant.e2e.test.ts +81 -6
- package/src/local-chant.test.ts +22 -3
- package/src/local-chant.ts +130 -13
- package/src/notify-product.ts +19 -8
- package/src/op/activities/source-release.ts +2 -1
- package/src/op/activities/source-rollback.ts +2 -1
- package/src/op/gate-resume.test.ts +27 -0
- package/src/op/index.ts +10 -0
- package/src/op/op-waves-evidence-jobs.ts +140 -0
- package/src/op/op-waves-evidence.test.ts +36 -3
- package/src/op/op-waves-evidence.ts +23 -3
- package/src/op/op-waves-notify-words.test.ts +18 -0
- package/src/op/op-waves-render-spec.test.ts +160 -0
- package/src/op/op-waves-render-spec.ts +171 -0
- package/src/op/op-waves-run.ts +59 -3
- package/src/op/op-waves.ts +16 -2
- package/src/op/schedule-overdue.test.ts +126 -1
- package/src/op/schedule-overdue.ts +164 -12
- package/src/op/wave-stop.test.ts +72 -0
- package/src/op/wave-stop.ts +137 -0
- package/src/planned-files.test.ts +80 -0
- package/src/planned-files.ts +134 -0
- package/src/pr-forge-job.test.ts +53 -0
- package/src/pr-forge-job.ts +46 -0
- package/src/pr-forge-reads-compare.test.ts +2 -1
- package/src/pr-forge-reads.ts +37 -1
- package/src/pr-forge.ts +14 -3
- package/src/pr-loop-narrowed.test.ts +2 -1
- package/src/pr-loop-words.test.ts +2 -1
- package/src/pr-loop.test.ts +1 -2
- package/src/pr-loop.ts +4 -80
- package/src/pr-plan-note.ts +184 -3
- package/src/pr-plan-record.test.ts +75 -0
- package/src/pr-plan-record.ts +101 -0
- package/src/pr-post-plan-note.test.ts +60 -0
- package/src/pr-post-replan.test.ts +144 -0
- package/src/pr-post-subject.test.ts +230 -0
- package/src/pr-post.test.ts +32 -1
- package/src/pr-post.ts +254 -15
- package/src/pr-requires.test.ts +20 -0
- package/src/pr-requires.ts +10 -1
- package/src/pr-status.ts +91 -0
- package/src/ref-gate-init.ts +208 -0
- package/src/ref-gate-rules.ts +26 -0
- package/src/release-floors.ts +139 -17
- package/src/render-module.ts +73 -0
- package/src/state-migration-record.test.ts +89 -0
- package/src/state-migration.test.ts +1 -1
- package/src/state-migration.ts +52 -4
- package/src/state-unlock.test.ts +33 -1
- package/src/state-unlock.ts +49 -1
- package/src/workspace/ci-green-cli.ts +14 -7
- package/src/workspace/ci-green-workflow.test.ts +32 -1
- package/src/workspace/drift-cli.ts +6 -18
- package/src/workspace/forge-work.ts +7 -14
- package/src/workspace/lexicon-outputs.ts +2 -2
- package/src/workspace/release-train.ts +2 -1
- package/src/workspace/release-workflow.test.ts +104 -3
- package/src/workspace/release-workflow.ts +60 -9
- package/src/workspace/trust/check-evidence-report.ts +39 -8
- package/src/workspace/trust/check-evidence.test.ts +5 -0
- package/src/workspace/trust/check-evidence.ts +17 -5
- package/src/workspace/trust/evidence.ts +5 -0
- package/src/workspace/trust/open-evidence.ts +129 -0
- package/src/workspace/trust/ref-gate-cli.ts +88 -10
- package/src/workspace/trust/ref-gate-pieces.test.ts +220 -0
- package/src/workspace/trust/ref-gate.e2e.test.ts +17 -0
- package/src/workspace/trust/ref-gate.test.ts +10 -0
- package/src/workspace/trust/ref-gate.ts +87 -6
- package/src/workspace/workspace-run.ts +2 -1
package/src/cli/parse-args.ts
CHANGED
|
@@ -21,7 +21,10 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
21
21
|
"--help",
|
|
22
22
|
"--open",
|
|
23
23
|
"--note-commands",
|
|
24
|
+
"--check-job",
|
|
25
|
+
"--ref-gate-status",
|
|
24
26
|
"--locks",
|
|
27
|
+
"--reach",
|
|
25
28
|
"--version",
|
|
26
29
|
"--agents",
|
|
27
30
|
"--agent",
|
|
@@ -80,6 +83,7 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
80
83
|
"--require-runner-start",
|
|
81
84
|
"--require-clouds",
|
|
82
85
|
"--no-push",
|
|
86
|
+
"--no-forks",
|
|
83
87
|
"--list",
|
|
84
88
|
"--no-require-review",
|
|
85
89
|
"--expire",
|
|
@@ -102,6 +106,8 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
102
106
|
"--root-only",
|
|
103
107
|
"--generated",
|
|
104
108
|
"--decide",
|
|
109
|
+
"--policy-only",
|
|
110
|
+
"--render-spec",
|
|
105
111
|
"--record-plans",
|
|
106
112
|
"--approval-status",
|
|
107
113
|
"--waves-outcome",
|
|
@@ -425,6 +431,9 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
425
431
|
} else if (arg === "--keep") {
|
|
426
432
|
// `chant lock --keep --pr <n>` (#4588): keep the locks the pull request's plan took, as `/<product> lock` asks.
|
|
427
433
|
result.keepLocks = true;
|
|
434
|
+
} else if (arg === "--reach") {
|
|
435
|
+
// `chant lock --reach --pr <n> --head <sha> --base <sha>` (#4979): lock what the reach line in CHANT_LOCK_REACH prints.
|
|
436
|
+
result.lockReach = true;
|
|
428
437
|
} else if (arg === "--runs" || arg === "--plans" || arg === "--wave-outputs") {
|
|
429
438
|
// `chant components plan-wave|apply-wave` (#4588): the op-waves runs and plans files, and the outputs the waves hand on.
|
|
430
439
|
const value = args[++i];
|
|
@@ -483,6 +492,12 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
483
492
|
result.wave = wave;
|
|
484
493
|
} else if (arg === "--decide") {
|
|
485
494
|
result.decide = true;
|
|
495
|
+
} else if (arg === "--policy-only") {
|
|
496
|
+
// `chant run wave --policy-only` (#4926): plan the wave and run its policy hold, as a step of its own.
|
|
497
|
+
result.policyOnly = true;
|
|
498
|
+
} else if (arg === "--render-spec") {
|
|
499
|
+
// `chant run wave --render-spec` (#4982): the product's command prints the spec at base.
|
|
500
|
+
result.renderSpec = true;
|
|
486
501
|
} else if (arg === "--record-plans") {
|
|
487
502
|
result.recordPlans = true;
|
|
488
503
|
} else if (arg === "--approval-status") {
|
|
@@ -570,6 +585,12 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
570
585
|
// `chant lock --from-report <pr-plan.json>` (#4293): lock the components a pull-request report lists.
|
|
571
586
|
result.fromReport = args[++i];
|
|
572
587
|
if (!result.fromReport || result.fromReport.startsWith("-")) throw new Error("--from-report needs a report file: --from-report <pr-plan.json>");
|
|
588
|
+
} else if (arg === "--from-job" || arg === "--claims") {
|
|
589
|
+
// `chant ci evidence sign --from-job <job> [--claims <dir>]` (#4926): sign from another job's step results.
|
|
590
|
+
const value = args[++i];
|
|
591
|
+
if (value === undefined || value.startsWith("-")) throw new Error(arg === "--from-job" ? "--from-job needs the job's name: --from-job <job>" : "--claims needs a directory: --claims <dir>");
|
|
592
|
+
if (arg === "--from-job") result.fromJob = value;
|
|
593
|
+
else result.claims = value;
|
|
573
594
|
} else if (arg === "--report-url") {
|
|
574
595
|
// `chant components pr-plan|pr-apply --report-url <url>` (#4007).
|
|
575
596
|
const url = args[++i];
|
|
@@ -579,6 +600,9 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
579
600
|
// `chant components pr-post --result <result>` (#4295): the plan job's own result, which fails the status when it failed.
|
|
580
601
|
result.planResult = args[++i];
|
|
581
602
|
if (!result.planResult || result.planResult.startsWith("-")) throw new Error("--result needs the plan job's result: --result success|failure|cancelled");
|
|
603
|
+
} else if (arg === "--no-forks") {
|
|
604
|
+
// `chant ci evidence sign --open --no-forks` (#4914): sign for no merge request from a fork.
|
|
605
|
+
result.noForks = true;
|
|
582
606
|
} else if (arg === "--no-status") {
|
|
583
607
|
// `chant ci run|serve --no-status` (#4097): post no commit status for the job.
|
|
584
608
|
result.noStatus = true;
|
|
@@ -926,6 +950,40 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
926
950
|
} else if (arg === "--note-commands") {
|
|
927
951
|
// `chant build --pr-loop --note-commands` (#4785).
|
|
928
952
|
result.noteCommands = true;
|
|
953
|
+
} else if (arg === "--check-job") {
|
|
954
|
+
// `chant build --pr-loop --check-job` (#4935): the check job, chant ci check on the pull request's commit.
|
|
955
|
+
result.checkJob = true;
|
|
956
|
+
} else if (arg === "--ref-gate-status") {
|
|
957
|
+
// `chant build --pr-loop --ref-gate-status` (#4935): the job that sets the ref gate's status; on `ci forge-check` (#4913), require it.
|
|
958
|
+
result.refGateStatus = true;
|
|
959
|
+
} else if (arg === "--evidence-runner-key-secret") {
|
|
960
|
+
// `chant build --pr-loop --evidence-runner-key-secret <NAME>` (#4935): the secret holding the runner key the note job signs with.
|
|
961
|
+
result.evidenceRunnerKeySecret = args[++i];
|
|
962
|
+
if (!result.evidenceRunnerKeySecret || result.evidenceRunnerKeySecret.startsWith("-")) throw new Error("--evidence-runner-key-secret needs the secret holding the runner key: --evidence-runner-key-secret <NAME>");
|
|
963
|
+
} else if (arg === "--evidence-identity") {
|
|
964
|
+
// `chant build --pr-loop --evidence-identity oidc` (#4935, #4869): sign keyless from the job's OIDC identity.
|
|
965
|
+
result.evidenceIdentity = args[++i];
|
|
966
|
+
if (result.evidenceIdentity !== "oidc") throw new Error(`--evidence-identity takes oidc, the one identity chant signs keyless with: got "${result.evidenceIdentity ?? ""}"`);
|
|
967
|
+
} else if (arg === "--evidence-audience") {
|
|
968
|
+
// `chant build --pr-loop --evidence-identity oidc --evidence-audience <aud>` (#4935, #4869).
|
|
969
|
+
result.evidenceAudience = args[++i];
|
|
970
|
+
if (!result.evidenceAudience || result.evidenceAudience.startsWith("-")) throw new Error("--evidence-audience needs the OIDC token's audience: --evidence-audience <aud>");
|
|
971
|
+
} else if (arg === "--record-run") {
|
|
972
|
+
// `chant components pr-post --record-run <plan job>` (#4899): keep the product plan job's run record on chant/lifecycle.
|
|
973
|
+
result.recordRun = args[++i];
|
|
974
|
+
if (!result.recordRun || !/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(result.recordRun)) throw new Error(`--record-run needs the plan job's name: got "${result.recordRun ?? ""}"`);
|
|
975
|
+
} else if (arg === "--not-affected") {
|
|
976
|
+
// `chant components pr-post --not-affected <argument>` (#4963): the re-plan's argument, which may be empty; pr-post checks it.
|
|
977
|
+
if (i + 1 >= args.length) throw new Error('--not-affected needs the re-plan\'s argument, empty for none: --not-affected "$CHANT_PLAN_ARGUMENT"');
|
|
978
|
+
result.notAffected = args[++i];
|
|
979
|
+
} else if (arg === "--evidence-dir") {
|
|
980
|
+
// `chant components pr-post --open --evidence-dir <dir>` (#4914): each merge request's evidence.json, from the GitLab signing job.
|
|
981
|
+
result.evidenceDir = args[++i];
|
|
982
|
+
if (!result.evidenceDir || result.evidenceDir.startsWith("-")) throw new Error("--evidence-dir needs the directory the signing job kept: --evidence-dir .chant/evidence/plan");
|
|
983
|
+
} else if (arg === "--summary") {
|
|
984
|
+
// `chant ci check --summary <file>` (#4914): the check report's markdown section, appended to the file.
|
|
985
|
+
result.checkSummary = args[++i];
|
|
986
|
+
if (!result.checkSummary || result.checkSummary.startsWith("-")) throw new Error("--summary needs a file to append the check report's section to: --summary <file>");
|
|
929
987
|
} else if (arg === "--locks") {
|
|
930
988
|
// `chant components pr-notes --locks` (#4785).
|
|
931
989
|
result.locks = true;
|
package/src/cli/registry.ts
CHANGED
|
@@ -334,6 +334,10 @@ export interface ParsedArgs {
|
|
|
334
334
|
wave?: number;
|
|
335
335
|
/** `chant run wave --decide` (#3679) — plan a wide wave and decide its gate, applying nothing. */
|
|
336
336
|
decide?: boolean;
|
|
337
|
+
/** `chant run wave --policy-only` (#4926) — plan the wave and run its policy hold, applying nothing: the wave job's policy step. */
|
|
338
|
+
policyOnly?: boolean;
|
|
339
|
+
/** `chant run wave --render-spec` (#4982) — run the command `CHANT_WAVES_SPEC_COMMAND` names to print the spec at base, and run the wave on it. */
|
|
340
|
+
renderSpec?: boolean;
|
|
337
341
|
/** `chant run wave --record-plans` (#3684) — plan every wave at a pull request's head and record the digests for a `pr-review` gate. */
|
|
338
342
|
recordPlans?: boolean;
|
|
339
343
|
/** `chant run wave --approval-status` (#4630) — post `<product>/approval` on an open pull request's head under `pr-review` or `pull-request`. */
|
|
@@ -375,6 +379,10 @@ export interface ParsedArgs {
|
|
|
375
379
|
lockStage?: string;
|
|
376
380
|
/** `chant lock --from-report <file>` (#4293): lock the components a `pr-plan.json` lists. */
|
|
377
381
|
fromReport?: string;
|
|
382
|
+
/** `chant ci evidence sign --from-job <job>` (#4926): sign the checks whose steps in that job of this run passed. */
|
|
383
|
+
fromJob?: string;
|
|
384
|
+
/** `chant ci evidence sign --from-job <job> --claims <dir>` (#4926): the directory of the checks' claim files. */
|
|
385
|
+
claims?: string;
|
|
378
386
|
/** `chant lock --alive <run>` (#4552): print `alive` or `dead` for a run that holds rows or the repo lock tag. */
|
|
379
387
|
aliveRun?: string;
|
|
380
388
|
/** `chant lock --beat <run>` (#4660): the heartbeat side process of the rows a run holds. Not for people. */
|
|
@@ -589,6 +597,26 @@ export interface ParsedArgs {
|
|
|
589
597
|
staleNotes?: boolean;
|
|
590
598
|
/** `chant build --pr-loop --note-commands` (#4785): on GitLab, the scheduled job that answers the product's comment commands by polling merge request notes. */
|
|
591
599
|
noteCommands?: boolean;
|
|
600
|
+
/** `chant build --pr-loop --check-job` (#4935): the check job, `chant ci check` on the pull request's commit. */
|
|
601
|
+
checkJob?: boolean;
|
|
602
|
+
/** `chant build --pr-loop --ref-gate-status` (#4935): the job that runs `chant workspace ref-gate status` for the pull request's commit. `chant ci forge-check --ref-gate-status` (#4913): the default branch requires its status. */
|
|
603
|
+
refGateStatus?: boolean;
|
|
604
|
+
/** `chant build --pr-loop --evidence-runner-key-secret <NAME>` (#4935): the secret holding the runner key the note job signs `plan` and `policy` with. */
|
|
605
|
+
evidenceRunnerKeySecret?: string;
|
|
606
|
+
/** `chant build --pr-loop --evidence-identity oidc` (#4935, #4869): sign keyless from the job's OIDC identity. */
|
|
607
|
+
evidenceIdentity?: string;
|
|
608
|
+
/** `chant build --pr-loop --evidence-audience <aud>` (#4935, #4869): the keyless signing token's audience. */
|
|
609
|
+
evidenceAudience?: string;
|
|
610
|
+
/** `chant components pr-post --record-run <plan job>` (#4899): keep the product plan job's run record on chant/lifecycle. */
|
|
611
|
+
recordRun?: string;
|
|
612
|
+
/** `chant components pr-post --not-affected <argument>` (#4963): the argument a re-plan was narrowed to, which gets a "not affected" reply when the change reaches nothing. */
|
|
613
|
+
notAffected?: string;
|
|
614
|
+
/** `chant components pr-post --open --evidence-dir <dir>` (#4914): where the GitLab signing job kept each merge request's `evidence.json`, for the note's checks line. */
|
|
615
|
+
evidenceDir?: string;
|
|
616
|
+
/** `chant ci evidence sign --open --no-forks` (#4914): sign for no merge request from a fork. */
|
|
617
|
+
noForks?: boolean;
|
|
618
|
+
/** `chant ci check --summary <file>` (#4914): append the check report's markdown section to the file. */
|
|
619
|
+
checkSummary?: string;
|
|
592
620
|
/** `chant components pr-notes --locks` (#4785): the pipeline has the lock and unlock jobs, so a lock or unlock note starts them. */
|
|
593
621
|
locks?: boolean;
|
|
594
622
|
/** `chant components pr-post --stale` (#4628): mark the open pull requests' notes stale after the target branch moved. */
|
|
@@ -890,6 +918,13 @@ export interface ParsedArgs {
|
|
|
890
918
|
* until it closes or `chant unlock`. What `/<product> lock` runs.
|
|
891
919
|
*/
|
|
892
920
|
keepLocks?: boolean;
|
|
921
|
+
/**
|
|
922
|
+
* `chant lock --reach` (#4979): lock the targets the reach line in
|
|
923
|
+
* `CHANT_LOCK_REACH` prints for the change from `--base` to `--head`,
|
|
924
|
+
* after fetching the pull request's head; with `--open`, every open merge
|
|
925
|
+
* request's (GitLab's plan notes pipeline).
|
|
926
|
+
*/
|
|
927
|
+
lockReach?: boolean;
|
|
893
928
|
/** `chant components plan-wave|apply-wave --runs <file>` (#4588): the runs file `chant run wave` writes, `{runs}`. */
|
|
894
929
|
runsFile?: string;
|
|
895
930
|
/** `chant components plan-wave|apply-wave --plans <file>` (#4588): the wave's plans file, `{plans}`. */
|
|
@@ -30,6 +30,7 @@ import { appendReleaseRecord, InvalidReleaseRecordError, type ReleaseAdmission,
|
|
|
30
30
|
import { changeSetDigest } from "../change-set";
|
|
31
31
|
import type { DriverComponent, DriverStepRecord } from "./driver";
|
|
32
32
|
import { componentInputDigests } from "./fan-out-inputs";
|
|
33
|
+
import { actorFromEnv } from "../actor";
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* A step output that represents a *promoted* artifact — a publish-family result
|
|
@@ -165,7 +166,7 @@ export interface AutoReleaseOptions {
|
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
function resolveActor(override?: string): string | undefined {
|
|
168
|
-
return override ?? process.env
|
|
169
|
+
return override ?? (actorFromEnv(process.env, "") || undefined);
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
/**
|
|
@@ -35,6 +35,7 @@ import { CHECK_EVIDENCE_KEY_ENV, LOCAL_EVIDENCE_KEY_ENV, SIGNING_ID_TOKEN_VAR }
|
|
|
35
35
|
import { acceptedLocalEvidence, acceptsLocalEvidence, fetchLocalEvidence } from "../workspace/trust/local-evidence";
|
|
36
36
|
|
|
37
37
|
export { CI_CHECK_HOOK_FLOOR } from "../op/op-waves";
|
|
38
|
+
export { CHECK_SUMMARY_FLOOR } from "../release-floors";
|
|
38
39
|
|
|
39
40
|
/** The check hooks a job runs, and where they were read. */
|
|
40
41
|
export interface CheckHooksRead {
|
|
@@ -161,6 +162,27 @@ export function passedCheckHooks(outcomes: readonly CheckHookOutcome[]): Array<{
|
|
|
161
162
|
return [...byName].filter(([, runs]) => runs.every((r) => r.outcome === "passed")).map(([check, runs]) => ({ check, runs }));
|
|
162
163
|
}
|
|
163
164
|
|
|
165
|
+
/**
|
|
166
|
+
* The check report's markdown section (#4914): a heading naming the base
|
|
167
|
+
* the hooks were read at, a line per hook run and per lexicon check step,
|
|
168
|
+
* the failure, and the checks whose evidence was signed. A product's check
|
|
169
|
+
* step keeps it in its own report or job summary (`chant ci check
|
|
170
|
+
* --summary <file>`) instead of rendering `check-hooks.json` itself. Empty
|
|
171
|
+
* when no hook is declared and no step ran.
|
|
172
|
+
*/
|
|
173
|
+
export function checkReportSummary(report: Pick<CheckHooksReport, "status" | "base" | "hooks" | "steps" | "failed" | "evidence">): string[] {
|
|
174
|
+
if (report.status === "none") return [];
|
|
175
|
+
const at = report.base === "HEAD" ? "" : ` (read at ${/^[0-9a-f]{40}$/.test(report.base) ? report.base.slice(0, 12) : report.base})`;
|
|
176
|
+
const hooks = report.hooks.map(
|
|
177
|
+
(h) => `- ${h.outcome}: \`${h.name}\`${h.target ? ` for \`${h.target}\`` : ""}${h.outcome === "failed" ? `, exit ${h.exit}` : ""}${h.reason ? ` (${h.reason})` : ""}`,
|
|
178
|
+
);
|
|
179
|
+
const steps = (report.steps ?? []).map(
|
|
180
|
+
(s) => `- ${s.outcome}: \`${s.lexicon} ${s.step}\` for \`${s.member}\`${s.stack ? ` (stack \`${s.stack}\`)` : ""}${s.outcome === "failed" ? `, exit ${s.exit}` : ""}${s.reason && s.outcome !== "failed" ? ` (${s.reason})` : ""}`,
|
|
181
|
+
);
|
|
182
|
+
const signed = report.evidence ? [`- signed: ${report.evidence.signed.map((c) => `\`${c}\``).join(", ")} as ${report.evidence.runner}`] : [];
|
|
183
|
+
return [`### Check hooks${at}`, "", ...hooks, ...steps, ...(report.failed ? [`- ${report.failed}`] : []), ...signed, ""];
|
|
184
|
+
}
|
|
185
|
+
|
|
164
186
|
/** Where {@link runCheckHooks} writes its runs file and report unless told: `.chant/check`. */
|
|
165
187
|
export const CHECK_HOOKS_DIR = ".chant/check";
|
|
166
188
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #4914: the check report's markdown section, which `chant ci check
|
|
3
|
+
* --summary <file>` appends to a product's own report, so a product's check
|
|
4
|
+
* step runs chant's check stage (hooks, lexicon steps, signing) and renders
|
|
5
|
+
* nothing of its own.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { execFileSync } from "node:child_process";
|
|
9
|
+
import { mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
|
10
|
+
import { tmpdir } from "node:os";
|
|
11
|
+
import { join } from "node:path";
|
|
12
|
+
import { afterEach, describe, expect, test, vi } from "vitest";
|
|
13
|
+
import { checkReportSummary } from "./check-hooks";
|
|
14
|
+
import { parseArgs } from "../cli/parse-args";
|
|
15
|
+
import type { CommandContext } from "../cli/registry";
|
|
16
|
+
|
|
17
|
+
const BASE = "0123456789abcdef0123456789abcdef01234567";
|
|
18
|
+
|
|
19
|
+
describe("checkReportSummary (#4914)", () => {
|
|
20
|
+
test("names the base, each hook run and step, the failure and the evidence signed", () => {
|
|
21
|
+
const lines = checkReportSummary({
|
|
22
|
+
status: "failed",
|
|
23
|
+
base: BASE,
|
|
24
|
+
hooks: [
|
|
25
|
+
{ name: "fmt", exit: 0, outcome: "passed" },
|
|
26
|
+
{ name: "tflint", target: "roots/a", exit: 2, outcome: "failed" },
|
|
27
|
+
{ name: "checkov", exit: 0, outcome: "skipped", reason: "current local evidence from person alice" },
|
|
28
|
+
],
|
|
29
|
+
steps: [{ lexicon: "pulumi", step: "pulumi-about", member: "app", stack: "dev", exit: 0, outcome: "passed" }],
|
|
30
|
+
failed: "a check hook failed: tflint",
|
|
31
|
+
evidence: { signed: ["fmt"], runner: "ci", commit: BASE },
|
|
32
|
+
});
|
|
33
|
+
expect(lines).toEqual([
|
|
34
|
+
"### Check hooks (read at 0123456789ab)",
|
|
35
|
+
"",
|
|
36
|
+
"- passed: `fmt`",
|
|
37
|
+
"- failed: `tflint` for `roots/a`, exit 2",
|
|
38
|
+
"- skipped: `checkov` (current local evidence from person alice)",
|
|
39
|
+
"- passed: `pulumi pulumi-about` for `app` (stack `dev`)",
|
|
40
|
+
"- a check hook failed: tflint",
|
|
41
|
+
"- signed: `fmt` as ci",
|
|
42
|
+
"",
|
|
43
|
+
]);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test("nothing when no hook is declared and no step ran", () => {
|
|
47
|
+
expect(checkReportSummary({ status: "none", base: "HEAD", hooks: [] })).toEqual([]);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe("chant ci check --summary (#4914)", () => {
|
|
52
|
+
afterEach(() => vi.restoreAllMocks());
|
|
53
|
+
|
|
54
|
+
test("the flag parses", () => {
|
|
55
|
+
expect(parseArgs(["ci", "check", "--base", "HEAD", "--summary", ".terragucci/check/report.md"])).toMatchObject({ checkSummary: ".terragucci/check/report.md" });
|
|
56
|
+
expect(() => parseArgs(["ci", "check", "--summary"])).toThrow(/--summary needs a file/);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test("appends the section to the file after the check hooks ran", async () => {
|
|
60
|
+
const cwd = mkdtempSync(join(tmpdir(), "chant-4914-summary-"));
|
|
61
|
+
const git = (...args: string[]) => execFileSync("git", ["-c", "user.name=t", "-c", "user.email=t@example.invalid", "-c", "init.defaultBranch=main", ...args], { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "pipe"] }).trim();
|
|
62
|
+
git("init", "--quiet");
|
|
63
|
+
writeFileSync(join(cwd, "chant.workspace.json"), JSON.stringify({ name: "acme", schema: 1, members: [], ci: { hooks: { check: [{ name: "ok", command: ["true"] }] } } }, null, 2) + "\n");
|
|
64
|
+
git("add", ".");
|
|
65
|
+
git("commit", "--quiet", "-m", "base");
|
|
66
|
+
const file = join(cwd, "out", "report.md");
|
|
67
|
+
vi.spyOn(process, "cwd").mockReturnValue(cwd);
|
|
68
|
+
const said: string[] = [];
|
|
69
|
+
vi.spyOn(console, "error").mockImplementation((l: string) => void said.push(String(l)));
|
|
70
|
+
vi.stubEnv("GITHUB_STEP_SUMMARY", "");
|
|
71
|
+
const { runCiCheck } = await import("../cli/handlers/ci-check");
|
|
72
|
+
const code = await runCiCheck({ args: parseArgs(["ci", "check", "--base", "HEAD", "--output", join(cwd, ".chant/check"), "--summary", file]), plugins: [{} as never] } as unknown as CommandContext);
|
|
73
|
+
vi.unstubAllEnvs();
|
|
74
|
+
expect(code, said.join("\n")).toBe(0);
|
|
75
|
+
expect(said.join("\n")).toContain("1 passed");
|
|
76
|
+
expect(readFileSync(file, "utf-8")).toContain("- passed: `ok`");
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pull request's check job and the ref gate's status job (#4935), for
|
|
3
|
+
* the forge lexicons to render beside the plan jobs: the pull request loop
|
|
4
|
+
* (`chant build --pr-loop --check-job --ref-gate-status`) and the product
|
|
5
|
+
* pipeline (`productPipelineJobs({ checkJob, refGateStatus })`).
|
|
6
|
+
*
|
|
7
|
+
* - The check job runs `chant ci check --base <base>` on the pull request's
|
|
8
|
+
* commit: the `ci.hooks.check` hooks the declaration at base names and the
|
|
9
|
+
* lexicons' check steps. A hook whose current local evidence the policy at
|
|
10
|
+
* base accepts is skipped (#4868). The job runs the change's code, so it
|
|
11
|
+
* follows the plan job's handover (#4295): the checkout script alone sees
|
|
12
|
+
* the forge token, every later step starts without it, and the check is
|
|
13
|
+
* the job's last step, handing `.chant/check` on as the job's outputs.
|
|
14
|
+
* It holds no runner key and no OIDC token for signing either (#4328).
|
|
15
|
+
* - With `evidence` (#4870, #4869) the `check-evidence` job signs each hook
|
|
16
|
+
* that passed, by name, from the check job's report, in a job that checks
|
|
17
|
+
* out the target branch's commit and runs none of the change's code, as
|
|
18
|
+
* the plan note job signs `plan` and `policy` from the plan job's report.
|
|
19
|
+
* It pushes `refs/notes/chant/evidence`. On GitLab it runs in the target
|
|
20
|
+
* branch's plan notes pipeline (#4914), as the plan's `<plan job>-evidence`
|
|
21
|
+
* job does: `ci evidence sign --open` signs every open merge request's
|
|
22
|
+
* settled check job from its artifact, so no job of the merge request's
|
|
23
|
+
* own pipeline holds the key.
|
|
24
|
+
* - The `ref-gate` job runs `chant workspace ref-gate status` (#4867) for
|
|
25
|
+
* the pull request's commit once the plan note and the check evidence are
|
|
26
|
+
* in: it reads the evidence notes, decides the update a merge into the
|
|
27
|
+
* target branch would make under the policy at base, and sets the
|
|
28
|
+
* `chant/ref-gate` status (or the policy's own status name), which a
|
|
29
|
+
* project can then make a required status. GitLab sets a status only with
|
|
30
|
+
* the protected token a target-branch pipeline holds (#4328), so there the
|
|
31
|
+
* job runs in the plan notes pipeline and posts for every open merge
|
|
32
|
+
* request into the branch (`ref-gate status --open`).
|
|
33
|
+
*
|
|
34
|
+
* The commit is the one the plan job checked out and every other status of
|
|
35
|
+
* the loop names: `github.sha` on GitHub and Forgejo, `CI_COMMIT_SHA` in a
|
|
36
|
+
* GitLab merge request pipeline. On a GitHub `pull_request` run that is the
|
|
37
|
+
* merge preview, and the status goes on the pull request's head, where the
|
|
38
|
+
* forge shows and requires it (#4964, ../pr-forge-job.ts).
|
|
39
|
+
*
|
|
40
|
+
* #4964: a workspace member's pipeline takes all three. The check job runs
|
|
41
|
+
* in the member's directory, the product's own service containers,
|
|
42
|
+
* variables, lines and report directory come with `PrCheckJobOptions`, and
|
|
43
|
+
* a product's own workflow renders the jobs through the lexicons'
|
|
44
|
+
* `productCheckJobs`.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
import type { ForgeKind } from "../pr-forge";
|
|
48
|
+
import { GITHUB_JOB_TOKEN } from "../ci-jobs";
|
|
49
|
+
import { assertPipelineEvidence, evidenceIdTokens, evidenceKeyEnv, evidenceKeyless, gitlabOpenEvidenceDir, openEvidenceLines, planEvidenceLines, type PipelineEvidence } from "../ci-evidence-jobs";
|
|
50
|
+
import { withProductBin } from "./pr-pipeline";
|
|
51
|
+
|
|
52
|
+
/** The check job's name (#4935). */
|
|
53
|
+
export const PR_CHECK_JOB = "check";
|
|
54
|
+
|
|
55
|
+
/** The job that signs the check job's hooks (#4935). */
|
|
56
|
+
export const PR_CHECK_EVIDENCE_JOB = "check-evidence";
|
|
57
|
+
|
|
58
|
+
/** The job that sets the ref gate's status (#4935). */
|
|
59
|
+
export const PR_REF_GATE_JOB = "ref-gate";
|
|
60
|
+
|
|
61
|
+
/** Where `chant ci check` writes its report: `CHECK_HOOKS_DIR` in ./check-hooks.ts, kept here so a generator does not load the check runner. */
|
|
62
|
+
export const PR_CHECK_REPORT_DIR = ".chant/check";
|
|
63
|
+
|
|
64
|
+
/** The artifact the check report is kept as. */
|
|
65
|
+
export const PR_CHECK_ARTIFACT = "chant-pr-check";
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* A service container the check job starts beside it (#4964), such as a
|
|
69
|
+
* throwaway database its hooks replay into. The job reaches it by `name`.
|
|
70
|
+
* GitHub and Forgejo hold the job's steps until `health` passes; GitLab
|
|
71
|
+
* does not wait, so a check job there waits in its `before` lines.
|
|
72
|
+
*/
|
|
73
|
+
export interface PrCheckService {
|
|
74
|
+
/** The service's host name on the job's network: lower-case letters, digits, `.`, `_` and `-`. */
|
|
75
|
+
name: string;
|
|
76
|
+
image: string;
|
|
77
|
+
/** The service container's environment. */
|
|
78
|
+
env?: Record<string, string>;
|
|
79
|
+
/** A command the forge runs in the service container until it passes (GitHub's and Forgejo's `--health-cmd`). */
|
|
80
|
+
health?: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The check job's own settings (#4964), as a product passes them in
|
|
85
|
+
* `checkJob: { ... }`. `true` is all of them left out.
|
|
86
|
+
*/
|
|
87
|
+
export interface PrCheckJobOptions {
|
|
88
|
+
/** Service containers beside the job. */
|
|
89
|
+
services?: PrCheckService[];
|
|
90
|
+
/** Variables of the check step, such as a service's URL. No forge token, runner key or `BASE_SHA`. */
|
|
91
|
+
env?: Record<string, string>;
|
|
92
|
+
/** Lines the check step runs before `chant ci check`, after the tokens are dropped, such as a wait for a service. */
|
|
93
|
+
before?: string[];
|
|
94
|
+
/** The report directory, repository-relative from the job's directory: `chant ci check --output <dir>`. Default `.chant/check`. */
|
|
95
|
+
dir?: string;
|
|
96
|
+
/** Arguments after `--base` (and `--output`), each one word, quoted where the shell needs it: `--summary <file>` and the targets a `perRun` hook runs for. */
|
|
97
|
+
args?: string[];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** One shell word: as it is when it needs no quoting, else in single quotes. */
|
|
101
|
+
function shellWord(word: string): string {
|
|
102
|
+
return /^[A-Za-z0-9._\/=:@+,-]+$/.test(word) ? word : `'${word.replace(/'/g, `'\\''`)}'`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** The check job (#4935): its command and the values it reads. */
|
|
106
|
+
export interface PrCheckJob {
|
|
107
|
+
jobName: string;
|
|
108
|
+
/** `chant ci check --base "$BASE_SHA"`, through the words' bin, with `--output <dir>` for a directory of the product's own. */
|
|
109
|
+
command: string;
|
|
110
|
+
/** `BASE_SHA`, as the forge spells it, and the product's own variables (#4964). */
|
|
111
|
+
env: Record<string, string>;
|
|
112
|
+
/** The report directory it writes and hands on. */
|
|
113
|
+
dir: string;
|
|
114
|
+
/** The service containers beside it (#4964). */
|
|
115
|
+
services?: PrCheckService[];
|
|
116
|
+
/** The lines before the command (#4964). */
|
|
117
|
+
before?: string[];
|
|
118
|
+
/**
|
|
119
|
+
* With `evidence`: the signing job's lines and variables. GitHub and
|
|
120
|
+
* Forgejo run them in `check-evidence` after taking the report back;
|
|
121
|
+
* GitLab in `check-evidence` in the target branch's plan notes pipeline
|
|
122
|
+
* (#4914), for every open merge request's check job, keeping `dir`.
|
|
123
|
+
* Signing keyless, the job asks for an OIDC token: `idToken` (GitHub's
|
|
124
|
+
* `id-token: write`, Forgejo's `enable-openid-connect`) or GitLab's
|
|
125
|
+
* `idTokens`.
|
|
126
|
+
*/
|
|
127
|
+
evidence?: { jobName: string; lines: string[]; env: Record<string, string>; dir?: string; idToken?: true; idTokens?: Record<string, { aud: string }> };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** The variables a check job's own `env` may not set: the ones the job and its handover read, and the credentials it drops. */
|
|
131
|
+
const CHECK_RESERVED_ENV = /^(BASE_SHA|HEAD_SHA|CHECK_RESULT|CHANT_RUNNER_KEY|CHANT_RUNNER_IDENTITY|CHANT_LOCAL_EVIDENCE_KEY|CHANT_CHECKOUT_TOKEN|GITHUB_TOKEN|GH_TOKEN|FORGEJO_TOKEN|GITLAB_TOKEN|CI_JOB_TOKEN|CHANT_FORGE_TOKEN|ACTIONS_ID_TOKEN_REQUEST_(URL|TOKEN))$/;
|
|
132
|
+
|
|
133
|
+
/** Refuse check job settings no job could hold (#4964). */
|
|
134
|
+
function assertCheckJobOptions(opts: PrCheckJobOptions): void {
|
|
135
|
+
if (opts.dir !== undefined && (!/^[A-Za-z0-9._][A-Za-z0-9._\/-]*$/.test(opts.dir) || opts.dir.split("/").includes(".."))) {
|
|
136
|
+
throw new Error(`the check job's report directory ${JSON.stringify(opts.dir)} is not a relative path inside the checkout`);
|
|
137
|
+
}
|
|
138
|
+
for (const a of opts.args ?? []) {
|
|
139
|
+
if (a === "" || /[\0\n]/.test(a) || a === "--base" || a === "--output" || a === "-o") throw new Error(`the check job's argument ${JSON.stringify(a)} is not one it takes: --base and --output are its own`);
|
|
140
|
+
}
|
|
141
|
+
const names = new Set<string>();
|
|
142
|
+
for (const s of opts.services ?? []) {
|
|
143
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(s.name)) throw new Error(`the check job's service name ${JSON.stringify(s.name)} is not a host name: lower-case letters, digits, . _ -`);
|
|
144
|
+
if (names.has(s.name)) throw new Error(`the check job names service ${s.name} twice`);
|
|
145
|
+
names.add(s.name);
|
|
146
|
+
if (!s.image.trim() || /\s/.test(s.image)) throw new Error(`the check job's service ${s.name} needs an image reference`);
|
|
147
|
+
}
|
|
148
|
+
for (const name of Object.keys(opts.env ?? {})) {
|
|
149
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) throw new Error(`the check job's variable ${JSON.stringify(name)} is not a variable name`);
|
|
150
|
+
if (CHECK_RESERVED_ENV.test(name)) throw new Error(`the check job sets ${name} itself, or drops it before the hooks run, so checkJob.env cannot name it`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The check job for `forge` (#4935), with the check evidence job when
|
|
156
|
+
* `evidence` names a runner identity. #4964: the product's services,
|
|
157
|
+
* variables, lines and report directory (`PrCheckJobOptions`), and for a
|
|
158
|
+
* workspace member's GitLab file (`member`) the jobs named
|
|
159
|
+
* `<member>-check` and `<member>-check-evidence`, with the report read from
|
|
160
|
+
* the artifact at the member's `reportPath`, as GitLab includes every
|
|
161
|
+
* member's file in one pipeline. On GitHub and Forgejo a member's workflow
|
|
162
|
+
* is a file of its own, and the jobs keep their names.
|
|
163
|
+
*/
|
|
164
|
+
export function prCheckJob(forge: ForgeKind, opts: { bin?: string; evidence?: PipelineEvidence; noForks?: boolean; member?: { name: string; reportPath: string } } & PrCheckJobOptions = {}): PrCheckJob {
|
|
165
|
+
assertPipelineEvidence(opts.evidence);
|
|
166
|
+
assertCheckJobOptions(opts);
|
|
167
|
+
const gitlab = forge === "gitlab";
|
|
168
|
+
const base = gitlab ? "$CI_MERGE_REQUEST_DIFF_BASE_SHA" : "${{ github.event.pull_request.base.sha }}";
|
|
169
|
+
const dir = opts.dir ?? PR_CHECK_REPORT_DIR;
|
|
170
|
+
const named = (job: string) => (gitlab && opts.member ? `${opts.member.name}-${job}` : job);
|
|
171
|
+
const job: PrCheckJob = {
|
|
172
|
+
jobName: named(PR_CHECK_JOB),
|
|
173
|
+
command: withProductBin(`chant ci check --base "$BASE_SHA"${dir === PR_CHECK_REPORT_DIR ? "" : ` --output ${dir}`}${(opts.args ?? []).map((a) => ` ${shellWord(a)}`).join("")}`, opts.bin),
|
|
174
|
+
env: { BASE_SHA: base, ...opts.env },
|
|
175
|
+
dir,
|
|
176
|
+
...(opts.services?.length ? { services: opts.services } : {}),
|
|
177
|
+
...(opts.before?.length ? { before: opts.before } : {}),
|
|
178
|
+
};
|
|
179
|
+
const evidence = opts.evidence;
|
|
180
|
+
if (!evidence) return job;
|
|
181
|
+
const key = evidenceKeyEnv(forge, evidence);
|
|
182
|
+
const bin = opts.bin ? { bin: opts.bin } : {};
|
|
183
|
+
if (gitlab) {
|
|
184
|
+
// #4914: the job runs in the target branch's plan notes pipeline and signs every open merge request's
|
|
185
|
+
// settled check job from its artifact; no job of a merge request pipeline holds the key.
|
|
186
|
+
const out = gitlabOpenEvidenceDir(job.jobName);
|
|
187
|
+
return {
|
|
188
|
+
...job,
|
|
189
|
+
evidence: {
|
|
190
|
+
jobName: named(PR_CHECK_EVIDENCE_JOB),
|
|
191
|
+
// A fork's check job runs too, as it holds nothing; with noForks (a product plan's forks: "skip") its hooks are not signed for.
|
|
192
|
+
lines: openEvidenceLines({ job: job.jobName, dir: opts.member?.reportPath ?? dir, out, ...bin, ...(opts.noForks ? { noForks: true } : {}) }),
|
|
193
|
+
env: key,
|
|
194
|
+
dir: out,
|
|
195
|
+
...(evidenceKeyless(evidence) ? { idTokens: evidenceIdTokens(evidence) } : {}),
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
...job,
|
|
201
|
+
evidence: {
|
|
202
|
+
jobName: PR_CHECK_EVIDENCE_JOB,
|
|
203
|
+
lines: planEvidenceLines({ dir, at: '"$HEAD_SHA"', base: '"$BASE_SHA"', result: '"$CHECK_RESULT"', ...bin }),
|
|
204
|
+
env: { HEAD_SHA: "${{ github.sha }}", BASE_SHA: base, CHECK_RESULT: `\${{ needs.${PR_CHECK_JOB}.result }}`, ...key },
|
|
205
|
+
...(evidenceKeyless(evidence) ? { idToken: true as const } : {}),
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** The ref gate's status job (#4935): its lines and the values they read. */
|
|
211
|
+
export interface PrRefGateJob {
|
|
212
|
+
jobName: string;
|
|
213
|
+
/** The fetches of the pull request's commit and the evidence notes, before the command. */
|
|
214
|
+
setup: string[];
|
|
215
|
+
/** `chant workspace ref-gate status`, through the words' bin. */
|
|
216
|
+
command: string;
|
|
217
|
+
/** The values the lines read, as the forge spells them, the token included on GitHub and Forgejo. */
|
|
218
|
+
env: Record<string, string>;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The ref gate's status job for `forge` (#4935). `branch` is the target
|
|
223
|
+
* branch on GitHub and Forgejo (default `main`); GitLab's job runs in a
|
|
224
|
+
* pipeline of the target branch and names it from `CI_COMMIT_BRANCH`.
|
|
225
|
+
*
|
|
226
|
+
* #4964: in a workspace member's GitLab file (`member`) the job is
|
|
227
|
+
* `<member>-ref-gate`. Each member's pipeline decides the whole update
|
|
228
|
+
* against the one rule and sets the one status, so the last job to run
|
|
229
|
+
* after the evidence it needs is in sets success; one that ran before
|
|
230
|
+
* another member's evidence was in set failure, and a re-run settles it.
|
|
231
|
+
* None sets success while a required check lacks evidence.
|
|
232
|
+
*/
|
|
233
|
+
export function prRefGateJob(forge: ForgeKind, opts: { bin?: string; branch?: string; member?: string } = {}): PrRefGateJob {
|
|
234
|
+
const notes = "'+refs/notes/chant/evidence:refs/notes/chant/evidence'";
|
|
235
|
+
if (forge === "gitlab") {
|
|
236
|
+
return {
|
|
237
|
+
jobName: opts.member ? `${opts.member}-${PR_REF_GATE_JOB}` : PR_REF_GATE_JOB,
|
|
238
|
+
// The heads are fetched by the command, one merge request at a time.
|
|
239
|
+
setup: [`git fetch --quiet --no-tags origin ${notes} || true`],
|
|
240
|
+
command: withProductBin('chant workspace ref-gate status --open --ref "refs/heads/$CI_COMMIT_BRANCH" --base "$CI_COMMIT_SHA"', opts.bin),
|
|
241
|
+
env: {},
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
const branch = opts.branch ?? "main";
|
|
245
|
+
if (!/^[A-Za-z0-9._\/-]+$/.test(branch)) throw new Error(`the ref gate's branch ${JSON.stringify(branch)} is not a branch name`);
|
|
246
|
+
return {
|
|
247
|
+
jobName: PR_REF_GATE_JOB,
|
|
248
|
+
setup: [`git fetch --quiet --no-tags origin "$HEAD_SHA" ${notes} || git fetch --quiet --no-tags origin "$HEAD_SHA" || true`],
|
|
249
|
+
command: withProductBin(`chant workspace ref-gate status --ref refs/heads/${branch} --at "$HEAD_SHA" --base "$BASE_SHA"`, opts.bin),
|
|
250
|
+
env: { HEAD_SHA: "${{ github.sha }}", BASE_SHA: "${{ github.event.pull_request.base.sha }}", GITHUB_TOKEN: GITHUB_JOB_TOKEN },
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export { CHECK_JOB_FLOOR, GITLAB_OPEN_EVIDENCE_FLOOR, MEMBER_SIGNED_CHECKS_FLOOR, PR_LOOP_EVIDENCE_FLOOR, PRODUCT_CHECK_JOBS_FLOOR, REF_GATE_STATUS_JOB_FLOOR } from "../release-floors";
|
|
@@ -101,6 +101,8 @@ import { commandWord, commentLine, PRODUCT_ACTION_ENV, PRODUCT_ACTION_EVENT_FLAG
|
|
|
101
101
|
import { CHANT_EXIT } from "../exit-codes";
|
|
102
102
|
import type { ControlTarget } from "../control/dispatch";
|
|
103
103
|
import { CI_RESPOND_ENV, respondList, type CiResponses } from "../ci-respond";
|
|
104
|
+
import type { PipelineEvidence } from "../ci-evidence-jobs";
|
|
105
|
+
import type { PrCheckJobOptions } from "./pr-checks";
|
|
104
106
|
|
|
105
107
|
/** The variable `chant ci run` reads its runner key from (`RUNNER_KEY_ENV` in ../workspace/ci-green.ts). */
|
|
106
108
|
const RUNNER_KEY_ENV = "CHANT_RUNNER_KEY";
|
|
@@ -391,6 +393,45 @@ export interface PrLoopPipelineOptions {
|
|
|
391
393
|
* to `pr-post`. Needed with `respond.description: "check"`.
|
|
392
394
|
*/
|
|
393
395
|
decide?: { backend: string; model: string };
|
|
396
|
+
/**
|
|
397
|
+
* The pipeline's runner identity (#4935, as #4870's `PipelineEvidence`):
|
|
398
|
+
* the plan-note job signs the plan job's `plan` and `policy` checks from
|
|
399
|
+
* its report before it posts, with the runner key from the named secret or
|
|
400
|
+
* (#4869) keyless from the job's OIDC identity. On GitLab a
|
|
401
|
+
* `<plan job>-evidence` job after the plan job signs from its artifact.
|
|
402
|
+
* With `checkJob`, the `check-evidence` job signs each passed hook. Set
|
|
403
|
+
* from `--evidence-runner-key-secret`, or `--evidence-identity oidc` with
|
|
404
|
+
* an optional `--evidence-audience`. Absent: nothing is signed, and every
|
|
405
|
+
* job is as before. #4964: a workspace member's pipeline plans that member
|
|
406
|
+
* alone, so it signs `plan:<member>` and `policy:<member>`
|
|
407
|
+
* (`memberEvidenceCheck`), which the `refs` rule names for each member.
|
|
408
|
+
*/
|
|
409
|
+
evidence?: PipelineEvidence;
|
|
410
|
+
/**
|
|
411
|
+
* The check job (#4935, ./pr-checks.ts): `chant ci check --base <base>` on
|
|
412
|
+
* the pull request's commit, with no forge token, runner key or OIDC token
|
|
413
|
+
* while the hooks run. Set from `--check-job`. #4964: an object gives the
|
|
414
|
+
* job service containers, variables, lines before the check and its own
|
|
415
|
+
* report directory (`PrCheckJobOptions`). In a workspace member's pipeline
|
|
416
|
+
* it runs in the member's directory: the top level's hooks and the
|
|
417
|
+
* member's, each signed by its own name, the same for every member that
|
|
418
|
+
* runs it.
|
|
419
|
+
*/
|
|
420
|
+
checkJob?: boolean | PrCheckJobOptions;
|
|
421
|
+
/**
|
|
422
|
+
* The ref gate's status job (#4935, ./pr-checks.ts): `chant workspace
|
|
423
|
+
* ref-gate status` for the pull request's commit, after the note and the
|
|
424
|
+
* check evidence, so `chant/ref-gate` can be a required status. Set from
|
|
425
|
+
* `--ref-gate-status`. #4964: in a member's pipeline it decides the whole
|
|
426
|
+
* update against the one rule, as the root's does, and sets the one
|
|
427
|
+
* status (`prRefGateJob`).
|
|
428
|
+
*/
|
|
429
|
+
refGateStatus?: boolean;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/** The check job's own settings from `checkJob` (#4964): undefined when there is no check job, `{}` for `true`. */
|
|
433
|
+
export function checkJobOptions(checkJob: boolean | PrCheckJobOptions | undefined): PrCheckJobOptions | undefined {
|
|
434
|
+
return checkJob === true ? {} : checkJob ? checkJob : undefined;
|
|
394
435
|
}
|
|
395
436
|
|
|
396
437
|
/** The `CHANT_RESPOND` value of `respond` (#4629), or undefined when every event is at its default. Throws on a description check with no decide service. */
|
|
@@ -427,7 +468,8 @@ export function prLoopRunner(options: Pick<PrLoopPipelineOptions, "runners">, st
|
|
|
427
468
|
*/
|
|
428
469
|
export function prLoopJobStage(name: string, member?: string): PrLoopRunnerStage {
|
|
429
470
|
const bare = member && name.startsWith(`${member}-`) ? name.slice(member.length + 1) : name;
|
|
430
|
-
|
|
471
|
+
// #4935: the check job runs the change's code, as the plan does.
|
|
472
|
+
if (bare === "plan" || bare === PR_COMMENT_PREVIEW_JOB || bare === "check") return "plan";
|
|
431
473
|
if (bare === "apply" || bare === "record" || bare === PR_ACTION_JOB || /^apply-wave-\d+$/.test(bare) || bare === "env-up" || bare === "env-down" || bare === "env-sweep") return "apply";
|
|
432
474
|
return "default";
|
|
433
475
|
}
|