@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { spawnSync } from "node:child_process";
|
|
2
|
-
import { mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { dirname, join, resolve } from "node:path";
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -26,14 +26,15 @@ const write = (file: string, body: string | object) => {
|
|
|
26
26
|
writeFileSync(file, typeof body === "string" ? body : JSON.stringify(body, null, 2) + "\n");
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
/** A chant checkout whose core and k8s lexicon are already built (dist/ in place, no prepack). */
|
|
30
|
-
function checkout(): string {
|
|
29
|
+
/** A chant checkout whose core and k8s lexicon are already built (dist/ in place, no prepack); `next` writes a NEXT_RELEASE into its release-floors.ts. */
|
|
30
|
+
function checkout(next?: string): string {
|
|
31
31
|
const dir = mkdtempSync(join(tmpdir(), "chant-4787-e2e-checkout-"));
|
|
32
32
|
write(join(dir, "package.json"), { name: "chant-monorepo", private: true, workspaces: ["packages/*", "lexicons/*"] });
|
|
33
33
|
write(join(dir, "packages/core/package.json"), { name: "@intentius/chant", version: "2.0.0", type: "module", files: ["dist/"], exports: { ".": { import: "./dist/index.js" } } });
|
|
34
34
|
write(join(dir, "packages/core/dist/index.js"), "export const local = true;\n");
|
|
35
35
|
write(join(dir, "lexicons/k8s/package.json"), { name: "@intentius/chant-lexicon-k8s", version: "2.0.0", type: "module", files: ["dist/"], exports: { ".": { default: "./dist/index.js" } }, peerDependencies: { "@intentius/chant": "2.0.0" } });
|
|
36
36
|
write(join(dir, "lexicons/k8s/dist/index.js"), "export {};\n");
|
|
37
|
+
if (next) write(join(dir, "packages/core/src/release-floors.ts"), `export const NEXT_RELEASE = "${next}";\n`);
|
|
37
38
|
// A lock for the checkout's npm ci: workspaces only, so npm writes it offline.
|
|
38
39
|
const lock = spawnSync("npm", ["install", "--package-lock-only", "--offline", "--no-audit", "--no-fund"], { cwd: dir, encoding: "utf8" });
|
|
39
40
|
if (lock.status !== 0) throw new Error(`npm install --package-lock-only: ${lock.stderr}`);
|
|
@@ -55,8 +56,11 @@ function product(): string {
|
|
|
55
56
|
return dir;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
const chant = (cwd: string, ...args: string[]) =>
|
|
59
|
-
|
|
59
|
+
const chant = (cwd: string, ...args: (string | { env: Record<string, string> })[]) => {
|
|
60
|
+
const extra = args.find((a): a is { env: Record<string, string> } => typeof a !== "string");
|
|
61
|
+
const argv = args.filter((a): a is string => typeof a === "string");
|
|
62
|
+
return spawnSync(process.execPath, ["--import", tsxLoader, mainTs, ...argv], { cwd, encoding: "utf8", env: { ...process.env, NO_COLOR: "1", npm_config_offline: "true", ...extra?.env }, timeout: 110_000 });
|
|
63
|
+
};
|
|
60
64
|
|
|
61
65
|
describe("chant dev local (#4787)", () => {
|
|
62
66
|
it("packs a checkout into a product, keeps its manifests and lock, builds, and checks the bundle", () => {
|
|
@@ -91,4 +95,75 @@ describe("chant dev local (#4787)", () => {
|
|
|
91
95
|
expect(r.status).toBe(2);
|
|
92
96
|
expect(r.stderr).toContain("chant dev local needs a chant checkout");
|
|
93
97
|
}, 60_000);
|
|
98
|
+
|
|
99
|
+
it("keeps a dev dependency's peers and installs the checkout at its next release (#4921)", async () => {
|
|
100
|
+
const repo = checkout("2.1.0");
|
|
101
|
+
const dir = product();
|
|
102
|
+
// A test runner whose peer (vitest's vite, say) npm installs from the registry.
|
|
103
|
+
const vendor = join(dir, "vendor/tester");
|
|
104
|
+
write(join(vendor, "package.json"), { name: "tester", version: "1.0.0", peerDependencies: { helper: "^1.0.0" } });
|
|
105
|
+
const packed = spawnSync("npm", ["pack", "--silent", "--pack-destination", join(dir, "vendor")], { cwd: vendor, encoding: "utf8" });
|
|
106
|
+
expect(packed.status).toBe(0);
|
|
107
|
+
const root = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
|
|
108
|
+
root.devDependencies.tester = "file:vendor/tester-1.0.0.tgz";
|
|
109
|
+
write(join(dir, "package.json"), root);
|
|
110
|
+
const registry = await startRegistry(dir);
|
|
111
|
+
try {
|
|
112
|
+
const env = { npm_config_registry: registry.url, npm_config_offline: "false" };
|
|
113
|
+
const build = "mkdir -p packages/app/dist && printf 'import { local } from \"@intentius/chant\";\\n' > packages/app/dist/app.mjs";
|
|
114
|
+
const r = chant(dir, "dev", "local", repo, "--build", build, "--json", { env });
|
|
115
|
+
expect(r.stderr).not.toContain("ERESOLVE");
|
|
116
|
+
expect(r.status).toBe(0);
|
|
117
|
+
expect(existsSync(join(dir, "node_modules/helper/package.json"))).toBe(true);
|
|
118
|
+
|
|
119
|
+
const core = JSON.parse(readFileSync(join(dir, "node_modules/@intentius/chant/package.json"), "utf8"));
|
|
120
|
+
expect(core.version).toBe("2.1.0");
|
|
121
|
+
const lexicon = JSON.parse(readFileSync(join(dir, "node_modules/@intentius/chant-lexicon-k8s/package.json"), "utf8"));
|
|
122
|
+
expect(lexicon.version).toBe("2.1.0");
|
|
123
|
+
expect(lexicon.peerDependencies["@intentius/chant"]).toBe("2.1.0");
|
|
124
|
+
const out = JSON.parse(r.stdout);
|
|
125
|
+
expect(out.local.packed).toEqual([
|
|
126
|
+
{ name: "@intentius/chant", version: "2.1.0" },
|
|
127
|
+
{ name: "@intentius/chant-lexicon-k8s", version: "2.1.0" },
|
|
128
|
+
]);
|
|
129
|
+
} finally {
|
|
130
|
+
registry.stop();
|
|
131
|
+
}
|
|
132
|
+
}, 120_000);
|
|
94
133
|
});
|
|
134
|
+
|
|
135
|
+
/** A registry on localhost, in its own process, that serves `helper` 1.0.0. */
|
|
136
|
+
async function startRegistry(dir: string): Promise<{ url: string; stop: () => void }> {
|
|
137
|
+
const helper = join(dir, "vendor/helper");
|
|
138
|
+
write(join(helper, "package.json"), { name: "helper", version: "1.0.0" });
|
|
139
|
+
const packed = spawnSync("npm", ["pack", "--silent", "--pack-destination", join(dir, "vendor")], { cwd: helper, encoding: "utf8" });
|
|
140
|
+
if (packed.status !== 0) throw new Error(`npm pack helper: ${packed.stderr}`);
|
|
141
|
+
const server = join(dir, "vendor/registry.mjs");
|
|
142
|
+
write(
|
|
143
|
+
server,
|
|
144
|
+
`import { createServer } from "node:http";
|
|
145
|
+
import { readFileSync } from "node:fs";
|
|
146
|
+
import { createHash } from "node:crypto";
|
|
147
|
+
const tgz = readFileSync(${JSON.stringify(join(dir, "vendor/helper-1.0.0.tgz"))});
|
|
148
|
+
const s = createServer((req, res) => {
|
|
149
|
+
const base = "http://127.0.0.1:" + s.address().port;
|
|
150
|
+
if (req.url === "/helper") {
|
|
151
|
+
res.setHeader("content-type", "application/json");
|
|
152
|
+
res.end(JSON.stringify({ name: "helper", "dist-tags": { latest: "1.0.0" }, versions: { "1.0.0": { name: "helper", version: "1.0.0", dist: { tarball: base + "/helper-1.0.0.tgz", shasum: createHash("sha1").update(tgz).digest("hex") } } } }));
|
|
153
|
+
} else if (req.url === "/helper-1.0.0.tgz") {
|
|
154
|
+
res.end(tgz);
|
|
155
|
+
} else {
|
|
156
|
+
res.statusCode = 404;
|
|
157
|
+
res.end("{}");
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
s.listen(0, "127.0.0.1", () => console.log(s.address().port));
|
|
161
|
+
`,
|
|
162
|
+
);
|
|
163
|
+
const child = spawn(process.execPath, [server], { stdio: ["ignore", "pipe", "inherit"] });
|
|
164
|
+
const port = await new Promise<string>((ok, fail) => {
|
|
165
|
+
child.stdout.once("data", (b: Buffer) => ok(b.toString().trim()));
|
|
166
|
+
child.once("exit", (code) => fail(new Error(`the registry exited ${code}`)));
|
|
167
|
+
});
|
|
168
|
+
return { url: `http://127.0.0.1:${port}/`, stop: () => child.kill() };
|
|
169
|
+
}
|
package/src/local-chant.test.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { basename, dirname, join } from "node:path";
|
|
4
4
|
import { describe, expect, it } from "vitest";
|
|
5
|
-
import { chantPackages, installLocalChant, LocalChantError, lockMismatches, packOrder, pointAtTarballs, productChantNames, productManifests, type Runner } from "./local-chant";
|
|
5
|
+
import { chantPackages, installLocalChant, LocalChantError, localChantVersion, lockMismatches, packOrder, pointAtTarballs, productChantNames, productManifests, type Runner } from "./local-chant";
|
|
6
6
|
|
|
7
7
|
/** #4787: what terragucci's and plywood's scripts/chant-local.sh did, as chant's `chant dev local`. */
|
|
8
8
|
|
|
@@ -60,10 +60,26 @@ describe("the packages to pack (#4787)", () => {
|
|
|
60
60
|
const root = pointAtTarballs({ dependencies: { "@intentius/chant": "1.0.0" } }, local, true);
|
|
61
61
|
expect(root).toEqual({ dependencies: { "@intentius/chant": "file:/t/a.tgz" }, devDependencies: { "@intentius/chant-lexicon-k8s": "file:/t/b.tgz" } });
|
|
62
62
|
});
|
|
63
|
+
|
|
64
|
+
it("gives a peer on a packed package its packed version (#4921)", () => {
|
|
65
|
+
const local = new Map([["@intentius/chant", "file:/t/a.tgz"]]);
|
|
66
|
+
const app = pointAtTarballs({ peerDependencies: { "@intentius/chant": "1.0.0", vitest: ">=2" } }, local, false, new Map([["@intentius/chant", "2.1.0"]]));
|
|
67
|
+
expect(app.peerDependencies).toEqual({ "@intentius/chant": "2.1.0", vitest: ">=2" });
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
describe("localChantVersion (#4921)", () => {
|
|
72
|
+
it("is the checkout's NEXT_RELEASE when it is newer than core's package.json version", () => {
|
|
73
|
+
const chant = checkout();
|
|
74
|
+
expect(localChantVersion(chant, "2.0.0")).toBe("2.0.0");
|
|
75
|
+
write(join(chant, "packages/core/src/release-floors.ts"), 'export const NEXT_RELEASE = "2.1.0";\n');
|
|
76
|
+
expect(localChantVersion(chant, "2.0.0")).toBe("2.1.0");
|
|
77
|
+
expect(localChantVersion(chant, "2.2.0")).toBe("2.2.0");
|
|
78
|
+
});
|
|
63
79
|
});
|
|
64
80
|
|
|
65
81
|
/** A runner standing in for npm: pack writes a versioned tarball; install copies each `file:` dependency the manifests name into node_modules. */
|
|
66
|
-
function fakeNpm(seen: { manifests?: string[]; calls: string[] }, opts: { installVersion?: string } = {}): Runner {
|
|
82
|
+
function fakeNpm(seen: { manifests?: string[]; calls: string[]; installArgs?: string[] }, opts: { installVersion?: string } = {}): Runner {
|
|
67
83
|
return (command, args, cwd) => {
|
|
68
84
|
seen.calls.push(`${command} ${args[0]} ${basename(cwd)}`);
|
|
69
85
|
if (args[0] === "pack") {
|
|
@@ -73,6 +89,7 @@ function fakeNpm(seen: { manifests?: string[]; calls: string[] }, opts: { instal
|
|
|
73
89
|
return `${file}\n`;
|
|
74
90
|
}
|
|
75
91
|
if (args[0] === "install") {
|
|
92
|
+
seen.installArgs = args;
|
|
76
93
|
seen.manifests = productManifests(cwd).map((f) => readFileSync(join(cwd, f), "utf8"));
|
|
77
94
|
for (const f of productManifests(cwd)) {
|
|
78
95
|
const p = JSON.parse(readFileSync(join(cwd, f), "utf8"));
|
|
@@ -95,11 +112,13 @@ describe("installLocalChant (#4787)", () => {
|
|
|
95
112
|
const chant = checkout();
|
|
96
113
|
const dir = product();
|
|
97
114
|
const before = ["package.json", "packages/app/package.json", "package-lock.json"].map((f) => readFileSync(join(dir, f), "utf8"));
|
|
98
|
-
const seen: { manifests?: string[]; calls: string[] } = { calls: [] };
|
|
115
|
+
const seen: { manifests?: string[]; calls: string[]; installArgs?: string[] } = { calls: [] };
|
|
99
116
|
const r = installLocalChant({ productDir: dir, chantDir: chant, install: false, run: fakeNpm(seen), log: () => {} });
|
|
100
117
|
|
|
101
118
|
expect(r.packed.map((p) => p.dir)).toEqual(["packages/core", "lexicons/k8s"]);
|
|
102
119
|
expect(seen.calls).toEqual(["npm pack core", "npm pack k8s", `npm install ${basename(dir)}`]);
|
|
120
|
+
// #4921: peers stay installed.
|
|
121
|
+
expect(seen.installArgs).not.toContain("--legacy-peer-deps");
|
|
103
122
|
expect(existsSync(join(dir, ".chant-local/intentius-chant.tgz"))).toBe(true);
|
|
104
123
|
expect(existsSync(join(dir, ".chant-local/intentius-chant-2.0.0.tgz"))).toBe(false);
|
|
105
124
|
// During the install every manifest named the tarballs.
|
package/src/local-chant.ts
CHANGED
|
@@ -11,11 +11,13 @@
|
|
|
11
11
|
* follows the packages it builds against ({@link packOrder});
|
|
12
12
|
* 2. `npm ci` in the checkout when its lock changed since the last run, then
|
|
13
13
|
* `npm pack` each package (its prepack builds it) into `.chant-local/` in
|
|
14
|
-
* the product, under a fixed name per package
|
|
14
|
+
* the product, under a fixed name per package, at the checkout's next
|
|
15
|
+
* release ({@link localChantVersion}, #4921);
|
|
15
16
|
* 3. point every package.json of the product at the tarballs, run
|
|
16
17
|
* `npm install --no-save`, and put the manifests and package-lock.json
|
|
17
18
|
* back byte for byte, so the workspace gets the local build everywhere and
|
|
18
|
-
* git sees no change
|
|
19
|
+
* git sees no change. The install keeps peer dependencies (#4921), so a
|
|
20
|
+
* test runner's peers stay installed;
|
|
19
21
|
* 4. mark each installed copy's package.json with `chantLocal` (the commit and
|
|
20
22
|
* the checkout), which `checkBundle` and a reader use to tell the local
|
|
21
23
|
* build from the pin, and fail when a copy is not the local build.
|
|
@@ -25,7 +27,8 @@
|
|
|
25
27
|
*/
|
|
26
28
|
import { spawnSync } from "node:child_process";
|
|
27
29
|
import { createHash } from "node:crypto";
|
|
28
|
-
import { existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
30
|
+
import { existsSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
31
|
+
import { tmpdir } from "node:os";
|
|
29
32
|
import { join, relative, resolve } from "node:path";
|
|
30
33
|
|
|
31
34
|
/** A chant workspace package that can be packed: not private. */
|
|
@@ -140,6 +143,54 @@ export function packOrder(pkgs: Map<string, ChantPackage>, want: Iterable<string
|
|
|
140
143
|
return out;
|
|
141
144
|
}
|
|
142
145
|
|
|
146
|
+
/** `a` against `b` as `x.y.z` versions, prerelease ignored: negative when `a` is older. */
|
|
147
|
+
function compareCore(a: string, b: string): number {
|
|
148
|
+
const pa = a.split(/[-+]/)[0]!.split(".").map(Number);
|
|
149
|
+
const pb = b.split(/[-+]/)[0]!.split(".").map(Number);
|
|
150
|
+
for (let i = 0; i < 3; i++) if ((pa[i] ?? 0) !== (pb[i] ?? 0)) return (pa[i] ?? 0) - (pb[i] ?? 0);
|
|
151
|
+
return 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The version `chant dev local` packs a checkout at (#4921): the checkout's
|
|
156
|
+
* `NEXT_RELEASE` (packages/core/src/release-floors.ts), the release its
|
|
157
|
+
* floors name, when that is newer than core's package.json version. A
|
|
158
|
+
* checkout's package.json keeps the version of the last time it was bumped by
|
|
159
|
+
* hand (0.124.34 while 0.124.87 was out), which failed a product's floor and
|
|
160
|
+
* `minReader` checks that pass on a published chant. Every floor the checkout
|
|
161
|
+
* declares is at or below `NEXT_RELEASE`, so the local build passes each one.
|
|
162
|
+
* The build is marked local by the `chantLocal` field on each installed copy,
|
|
163
|
+
* not in the version, because a prerelease of `NEXT_RELEASE` sorts below it.
|
|
164
|
+
*/
|
|
165
|
+
export function localChantVersion(chantDir: string, coreVersion: string): string {
|
|
166
|
+
const f = join(chantDir, "packages/core/src/release-floors.ts");
|
|
167
|
+
const next = existsSync(f) ? /export const NEXT_RELEASE = "(\d+\.\d+\.\d+)"/.exec(readFileSync(f, "utf8"))?.[1] : undefined;
|
|
168
|
+
return next !== undefined && compareCore(next, coreVersion) > 0 ? next : coreVersion;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Set the version of one packed tarball's package.json, and every chant
|
|
173
|
+
* dependency, peer and optional dependency it names among `versions` to that
|
|
174
|
+
* package's packed version, so the packages npm installs agree with each
|
|
175
|
+
* other (#4921). The tarball is unpacked under the OS temp directory, which is
|
|
176
|
+
* left for the OS to clear, and packed again in place. Nothing is run when
|
|
177
|
+
* the manifest already says all of it.
|
|
178
|
+
*/
|
|
179
|
+
export function restampTarball(tarball: string, versions: Map<string, string>, run: Runner): void {
|
|
180
|
+
const stage = mkdtempSync(join(tmpdir(), "chant-dev-local-"));
|
|
181
|
+
run("tar", ["-xzf", tarball, "-C", stage], stage);
|
|
182
|
+
const f = join(stage, "package", "package.json");
|
|
183
|
+
const p = readManifest(f);
|
|
184
|
+
const before = JSON.stringify(p);
|
|
185
|
+
if (p.name && versions.has(p.name)) p.version = versions.get(p.name)!;
|
|
186
|
+
for (const k of ["dependencies", "peerDependencies", "optionalDependencies"] as const) {
|
|
187
|
+
for (const n of Object.keys(p[k] ?? {})) if (versions.has(n)) p[k]![n] = versions.get(n)!;
|
|
188
|
+
}
|
|
189
|
+
if (JSON.stringify(p) === before) return;
|
|
190
|
+
writeFileSync(f, `${JSON.stringify(p, null, 2)}\n`);
|
|
191
|
+
run("tar", ["-czf", tarball, "-C", stage, "package"], stage);
|
|
192
|
+
}
|
|
193
|
+
|
|
143
194
|
/** The fixed tarball name for a package, so a later run replaces it: `@intentius/chant-lexicon-k8s` is `intentius-chant-lexicon-k8s.tgz`. */
|
|
144
195
|
export const tarballName = (name: string) => `${name.replace(/^@/, "").replace(/\//g, "-")}.tgz`;
|
|
145
196
|
|
|
@@ -148,15 +199,18 @@ export const tarballName = (name: string) => `${name.replace(/^@/, "").replace(/
|
|
|
148
199
|
* and optionalDependency `local` names takes its `file:` spec. The root also
|
|
149
200
|
* gets every tarball as a devDependency, so npm replaces a copy only a lexicon
|
|
150
201
|
* reaches (a lexicon's own chant dependencies) instead of keeping a registry
|
|
151
|
-
* release of it.
|
|
202
|
+
* release of it. A peerDependency on a packed package takes its packed
|
|
203
|
+
* version from `versions` (#4921), so the install needs no
|
|
204
|
+
* `--legacy-peer-deps`.
|
|
152
205
|
*/
|
|
153
|
-
export function pointAtTarballs(manifest: Manifest, local: Map<string, string>, isRoot: boolean): Manifest {
|
|
206
|
+
export function pointAtTarballs(manifest: Manifest, local: Map<string, string>, isRoot: boolean, versions: Map<string, string> = new Map()): Manifest {
|
|
154
207
|
const p: Manifest = structuredClone(manifest);
|
|
155
208
|
for (const k of ["dependencies", "devDependencies", "optionalDependencies"] as const) {
|
|
156
209
|
const deps = p[k];
|
|
157
210
|
if (!deps) continue;
|
|
158
211
|
for (const n of Object.keys(deps)) if (local.has(n)) deps[n] = local.get(n)!;
|
|
159
212
|
}
|
|
213
|
+
for (const n of Object.keys(p.peerDependencies ?? {})) if (versions.has(n)) p.peerDependencies![n] = versions.get(n)!;
|
|
160
214
|
if (isRoot) {
|
|
161
215
|
const extra = Object.fromEntries([...local].filter(([n]) => !(n in (p.dependencies ?? {})) && !(n in (p.optionalDependencies ?? {}))));
|
|
162
216
|
p.devDependencies = { ...p.devDependencies, ...extra };
|
|
@@ -186,9 +240,10 @@ export function installedChantCopies(productDir: string): { at: string; name: st
|
|
|
186
240
|
/** How a command runs: throws {@link LocalChantError} when it exits non-zero. */
|
|
187
241
|
export type Runner = (command: string, args: string[], cwd: string) => string;
|
|
188
242
|
|
|
189
|
-
/** Run a command with its stderr on ours and its stdout returned. */
|
|
243
|
+
/** Run a command with its stderr on ours and its stdout returned. macOS tar is told not to add `._` metadata files. */
|
|
190
244
|
export const defaultRunner: Runner = (command, args, cwd) => {
|
|
191
|
-
const
|
|
245
|
+
const env = command === "tar" ? { ...process.env, COPYFILE_DISABLE: "1" } : process.env;
|
|
246
|
+
const r = spawnSync(command, args, { cwd, env, stdio: ["ignore", "pipe", "inherit"], encoding: "utf8", maxBuffer: 64 * 1024 * 1024 });
|
|
192
247
|
if (r.error) throw new LocalChantError(`${command} ${args.join(" ")} in ${cwd}: ${r.error.message}`);
|
|
193
248
|
if (r.status !== 0) throw new LocalChantError(`${command} ${args.join(" ")} in ${cwd} exited ${r.status ?? r.signal}`);
|
|
194
249
|
return r.stdout;
|
|
@@ -255,6 +310,10 @@ export function installLocalChant(opts: LocalChantOptions): LocalChantResult {
|
|
|
255
310
|
|
|
256
311
|
const outDir = join(productDir, ".chant-local");
|
|
257
312
|
mkdirSync(join(outDir, "manifests"), { recursive: true });
|
|
313
|
+
// #4921: every package at the checkout's next release, which a product's floor checks accept.
|
|
314
|
+
const version = localChantVersion(chantDir, pkgs.get("@intentius/chant")?.version ?? order[0]!.version);
|
|
315
|
+
const stamped = new Map(order.map((p) => [p.name, version]));
|
|
316
|
+
const restamp = order.some((p) => p.version !== version);
|
|
258
317
|
const packed: LocalChantResult["packed"] = [];
|
|
259
318
|
for (const p of order) {
|
|
260
319
|
log(`packing ${p.dir}`);
|
|
@@ -263,29 +322,34 @@ export function installLocalChant(opts: LocalChantOptions): LocalChantResult {
|
|
|
263
322
|
if (!file || !existsSync(join(outDir, file))) throw new LocalChantError(`npm pack in ${p.dir} wrote no tarball`);
|
|
264
323
|
const fixed = tarballName(p.name);
|
|
265
324
|
if (file !== fixed) renameSync(join(outDir, file), join(outDir, fixed));
|
|
266
|
-
|
|
325
|
+
if (restamp) restampTarball(join(outDir, fixed), stamped, run);
|
|
326
|
+
packed.push({ ...p, version, tarball: join(outDir, fixed) });
|
|
267
327
|
}
|
|
328
|
+
if (restamp) log(`packed at ${version}, the checkout's next release; each installed copy is marked chantLocal`);
|
|
268
329
|
writeFileSync(join(outDir, "commit"), `${mark.commit}\n`);
|
|
269
330
|
writeFileSync(join(outDir, "packages.json"), `${JSON.stringify(packed.map((p) => ({ name: p.name, version: p.version, tarball: relative(productDir, p.tarball) })), null, 2)}\n`);
|
|
270
331
|
|
|
271
332
|
// The workspace packages pin chant too, so installing at the root alone
|
|
272
333
|
// would leave the pinned copies nested under packages/*/node_modules. Point
|
|
273
334
|
// every package.json at the tarballs for one install and put each file
|
|
274
|
-
// back afterwards, the lock with them.
|
|
275
|
-
//
|
|
276
|
-
//
|
|
335
|
+
// back afterwards, the lock with them. Peers are installed as npm always
|
|
336
|
+
// does (#4921): --legacy-peer-deps dropped a test runner's peers (vitest's
|
|
337
|
+
// vite, rolldown, lightningcss). The packed versions are the next release,
|
|
338
|
+
// which the pinned lexicons' `^` peers on core accept, and each manifest's
|
|
339
|
+
// peers on chant name the packed version.
|
|
277
340
|
const local = new Map(packed.map((p) => [p.name, `file:${p.tarball}`]));
|
|
341
|
+
const packedVersions = new Map(packed.map((p) => [p.name, p.version]));
|
|
278
342
|
const files = [...productManifests(productDir), ...(existsSync(join(productDir, "package-lock.json")) ? ["package-lock.json"] : [])];
|
|
279
343
|
const saved = new Map(files.map((f) => [f, readFileSync(join(productDir, f))]));
|
|
280
344
|
for (const [f, body] of saved) writeFileSync(join(outDir, "manifests", f.replace(/\//g, "_")), body);
|
|
281
345
|
try {
|
|
282
346
|
for (const f of files) {
|
|
283
347
|
if (!f.endsWith("package.json")) continue;
|
|
284
|
-
const p = pointAtTarballs(JSON.parse(saved.get(f)!.toString("utf8")) as Manifest, local, f === "package.json");
|
|
348
|
+
const p = pointAtTarballs(JSON.parse(saved.get(f)!.toString("utf8")) as Manifest, local, f === "package.json", packedVersions);
|
|
285
349
|
writeFileSync(join(productDir, f), `${JSON.stringify(p, null, 2)}\n`);
|
|
286
350
|
}
|
|
287
351
|
log(`installing ${packed.length} tarballs with npm install --no-save`);
|
|
288
|
-
run("npm", ["install", "--no-save", "--no-audit", "--no-fund"
|
|
352
|
+
run("npm", ["install", "--no-save", "--no-audit", "--no-fund"], productDir);
|
|
289
353
|
} finally {
|
|
290
354
|
for (const [f, body] of saved) writeFileSync(join(productDir, f), body);
|
|
291
355
|
}
|
|
@@ -339,3 +403,56 @@ export function resetLocalChant(opts: { productDir: string; log?: (line: string)
|
|
|
339
403
|
const bad = lockMismatches(dir);
|
|
340
404
|
if (bad.length) throw new LocalChantError(`node_modules does not match package-lock.json after npm ci:\n ${bad.join("\n ")}`);
|
|
341
405
|
}
|
|
406
|
+
|
|
407
|
+
/** What a product's image build needs to install the chant the product has (#4909). */
|
|
408
|
+
export interface LocalChantImage {
|
|
409
|
+
/** The chant the image installs: the root's pin, or `local-<commit>` for a `chant dev local` build. */
|
|
410
|
+
version: string;
|
|
411
|
+
/** The mark, when the installed chant is a local build. */
|
|
412
|
+
local?: LocalChantMark;
|
|
413
|
+
/** The tarball directory the image installs from, when local: `<product>/.chant-local`. */
|
|
414
|
+
context?: string;
|
|
415
|
+
/**
|
|
416
|
+
* `docker build` arguments: `--build-arg CHANT_VERSION=<version>`, and for a
|
|
417
|
+
* local build `--build-context chant-local=<product>/.chant-local`, which
|
|
418
|
+
* the Dockerfile's `chant-local` stage (`FROM scratch AS chant-local`)
|
|
419
|
+
* stands in for when the chant is the pin.
|
|
420
|
+
*/
|
|
421
|
+
args: string[];
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* The chant a product's image should install (#4909): the local build when
|
|
426
|
+
* `chant dev local` marked the installed `@intentius/chant`, else the root's
|
|
427
|
+
* pin. terragucci's stack/bootstrap.sh read the `chantLocal` mark with jq,
|
|
428
|
+
* checked `.chant-local/` for its tarballs and built the
|
|
429
|
+
* `--build-context` itself. For a local build every package in `with` (core
|
|
430
|
+
* is always one) must have its tarball, of the commit the mark names; a
|
|
431
|
+
* missing one is a {@link LocalChantError} that says to run `chant dev local`
|
|
432
|
+
* again with `--with`.
|
|
433
|
+
*/
|
|
434
|
+
export function localChantImage(productDir: string, opts: { with?: string[]; buildArg?: string; contextName?: string } = {}): LocalChantImage {
|
|
435
|
+
const dir = resolve(productDir);
|
|
436
|
+
const buildArg = opts.buildArg ?? "CHANT_VERSION";
|
|
437
|
+
const contextName = opts.contextName ?? "chant-local";
|
|
438
|
+
const coreFile = join(dir, "node_modules/@intentius/chant/package.json");
|
|
439
|
+
if (!existsSync(coreFile)) throw new LocalChantError(`@intentius/chant is not installed in ${dir}; run npm ci`);
|
|
440
|
+
const core = readManifest(coreFile);
|
|
441
|
+
if (core.chantLocal) {
|
|
442
|
+
const outDir = join(dir, ".chant-local");
|
|
443
|
+
const commitFile = join(outDir, "commit");
|
|
444
|
+
const commit = existsSync(commitFile) ? readFileSync(commitFile, "utf8").trim() : undefined;
|
|
445
|
+
if (commit !== core.chantLocal.commit) {
|
|
446
|
+
throw new LocalChantError(`node_modules has the local chant ${core.chantLocal.commit}, but .chant-local/ holds ${commit ? `the tarballs of ${commit}` : "no tarballs"}; run chant dev local again`);
|
|
447
|
+
}
|
|
448
|
+
const names = ["@intentius/chant", ...(opts.with ?? [])];
|
|
449
|
+
const missing = names.filter((n) => !existsSync(join(outDir, tarballName(n))));
|
|
450
|
+
if (missing.length) throw new LocalChantError(`.chant-local/ has no tarball for ${missing.join(", ")}; run chant dev local again with ${missing.map((n) => `--with ${n}`).join(" ")}`);
|
|
451
|
+
const version = `local-${core.chantLocal.commit}`;
|
|
452
|
+
return { version, local: core.chantLocal, context: outDir, args: ["--build-context", `${contextName}=${outDir}`, "--build-arg", `${buildArg}=${version}`] };
|
|
453
|
+
}
|
|
454
|
+
const root = readManifest(join(dir, "package.json"));
|
|
455
|
+
const version = root.dependencies?.["@intentius/chant"] ?? root.devDependencies?.["@intentius/chant"] ?? core.version;
|
|
456
|
+
if (!version) throw new LocalChantError(`${coreFile} has no version`);
|
|
457
|
+
return { version, args: ["--build-arg", `${buildArg}=${version}`] };
|
|
458
|
+
}
|
package/src/notify-product.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import { CHANT_WORDS, isChantWords, type CiProductNotifyWords, type CiProductWords } from "./ci-product-words";
|
|
16
16
|
import type { NotifyFields, SendNotifyOptions } from "./notify";
|
|
17
|
+
import { driftIssueRecords, driftRunFingerprint, type DriftRunStack } from "./drift-issue";
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* The first chant whose Slack and Teams messages take a product's words, a
|
|
@@ -48,12 +49,19 @@ export function productSendOptions(words: CiProductWords, options: SendNotifyOpt
|
|
|
48
49
|
|
|
49
50
|
/** What a drift notice concerns. */
|
|
50
51
|
export interface DriftNotifyInput {
|
|
51
|
-
/** The members whose refresh found drift. */
|
|
52
|
-
changed
|
|
52
|
+
/** The members whose refresh found drift. Left out, the {@link stacks} with drift records, in their order. */
|
|
53
|
+
changed?: string[];
|
|
53
54
|
missing?: string[];
|
|
54
55
|
/** The members whose refresh failed, so drift there is unknown. */
|
|
55
56
|
failed?: string[];
|
|
57
|
+
/** The run's fingerprint. Left out, `driftRunFingerprint` of the {@link stacks}. */
|
|
56
58
|
fingerprint?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Each member's drift records, as the run read them (#4944). The notice
|
|
61
|
+
* then names the members with drift and carries the run's fingerprint, so
|
|
62
|
+
* a product passes what it read instead of computing either.
|
|
63
|
+
*/
|
|
64
|
+
stacks?: readonly DriftRunStack[];
|
|
57
65
|
project?: string;
|
|
58
66
|
environment?: string;
|
|
59
67
|
reportUrl?: string;
|
|
@@ -62,24 +70,27 @@ export interface DriftNotifyInput {
|
|
|
62
70
|
/**
|
|
63
71
|
* A `drift` event under `words`: `2 stacks drifted: shop-dev, shop-prod` for
|
|
64
72
|
* plywood, `1 member drifted: net` for chant, with the failed refreshes
|
|
65
|
-
* named after them.
|
|
73
|
+
* named after them. Given `stacks`, the drifted members and the
|
|
74
|
+
* fingerprint come from their records (#4944).
|
|
66
75
|
*/
|
|
67
76
|
export function driftNotifyFields(words: CiProductWords, input: DriftNotifyInput): NotifyFields {
|
|
68
77
|
const [one, many] = words.noun;
|
|
69
|
-
const
|
|
78
|
+
const changed = input.changed ?? (input.stacks ?? []).filter((s) => driftIssueRecords(s.records).length > 0).map((s) => s.stack);
|
|
79
|
+
const fingerprint = input.fingerprint ?? (input.stacks ? driftRunFingerprint(input.stacks) : undefined);
|
|
80
|
+
const n = changed.length;
|
|
70
81
|
const failed = input.failed ?? [];
|
|
71
|
-
const what = n > 0 ? `${n} ${n === 1 ? one : many} drifted: ${
|
|
82
|
+
const what = n > 0 ? `${n} ${n === 1 ? one : many} drifted: ${changed.join(", ")}` : `no ${many} drifted`;
|
|
72
83
|
const summary = failed.length > 0 ? `${what}; ${failed.length} ${failed.length === 1 ? one : many} could not be refreshed: ${failed.join(", ")}` : what;
|
|
73
84
|
return {
|
|
74
85
|
source: productNotifySource(words),
|
|
75
86
|
event: "drift",
|
|
76
87
|
summary,
|
|
77
|
-
targets:
|
|
88
|
+
targets: changed,
|
|
78
89
|
drift: {
|
|
79
|
-
changed
|
|
90
|
+
changed,
|
|
80
91
|
...(input.missing?.length ? { missing: input.missing } : {}),
|
|
81
92
|
...(failed.length > 0 ? { failed } : {}),
|
|
82
|
-
...(
|
|
93
|
+
...(fingerprint ? { fingerprint } : {}),
|
|
83
94
|
},
|
|
84
95
|
...(input.project !== undefined ? { project: input.project } : {}),
|
|
85
96
|
...(input.environment !== undefined ? { environment: input.environment } : {}),
|
|
@@ -23,6 +23,7 @@ import { join, resolve } from "node:path";
|
|
|
23
23
|
import type { ReleaseAdmission } from "../../lifecycle/release-ledger";
|
|
24
24
|
import { sortedJsonReplacer } from "../../utils";
|
|
25
25
|
import { archiveSourceTree, sha256Digest, type SourceArchive } from "../source-archive";
|
|
26
|
+
import { actorFromEnv } from "../../actor";
|
|
26
27
|
|
|
27
28
|
// ── sourceArchive ─────────────────────────────────────────────────────────────
|
|
28
29
|
|
|
@@ -149,7 +150,7 @@ export async function releaseRecord(args: ReleaseRecordArgs): Promise<ReleaseRec
|
|
|
149
150
|
return { recorded: false, digest: plan.digest, env, component, approver };
|
|
150
151
|
}
|
|
151
152
|
|
|
152
|
-
const actor = args.actor || process.env
|
|
153
|
+
const actor = args.actor || actorFromEnv(process.env, "");
|
|
153
154
|
if (!actor) throw new Error("releaseRecord: no actor: pass one, or set GITHUB_ACTOR, GITLAB_USER_LOGIN or USER");
|
|
154
155
|
const { runId, runOrigin } = resolveRunId(args.runId);
|
|
155
156
|
await persistReleasePlan(plan, opts);
|
|
@@ -26,6 +26,7 @@ import { realpathSync } from "node:fs";
|
|
|
26
26
|
import { join, resolve } from "node:path";
|
|
27
27
|
import type { ReleaseAdmission, ReleaseRecord, ReleaseRef } from "../../lifecycle/release-ledger";
|
|
28
28
|
import { archiveSourceTree } from "../source-archive";
|
|
29
|
+
import { actorFromEnv } from "../../actor";
|
|
29
30
|
import { readReleasePlan, releasePlan, releasePlanDigest } from "./source-release";
|
|
30
31
|
|
|
31
32
|
// ── releaseRollbackPlan ───────────────────────────────────────────────────────
|
|
@@ -219,7 +220,7 @@ export async function releaseRollbackRecord(args: ReleaseRollbackRecordArgs): Pr
|
|
|
219
220
|
return { recorded: false, digest: rollback.to, env, component, approver };
|
|
220
221
|
}
|
|
221
222
|
|
|
222
|
-
const actor = args.actor || process.env
|
|
223
|
+
const actor = args.actor || actorFromEnv(process.env, "");
|
|
223
224
|
if (!actor) throw new Error("releaseRollbackRecord: no actor: pass one, or set GITHUB_ACTOR, GITLAB_USER_LOGIN or USER");
|
|
224
225
|
const { runId, runOrigin } = resolveRunId(args.runId);
|
|
225
226
|
await appendReleaseRecord(
|
|
@@ -119,6 +119,33 @@ describe("resumeGateRun", () => {
|
|
|
119
119
|
expect(await resumeGateRun(gitlab, { token: "t", fetch: retried.fetch })).toMatchObject({ status: "skipped", reason: expect.stringContaining("job 556") });
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
+
test("GitLab (#4978): a wave job's evidence job that already ran is retried with it, and one GitLab skipped is left to GitLab", async () => {
|
|
123
|
+
const gitlab: GateRunLocator = { forge: "gitlab", api: "https://gl/api/v4", repo: "7", run: "100", job: "555", jobName: "wave-2-staging" };
|
|
124
|
+
const ran = fakeForge({
|
|
125
|
+
"GET /api/v4/projects/7/jobs/555": { status: "failed", name: "wave-2-staging" },
|
|
126
|
+
"GET /api/v4/projects/7/pipelines/100/jobs": [{ id: 555, name: "wave-2-staging", status: "failed" }, { id: 560, name: "wave-2-staging-evidence", status: "success" }],
|
|
127
|
+
"POST /api/v4/projects/7/jobs/555/retry": { id: 556 },
|
|
128
|
+
"POST /api/v4/projects/7/jobs/560/retry": { id: 561 },
|
|
129
|
+
});
|
|
130
|
+
expect(await resumeGateRun(gitlab, { token: "t", fetch: ran.fetch })).toMatchObject({ status: "resumed", how: "retried job 555 as job 556, and its evidence job 560 as job 561" });
|
|
131
|
+
// The wave job first, so the evidence job's need is the new try.
|
|
132
|
+
expect(ran.calls.filter((c) => c.method === "POST").map((c) => c.url)).toEqual(["https://gl/api/v4/projects/7/jobs/555/retry", "https://gl/api/v4/projects/7/jobs/560/retry"]);
|
|
133
|
+
|
|
134
|
+
const skipped = fakeForge({
|
|
135
|
+
"GET /api/v4/projects/7/jobs/555": { status: "failed", name: "wave-2-staging" },
|
|
136
|
+
"GET /api/v4/projects/7/pipelines/100/jobs": [{ id: 555, name: "wave-2-staging", status: "failed" }, { id: 560, name: "wave-2-staging-evidence", status: "skipped" }],
|
|
137
|
+
"POST /api/v4/projects/7/jobs/555/retry": { id: 556 },
|
|
138
|
+
});
|
|
139
|
+
expect(await resumeGateRun(gitlab, { token: "t", fetch: skipped.fetch })).toMatchObject({ status: "resumed", how: "retried job 555 as job 556" });
|
|
140
|
+
expect(skipped.calls.filter((c) => c.method === "POST")).toHaveLength(1);
|
|
141
|
+
|
|
142
|
+
const dry = fakeForge({
|
|
143
|
+
"GET /api/v4/projects/7/jobs/555": { status: "failed", name: "wave-2-staging" },
|
|
144
|
+
"GET /api/v4/projects/7/pipelines/100/jobs": [{ id: 555, name: "wave-2-staging", status: "failed" }, { id: 560, name: "wave-2-staging-evidence", status: "failed" }],
|
|
145
|
+
});
|
|
146
|
+
expect(await resumeGateRun(gitlab, { token: "t", fetch: dry.fetch, dryRun: true })).toMatchObject({ status: "would-resume", how: "would retry job 555 and its evidence job 560" });
|
|
147
|
+
});
|
|
148
|
+
|
|
122
149
|
test("Forgejo: dispatches the workflow on its branch, unless a run of it started after the approval", async () => {
|
|
123
150
|
const forgejo: GateRunLocator = { forge: "forgejo", api: "https://fj/api/v1", repo: "acme/db", run: "9", workflow: "migrations.yml", ref: "main" };
|
|
124
151
|
const forge = fakeForge({
|
package/src/op/index.ts
CHANGED
|
@@ -137,6 +137,16 @@ export {
|
|
|
137
137
|
} from "./op-waves-capability";
|
|
138
138
|
export type { OpWaveCostFormat, OpWaveCostHold, OpWaveCostVerdict, OpWaveHolds, OpWaveRunCost, OpWaveStep, OpWaveStepApply, OpWaveStepGroup, OpWaveStepPlan } from "./op-waves-capability";
|
|
139
139
|
export { notifyOpWave, opWaveNotifyFields } from "./op-waves-notify";
|
|
140
|
+
export {
|
|
141
|
+
OP_WAVES_RENDER_SPEC_FLAG,
|
|
142
|
+
OP_WAVES_SPEC_AT_ENV,
|
|
143
|
+
OP_WAVES_SPEC_COMMAND_ENV,
|
|
144
|
+
OP_WAVES_SPEC_FILE_ENV,
|
|
145
|
+
RUNTIME_WAVES_SPEC_FLOOR,
|
|
146
|
+
opWavesRenderSpecEnv,
|
|
147
|
+
opWavesRenderSpecProblems,
|
|
148
|
+
} from "./op-waves-render-spec";
|
|
149
|
+
export type { OpWavesRenderSpec } from "./op-waves-render-spec";
|
|
140
150
|
export { OP_WAVE_STAND_DOWN_FLOOR, gitOpWaveNewerCommit, newerCommitOnBranch, opWaveRunBranch, opWaveStandDownReason, tipAppliesTargets } from "./op-waves-stand-down";
|
|
141
151
|
export type { OpWaveNewerCommit, OpWaveNewerCommitPort } from "./op-waves-stand-down";
|
|
142
152
|
export { OP_WAVE_RELEASE_RECORD_FLOOR, opWaveReleaseNames, opWaveReleaseProblems, releaseOfCommit } from "./op-waves-release";
|