@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/pr-post.ts
CHANGED
|
@@ -32,13 +32,17 @@
|
|
|
32
32
|
import { appendFileSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
33
33
|
import { tmpdir } from "node:os";
|
|
34
34
|
import { join } from "node:path";
|
|
35
|
-
import { prNoteMarker, prStatusContext,
|
|
35
|
+
import { prNoteMarker, prStatusContext, renderPrNote, type PrOverdue, type PrReport } from "./pr-loop";
|
|
36
|
+
import { prStatusDescription, prStatusState } from "./pr-status";
|
|
36
37
|
import { forgePrincipalOf, type PrForge } from "./pr-forge";
|
|
37
|
-
import { GITHUB_COMMENT_LIMIT, GITLAB_NOTE_LIMIT } from "./plan-summary";
|
|
38
|
+
import { fitNote, GITHUB_COMMENT_LIMIT, GITLAB_NOTE_LIMIT } from "./plan-summary";
|
|
38
39
|
import { activeProductWords, commentLine, type CiProductWords } from "./ci-product-words";
|
|
39
40
|
import { controlEdgeFactsFromEnv, remarkCrossStackEdges, type ControlEdgeFacts } from "./control/edges";
|
|
40
|
-
import { checkEvidenceNoteLine } from "./workspace/trust/check-evidence-report";
|
|
41
|
-
import {
|
|
41
|
+
import { CHECK_EVIDENCE_FILE, checkEvidenceNoteLine, openEvidenceFor } from "./workspace/trust/check-evidence-report";
|
|
42
|
+
import { PLAN_RUN_RECORD_FILE, readPlanRunRecord } from "./pr-plan-record";
|
|
43
|
+
import type { OpRunRecordInput } from "./op/runtime";
|
|
44
|
+
import type { RunOrigin } from "./lifecycle/release-ledger";
|
|
45
|
+
import { isPlanNote, PLAN_BODY_LIMIT, PLAN_SUBJECT_LIMIT, planNoteMarker, planSubjectProblem, PR_PLAN_NOTE_CONTRACT, PR_PLAN_NOTE_FILE, PRODUCT_MARKER_BODY, PRODUCT_MARKER_LIMIT, PRODUCT_MARKER_NAME, productMarkerLine, renderPlanNote, sinceLastLine, type PrPlanBodyHandoff, type PrPlanNoteHandoff, type PrPlanNoteWords, type PrPlanSubject } from "./pr-plan-note";
|
|
42
46
|
|
|
43
47
|
/** The plan report's file under the report directory. */
|
|
44
48
|
export const PR_PLAN_REPORT_FILE = "pr-plan.json";
|
|
@@ -90,6 +94,35 @@ export interface PlanPostInput {
|
|
|
90
94
|
* from the pipeline, never from the report.
|
|
91
95
|
*/
|
|
92
96
|
noteWords?: PrPlanNoteWords;
|
|
97
|
+
/**
|
|
98
|
+
* Notices the note job's own lines wrote (#4931), each added under a
|
|
99
|
+
* product's plan note hand-off's counts, after its own. Default: the
|
|
100
|
+
* lines of the file `CHANT_PLAN_NOTE_NOTICES` names, which the generated
|
|
101
|
+
* note job sets to a file outside the report the plan job handed on.
|
|
102
|
+
*/
|
|
103
|
+
notices?: string[];
|
|
104
|
+
/**
|
|
105
|
+
* Keep the plan job's run record (#4899, ./pr-plan-record.ts), when it
|
|
106
|
+
* wrote one into the hand-off: read as data, with `origin` naming the plan
|
|
107
|
+
* job's run, and handed to `keep`, which appends it to the run ledger and
|
|
108
|
+
* pushes. `keep` returns a warning to say, when there is one.
|
|
109
|
+
*/
|
|
110
|
+
recordRun?: PlanRunRecorder;
|
|
111
|
+
/**
|
|
112
|
+
* The one argument a re-plan was narrowed to (#4963), such as a
|
|
113
|
+
* terragucci root: when the report or the hand-off says the change
|
|
114
|
+
* reaches nothing, the pull request gets a reply that the argument is not
|
|
115
|
+
* affected, and the note and the status stay as they were. Ignored when
|
|
116
|
+
* empty or not one plain word.
|
|
117
|
+
*/
|
|
118
|
+
notAffected?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** How the note job keeps the plan job's run record (#4899). */
|
|
122
|
+
export interface PlanRunRecorder {
|
|
123
|
+
/** The plan job's run, as the note job names it. */
|
|
124
|
+
origin?: RunOrigin;
|
|
125
|
+
keep(record: OpRunRecordInput): Promise<string | undefined>;
|
|
93
126
|
}
|
|
94
127
|
|
|
95
128
|
/** What {@link postPlanReport} did. */
|
|
@@ -100,6 +133,8 @@ export interface PlanPostResult {
|
|
|
100
133
|
noted: boolean;
|
|
101
134
|
/** Why the report was not used, when it was not. */
|
|
102
135
|
refused?: string;
|
|
136
|
+
/** The id of the plan job's run record kept on chant/lifecycle (#4899), when one was. */
|
|
137
|
+
recorded?: string;
|
|
103
138
|
warnings: string[];
|
|
104
139
|
}
|
|
105
140
|
|
|
@@ -136,7 +171,7 @@ export function readPlanReport(input: Pick<PlanPostInput, "dir" | "pr" | "head"
|
|
|
136
171
|
* The note for `report`, rendered here, with every `<!--` after the marker
|
|
137
172
|
* line written as `<!--`, so the note carries no hidden marker but its own.
|
|
138
173
|
*/
|
|
139
|
-
export function planNoteFor(report: PrReport, forge: Pick<PrForge, "kind" | "host">, marker: string, baseTip?: string): string {
|
|
174
|
+
export function planNoteFor(report: PrReport, forge: Pick<PrForge, "kind" | "host">, marker: string, baseTip?: string, own?: string): string {
|
|
140
175
|
const note = renderPrNote(report, {
|
|
141
176
|
limit: forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT,
|
|
142
177
|
approver: forgePrincipalOf(forge.kind, forge.host, "<your-login>"),
|
|
@@ -145,7 +180,42 @@ export function planNoteFor(report: PrReport, forge: Pick<PrForge, "kind" | "hos
|
|
|
145
180
|
const rest = (at < 0 ? "" : note.slice(at + 1)).split("<!--").join("<!--");
|
|
146
181
|
// #4628: the tip line is written after the defusing, from the caller's sha, never the report's.
|
|
147
182
|
const tip = baseTip && SHA.test(baseTip) ? `${rest.endsWith("\n") ? "" : "\n"}${prNoteTipMarker(baseTip)}\n` : "";
|
|
148
|
-
|
|
183
|
+
// #4963: the product's own line, already checked, under chant's marker.
|
|
184
|
+
return `${marker}\n${own ? `${own}\n` : ""}${rest}${tip}`;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* The product's hidden line for a report or a hand-off (#4931, #4963): from
|
|
189
|
+
* the pipeline's `productMarker` and the file's `marker`, checked against
|
|
190
|
+
* {@link PRODUCT_MARKER_BODY}. Undefined when either is missing or the
|
|
191
|
+
* marker is not plain words.
|
|
192
|
+
*/
|
|
193
|
+
function productLineOf(name: string | undefined, marker: unknown): string | undefined {
|
|
194
|
+
if (name === undefined || !PRODUCT_MARKER_NAME.test(name) || typeof marker !== "string" || marker.length > PRODUCT_MARKER_LIMIT) return undefined;
|
|
195
|
+
if (marker !== "" && !PRODUCT_MARKER_BODY.test(marker)) return undefined;
|
|
196
|
+
return productMarkerLine(name, marker);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** The one plain word a re-plan was narrowed to (#4963), or undefined. */
|
|
200
|
+
function narrowedTo(input: Pick<PlanPostInput, "notAffected">): string | undefined {
|
|
201
|
+
const a = input.notAffected?.trim();
|
|
202
|
+
return a && /^[A-Za-z0-9_.\/@+=,:-]+$/.test(a) ? a : undefined;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The reply for a re-plan narrowed to an argument the change does not
|
|
207
|
+
* reach (#4963), in place of the note and the status, as terragucci's
|
|
208
|
+
* plan-note job replied (plan-note.ts).
|
|
209
|
+
*/
|
|
210
|
+
async function replyNotAffected(input: PlanPostInput, argument: string, state: PlanPostResult["state"], warnings: string[]): Promise<PlanPostResult> {
|
|
211
|
+
const description = `${argument} is not affected by this pull request, so nothing was planned.`;
|
|
212
|
+
try {
|
|
213
|
+
await input.forge.addComment(input.pr, `${activeProductWords().product}: ${description}`);
|
|
214
|
+
} catch (err) {
|
|
215
|
+
warnings.push(`could not reply on #${input.pr}: ${err instanceof Error ? err.message : String(err)}`);
|
|
216
|
+
}
|
|
217
|
+
const recorded = await keepRunRecord(input, warnings);
|
|
218
|
+
return { state, description: cut(description), noted: false, ...(recorded ? { recorded } : {}), warnings };
|
|
149
219
|
}
|
|
150
220
|
|
|
151
221
|
/** The hidden line a note carries with the target branch's commit it was posted against (#4628). */
|
|
@@ -158,6 +228,55 @@ export function prNoteStaleMarker(sha: string): string {
|
|
|
158
228
|
return `<!-- chant-pr-stale:${sha} -->`;
|
|
159
229
|
}
|
|
160
230
|
|
|
231
|
+
/**
|
|
232
|
+
* The hidden line a note keeps its plan's subject in (#4972): base64url of
|
|
233
|
+
* the subject's JSON, `{ id }` alone when its parts would make the line
|
|
234
|
+
* longer than {@link PLAN_SUBJECT_LIMIT}. Undefined when even that is.
|
|
235
|
+
*/
|
|
236
|
+
export function prNoteSubjectMarker(subject: PrPlanSubject): string | undefined {
|
|
237
|
+
const line = (s: PrPlanSubject) => `<!-- chant-pr-subject:${Buffer.from(JSON.stringify(s), "utf8").toString("base64url")} -->`;
|
|
238
|
+
const full = line(subject);
|
|
239
|
+
if (full.length <= PLAN_SUBJECT_LIMIT) return full;
|
|
240
|
+
const bare = line({ id: subject.id });
|
|
241
|
+
return bare.length <= PLAN_SUBJECT_LIMIT ? bare : undefined;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const SUBJECT_LINE = /^<!-- chant-pr-subject:([A-Za-z0-9_-]+) -->$/m;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* The subject a note kept (#4972), checked again: the line was chant's, but
|
|
248
|
+
* what it holds came from an earlier plan job. Undefined when there is none.
|
|
249
|
+
*/
|
|
250
|
+
export function subjectInNote(body: string): PrPlanSubject | undefined {
|
|
251
|
+
const m = SUBJECT_LINE.exec(body.replace(/\r\n/g, "\n"));
|
|
252
|
+
if (!m?.[1] || m[1].length > PLAN_SUBJECT_LIMIT) return undefined;
|
|
253
|
+
try {
|
|
254
|
+
const s = JSON.parse(Buffer.from(m[1], "base64url").toString("utf8")) as unknown;
|
|
255
|
+
return planSubjectProblem(s) === undefined ? (s as PrPlanSubject) : undefined;
|
|
256
|
+
} catch {
|
|
257
|
+
return undefined;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* The line saying what changed since the previous note (#4972): the
|
|
263
|
+
* previous note of the same environment and member is read with the job's
|
|
264
|
+
* token, and its kept subject compared with the hand-off's. Undefined when
|
|
265
|
+
* there is no previous note, it kept no subject, or the id is the same. A
|
|
266
|
+
* forge that refuses the read is a warning.
|
|
267
|
+
*/
|
|
268
|
+
async function sinceLastOf(input: PlanPostInput, subject: PrPlanSubject, words: PrPlanNoteWords | undefined, warnings: string[]): Promise<string | undefined> {
|
|
269
|
+
let found: { body: string } | undefined;
|
|
270
|
+
try {
|
|
271
|
+
found = await input.forge.findComment(input.pr, prNoteMarker(input.env, input.member));
|
|
272
|
+
} catch (err) {
|
|
273
|
+
warnings.push(`could not read the previous note on #${input.pr}, so the note does not say what changed since it: ${err instanceof Error ? err.message : String(err)}`);
|
|
274
|
+
return undefined;
|
|
275
|
+
}
|
|
276
|
+
const previous = found ? subjectInNote(found.body) : undefined;
|
|
277
|
+
return previous ? sinceLastLine(previous, subject, words ?? {}) : undefined;
|
|
278
|
+
}
|
|
279
|
+
|
|
161
280
|
const TIP_LINE = /<!-- chant-pr-tip:([0-9a-f]{40}) -->/;
|
|
162
281
|
const STALE_LINE = /<!-- chant-pr-stale:([0-9a-f]{40}) -->/;
|
|
163
282
|
const STALE_PREFIX = "> Stale: ";
|
|
@@ -195,6 +314,9 @@ export async function postPlanReport(input: PlanPostInput): Promise<PlanPostResu
|
|
|
195
314
|
description = cut(read.refused);
|
|
196
315
|
} else {
|
|
197
316
|
let report = read.report;
|
|
317
|
+
// #4963: a re-plan narrowed to an argument the change does not reach.
|
|
318
|
+
const narrowed = narrowedTo(input);
|
|
319
|
+
if (narrowed && report.status === "nothing" && !failedJob) return replyNotAffected(input, narrowed, "success", warnings);
|
|
198
320
|
if (input.overdue) {
|
|
199
321
|
const { overdue: _forged, ...rest } = report;
|
|
200
322
|
const found = await input.overdue().catch(() => [] as PrOverdue[]);
|
|
@@ -209,7 +331,9 @@ export async function postPlanReport(input: PlanPostInput): Promise<PlanPostResu
|
|
|
209
331
|
state = prStatusState(report);
|
|
210
332
|
description = prStatusDescription(report);
|
|
211
333
|
// A member the change does not reach has nothing to say on the pull request (as pr-plan's own publish).
|
|
212
|
-
|
|
334
|
+
// #4963: the report's own `marker`, under the pipeline's productMarker, as a hand-off's.
|
|
335
|
+
const own = productLineOf((input.noteWords ?? noteWordsFromEnv())?.productMarker, (read.report as { marker?: unknown }).marker);
|
|
336
|
+
if (!(input.member && report.status === "nothing" && !report.overdue?.length && !report.migrations?.length)) note = planNoteFor(report, input.forge, prNoteMarker(input.env, input.member), input.baseTip, own);
|
|
213
337
|
} catch (err) {
|
|
214
338
|
refused = `the plan report does not render: ${err instanceof Error ? err.message : String(err)}`;
|
|
215
339
|
state = "failure";
|
|
@@ -229,7 +353,40 @@ export async function postPlanReport(input: PlanPostInput): Promise<PlanPostResu
|
|
|
229
353
|
warnings.push(`the description check did not run: ${err instanceof Error ? err.message : String(err)}`);
|
|
230
354
|
}
|
|
231
355
|
}
|
|
232
|
-
|
|
356
|
+
const recorded = await keepRunRecord(input, warnings);
|
|
357
|
+
return { state, description: cut(description), noted: note !== undefined, ...(refused ? { refused } : {}), ...(recorded ? { recorded } : {}), warnings };
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Keep the plan job's run record on chant/lifecycle (#4899), with
|
|
362
|
+
* `input.recordRun`. A record that is missing, refused or not kept is a
|
|
363
|
+
* warning: the note and the status stand. Returns the record's id once kept.
|
|
364
|
+
*/
|
|
365
|
+
async function keepRunRecord(input: PlanPostInput, warnings: string[]): Promise<string | undefined> {
|
|
366
|
+
if (!input.recordRun) return undefined;
|
|
367
|
+
const read = readPlanRunRecord(input.dir, {
|
|
368
|
+
env: input.env,
|
|
369
|
+
head: input.head,
|
|
370
|
+
...(input.member ? { target: input.member } : {}),
|
|
371
|
+
...(input.result ? { result: input.result } : {}),
|
|
372
|
+
...(input.recordRun.origin ? { origin: input.recordRun.origin } : {}),
|
|
373
|
+
});
|
|
374
|
+
if (!read) {
|
|
375
|
+
warnings.push("the plan job wrote no run record, so none is kept");
|
|
376
|
+
return undefined;
|
|
377
|
+
}
|
|
378
|
+
if ("refused" in read) {
|
|
379
|
+
warnings.push(`the plan job's run record was not kept: ${read.refused}`);
|
|
380
|
+
return undefined;
|
|
381
|
+
}
|
|
382
|
+
try {
|
|
383
|
+
const said = await input.recordRun.keep(read.record);
|
|
384
|
+
if (said) warnings.push(said);
|
|
385
|
+
return read.record.id;
|
|
386
|
+
} catch (err) {
|
|
387
|
+
warnings.push(`the plan job's run record was not kept on chant/lifecycle: ${err instanceof Error ? err.message : String(err)}`);
|
|
388
|
+
return undefined;
|
|
389
|
+
}
|
|
233
390
|
}
|
|
234
391
|
|
|
235
392
|
/**
|
|
@@ -277,7 +434,7 @@ async function postOutcome(
|
|
|
277
434
|
* Read a product's plan note hand-off under `dir` (#4799) and check it is the
|
|
278
435
|
* one the caller ran, as {@link readPlanReport} checks a report.
|
|
279
436
|
*/
|
|
280
|
-
export function readPlanNoteHandoff(input: Pick<PlanPostInput, "dir" | "pr" | "head" | "env" | "member">): { handoff: PrPlanNoteHandoff } | { refused: string } {
|
|
437
|
+
export function readPlanNoteHandoff(input: Pick<PlanPostInput, "dir" | "pr" | "head" | "env" | "member">): { handoff: PrPlanNoteHandoff | PrPlanBodyHandoff } | { refused: string } {
|
|
281
438
|
let doc: unknown;
|
|
282
439
|
try {
|
|
283
440
|
doc = JSON.parse(readFileSync(join(input.dir, PR_PLAN_NOTE_FILE), "utf-8"));
|
|
@@ -294,10 +451,50 @@ export function readPlanNoteHandoff(input: Pick<PlanPostInput, "dir" | "pr" | "h
|
|
|
294
451
|
if ((r.member ?? undefined) !== input.member) return { refused: `the plan note is for ${JSON.stringify(r.member ?? null)}, not ${JSON.stringify(input.member ?? null)}` };
|
|
295
452
|
if (r.state !== "success" && r.state !== "failure" && r.state !== "pending") return { refused: `the plan note's state ${JSON.stringify(r.state)} is not success, failure or pending` };
|
|
296
453
|
if (typeof r.description !== "string") return { refused: "the plan note has no description" };
|
|
297
|
-
|
|
454
|
+
// #4963: the product's own text in place of a plan note.
|
|
455
|
+
if (r.body !== undefined) {
|
|
456
|
+
if (r.note !== undefined) return { refused: "the plan note gives both a note and a body; give one" };
|
|
457
|
+
if (typeof r.body !== "string" || r.body.length > PLAN_BODY_LIMIT) return { refused: `the plan note's body is not text of at most ${PLAN_BODY_LIMIT} characters` };
|
|
458
|
+
} else if (!isPlanNote(r.note) || r.note.head !== r.head || !Array.isArray(r.note.waves) || !Array.isArray(r.note.groups) || !Array.isArray(r.note.named)) {
|
|
298
459
|
return { refused: "the plan note's note is not a plan note for its head" };
|
|
299
460
|
}
|
|
300
|
-
|
|
461
|
+
// #4931: the product's hidden line is the change's too, so it holds only plain words.
|
|
462
|
+
if (r.marker !== undefined && (typeof r.marker !== "string" || r.marker.length > PRODUCT_MARKER_LIMIT || (r.marker !== "" && !PRODUCT_MARKER_BODY.test(r.marker)))) {
|
|
463
|
+
return { refused: `the plan note's marker is not words of letters, digits and _.,/@+=:- of at most ${PRODUCT_MARKER_LIMIT} characters` };
|
|
464
|
+
}
|
|
465
|
+
// #4972: the subject is kept in the note and said back in a later one, so it holds only plain words too.
|
|
466
|
+
const subjectProblem = r.subject !== undefined ? planSubjectProblem(r.subject) : undefined;
|
|
467
|
+
if (subjectProblem) return { refused: `the plan note's subject ${subjectProblem}` };
|
|
468
|
+
return { handoff: doc as PrPlanNoteHandoff | PrPlanBodyHandoff };
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* The note for a hand-off of the product's own text (#4963): chant's
|
|
473
|
+
* marker, the product's line, the body with every `<!--` defused, the
|
|
474
|
+
* notices as quoted lines under it, the tip line, cut to the forge's limit.
|
|
475
|
+
*/
|
|
476
|
+
export function planBodyHandoffNote(handoff: PrPlanBodyHandoff, forge: Pick<PrForge, "kind">, marker: string, noteWords?: PrPlanNoteWords, baseTip?: string, notices: readonly string[] = []): string {
|
|
477
|
+
const limit = forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT;
|
|
478
|
+
const line = productLineOf(noteWords?.productMarker, handoff.marker);
|
|
479
|
+
const head = `${marker}\n${line ? `${line}\n` : ""}`;
|
|
480
|
+
const said = notices.length > 0 ? `\n${notices.map((n) => `> ${n.split("<!--").join("<!--")}`).join("\n")}\n` : "";
|
|
481
|
+
const tip = baseTip && SHA.test(baseTip) ? `${prNoteTipMarker(baseTip)}\n` : "";
|
|
482
|
+
// #4972: the subject, kept for the next note to compare with.
|
|
483
|
+
const kept = handoff.subject ? prNoteSubjectMarker(handoff.subject) : undefined;
|
|
484
|
+
const subject = kept ? `${kept}\n` : "";
|
|
485
|
+
const body = handoff.body.split("<!--").join("<!--").replace(/\n*$/, "\n");
|
|
486
|
+
return `${head}${fitNote(body, { limit: Math.max(0, limit - head.length - said.length - tip.length - subject.length) })}${said}${tip}${subject}`;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/** The notices in the file `CHANT_PLAN_NOTE_NOTICES` names (#4931), one a line, or none when unset or unreadable. */
|
|
490
|
+
export function noticesFromEnv(env: NodeJS.ProcessEnv = process.env): string[] {
|
|
491
|
+
const file = env.CHANT_PLAN_NOTE_NOTICES;
|
|
492
|
+
if (!file || !existsSync(file)) return [];
|
|
493
|
+
try {
|
|
494
|
+
return readFileSync(file, "utf-8").split("\n").map((l) => l.trim()).filter((l) => l !== "");
|
|
495
|
+
} catch {
|
|
496
|
+
return [];
|
|
497
|
+
}
|
|
301
498
|
}
|
|
302
499
|
|
|
303
500
|
/** The note words from `CHANT_PLAN_NOTE_WORDS` (#4799), or undefined when unset or not an object. */
|
|
@@ -320,14 +517,21 @@ function noteWordsFromEnv(): PrPlanNoteWords | undefined {
|
|
|
320
517
|
*/
|
|
321
518
|
export function planNoteHandoffNote(handoff: PrPlanNoteHandoff, forge: Pick<PrForge, "kind">, marker: string, noteWords?: PrPlanNoteWords, baseTip?: string): string {
|
|
322
519
|
const words = activeProductWords();
|
|
323
|
-
|
|
520
|
+
// #4972: the subject, kept for the next note to compare with, within the forge's limit.
|
|
521
|
+
const kept = handoff.subject ? prNoteSubjectMarker(handoff.subject) : undefined;
|
|
522
|
+
const limit = (forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT) - (kept ? kept.length + 1 : 0);
|
|
523
|
+
const rendered = renderPlanNote(handoff.note, { limit, words, ...(noteWords ? { note: noteWords } : {}) });
|
|
324
524
|
let body = rendered.split("<!--").join("<!--");
|
|
325
525
|
const n = handoff.note;
|
|
326
526
|
const previews = n.previews ?? [];
|
|
327
527
|
const waves = planNoteMarker(noteWords?.marker ?? `${words.product}:waves`, { head: n.head, waves: n.waves.map((x) => ({ number: x.number, digest: x.digest ?? null, waits: x.waits === true })), ...(previews.length ? { previews } : {}) });
|
|
328
528
|
body = body.replace(`<!--${waves.slice(4)}`, waves);
|
|
329
529
|
const tip = baseTip && SHA.test(baseTip) ? `${body.endsWith("\n") ? "" : "\n"}${prNoteTipMarker(baseTip)}\n` : "";
|
|
330
|
-
|
|
530
|
+
// #4931: the product's own line, from the pipeline's name and the hand-off's checked body, under chant's marker.
|
|
531
|
+
const name = noteWords?.productMarker;
|
|
532
|
+
const own = name !== undefined && PRODUCT_MARKER_NAME.test(name) && handoff.marker !== undefined ? `${productMarkerLine(name, handoff.marker)}\n` : "";
|
|
533
|
+
const subject = kept ? `${body.endsWith("\n") || tip ? "" : "\n"}${kept}\n` : "";
|
|
534
|
+
return `${marker}\n${own}${body}${tip}${subject}`;
|
|
331
535
|
}
|
|
332
536
|
|
|
333
537
|
/** {@link postPlanReport} for a product's plan note hand-off (#4799). */
|
|
@@ -347,8 +551,22 @@ async function postPlanNoteHandoff(input: PlanPostInput): Promise<PlanPostResult
|
|
|
347
551
|
} else {
|
|
348
552
|
state = read.handoff.state;
|
|
349
553
|
description = read.handoff.description;
|
|
554
|
+
const h = read.handoff;
|
|
555
|
+
// #4963: a re-plan narrowed to an argument the change does not reach.
|
|
556
|
+
const narrowed = narrowedTo(input);
|
|
557
|
+
if (narrowed && "note" in h && h.note.nothing === true && !failedJob) return replyNotAffected(input, narrowed, state, warnings);
|
|
558
|
+
// #4931: the overdue Ops (#4289), asked here with the job's token, and the note job's own notices, under the counts.
|
|
559
|
+
const given = "note" in h ? (h.note.notices ?? []) : [];
|
|
560
|
+
// An Op the product's own notices already call overdue is not said twice.
|
|
561
|
+
const overdue = input.overdue ? (await input.overdue().catch(() => [] as PrOverdue[])).filter((o) => !given.some((g) => g.includes(`\`${o.op}\``) && g.includes("overdue"))).map((o) => o.message) : [];
|
|
562
|
+
const noteWords = input.noteWords ?? noteWordsFromEnv();
|
|
563
|
+
// #4972: what changed since the previous note, from the subject it kept, read here with the job's token.
|
|
564
|
+
const since = h.subject ? await sinceLastOf(input, h.subject, noteWords, warnings) : undefined;
|
|
565
|
+
const added = [...(since ? [since] : []), ...overdue, ...(input.notices ?? noticesFromEnv())].filter((n, i, all) => !given.includes(n) && all.indexOf(n) === i);
|
|
350
566
|
try {
|
|
351
|
-
note =
|
|
567
|
+
note = "note" in h
|
|
568
|
+
? planNoteHandoffNote(added.length > 0 ? { ...h, note: { ...h.note, notices: [...given, ...added] } } : h, input.forge, prNoteMarker(input.env, input.member), noteWords, input.baseTip)
|
|
569
|
+
: planBodyHandoffNote(h, input.forge, prNoteMarker(input.env, input.member), noteWords, input.baseTip, added);
|
|
352
570
|
} catch (err) {
|
|
353
571
|
refused = `the plan note does not render: ${err instanceof Error ? err.message : String(err)}`;
|
|
354
572
|
state = "failure";
|
|
@@ -360,7 +578,8 @@ async function postPlanNoteHandoff(input: PlanPostInput): Promise<PlanPostResult
|
|
|
360
578
|
}
|
|
361
579
|
}
|
|
362
580
|
note = await postOutcome(input, context, state, description, note, refused, warnings);
|
|
363
|
-
|
|
581
|
+
const recorded = await keepRunRecord(input, warnings);
|
|
582
|
+
return { state, description: cut(description), noted: note !== undefined, ...(refused ? { refused } : {}), ...(recorded ? { recorded } : {}), warnings };
|
|
364
583
|
}
|
|
365
584
|
|
|
366
585
|
/**
|
|
@@ -398,6 +617,17 @@ export interface OpenPlanPostInput {
|
|
|
398
617
|
description?: (report: PrReport) => Promise<void>;
|
|
399
618
|
/** The target branch's commit this pipeline runs at (#4628), for each note's tip line. */
|
|
400
619
|
baseTip?: string;
|
|
620
|
+
/**
|
|
621
|
+
* Keep each plan job's run record (#4899) from its artifacts, the job
|
|
622
|
+
* named as its run origin's `jobId`. `repo` is the project's path.
|
|
623
|
+
*/
|
|
624
|
+
recordRun?: { repo?: string; keep: PlanRunRecorder["keep"] };
|
|
625
|
+
/**
|
|
626
|
+
* Where the signing job of this pipeline kept each merge request's
|
|
627
|
+
* `evidence.json` (#4914), `<dir>/<iid>/evidence.json`: the note of a
|
|
628
|
+
* merge request whose file names its head ends with the checks line.
|
|
629
|
+
*/
|
|
630
|
+
evidenceDir?: string;
|
|
401
631
|
}
|
|
402
632
|
|
|
403
633
|
/** What {@link postOpenPlanReports} did for one merge request. */
|
|
@@ -447,6 +677,12 @@ export async function postOpenPlanReports(input: OpenPlanPostInput): Promise<{ p
|
|
|
447
677
|
// #4799: a product's plan verb writes its plan note hand-off in place of the report.
|
|
448
678
|
const handoff = text === undefined ? await forge.jobArtifact(job.id, `${input.artifactDir.replace(/\/+$/, "")}/${PR_PLAN_NOTE_FILE}`) : undefined;
|
|
449
679
|
if (handoff !== undefined) writeFileSync(join(dir, PR_PLAN_NOTE_FILE), handoff);
|
|
680
|
+
// #4899: the plan job's run record, kept with its note.
|
|
681
|
+
const runRecord = input.recordRun ? await forge.jobArtifact(job.id, `${input.artifactDir.replace(/\/+$/, "")}/${PLAN_RUN_RECORD_FILE}`) : undefined;
|
|
682
|
+
if (runRecord !== undefined) writeFileSync(join(dir, PLAN_RUN_RECORD_FILE), runRecord);
|
|
683
|
+
// #4914: what the signing job signed for this head, which the note's checks line says.
|
|
684
|
+
const evidence = input.evidenceDir ? openEvidenceFor(input.evidenceDir, job.pr, job.head) : undefined;
|
|
685
|
+
if (evidence !== undefined) writeFileSync(join(dir, CHECK_EVIDENCE_FILE), evidence);
|
|
450
686
|
const posted = await postPlanReport({
|
|
451
687
|
// The status links to the plan job it reports on, which is how the next run knows it is posted.
|
|
452
688
|
forge: job.url ? { ...forge, runUrl: job.url } : forge,
|
|
@@ -459,6 +695,9 @@ export async function postOpenPlanReports(input: OpenPlanPostInput): Promise<{ p
|
|
|
459
695
|
...(overdueOnce ? { overdue: overdueOnce } : {}),
|
|
460
696
|
...(input.description ? { description: input.description } : {}),
|
|
461
697
|
...(input.baseTip ? { baseTip: input.baseTip } : {}),
|
|
698
|
+
...(input.recordRun
|
|
699
|
+
? { recordRun: { origin: { forge: "gitlab", ...(input.recordRun.repo ? { repo: input.recordRun.repo } : {}), ...(job.url ? { url: job.url } : {}), jobId: String(job.id) }, keep: input.recordRun.keep } }
|
|
700
|
+
: {}),
|
|
462
701
|
});
|
|
463
702
|
posts.push({ pr: job.pr, head: job.head, posted });
|
|
464
703
|
} finally {
|
package/src/pr-requires.test.ts
CHANGED
|
@@ -129,6 +129,20 @@ describe("github", () => {
|
|
|
129
129
|
const f = forge({ [`GET ${repo}/commits/${HEAD}/status`]: { statuses: [] }, [`GET ${repo}/commits/${HEAD}/check-runs`]: { check_runs: [] } });
|
|
130
130
|
expect(await f.prChecksPassed!(7, HEAD)).toMatchObject({ passed: false, pending: true });
|
|
131
131
|
});
|
|
132
|
+
|
|
133
|
+
test("checks: a required status that has not reported is pending, through checkPrRequires' require (#4913)", async () => {
|
|
134
|
+
const green = { [`GET ${repo}/commits/${HEAD}/check-runs`]: { check_runs: [{ name: "lint", status: "completed", conclusion: "success" }] } };
|
|
135
|
+
const before = forge({ [`GET ${repo}/commits/${HEAD}/status`]: { statuses: [{ context: "ci/test", state: "success" }] }, ...green });
|
|
136
|
+
expect(await before.prChecksPassed!(7, HEAD, [], ["chant/ref-gate"])).toEqual({ passed: false, pending: true, reason: "chant/ref-gate still running on aaaaaaaa" });
|
|
137
|
+
const out = await checkPrRequires(before, 7, HEAD, { only: ["checks"], require: ["chant/ref-gate"], wait: async () => {} });
|
|
138
|
+
expect(out.find((o) => o.name === "checks")).toMatchObject({ passed: false, pending: true, reason: "chant/ref-gate still running on aaaaaaaa" });
|
|
139
|
+
// Without require, the same head passes: the gap the ref gate's status job leaves until it posts.
|
|
140
|
+
expect((await before.prChecksPassed!(7, HEAD)).passed).toBe(true);
|
|
141
|
+
const after = forge({ [`GET ${repo}/commits/${HEAD}/status`]: { statuses: [{ context: "ci/test", state: "success" }, { context: "chant/ref-gate", state: "success" }] }, ...green });
|
|
142
|
+
expect(await after.prChecksPassed!(7, HEAD, [], ["chant/ref-gate"])).toEqual({ passed: true, reason: "3 checks passed on aaaaaaaa" });
|
|
143
|
+
const refused = forge({ [`GET ${repo}/commits/${HEAD}/status`]: { statuses: [{ context: "chant/ref-gate", state: "failure" }] }, ...green });
|
|
144
|
+
expect((await refused.prChecksPassed!(7, HEAD, [], ["chant/ref-gate"])).reason).toBe("chant/ref-gate failed on aaaaaaaa");
|
|
145
|
+
});
|
|
132
146
|
});
|
|
133
147
|
|
|
134
148
|
describe("forgejo", () => {
|
|
@@ -264,6 +278,12 @@ describe("gitlab", () => {
|
|
|
264
278
|
expect(await f.prChecksPassed!(3, HEAD, ["apply"])).toEqual({ passed: true, reason: "2 checks passed on aaaaaaaa" });
|
|
265
279
|
expect((await f.prChecksPassed!(3, HEAD)).pending).toBe(true);
|
|
266
280
|
});
|
|
281
|
+
|
|
282
|
+
test("checks: a required status that has not reported is pending (#4913)", async () => {
|
|
283
|
+
const f = (statuses: unknown[]) => forge({ [`GET ${project}/repository/commits/${HEAD}/statuses`]: statuses });
|
|
284
|
+
expect(await f([{ id: 1, name: "test", status: "success" }]).prChecksPassed!(3, HEAD, [], ["chant/ref-gate"])).toEqual({ passed: false, pending: true, reason: "chant/ref-gate still running on aaaaaaaa" });
|
|
285
|
+
expect((await f([{ id: 1, name: "test", status: "success" }, { id: 2, name: "chant/ref-gate", status: "success" }]).prChecksPassed!(3, HEAD, [], ["chant/ref-gate"])).passed).toBe(true);
|
|
286
|
+
});
|
|
267
287
|
});
|
|
268
288
|
|
|
269
289
|
describe("checkPrRequires", () => {
|
package/src/pr-requires.ts
CHANGED
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import type { PrApproverFilter, PrExcludedApprover, PrForge, PrRequireResult } from "./pr-forge";
|
|
18
18
|
|
|
19
|
+
/** `require` in {@link PrRequiresOptions} (#4913). */
|
|
20
|
+
export { REF_GATE_PIECES_FLOOR } from "./release-floors";
|
|
21
|
+
|
|
19
22
|
/** The four checks, in the order they run and the report lists them. */
|
|
20
23
|
export const PR_APPLY_REQUIRES = ["approved", "mergeable", "undiverged", "checks"] as const;
|
|
21
24
|
|
|
@@ -40,6 +43,12 @@ export interface PrRequiresOptions {
|
|
|
40
43
|
approvers?: PrApproverFilter;
|
|
41
44
|
/** Status names the `checks` require leaves out: the apply's own. */
|
|
42
45
|
ignore?: readonly string[];
|
|
46
|
+
/**
|
|
47
|
+
* Statuses the `checks` require needs to have reported and passed (#4913),
|
|
48
|
+
* such as the ref gate's: `refGateRulesAt(...).status` from
|
|
49
|
+
* `@intentius/chant/ref-gate-rules`. One not reported yet is pending.
|
|
50
|
+
*/
|
|
51
|
+
require?: readonly string[];
|
|
43
52
|
/** How many times a pending check is asked in all. Default 5. */
|
|
44
53
|
reads?: number;
|
|
45
54
|
/** The wait between reads. Default 3 seconds. */
|
|
@@ -61,7 +70,7 @@ export async function checkPrRequires(forge: PrForge, pr: number, head: string,
|
|
|
61
70
|
approved: forge.prApproved ? () => forge.prApproved!(pr, head, opts.approvers) : undefined,
|
|
62
71
|
mergeable: forge.prMergeable ? () => forge.prMergeable!(pr, head) : undefined,
|
|
63
72
|
undiverged: forge.prUndiverged ? () => forge.prUndiverged!(pr, head) : undefined,
|
|
64
|
-
checks: forge.prChecksPassed ? () => forge.prChecksPassed!(pr, head, opts.ignore ?? []) : undefined,
|
|
73
|
+
checks: forge.prChecksPassed ? () => forge.prChecksPassed!(pr, head, opts.ignore ?? [], opts.require ?? []) : undefined,
|
|
65
74
|
};
|
|
66
75
|
const out: PrRequireOutcome[] = [];
|
|
67
76
|
const asked = new Set<PrApplyRequire>(opts.only ?? PR_APPLY_REQUIRES);
|
package/src/pr-status.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pull-request loop's commit status (#3183): its description and its
|
|
3
|
+
* state, from the report `chant components pr-plan` and `pr-apply` write.
|
|
4
|
+
*
|
|
5
|
+
* They lived in `./pr-loop.ts` until #4966 moved them here, so the bundle
|
|
6
|
+
* a product builds from `pr-loop.ts` and `pr-forge.ts` (the report, the note
|
|
7
|
+
* and the forge clients, `pr-loop-bundle.test.ts`) keeps room under its
|
|
8
|
+
* ceiling. chant's own handlers post the status; no product reads these.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { activeProductWords, type CiProductWords } from "./ci-product-words";
|
|
12
|
+
import { memberHoleReasons, type PrReport } from "./pr-loop";
|
|
13
|
+
|
|
14
|
+
/** A commit status's description, at most 140 characters (GitHub's limit). */
|
|
15
|
+
export function prStatusDescription(report: PrReport, words: CiProductWords = activeProductWords()): string {
|
|
16
|
+
const n = report.members.length;
|
|
17
|
+
const many = (k: number): string => `${k} ${words.noun[k === 1 ? 0 : 1]}`;
|
|
18
|
+
const sum = report.members.reduce(
|
|
19
|
+
(acc, m) => ({ change: acc.change + m.counts.create + m.counts.update + m.counts.replace, destroy: acc.destroy + m.counts.delete + m.counts.replace }),
|
|
20
|
+
{ change: 0, destroy: 0 },
|
|
21
|
+
);
|
|
22
|
+
const digest = report.digest ? `; plan ${report.digest.replace(/^(?:jcs1-)?sha256:/, "").slice(0, 12)}` : "";
|
|
23
|
+
let text: string;
|
|
24
|
+
switch (report.status) {
|
|
25
|
+
case "nothing":
|
|
26
|
+
text = "nothing to plan";
|
|
27
|
+
break;
|
|
28
|
+
case "planned": {
|
|
29
|
+
const unknown = report.members.filter((m) => memberHoleReasons(report, m.member).length > 0).length;
|
|
30
|
+
// #4626: a narrowed plan says so in its status.
|
|
31
|
+
const narrowed = Object.values(report.narrowed ?? {}).filter((a) => a.length > 0).length;
|
|
32
|
+
text = `${many(n)}${narrowed > 0 ? ` (${narrowed} narrowed with --target)` : ""}: ${sum.change} to change, ${sum.destroy} to destroy or replace${unknown > 0 ? `, ${unknown} with holes` : ""}${digest}`;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case "plan-failed":
|
|
36
|
+
text = `a ${words.noun[0]} failed to ${words.verbs.plan[0]}${digest}`;
|
|
37
|
+
break;
|
|
38
|
+
case "recorded":
|
|
39
|
+
text = `recorded ${many(n)}: ${report.approval.status === "approved" ? "the approved plan" : report.approval.status === "changed" ? "the plan differs from the approved one" : "no approval for this plan"}${digest}`;
|
|
40
|
+
break;
|
|
41
|
+
case "applied":
|
|
42
|
+
text = `${words.verbs.apply[1]} ${many(n)}${digest}`;
|
|
43
|
+
break;
|
|
44
|
+
case "wave-applied": {
|
|
45
|
+
const last = (report.waves ?? []).filter((w) => w.status === "applied").at(-1);
|
|
46
|
+
text = `applied wave ${last?.wave ?? "?"} of ${report.selection.waves.length}${last ? ` under ${last.approval === "pull-request" ? "the pull request's approval" : `${last.gate}`}` : ""}`;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
case "failed":
|
|
50
|
+
text = `apply failed for ${report.members.filter((m) => m.status === "failed").map((m) => m.member).join(", ")}`;
|
|
51
|
+
break;
|
|
52
|
+
case "waiting":
|
|
53
|
+
text = `waiting: ${report.members.filter((m) => m.status === "waiting").map((m) => m.member).join(", ")} planned again after an upstream applied, not approved yet`;
|
|
54
|
+
break;
|
|
55
|
+
case "refused": {
|
|
56
|
+
const waiting = report.waves?.find((w) => w.status === "waiting");
|
|
57
|
+
if (waiting && (report.refusal === "wave-not-approved" || report.refusal === "wave-plan-changed")) {
|
|
58
|
+
text = `wave ${waiting.wave} waits at ${waiting.gate}: ${report.refusal === "wave-plan-changed" ? "its plan changed after its approval" : "its plan moved, approve it"}`;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
if (report.refusal === "earlier-wave") {
|
|
62
|
+
text = "refused: an earlier wave has not applied";
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
if (report.refusal === "requires-unmet" || report.refusal === "before-merge-off") {
|
|
66
|
+
const unmet = (report.beforeMerge?.requires ?? []).filter((r) => !r.passed).map((r) => r.name);
|
|
67
|
+
text = report.refusal === "before-merge-off" ? "refused: this workspace does not apply before merge" : `refused: ${unmet.join(", ") || "a require"} unmet for an apply before merge`;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
if (report.refusal === "policy-denied" || report.refusal === "policy-error") {
|
|
71
|
+
text = report.refusal === "policy-denied" ? `refused: the policy denied the plan (${(report.policy?.rules ?? []).join(", ")})` : "refused: the policy could not be checked";
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
text = `refused: ${report.refusal === "plan-changed" ? "the plan changed after review" : report.refusal === "not-a-reviewer" ? "the approver has not approved the pull request" : report.refusal === "author-approved" ? "the approver wrote the change" : report.refusal === "no-pull-request" ? "no pull request merged this commit" : report.refusal === "locked" ? "another pull request holds a target lock" : "the plan is not approved"}`;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return text.length > 140 ? text.slice(0, 137) + "..." : text;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The commit status state for a report: success, failure, or pending while it waits on approval. */
|
|
82
|
+
export function prStatusState(report: PrReport): "success" | "failure" | "pending" {
|
|
83
|
+
// #4168 decision 1: a merge whose plan differs from the approved one is recorded, and its status fails.
|
|
84
|
+
if (report.status === "recorded") return report.approval.status === "changed" ? "failure" : "success";
|
|
85
|
+
// #4294: a plan the policy denied, with no override, or one it could not check, fails at the plan stage as it would at the apply.
|
|
86
|
+
if (report.status === "planned" && report.policy && (report.policy.result === "error" || (report.policy.result === "denied" && !report.policy.override))) return "failure";
|
|
87
|
+
if (report.status === "planned" || report.status === "applied" || report.status === "wave-applied" || report.status === "nothing") return "success";
|
|
88
|
+
if (report.status === "refused" && (report.refusal === "not-approved" || report.refusal === "wave-not-approved")) return "pending";
|
|
89
|
+
if (report.status === "waiting") return "pending";
|
|
90
|
+
return "failure";
|
|
91
|
+
}
|