@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/ci-handover.ts
CHANGED
|
@@ -77,10 +77,23 @@ export const NO_FORGE_TOKEN_MARKER = "CHANT_NO_FORGE_TOKEN";
|
|
|
77
77
|
* `$0` is that file. terragucci's `restartWithout` (render.ts:1826).
|
|
78
78
|
*/
|
|
79
79
|
export function dropForgeTokens(shell: "sh" | "bash" = "sh", extra: readonly string[] = []): string {
|
|
80
|
-
const again = shell === "bash" ? 'bash --noprofile --norc -e -o pipefail "$0"' : 'sh -e "$0"';
|
|
81
|
-
const marker = NO_FORGE_TOKEN_MARKER;
|
|
82
80
|
// #4296: a plan job that traded its OIDC token drops the variables a token is requested with too.
|
|
83
|
-
|
|
81
|
+
return restartWithout(shell, [...FORGE_TOKEN_VARS, ...extra], NO_FORGE_TOKEN_MARKER);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The line that restarts the step's shell once without `vars` in its
|
|
86
|
+
* process environment, setting `marker` so the restarted shell does not
|
|
87
|
+
* restart again, or, when it cannot restart, unsets them (#4912). The
|
|
88
|
+
* restart runs the step's script file (`$0`) again from its first line,
|
|
89
|
+
* with every exported variable but `vars`, so the line goes at the top of
|
|
90
|
+
* the step. It needs that file, `env` and the shell on the PATH; without
|
|
91
|
+
* them (a script given to `sh -c`, GitLab's piped script) the shell unsets
|
|
92
|
+
* `vars` and runs on. {@link dropForgeTokens} and ci-login's `restart` use
|
|
93
|
+
* it. terragucci's `restartWithout` (render.ts:2101).
|
|
94
|
+
*/
|
|
95
|
+
export function restartWithout(shell: "sh" | "bash", vars: readonly string[], marker: string): string {
|
|
96
|
+
const again = shell === "bash" ? 'bash --noprofile --norc -e -o pipefail "$0"' : 'sh -e "$0"';
|
|
84
97
|
const can = `[ -z "\${${marker}:-}" ] && [ "\${0#*/}" != "$0" ] && [ -f "$0" ] && ! { [ "\${0##*/}" = sh ] || [ "\${0##*/}" = bash ] || [ "\${0##*/}" = dash ]; } && command -v env >/dev/null 2>&1 && command -v ${shell} >/dev/null 2>&1`;
|
|
85
98
|
return `if ${can}; then exec env ${vars.map((v) => `-u ${v}`).join(" ")} ${marker}=1 ${again}; fi; unset ${vars.join(" ")}`;
|
|
86
99
|
}
|
package/src/ci-identity.test.ts
CHANGED
|
@@ -84,11 +84,11 @@ describe("the trade script stays inside one shell word", () => {
|
|
|
84
84
|
test("it holds no single quote, so tradeLine can quote it", () => {
|
|
85
85
|
expect(TRADE_JS).not.toContain("'");
|
|
86
86
|
});
|
|
87
|
-
test("GitLab's lines trade, unset the token variables and the extra ones, then
|
|
87
|
+
test("GitLab's lines trade into a shell variable, unset the token variables and the extra ones, then evaluate the credentials (#4912)", () => {
|
|
88
88
|
const [trade, unset, source] = gitlabTradeLines(["CHANT_FORGE_TOKEN"]);
|
|
89
|
-
expect(trade).
|
|
89
|
+
expect(trade).toMatch(/^CHANT_CLOUD_TRADE_VARS="\$\(cd \/ && node -e '.*' "-" sh\)"$/);
|
|
90
90
|
expect(unset).toBe(`unset CHANT_FORGE_TOKEN ${OIDC_REQUEST_VARS.join(" ")}`);
|
|
91
|
-
expect(source).
|
|
91
|
+
expect(source).toBe('eval "$CHANT_CLOUD_TRADE_VARS"; unset CHANT_CLOUD_TRADE_VARS');
|
|
92
92
|
expect(gitlabTradeIdTokens(resolveCloudIdentity(DECL, "prod", "app")!.plan)).toEqual({
|
|
93
93
|
CHANT_ID_TOKEN_AWS: { aud: "sts.amazonaws.com" },
|
|
94
94
|
CHANT_ID_TOKEN_GCP: { aud: "https://iam.googleapis.com/projects/123/locations/global/workloadIdentityPools/ci/providers/forge" },
|
package/src/ci-identity.ts
CHANGED
|
@@ -124,7 +124,12 @@ export interface GcpCloudIdentity {
|
|
|
124
124
|
provider: string;
|
|
125
125
|
/** The OIDC token's audience. Default `https://iam.googleapis.com/<provider>`. */
|
|
126
126
|
audience?: string;
|
|
127
|
-
/**
|
|
127
|
+
/**
|
|
128
|
+
* Google's STS, for a regional endpoint or an emulator: its base URL, to
|
|
129
|
+
* which `/v1/token` is added, or its full token URL, one that ends in
|
|
130
|
+
* `/token` (#4912, terragucci's `token_url`). Default
|
|
131
|
+
* `https://sts.googleapis.com`.
|
|
132
|
+
*/
|
|
128
133
|
stsEndpoint?: string;
|
|
129
134
|
/** IAM credentials, for an emulator. Default `https://iamcredentials.googleapis.com`. */
|
|
130
135
|
iamEndpoint?: string;
|
|
@@ -569,8 +574,9 @@ export const TRADED_VARS: Record<IdentityCloud, readonly string[]> = {
|
|
|
569
574
|
/**
|
|
570
575
|
* How the trade leaves what it got. `github-env`: `NAME=value` lines
|
|
571
576
|
* appended to the file argv 1 names (`$GITHUB_ENV`), and an `::add-mask::`
|
|
572
|
-
* line for each secret, so every later step of the job has them. `sh`:
|
|
573
|
-
*
|
|
577
|
+
* line for each secret, so every later step of the job has them. `sh`:
|
|
578
|
+
* `export` lines, printed when argv 1 is `-` (GitLab's script captures and
|
|
579
|
+
* evaluates them, #4912), else written to that file, mode 0600.
|
|
574
580
|
*/
|
|
575
581
|
export type TradeFormat = "github-env" | "sh";
|
|
576
582
|
|
|
@@ -582,6 +588,22 @@ export type TradeFormat = "github-env" | "sh";
|
|
|
582
588
|
*/
|
|
583
589
|
export const CLOUD_TARGETS_ENV = "CHANT_CLOUD_TARGETS";
|
|
584
590
|
|
|
591
|
+
/**
|
|
592
|
+
* The variable the trade sets (#4930): the clouds it traded the job's
|
|
593
|
+
* token for, comma-separated (`aws,gcp`). The trade and ci-login's login
|
|
594
|
+
* both write a {@link CLOUD_TARGETS_ENV} file, so a product that hands a
|
|
595
|
+
* target traded credentials (terragucci's re-plan) reads this, not the
|
|
596
|
+
* file, to know the job traded. The login never sets it.
|
|
597
|
+
*/
|
|
598
|
+
export const CLOUD_TRADED_ENV = "CHANT_CLOUD_TRADED";
|
|
599
|
+
|
|
600
|
+
/** The clouds the job's trade traded for, from {@link CLOUD_TRADED_ENV}: none when the job did not trade, such as after ci-login's login (#4930). */
|
|
601
|
+
export function cloudsTraded(env: Readonly<Record<string, string | undefined>>): IdentityCloud[] {
|
|
602
|
+
const v = env[CLOUD_TRADED_ENV];
|
|
603
|
+
if (!v) return [];
|
|
604
|
+
return v.split(",").filter((c): c is IdentityCloud => (IDENTITY_CLOUDS as readonly string[]).includes(c));
|
|
605
|
+
}
|
|
606
|
+
|
|
585
607
|
/** The file {@link CLOUD_TARGETS_ENV} names: per cloud, the job's own identity, the targets that take another, and each identity's variables. */
|
|
586
608
|
export interface CloudTargetsFile {
|
|
587
609
|
version: 1;
|
|
@@ -633,7 +655,8 @@ export const TRADE_JS = [
|
|
|
633
655
|
"if(a.role)Object.assign(vars,by.aws[a.role])}",
|
|
634
656
|
'if(spec.gcp){const c=spec.gcp;const tok=await idToken("gcp",c.audience);by.gcp={};',
|
|
635
657
|
'const sts=trim(c.stsEndpoint||"https://sts.googleapis.com"),iam=trim(c.iamEndpoint||"https://iamcredentials.googleapis.com");',
|
|
636
|
-
'
|
|
658
|
+
// #4912: stsEndpoint is Google's STS, or its full token URL (terragucci's `token_url`).
|
|
659
|
+
'const fed=json(await post(/\\/token$/.test(sts)?sts:sts+"/v1/token",{"content-type":"application/json"},JSON.stringify({grantType:"urn:ietf:params:oauth:grant-type:token-exchange",audience:"//iam.googleapis.com/"+c.provider,scope:"https://www.googleapis.com/auth/cloud-platform",requestedTokenType:"urn:ietf:params:oauth:token-type:access_token",subjectToken:tok,subjectTokenType:"urn:ietf:params:oauth:token-type:jwt"})),"Google STS").access_token;',
|
|
637
660
|
'if(!clean(fed))throw new Error("Google STS gave no token");',
|
|
638
661
|
'for(const sa of ids("gcp")){',
|
|
639
662
|
'const at=json(await post(iam+"/v1/projects/-/serviceAccounts/"+encodeURIComponent(sa)+":generateAccessToken",{"content-type":"application/json",authorization:"Bearer "+fed},JSON.stringify({scope:["https://www.googleapis.com/auth/cloud-platform"]})),"IAM credentials").accessToken;',
|
|
@@ -665,9 +688,11 @@ export const TRADE_JS = [
|
|
|
665
688
|
'const doc={version:1,clouds:{}};for(const c of clouds){const s=spec[c];doc.clouds[c]={...(s[KEY[c]]?{default:s[KEY[c]]}:{}),targets:(s.targets||[]).map((t)=>({targets:t.targets,identity:t[KEY[c]]})),vars:by[c]}}',
|
|
666
689
|
'const tf=trim(process.env.RUNNER_TEMP||process.env.TMPDIR||"/tmp")+"/chant-cloud-targets-"+require("crypto").randomBytes(8).toString("hex")+".json";',
|
|
667
690
|
`fs.writeFileSync(tf,JSON.stringify(doc),{mode:0o600,flag:"wx"});vars.${CLOUD_TARGETS_ENV}=tf}`,
|
|
691
|
+
// #4930: which clouds this job traded, so a product tells the trade's targets file from a login's.
|
|
692
|
+
`if(clouds.length)vars.${CLOUD_TRADED_ENV}=clouds.join(",");`,
|
|
668
693
|
'for(const [k,v] of Object.entries(vars))if(!clean(v))throw new Error(k+" is not a value the job can hold");',
|
|
669
694
|
'if(format==="github-env"){for(const s of secrets)console.log("::add-mask::"+s);fs.appendFileSync(out,Object.entries(vars).map(([k,v])=>k+"="+v+"\\n").join(""))}',
|
|
670
|
-
'else
|
|
695
|
+
'else{const sh=Object.entries(vars).map(([k,v])=>"export "+k+"="+Q+v.split(Q).join(Q+"\\\\"+Q+Q)+Q+"\\n").join("");if(out==="-")process.stdout.write(sh);else fs.writeFileSync(out,sh,{mode:0o600})}',
|
|
671
696
|
'for(const s of said)console.error("chant: traded the job\\u0027s OIDC token for "+s)};',
|
|
672
697
|
"run().catch((e)=>fail(e&&e.message?e.message:String(e)));",
|
|
673
698
|
].join("");
|
|
@@ -681,19 +706,30 @@ export function tradeLine(out: string, format: TradeFormat): string {
|
|
|
681
706
|
return `(cd / && node -e '${TRADE_JS}' "${out}" ${format})`;
|
|
682
707
|
}
|
|
683
708
|
|
|
684
|
-
/**
|
|
709
|
+
/**
|
|
710
|
+
* The file GitLab's trade wrote and sourced before #4912. `gitlabTradeLines`
|
|
711
|
+
* writes none now; kept for a product that names it.
|
|
712
|
+
* @deprecated `gitlabTradeLines` captures the trade's `export` lines in {@link GITLAB_TRADE_VARS}.
|
|
713
|
+
*/
|
|
685
714
|
export const GITLAB_TRADE_FILE = "${TMPDIR:-/tmp}/chant-cloud-$CI_JOB_ID.sh";
|
|
686
715
|
|
|
716
|
+
/** The shell variable GitLab's script holds the trade's `export` lines in until it evaluates them (#4912), as ci-login's `CHANT_CLOUD_LOGIN_VARS`. Not exported, so no child sees it. */
|
|
717
|
+
export const GITLAB_TRADE_VARS = "CHANT_CLOUD_TRADE_VARS";
|
|
718
|
+
|
|
687
719
|
/**
|
|
688
720
|
* The lines a GitLab job's script starts with when it trades: the trade,
|
|
689
|
-
*
|
|
690
|
-
*
|
|
721
|
+
* its `export` lines captured in {@link GITLAB_TRADE_VARS}, the unset of
|
|
722
|
+
* the token variables (and, with `extraUnset`, the forge tokens'), and the
|
|
723
|
+
* evaluation of what the trade printed, then the unset of the variable
|
|
724
|
+
* that held it. No file of credentials is written (#4912), as ci-login's
|
|
725
|
+
* `gitlabCloudLogin`. An assignment's status is its command substitution's,
|
|
726
|
+
* so a failed trade stops the script.
|
|
691
727
|
*/
|
|
692
728
|
export function gitlabTradeLines(extraUnset: readonly string[] = []): string[] {
|
|
693
729
|
return [
|
|
694
|
-
tradeLine(
|
|
730
|
+
`${GITLAB_TRADE_VARS}="$${tradeLine("-", "sh")}"`,
|
|
695
731
|
`unset ${[...extraUnset, ...OIDC_REQUEST_VARS].join(" ")}`,
|
|
696
|
-
|
|
732
|
+
`eval "$${GITLAB_TRADE_VARS}"; unset ${GITLAB_TRADE_VARS}`,
|
|
697
733
|
];
|
|
698
734
|
}
|
|
699
735
|
|
|
@@ -702,6 +738,9 @@ export function gitlabTradeIdTokens(spec: CloudTradeSpec): Record<string, { aud:
|
|
|
702
738
|
return Object.fromEntries(tradedClouds(spec).map((c) => [idTokenVar(c), { aud: spec[c]!.audience }]));
|
|
703
739
|
}
|
|
704
740
|
|
|
741
|
+
/** The AWS region variables, which {@link targetCloudEnv} replaces only when the target's identity sets them. */
|
|
742
|
+
const JOB_REGION_VARS: ReadonlySet<string> = new Set(["AWS_REGION", "AWS_DEFAULT_REGION"]);
|
|
743
|
+
|
|
705
744
|
/**
|
|
706
745
|
* `env` for one target's tool (#4332): the job's environment with each
|
|
707
746
|
* cloud's credentials replaced by those of the identity `target` takes, as
|
|
@@ -722,7 +761,8 @@ export function targetCloudEnv(env: Readonly<Record<string, string | undefined>>
|
|
|
722
761
|
if (id === undefined || id === c.default) continue;
|
|
723
762
|
const vars = c.vars[id];
|
|
724
763
|
if (!vars) throw new Error(`${CLOUD_TARGETS_ENV} (${path}) holds no ${cloud} credentials for ${id}`);
|
|
725
|
-
|
|
764
|
+
// The region is the job's, not the identity's: a login that names none (#4930) leaves the job's in place, and a trade's identity sets its own.
|
|
765
|
+
for (const k of TRADED_VARS[cloud]) if (!JOB_REGION_VARS.has(k)) delete out[k];
|
|
726
766
|
Object.assign(out, vars);
|
|
727
767
|
}
|
|
728
768
|
return out;
|
package/src/ci-image.test.ts
CHANGED
|
@@ -7,7 +7,10 @@ import { crc32, deflateRawSync, gzipSync } from "node:zlib";
|
|
|
7
7
|
import { describe, expect, test } from "vitest";
|
|
8
8
|
import {
|
|
9
9
|
CI_BASE_IMAGES,
|
|
10
|
+
CI_IMAGE_DOCKER_STAGES_FLOOR,
|
|
10
11
|
CI_IMAGE_FLOOR,
|
|
12
|
+
CI_IMAGE_NON_ROOT_FLOOR,
|
|
13
|
+
CI_TOOL_NODE_DOWNLOAD_FLOOR,
|
|
11
14
|
CI_TOOL_DOCKER_ARCH,
|
|
12
15
|
CI_TOOL_SHA256,
|
|
13
16
|
CI_TOOLS,
|
|
@@ -55,8 +58,8 @@ function tarGz(files: Record<string, string>): Uint8Array {
|
|
|
55
58
|
return gzipSync(Buffer.concat(blocks));
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
/** A zip of `files`, deflated, with a central directory, as a release's `.zip` holds them. */
|
|
59
|
-
function zip(files: Record<string, string>): Uint8Array {
|
|
61
|
+
/** A zip of `files`, deflated, with a central directory, as a release's `.zip` holds them; `modes` gives an entry its Unix mode, as the AWS CLI's installer has. */
|
|
62
|
+
function zip(files: Record<string, string>, modes: Record<string, number> = {}): Uint8Array {
|
|
60
63
|
const locals: Buffer[] = [];
|
|
61
64
|
const centrals: Buffer[] = [];
|
|
62
65
|
let offset = 0;
|
|
@@ -81,6 +84,11 @@ function zip(files: Record<string, string>): Uint8Array {
|
|
|
81
84
|
central.writeUInt32LE(data.length, 20);
|
|
82
85
|
central.writeUInt32LE(raw.length, 24);
|
|
83
86
|
central.writeUInt16LE(n.length, 28);
|
|
87
|
+
if (modes[name] !== undefined) {
|
|
88
|
+
// Made by Unix (3), with the mode in the external attributes' high half.
|
|
89
|
+
central.writeUInt16LE((3 << 8) | 20, 4);
|
|
90
|
+
central.writeUInt32LE(((0o100000 | modes[name]!) << 16) >>> 0, 38);
|
|
91
|
+
}
|
|
84
92
|
central.writeUInt32LE(offset, 42);
|
|
85
93
|
locals.push(local, n, data);
|
|
86
94
|
centrals.push(central, n);
|
|
@@ -132,6 +140,40 @@ function runShell(script: string, fixtures: Record<string, Uint8Array | string>,
|
|
|
132
140
|
return { status: r.status ?? -1, stderr: r.stderr, urls: existsSync(log) ? readFileSync(log, "utf-8").trim().split("\n") : [] };
|
|
133
141
|
}
|
|
134
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Runs a fetch script as a job with no curl and no unzip would (#4952):
|
|
145
|
+
* both are on PATH as commands that fail, and node's `fetch` is replaced,
|
|
146
|
+
* through `NODE_OPTIONS=--import`, by one that serves the fixtures by the
|
|
147
|
+
* URL's last segment.
|
|
148
|
+
*/
|
|
149
|
+
function runNodeShell(script: string, fixtures: Record<string, Uint8Array | string>, env: Record<string, string> = {}): { status: number; stderr: string; urls: string[] } {
|
|
150
|
+
const dir = tmp();
|
|
151
|
+
const serve = join(dir, "serve");
|
|
152
|
+
const bin = join(dir, "bin");
|
|
153
|
+
mkdirSync(serve);
|
|
154
|
+
mkdirSync(bin);
|
|
155
|
+
for (const [name, body] of Object.entries(fixtures)) writeFileSync(join(serve, name), body);
|
|
156
|
+
const log = join(dir, "urls");
|
|
157
|
+
for (const missing of ["curl", "unzip"]) {
|
|
158
|
+
writeFileSync(join(bin, missing), `#!/bin/sh\necho "${missing}: not in this image" >&2\nexit 127\n`);
|
|
159
|
+
chmodSync(join(bin, missing), 0o755);
|
|
160
|
+
}
|
|
161
|
+
const preload = join(dir, "fetch.mjs");
|
|
162
|
+
writeFileSync(
|
|
163
|
+
preload,
|
|
164
|
+
[
|
|
165
|
+
'import { appendFileSync, existsSync, readFileSync } from "node:fs";',
|
|
166
|
+
"globalThis.fetch = async (url) => {",
|
|
167
|
+
` appendFileSync(${JSON.stringify(log)}, String(url) + "\\n");`,
|
|
168
|
+
` const f = ${JSON.stringify(serve)} + "/" + String(url).split("/").pop();`,
|
|
169
|
+
' return existsSync(f) ? new Response(readFileSync(f)) : new Response("not found", { status: 404 });',
|
|
170
|
+
"};",
|
|
171
|
+
].join("\n"),
|
|
172
|
+
);
|
|
173
|
+
const r = spawnSync("sh", ["-c", `set -e; ${script}`], { env: { ...process.env, PATH: `${bin}:${process.env.PATH}`, NODE_OPTIONS: `--import ${preload}`, ...env }, encoding: "utf-8" });
|
|
174
|
+
return { status: r.status ?? -1, stderr: r.stderr, urls: existsSync(log) ? readFileSync(log, "utf-8").trim().split("\n") : [] };
|
|
175
|
+
}
|
|
176
|
+
|
|
135
177
|
describe("ciToolRelease", () => {
|
|
136
178
|
test("names each release file and its checksums file per architecture", () => {
|
|
137
179
|
expect(ciToolRelease("tofu", "1.13.1", "arm64")).toMatchObject({
|
|
@@ -163,8 +205,11 @@ describe("ciToolRelease", () => {
|
|
|
163
205
|
expect(() => ciToolSha256("tofu", "1.13.1", { amd64: "nothex" })).toThrow(/64 lower-case hex/);
|
|
164
206
|
});
|
|
165
207
|
|
|
166
|
-
test("CI_IMAGE_FLOOR is the
|
|
167
|
-
expect(CI_IMAGE_FLOOR).toBe(
|
|
208
|
+
test("CI_IMAGE_FLOOR is the release that shipped it, and #4908's and #4932's floors theirs", () => {
|
|
209
|
+
expect(CI_IMAGE_FLOOR).toBe("0.124.86");
|
|
210
|
+
expect(CI_IMAGE_NON_ROOT_FLOOR).toBe("0.124.88");
|
|
211
|
+
expect(CI_IMAGE_DOCKER_STAGES_FLOOR).toBe("0.124.88");
|
|
212
|
+
expect(CI_TOOL_NODE_DOWNLOAD_FLOOR).toBe(NEXT_RELEASE);
|
|
168
213
|
});
|
|
169
214
|
});
|
|
170
215
|
|
|
@@ -227,24 +272,25 @@ describe("ciToolFetchScript against local fixtures", () => {
|
|
|
227
272
|
const binary = Buffer.from("#!/bin/sh\necho just\n");
|
|
228
273
|
const archiveJust = tarGz({ just: binary.toString() });
|
|
229
274
|
const out = tmp();
|
|
230
|
-
|
|
275
|
+
// just publishes a checksums file from 1.35.0 (#4952), so an older release is checked on its recorded sha256.
|
|
276
|
+
const script = ciToolFetchScript("just", "1.34.0", { dir: `${out}/d`, arch: CI_TOOL_DOCKER_ARCH, sha256: { amd64: sha(archiveJust), arm64: "2".repeat(64) } });
|
|
231
277
|
expect(script).not.toContain("sums");
|
|
232
|
-
expect(runShell(script, { "just-1.
|
|
278
|
+
expect(runShell(script, { "just-1.34.0-x86_64-unknown-linux-musl.tar.gz": archiveJust }, { TARGETARCH: "amd64" }).status).toBe(0);
|
|
233
279
|
expect(readFileSync(`${out}/d/just`, "utf-8")).toContain("echo just");
|
|
234
|
-
const r = runShell(script, { "just-1.
|
|
280
|
+
const r = runShell(script, { "just-1.34.0-aarch64-unknown-linux-musl.tar.gz": archiveJust }, { TARGETARCH: "arm64" });
|
|
235
281
|
expect(r.status).not.toBe(0);
|
|
236
282
|
});
|
|
237
283
|
|
|
238
284
|
test("a bare binary, and a zip's member, install as the command", () => {
|
|
239
285
|
const tg = Buffer.from("#!/bin/sh\necho terragrunt\n");
|
|
240
286
|
const out = tmp();
|
|
241
|
-
const s1 = ciToolFetchScript("terragrunt", "1.
|
|
287
|
+
const s1 = ciToolFetchScript("terragrunt", "1.1.0", { dir: `${out}/tg`, arch: CI_TOOL_DOCKER_ARCH });
|
|
242
288
|
expect(runShell(s1, { terragrunt_linux_arm64: tg, SHA256SUMS: `${sha(tg)} *terragrunt_linux_arm64\n` }, { TARGETARCH: "arm64" }).status).toBe(0);
|
|
243
289
|
expect(readFileSync(`${out}/tg/terragrunt`, "utf-8")).toContain("echo terragrunt");
|
|
244
290
|
|
|
245
291
|
const z = zip({ terraform: "#!/bin/sh\necho terraform\n", "LICENSE.txt": "x" });
|
|
246
|
-
const s2 = ciToolFetchScript("terraform", "1.14.
|
|
247
|
-
const r = runShell(s2, { "terraform_1.14.
|
|
292
|
+
const s2 = ciToolFetchScript("terraform", "1.14.8", { dir: `${out}/tf`, arch: CI_TOOL_DOCKER_ARCH });
|
|
293
|
+
const r = runShell(s2, { "terraform_1.14.8_linux_amd64.zip": z, "terraform_1.14.8_SHA256SUMS": `${sha(z)} terraform_1.14.8_linux_amd64.zip\n` }, { TARGETARCH: "amd64" });
|
|
248
294
|
expect(r.stderr).toBe("");
|
|
249
295
|
expect(readFileSync(`${out}/tf/terraform`, "utf-8")).toContain("echo terraform");
|
|
250
296
|
});
|
|
@@ -257,8 +303,8 @@ describe("ciToolFetchScript against local fixtures", () => {
|
|
|
257
303
|
});
|
|
258
304
|
|
|
259
305
|
test("refuses, before any shell, a release that needs a recorded sha256 it lacks", () => {
|
|
260
|
-
expect(() => ciToolFetchScript("
|
|
261
|
-
expect(() => ciToolFetchScript("terragrunt", "1.
|
|
306
|
+
expect(() => ciToolFetchScript("just", "1.34.0", { dir: "/out/just" })).toThrow(/no recorded sha256 for just 1.34.0 on amd64 and arm64; just's release publishes no checksums file/);
|
|
307
|
+
expect(() => ciToolFetchScript("terragrunt", "1.1.0", { dir: "/out/tg", requirePin: true })).toThrow(/no recorded sha256 for terragrunt 1.1.0/);
|
|
262
308
|
expect(() => ciToolFetchScript("tofu", "1.13.1", { dir: "/out/x y" })).toThrow(/absolute path/);
|
|
263
309
|
});
|
|
264
310
|
});
|
|
@@ -285,6 +331,131 @@ describe("ciToolInstallLine", () => {
|
|
|
285
331
|
});
|
|
286
332
|
});
|
|
287
333
|
|
|
334
|
+
describe("non-root job lines (#4908)", () => {
|
|
335
|
+
test("sudo writes the tool root and the link, and leaves the download and the check to the job's user", () => {
|
|
336
|
+
const line = ciToolInstallLine("tofu", "1.13.1", { sudo: true });
|
|
337
|
+
expect(line).toContain('sudo mkdir -p "/opt/chant/tofu-1.13.1"');
|
|
338
|
+
expect(line).toContain('sudo install -m 0755 "$t/tofu" "/opt/chant/tofu-1.13.1/tofu"');
|
|
339
|
+
expect(line.endsWith('sudo ln -sf "/opt/chant/tofu-1.13.1/tofu" /usr/local/bin/tofu')).toBe(true);
|
|
340
|
+
expect(line).not.toContain("sudo curl");
|
|
341
|
+
expect(line).not.toContain("sudo sha256sum");
|
|
342
|
+
expect(ciToolFetchScript("pulumi", "3.272.0", { dir: "/opt/p/pulumi-3.272.0", sudo: true })).toContain('sudo tar -xzf "$t/$f" -C "/opt/p/pulumi-3.272.0" --strip-components=1');
|
|
343
|
+
expect(ciToolInstallLine("aws-cli", "2.37.9", { sudo: true })).toContain('sudo "$t/aws/install" -i "/opt/chant/aws-cli-2.37.9" -b "/opt/chant/aws-cli-2.37.9/bin"');
|
|
344
|
+
expect(ciToolInstallLine("tofu", "1.13.1")).not.toContain("sudo");
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
test("a root and a binDir under a variable the job expands, quoted", () => {
|
|
348
|
+
const line = ciToolInstallLine("aws-cli", "2.37.9", { root: "$RUNNER_TEMP/chant-tools", binDir: "${HOME}/.local/bin/" });
|
|
349
|
+
expect(line.startsWith('{ [ -x "$RUNNER_TEMP/chant-tools/aws-cli-2.37.9/v2/current/bin/aws" ] || (set -e;')).toBe(true);
|
|
350
|
+
expect(line.endsWith('mkdir -p "${HOME}/.local/bin" && ln -sf "$RUNNER_TEMP/chant-tools/aws-cli-2.37.9/v2/current/bin/aws" "${HOME}/.local/bin/aws"')).toBe(true);
|
|
351
|
+
expect(ciToolBin("tofu", "1.13.1", "$RUNNER_TEMP/t")).toBe("$RUNNER_TEMP/t/tofu-1.13.1/tofu");
|
|
352
|
+
expect(() => ciToolInstallLine("tofu", "1.13.1", { root: "$(id)/x" })).toThrow(/tool root/);
|
|
353
|
+
expect(() => ciToolInstallLine("tofu", "1.13.1", { root: "relative/x" })).toThrow(/tool root/);
|
|
354
|
+
expect(() => ciToolInstallLine("tofu", "1.13.1", { binDir: "$HOME x" })).toThrow(/binDir/);
|
|
355
|
+
// An image's COPY expands no shell variable.
|
|
356
|
+
expect(() => productImageStages({ name: "p", product: "p", description: "d", source: "s", toolRoot: "$HOME/t", tools: [{ tool: "tofu", version: "1.13.1" }], bundle: { file: "a", bin: "a" } })).toThrow(/toolRoot/);
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
test("runs as a user: installs under a variable root and links into a variable binDir", () => {
|
|
360
|
+
const a = tarGz({ tofu: "#!/bin/sh\necho user-install\n" });
|
|
361
|
+
const home = tmp();
|
|
362
|
+
const line = ciToolInstallLine("tofu", "1.13.1", { root: "$TOOLS/t", binDir: "$TOOLS/bin", sha256: { amd64: sha(a), arm64: sha(a) } });
|
|
363
|
+
const files = { "tofu_1.13.1_linux_amd64.tar.gz": a, "tofu_1.13.1_linux_arm64.tar.gz": a, "tofu_1.13.1_SHA256SUMS": `${sha(a)} tofu_1.13.1_linux_amd64.tar.gz\n${sha(a)} tofu_1.13.1_linux_arm64.tar.gz\n` };
|
|
364
|
+
const r = runShell(line, files, { TOOLS: home });
|
|
365
|
+
expect(r.stderr).toBe("");
|
|
366
|
+
expect(r.status).toBe(0);
|
|
367
|
+
expect(readFileSync(`${home}/bin/tofu`, "utf-8")).toContain("echo user-install");
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
test("chant records terragucci's terraform and terragrunt pins and its drift job's AWS CLI", () => {
|
|
371
|
+
expect(ciToolSha256("terraform", "1.14.9")).toEqual({ amd64: "2e5cffc20a0b48a67a76268723bd5a10b8666f69b2aa4f04906e206726bedd63", arm64: "863002085b886453795d9ff4b8989b8468784478150b70ba8a1df3e3ad66da99" });
|
|
372
|
+
expect(ciToolSha256("terragrunt", "1.2.0")).toEqual({ amd64: "45b6df8a8494c8cfe34b4abf919e894709557163e4d3b5704d11083002ab787a", arm64: "b069ce4310572bc46ee6f057057acc4bc6a9077ef8687e157a64b0551290a371" });
|
|
373
|
+
expect(ciToolSha256("aws-cli", "2.37.9")).toEqual({ amd64: "6b3a6a3d7bb3997928f0bdf7b866914224abf242c2e54e1dcebbe84bee64f356", arm64: "e7d2cca3622af4765871fe9ce7eeed03acd09dca10a99ebc46e92f79d78765c0" });
|
|
374
|
+
// So an image carries them with no sums of the product's, and a job line can require the pin.
|
|
375
|
+
expect(() => productImageStages({ name: "t", product: "t", description: "d", source: "s", tools: [{ tool: "terraform", version: "1.14.9" }, { tool: "terragrunt", version: "1.2.0" }], bundle: { file: "a", bin: "a" } })).not.toThrow();
|
|
376
|
+
expect(ciToolInstallLine("terragrunt", "1.2.0", { requirePin: true, sudo: true, link: false })).toContain("want=45b6df8a");
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
describe("a job with no curl or unzip (#4952)", () => {
|
|
381
|
+
test("download: node fetches and checks a release with node, and the line names neither tool", () => {
|
|
382
|
+
const a = tarGz({ tofu: "#!/bin/sh\necho node-fetched\n" });
|
|
383
|
+
const root = tmp();
|
|
384
|
+
const line = ciToolInstallLine("tofu", "1.13.1", { root, link: false, download: "node", sha256: { amd64: sha(a), arm64: sha(a) } });
|
|
385
|
+
expect(line).not.toMatch(/\bcurl\b|\bunzip\b/);
|
|
386
|
+
const files = { "tofu_1.13.1_linux_amd64.tar.gz": a, "tofu_1.13.1_linux_arm64.tar.gz": a, "tofu_1.13.1_SHA256SUMS": `${sha(a)} tofu_1.13.1_linux_amd64.tar.gz\n${sha(a)} tofu_1.13.1_linux_arm64.tar.gz\n` };
|
|
387
|
+
const r = runNodeShell(line, files);
|
|
388
|
+
expect(r.stderr).toBe("");
|
|
389
|
+
expect(r.status).toBe(0);
|
|
390
|
+
expect(readFileSync(`${root}/tofu-1.13.1/tofu`, "utf-8")).toContain("echo node-fetched");
|
|
391
|
+
expect(r.urls).toHaveLength(2);
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
test("download: node fails a tampered archive and a missing file, and installs nothing", () => {
|
|
395
|
+
const a = tarGz({ tofu: "#!/bin/sh\n" });
|
|
396
|
+
const out = tmp();
|
|
397
|
+
const script = ciToolFetchScript("tofu", "1.13.1", { dir: `${out}/d`, arch: CI_TOOL_DOCKER_ARCH, download: "node", sha256: { amd64: sha(a), arm64: sha(a) } });
|
|
398
|
+
const sums = `${sha(a)} tofu_1.13.1_linux_amd64.tar.gz\n`;
|
|
399
|
+
expect(runNodeShell(script, { "tofu_1.13.1_linux_amd64.tar.gz": tarGz({ tofu: "evil" }), "tofu_1.13.1_SHA256SUMS": sums }, { TARGETARCH: "amd64" }).status).not.toBe(0);
|
|
400
|
+
const missing = runNodeShell(script, { "tofu_1.13.1_SHA256SUMS": sums }, { TARGETARCH: "amd64" });
|
|
401
|
+
expect(missing.status).not.toBe(0);
|
|
402
|
+
expect(missing.stderr).toContain("tofu_1.13.1_linux_amd64.tar.gz: HTTP 404");
|
|
403
|
+
expect(existsSync(`${out}/d/tofu`)).toBe(false);
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
test("download: node unpacks a zip's member, and the AWS CLI's whole zip for its installer", () => {
|
|
407
|
+
const out = tmp();
|
|
408
|
+
const z = zip({ terraform: "#!/bin/sh\necho terraform\n", "LICENSE.txt": "x" });
|
|
409
|
+
const s1 = ciToolFetchScript("terraform", "1.14.8", { dir: `${out}/tf`, arch: CI_TOOL_DOCKER_ARCH, download: "node" });
|
|
410
|
+
const r1 = runNodeShell(s1, { "terraform_1.14.8_linux_amd64.zip": z, "terraform_1.14.8_SHA256SUMS": `${sha(z)} terraform_1.14.8_linux_amd64.zip\n` }, { TARGETARCH: "amd64" });
|
|
411
|
+
expect(r1.stderr).toBe("");
|
|
412
|
+
expect(readFileSync(`${out}/tf/terraform`, "utf-8")).toContain("echo terraform");
|
|
413
|
+
|
|
414
|
+
// The installer writes the binary where `-i` points, as the AWS CLI's does.
|
|
415
|
+
const installer = '#!/bin/sh\nmkdir -p "$2/v2/current/bin"\ncp "$(dirname "$0")/dist/aws" "$2/v2/current/bin/aws"\n';
|
|
416
|
+
const aws = zip({ "aws/": "", "aws/install": installer, "aws/dist/aws": "#!/bin/sh\necho aws-cli\n" }, { "aws/install": 0o755, "aws/dist/aws": 0o755 });
|
|
417
|
+
const root = tmp();
|
|
418
|
+
const line = ciToolInstallLine("aws-cli", "2.37.9", { root, link: false, download: "node", sha256: { amd64: sha(aws), arm64: sha(aws) } });
|
|
419
|
+
expect(line).not.toMatch(/\bcurl\b|\bunzip\b/);
|
|
420
|
+
const r2 = runNodeShell(line, { "awscli-exe-linux-x86_64-2.37.9.zip": aws, "awscli-exe-linux-aarch64-2.37.9.zip": aws });
|
|
421
|
+
expect(r2.stderr).toBe("");
|
|
422
|
+
expect(r2.status).toBe(0);
|
|
423
|
+
expect(spawnSync(`${root}/aws-cli-2.37.9/v2/current/bin/aws`, { encoding: "utf-8" }).stdout).toBe("aws-cli\n");
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
test("curl stays the default, and download names curl or node only", () => {
|
|
427
|
+
expect(ciToolInstallLine("tofu", "1.13.1")).toContain("curl -fsSLo");
|
|
428
|
+
expect(() => ciToolFetchScript("tofu", "1.13.1", { dir: "/out/t", download: "wget" as never })).toThrow(/download is curl or node/);
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
describe("just's and act's checksums files and recorded sums (#4952)", () => {
|
|
433
|
+
test("just 1.36.0 and act 0.2.89 are recorded, copied from the releases' checksums files", () => {
|
|
434
|
+
expect(ciToolSha256("just", "1.36.0")).toEqual({ amd64: "bc7c9f377944f8de9cd0418b11d2955adebfa25a488c0b5e3dd2d2c0e9d732da", arm64: "bb3886b15e2cbcb9c0eb19956297d36de4eaef45b89d3f5fa5d1fc4ed3b5b51d" });
|
|
435
|
+
expect(ciToolSha256("act", "0.2.89")).toEqual({ amd64: "0191d6f1f3b716b5c55820032605d05fc3c1cdbf581ebeff655019e5dd1524c0", arm64: "daa8679ba9615a74d2d0cec321dc593f21948a2a11bb65862b063d8b930f4bcb" });
|
|
436
|
+
expect(() => ciToolInstallLine("just", "1.36.0", { requirePin: true })).not.toThrow();
|
|
437
|
+
expect(() => ciToolInstallLine("act", "0.2.89", { requirePin: true })).not.toThrow();
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
test("each is checked against its release's checksums file: just's per file to 1.36.0, SHA256SUMS from 1.37.0, act's checksums.txt", () => {
|
|
441
|
+
expect(ciToolRelease("just", "1.36.0", "amd64").checksumsUrl).toBe("https://github.com/casey/just/releases/download/1.36.0/just-1.36.0-x86_64-unknown-linux-musl.tar.gz.sha256sum");
|
|
442
|
+
expect(ciToolRelease("just", "1.35.0", "arm64").checksums).toBe("just-1.35.0-aarch64-unknown-linux-musl.tar.gz.sha256sum");
|
|
443
|
+
expect(ciToolRelease("just", "1.37.0", "amd64").checksumsUrl).toBe("https://github.com/casey/just/releases/download/1.37.0/SHA256SUMS");
|
|
444
|
+
expect(ciToolRelease("just", "1.34.0", "amd64").checksumsUrl).toBeUndefined();
|
|
445
|
+
expect(ciToolRelease("act", "0.2.89", "arm64").checksumsUrl).toBe("https://github.com/nektos/act/releases/download/v0.2.89/checksums.txt");
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
test("the shell reads just's per-file checksums file", () => {
|
|
449
|
+
const a = tarGz({ just: "#!/bin/sh\necho just\n" });
|
|
450
|
+
const out = tmp();
|
|
451
|
+
const s = ciToolFetchScript("just", "1.36.0", { dir: `${out}/j`, arch: CI_TOOL_DOCKER_ARCH, sha256: { amd64: sha(a), arm64: sha(a) } });
|
|
452
|
+
const r = runShell(s, { "just-1.36.0-x86_64-unknown-linux-musl.tar.gz": a, "just-1.36.0-x86_64-unknown-linux-musl.tar.gz.sha256sum": `${sha(a)} just-1.36.0-x86_64-unknown-linux-musl.tar.gz\n` }, { TARGETARCH: "amd64" });
|
|
453
|
+
expect(r.stderr).toBe("");
|
|
454
|
+
expect(r.urls[1]).toBe("https://github.com/casey/just/releases/download/1.36.0/just-1.36.0-x86_64-unknown-linux-musl.tar.gz.sha256sum");
|
|
455
|
+
expect(readFileSync(`${out}/j/just`, "utf-8")).toContain("echo just");
|
|
456
|
+
});
|
|
457
|
+
});
|
|
458
|
+
|
|
288
459
|
describe("installCiTool", () => {
|
|
289
460
|
const a = tarGz({ tofu: "#!/bin/sh\necho node-install\n" });
|
|
290
461
|
const base = "https://github.com/opentofu/opentofu/releases/download/v1.13.1";
|
|
@@ -332,9 +503,9 @@ describe("installCiTool", () => {
|
|
|
332
503
|
test("unpacks a zip's member, a bare binary and a tree", async () => {
|
|
333
504
|
const root = tmp();
|
|
334
505
|
const z = zip({ terraform: "tf" });
|
|
335
|
-
const tf = "https://releases.hashicorp.com/terraform/1.14.
|
|
336
|
-
await installCiTool("terraform", "1.14.
|
|
337
|
-
expect(readFileSync(join(root, "terraform-1.14.
|
|
506
|
+
const tf = "https://releases.hashicorp.com/terraform/1.14.8";
|
|
507
|
+
await installCiTool("terraform", "1.14.8", { ...opts, root, download: served({ [`${tf}/terraform_1.14.8_linux_amd64.zip`]: z, [`${tf}/terraform_1.14.8_SHA256SUMS`]: `${sha(z)} terraform_1.14.8_linux_amd64.zip\n` }).download });
|
|
508
|
+
expect(readFileSync(join(root, "terraform-1.14.8", "terraform"), "utf-8")).toBe("tf");
|
|
338
509
|
|
|
339
510
|
const cosign = Buffer.from("cosign");
|
|
340
511
|
const cb = "https://github.com/sigstore/cosign/releases/download/v2.6.5";
|
|
@@ -407,7 +578,7 @@ describe("productImageStages", () => {
|
|
|
407
578
|
});
|
|
408
579
|
|
|
409
580
|
test("an image refuses an engine with no recorded sha256", () => {
|
|
410
|
-
expect(() => productImageStages({ ...terragucci, tools: [{ tool: "terragrunt", version: "1.
|
|
581
|
+
expect(() => productImageStages({ ...terragucci, tools: [{ tool: "terragrunt", version: "1.1.0" }] })).toThrow(/no recorded sha256 for terragrunt 1.1.0 on amd64 and arm64/);
|
|
411
582
|
expect(() => productImageStages({ ...terragucci, tools: [{ tool: "tofu", version: "1.13.1" }, { tool: "tofu", version: "1.13.1" }] })).toThrow(/listed twice/);
|
|
412
583
|
});
|
|
413
584
|
|