@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
|
@@ -14,11 +14,20 @@
|
|
|
14
14
|
* before posting the note, which then says which checks were signed. The
|
|
15
15
|
* key is in that one step, in a job that runs none of the change's code.
|
|
16
16
|
* GitLab posts its notes from a target-branch pipeline that reads every
|
|
17
|
-
* open merge request, so there a job of its own
|
|
18
|
-
* (`<plan job>-evidence`) signs from
|
|
17
|
+
* open merge request, so there a job of its own in that pipeline, before
|
|
18
|
+
* the note job (`<plan job>-evidence`), signs from each merge request's
|
|
19
|
+
* plan job artifact (#4914): a merge request pipeline is built from the
|
|
20
|
+
* change's own files, so no job in it may hold the key. The signing job
|
|
21
|
+
* names the environment {@link GITLAB_EVIDENCE_ENVIRONMENT}, which the
|
|
22
|
+
* key's variable is scoped to, protected; the jobs that run the change
|
|
23
|
+
* name none, so GitLab never hands them the key.
|
|
19
24
|
* - A wave job (the waves pipeline) gets the key on its `chant run wave`
|
|
20
25
|
* step, and signs `plan:<wave>` and `policy:<wave>` once the wave is
|
|
21
|
-
* planned (../op/op-waves-evidence.ts).
|
|
26
|
+
* planned (../op/op-waves-evidence.ts). A wave with a policy runs it as a
|
|
27
|
+
* step of its own and a `<wave job>-evidence` job signs `policy:<wave>`
|
|
28
|
+
* from that step's result; a wave that trades cloud credentials and signs
|
|
29
|
+
* keyless signs `plan:<wave>` there too (#4926,
|
|
30
|
+
* ./op/op-waves-evidence-jobs.ts).
|
|
22
31
|
* - A product's check job runs `chant ci check` with the key in
|
|
23
32
|
* `CHANT_RUNNER_KEY`; the check runner signs each hook (./components/check-steps.ts).
|
|
24
33
|
*
|
|
@@ -39,7 +48,61 @@ export declare const EVIDENCE_IDENTITY_ENV = "CHANT_RUNNER_IDENTITY";
|
|
|
39
48
|
export declare const EVIDENCE_ID_TOKEN_VAR = "CHANT_ID_TOKEN_SIGSTORE";
|
|
40
49
|
/** The audience a keyless signing job's token is requested for unless told: sigstore's. */
|
|
41
50
|
export declare const EVIDENCE_DEFAULT_AUDIENCE = "sigstore";
|
|
42
|
-
export { CHECK_EVIDENCE_FLOOR, KEYLESS_EVIDENCE_FLOOR, LOCAL_EVIDENCE_FLOOR } from "./release-floors.js";
|
|
51
|
+
export { CHECK_EVIDENCE_FLOOR, CHECK_JOB_FLOOR, GITLAB_OPEN_EVIDENCE_FLOOR, GITLAB_WAVE_EVIDENCE_RETRY_FLOOR, GITLAB_WAVE_KEY_SCOPE_FLOOR, KEYLESS_EVIDENCE_FLOOR, LOCAL_EVIDENCE_FLOOR, MEMBER_SIGNED_CHECKS_FLOOR, PR_LOOP_EVIDENCE_FLOOR, REF_GATE_STATUS_JOB_FLOOR, TARGET_SIGNED_CHECKS_FLOOR, WAVE_EVIDENCE_JOB_FLOOR } from "./release-floors.js";
|
|
52
|
+
/**
|
|
53
|
+
* The GitLab environment every signing job names (#4914), with `action:
|
|
54
|
+
* access`, so it creates no deployment. Scope the runner key's CI/CD
|
|
55
|
+
* variable to it and protect it: GitLab then hands the key only to the
|
|
56
|
+
* signing jobs of a protected branch's pipeline, and to none of the jobs
|
|
57
|
+
* that run a merge request's code.
|
|
58
|
+
*/
|
|
59
|
+
export declare const GITLAB_EVIDENCE_ENVIRONMENT = "chant-evidence";
|
|
60
|
+
/** Where a GitLab signing job keeps what it signed for each merge request (#4914): `.chant/evidence/<job>/<iid>/evidence.json`. */
|
|
61
|
+
export declare function gitlabOpenEvidenceDir(job: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* The lines of a GitLab signing job in the target branch's plan notes
|
|
64
|
+
* pipeline (#4914): `chant ci evidence sign --open` finds every open merge
|
|
65
|
+
* request's newest `job`, reads its report from the job's artifact at
|
|
66
|
+
* `dir`, fetches the head and signs it against the policy at the branch's
|
|
67
|
+
* commit, and keeps each merge request's `evidence.json` under `out`.
|
|
68
|
+
* With `noForks`, a merge request from a fork is not signed for, as a
|
|
69
|
+
* product plan with `forks: "skip"` plans none.
|
|
70
|
+
*/
|
|
71
|
+
export declare function openEvidenceLines(opts: {
|
|
72
|
+
job: string;
|
|
73
|
+
dir: string;
|
|
74
|
+
out: string;
|
|
75
|
+
bin?: string;
|
|
76
|
+
noForks?: boolean;
|
|
77
|
+
member?: string;
|
|
78
|
+
}): string[];
|
|
79
|
+
/**
|
|
80
|
+
* The check a workspace member's pipeline signs for one of the plan job's
|
|
81
|
+
* two (#4964): `plan:<member>`, `policy:<member>`. A member's plan job plans
|
|
82
|
+
* that member alone, so its pass says nothing of another member's plan; a
|
|
83
|
+
* `refs` rule names each member's checks. The root pipeline's are `plan`
|
|
84
|
+
* and `policy`.
|
|
85
|
+
*/
|
|
86
|
+
export declare function memberEvidenceCheck(check: "plan" | "policy", member?: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* The check a product plan target's note job signs for one of its plan
|
|
89
|
+
* job's two (#4978): `plan:<target>`, `policy:<target>`. Each target has a
|
|
90
|
+
* plan job of its own, so its pass says nothing of another target's plan,
|
|
91
|
+
* and a `refs` rule names each target's checks. A product plan without
|
|
92
|
+
* targets signs `plan` and `policy`.
|
|
93
|
+
*/
|
|
94
|
+
export declare function targetEvidenceCheck(check: "plan" | "policy", target?: string): string;
|
|
95
|
+
/**
|
|
96
|
+
* The checks a product plan's note jobs sign (#4978), in the order a `refs`
|
|
97
|
+
* rule lists them: `plan` and `policy`, or with `targets` each target's
|
|
98
|
+
* `plan:<target>` and `policy:<target>`.
|
|
99
|
+
*/
|
|
100
|
+
export declare function productPlanEvidenceChecks(targets?: readonly string[]): string[];
|
|
101
|
+
/**
|
|
102
|
+
* The name `--member` takes (#4964): a workspace member's or (#4978) a
|
|
103
|
+
* product plan target's, which a check name carries after `plan:`.
|
|
104
|
+
*/
|
|
105
|
+
export declare const EVIDENCE_MEMBER_NAME: RegExp;
|
|
43
106
|
/**
|
|
44
107
|
* A pipeline's runner identity (#4870): a runner key's secret, or (#4869)
|
|
45
108
|
* the job's own OIDC identity. Exactly one.
|
|
@@ -74,5 +137,6 @@ export declare function planEvidenceLines(opts: {
|
|
|
74
137
|
base: string;
|
|
75
138
|
result: string;
|
|
76
139
|
bin?: string;
|
|
140
|
+
member?: string;
|
|
77
141
|
}): string[];
|
|
78
142
|
//# sourceMappingURL=ci-evidence-jobs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-evidence-jobs.d.ts","sourceRoot":"","sources":["../src/ci-evidence-jobs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ci-evidence-jobs.d.ts","sourceRoot":"","sources":["../src/ci-evidence-jobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,mEAAmE;AACnE,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAE/D,2FAA2F;AAC3F,eAAO,MAAM,yBAAyB,aAAa,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEtV;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,mBAAmB,CAAC;AAE5D,mIAAmI;AACnI,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE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EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGnG;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CAM1I"}
|
package/dist/ci-evidence-jobs.js
CHANGED
|
@@ -14,11 +14,20 @@
|
|
|
14
14
|
* before posting the note, which then says which checks were signed. The
|
|
15
15
|
* key is in that one step, in a job that runs none of the change's code.
|
|
16
16
|
* GitLab posts its notes from a target-branch pipeline that reads every
|
|
17
|
-
* open merge request, so there a job of its own
|
|
18
|
-
* (`<plan job>-evidence`) signs from
|
|
17
|
+
* open merge request, so there a job of its own in that pipeline, before
|
|
18
|
+
* the note job (`<plan job>-evidence`), signs from each merge request's
|
|
19
|
+
* plan job artifact (#4914): a merge request pipeline is built from the
|
|
20
|
+
* change's own files, so no job in it may hold the key. The signing job
|
|
21
|
+
* names the environment {@link GITLAB_EVIDENCE_ENVIRONMENT}, which the
|
|
22
|
+
* key's variable is scoped to, protected; the jobs that run the change
|
|
23
|
+
* name none, so GitLab never hands them the key.
|
|
19
24
|
* - A wave job (the waves pipeline) gets the key on its `chant run wave`
|
|
20
25
|
* step, and signs `plan:<wave>` and `policy:<wave>` once the wave is
|
|
21
|
-
* planned (../op/op-waves-evidence.ts).
|
|
26
|
+
* planned (../op/op-waves-evidence.ts). A wave with a policy runs it as a
|
|
27
|
+
* step of its own and a `<wave job>-evidence` job signs `policy:<wave>`
|
|
28
|
+
* from that step's result; a wave that trades cloud credentials and signs
|
|
29
|
+
* keyless signs `plan:<wave>` there too (#4926,
|
|
30
|
+
* ./op/op-waves-evidence-jobs.ts).
|
|
22
31
|
* - A product's check job runs `chant ci check` with the key in
|
|
23
32
|
* `CHANT_RUNNER_KEY`; the check runner signs each hook (./components/check-steps.ts).
|
|
24
33
|
*
|
|
@@ -38,7 +47,75 @@ export const EVIDENCE_IDENTITY_ENV = "CHANT_RUNNER_IDENTITY";
|
|
|
38
47
|
export const EVIDENCE_ID_TOKEN_VAR = "CHANT_ID_TOKEN_SIGSTORE";
|
|
39
48
|
/** The audience a keyless signing job's token is requested for unless told: sigstore's. */
|
|
40
49
|
export const EVIDENCE_DEFAULT_AUDIENCE = "sigstore";
|
|
41
|
-
export { CHECK_EVIDENCE_FLOOR, KEYLESS_EVIDENCE_FLOOR, LOCAL_EVIDENCE_FLOOR } from "./release-floors.js";
|
|
50
|
+
export { CHECK_EVIDENCE_FLOOR, CHECK_JOB_FLOOR, GITLAB_OPEN_EVIDENCE_FLOOR, GITLAB_WAVE_EVIDENCE_RETRY_FLOOR, GITLAB_WAVE_KEY_SCOPE_FLOOR, KEYLESS_EVIDENCE_FLOOR, LOCAL_EVIDENCE_FLOOR, MEMBER_SIGNED_CHECKS_FLOOR, PR_LOOP_EVIDENCE_FLOOR, REF_GATE_STATUS_JOB_FLOOR, TARGET_SIGNED_CHECKS_FLOOR, WAVE_EVIDENCE_JOB_FLOOR } from "./release-floors.js";
|
|
51
|
+
/**
|
|
52
|
+
* The GitLab environment every signing job names (#4914), with `action:
|
|
53
|
+
* access`, so it creates no deployment. Scope the runner key's CI/CD
|
|
54
|
+
* variable to it and protect it: GitLab then hands the key only to the
|
|
55
|
+
* signing jobs of a protected branch's pipeline, and to none of the jobs
|
|
56
|
+
* that run a merge request's code.
|
|
57
|
+
*/
|
|
58
|
+
export const GITLAB_EVIDENCE_ENVIRONMENT = "chant-evidence";
|
|
59
|
+
/** Where a GitLab signing job keeps what it signed for each merge request (#4914): `.chant/evidence/<job>/<iid>/evidence.json`. */
|
|
60
|
+
export function gitlabOpenEvidenceDir(job) {
|
|
61
|
+
return `.chant/evidence/${job}`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The lines of a GitLab signing job in the target branch's plan notes
|
|
65
|
+
* pipeline (#4914): `chant ci evidence sign --open` finds every open merge
|
|
66
|
+
* request's newest `job`, reads its report from the job's artifact at
|
|
67
|
+
* `dir`, fetches the head and signs it against the policy at the branch's
|
|
68
|
+
* commit, and keeps each merge request's `evidence.json` under `out`.
|
|
69
|
+
* With `noForks`, a merge request from a fork is not signed for, as a
|
|
70
|
+
* product plan with `forks: "skip"` plans none.
|
|
71
|
+
*/
|
|
72
|
+
export function openEvidenceLines(opts) {
|
|
73
|
+
const chant = opts.bin ?? "chant";
|
|
74
|
+
return [`${chant} ci evidence sign --open --job ${opts.job} --from-report ${opts.dir}${memberFlag(opts.member)} --base "$CI_COMMIT_SHA" --output ${opts.out}${opts.noForks ? " --no-forks" : ""}`];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The check a workspace member's pipeline signs for one of the plan job's
|
|
78
|
+
* two (#4964): `plan:<member>`, `policy:<member>`. A member's plan job plans
|
|
79
|
+
* that member alone, so its pass says nothing of another member's plan; a
|
|
80
|
+
* `refs` rule names each member's checks. The root pipeline's are `plan`
|
|
81
|
+
* and `policy`.
|
|
82
|
+
*/
|
|
83
|
+
export function memberEvidenceCheck(check, member) {
|
|
84
|
+
return member ? `${check}:${member}` : check;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The check a product plan target's note job signs for one of its plan
|
|
88
|
+
* job's two (#4978): `plan:<target>`, `policy:<target>`. Each target has a
|
|
89
|
+
* plan job of its own, so its pass says nothing of another target's plan,
|
|
90
|
+
* and a `refs` rule names each target's checks. A product plan without
|
|
91
|
+
* targets signs `plan` and `policy`.
|
|
92
|
+
*/
|
|
93
|
+
export function targetEvidenceCheck(check, target) {
|
|
94
|
+
return memberEvidenceCheck(check, target);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The checks a product plan's note jobs sign (#4978), in the order a `refs`
|
|
98
|
+
* rule lists them: `plan` and `policy`, or with `targets` each target's
|
|
99
|
+
* `plan:<target>` and `policy:<target>`.
|
|
100
|
+
*/
|
|
101
|
+
export function productPlanEvidenceChecks(targets) {
|
|
102
|
+
if (!targets || targets.length === 0)
|
|
103
|
+
return ["plan", "policy"];
|
|
104
|
+
return targets.flatMap((t) => [targetEvidenceCheck("plan", t), targetEvidenceCheck("policy", t)]);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The name `--member` takes (#4964): a workspace member's or (#4978) a
|
|
108
|
+
* product plan target's, which a check name carries after `plan:`.
|
|
109
|
+
*/
|
|
110
|
+
export const EVIDENCE_MEMBER_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
|
|
111
|
+
/** ` --member <name>` on a signing line of a member's or a target's plan evidence (#4964, #4978), or nothing. */
|
|
112
|
+
function memberFlag(member) {
|
|
113
|
+
if (member === undefined)
|
|
114
|
+
return "";
|
|
115
|
+
if (!EVIDENCE_MEMBER_NAME.test(member))
|
|
116
|
+
throw new Error(`the name ${JSON.stringify(member)} is not one a check name can carry: letters, digits, - and _`);
|
|
117
|
+
return ` --member ${member}`;
|
|
118
|
+
}
|
|
42
119
|
const SECRET_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
43
120
|
/** Refuse a secret name the forge could not hold, and an evidence block that names both identities or neither. */
|
|
44
121
|
export function assertPipelineEvidence(evidence) {
|
|
@@ -80,6 +157,6 @@ export function planEvidenceLines(opts) {
|
|
|
80
157
|
const chant = opts.bin ?? "chant";
|
|
81
158
|
return [
|
|
82
159
|
`git fetch --quiet --no-tags --depth=1 origin ${opts.at} || true`,
|
|
83
|
-
`${chant} ci evidence sign --from-report ${opts.dir} --result ${opts.result} --at ${opts.at} --base ${opts.base}`,
|
|
160
|
+
`${chant} ci evidence sign --from-report ${opts.dir}${memberFlag(opts.member)} --result ${opts.result} --at ${opts.at} --base ${opts.base}`,
|
|
84
161
|
];
|
|
85
162
|
}
|
package/dist/ci-handover.d.ts
CHANGED
|
@@ -52,6 +52,18 @@ export declare const NO_FORGE_TOKEN_MARKER = "CHANT_NO_FORGE_TOKEN";
|
|
|
52
52
|
* `$0` is that file. terragucci's `restartWithout` (render.ts:1826).
|
|
53
53
|
*/
|
|
54
54
|
export declare function dropForgeTokens(shell?: "sh" | "bash", extra?: readonly string[]): string;
|
|
55
|
+
/**
|
|
56
|
+
* The line that restarts the step's shell once without `vars` in its
|
|
57
|
+
* process environment, setting `marker` so the restarted shell does not
|
|
58
|
+
* restart again, or, when it cannot restart, unsets them (#4912). The
|
|
59
|
+
* restart runs the step's script file (`$0`) again from its first line,
|
|
60
|
+
* with every exported variable but `vars`, so the line goes at the top of
|
|
61
|
+
* the step. It needs that file, `env` and the shell on the PATH; without
|
|
62
|
+
* them (a script given to `sh -c`, GitLab's piped script) the shell unsets
|
|
63
|
+
* `vars` and runs on. {@link dropForgeTokens} and ci-login's `restart` use
|
|
64
|
+
* it. terragucci's `restartWithout` (render.ts:2101).
|
|
65
|
+
*/
|
|
66
|
+
export declare function restartWithout(shell: "sh" | "bash", vars: readonly string[], marker: string): string;
|
|
55
67
|
/** The line a GitLab plan job starts its script with: GitLab runs the script in one shell, so the unset holds for every line after it. */
|
|
56
68
|
export declare const GITLAB_DROP_FORGE_TOKENS: string;
|
|
57
69
|
/** The forges whose plan job hands its report on through job outputs. GitLab passes the artifact to the next job itself. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-handover.d.ts","sourceRoot":"","sources":["../src/ci-handover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,YAC3B,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,eAAe,EACf,aAAa,EAC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;AACvE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE1F;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CASrF;AAED,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAEzD,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iHAAiH;IACjH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6HAA6H;IAC7H,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAQ,EAAE,IAAI,GAAE,eAAoB,GAAG,MAAM,CAoCnG"}
|
package/dist/ci-handover.js
CHANGED
|
@@ -71,10 +71,22 @@ export const NO_FORGE_TOKEN_MARKER = "CHANT_NO_FORGE_TOKEN";
|
|
|
71
71
|
* `$0` is that file. terragucci's `restartWithout` (render.ts:1826).
|
|
72
72
|
*/
|
|
73
73
|
export function dropForgeTokens(shell = "sh", extra = []) {
|
|
74
|
-
const again = shell === "bash" ? 'bash --noprofile --norc -e -o pipefail "$0"' : 'sh -e "$0"';
|
|
75
|
-
const marker = NO_FORGE_TOKEN_MARKER;
|
|
76
74
|
// #4296: a plan job that traded its OIDC token drops the variables a token is requested with too.
|
|
77
|
-
|
|
75
|
+
return restartWithout(shell, [...FORGE_TOKEN_VARS, ...extra], NO_FORGE_TOKEN_MARKER);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The line that restarts the step's shell once without `vars` in its
|
|
79
|
+
* process environment, setting `marker` so the restarted shell does not
|
|
80
|
+
* restart again, or, when it cannot restart, unsets them (#4912). The
|
|
81
|
+
* restart runs the step's script file (`$0`) again from its first line,
|
|
82
|
+
* with every exported variable but `vars`, so the line goes at the top of
|
|
83
|
+
* the step. It needs that file, `env` and the shell on the PATH; without
|
|
84
|
+
* them (a script given to `sh -c`, GitLab's piped script) the shell unsets
|
|
85
|
+
* `vars` and runs on. {@link dropForgeTokens} and ci-login's `restart` use
|
|
86
|
+
* it. terragucci's `restartWithout` (render.ts:2101).
|
|
87
|
+
*/
|
|
88
|
+
export function restartWithout(shell, vars, marker) {
|
|
89
|
+
const again = shell === "bash" ? 'bash --noprofile --norc -e -o pipefail "$0"' : 'sh -e "$0"';
|
|
78
90
|
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`;
|
|
79
91
|
return `if ${can}; then exec env ${vars.map((v) => `-u ${v}`).join(" ")} ${marker}=1 ${again}; fi; unset ${vars.join(" ")}`;
|
|
80
92
|
}
|
package/dist/ci-identity.d.ts
CHANGED
|
@@ -113,7 +113,12 @@ export interface GcpCloudIdentity {
|
|
|
113
113
|
provider: string;
|
|
114
114
|
/** The OIDC token's audience. Default `https://iam.googleapis.com/<provider>`. */
|
|
115
115
|
audience?: string;
|
|
116
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Google's STS, for a regional endpoint or an emulator: its base URL, to
|
|
118
|
+
* which `/v1/token` is added, or its full token URL, one that ends in
|
|
119
|
+
* `/token` (#4912, terragucci's `token_url`). Default
|
|
120
|
+
* `https://sts.googleapis.com`.
|
|
121
|
+
*/
|
|
117
122
|
stsEndpoint?: string;
|
|
118
123
|
/** IAM credentials, for an emulator. Default `https://iamcredentials.googleapis.com`. */
|
|
119
124
|
iamEndpoint?: string;
|
|
@@ -360,8 +365,9 @@ export declare const TRADED_VARS: Record<IdentityCloud, readonly string[]>;
|
|
|
360
365
|
/**
|
|
361
366
|
* How the trade leaves what it got. `github-env`: `NAME=value` lines
|
|
362
367
|
* appended to the file argv 1 names (`$GITHUB_ENV`), and an `::add-mask::`
|
|
363
|
-
* line for each secret, so every later step of the job has them. `sh`:
|
|
364
|
-
*
|
|
368
|
+
* line for each secret, so every later step of the job has them. `sh`:
|
|
369
|
+
* `export` lines, printed when argv 1 is `-` (GitLab's script captures and
|
|
370
|
+
* evaluates them, #4912), else written to that file, mode 0600.
|
|
365
371
|
*/
|
|
366
372
|
export type TradeFormat = "github-env" | "sh";
|
|
367
373
|
/**
|
|
@@ -371,6 +377,16 @@ export type TradeFormat = "github-env" | "sh";
|
|
|
371
377
|
* reads it.
|
|
372
378
|
*/
|
|
373
379
|
export declare const CLOUD_TARGETS_ENV = "CHANT_CLOUD_TARGETS";
|
|
380
|
+
/**
|
|
381
|
+
* The variable the trade sets (#4930): the clouds it traded the job's
|
|
382
|
+
* token for, comma-separated (`aws,gcp`). The trade and ci-login's login
|
|
383
|
+
* both write a {@link CLOUD_TARGETS_ENV} file, so a product that hands a
|
|
384
|
+
* target traded credentials (terragucci's re-plan) reads this, not the
|
|
385
|
+
* file, to know the job traded. The login never sets it.
|
|
386
|
+
*/
|
|
387
|
+
export declare const CLOUD_TRADED_ENV = "CHANT_CLOUD_TRADED";
|
|
388
|
+
/** 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). */
|
|
389
|
+
export declare function cloudsTraded(env: Readonly<Record<string, string | undefined>>): IdentityCloud[];
|
|
374
390
|
/** The file {@link CLOUD_TARGETS_ENV} names: per cloud, the job's own identity, the targets that take another, and each identity's variables. */
|
|
375
391
|
export interface CloudTargetsFile {
|
|
376
392
|
version: 1;
|
|
@@ -403,12 +419,22 @@ export declare const TRADE_JS: string;
|
|
|
403
419
|
* `format`.
|
|
404
420
|
*/
|
|
405
421
|
export declare function tradeLine(out: string, format: TradeFormat): string;
|
|
406
|
-
/**
|
|
422
|
+
/**
|
|
423
|
+
* The file GitLab's trade wrote and sourced before #4912. `gitlabTradeLines`
|
|
424
|
+
* writes none now; kept for a product that names it.
|
|
425
|
+
* @deprecated `gitlabTradeLines` captures the trade's `export` lines in {@link GITLAB_TRADE_VARS}.
|
|
426
|
+
*/
|
|
407
427
|
export declare const GITLAB_TRADE_FILE = "${TMPDIR:-/tmp}/chant-cloud-$CI_JOB_ID.sh";
|
|
428
|
+
/** 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. */
|
|
429
|
+
export declare const GITLAB_TRADE_VARS = "CHANT_CLOUD_TRADE_VARS";
|
|
408
430
|
/**
|
|
409
431
|
* The lines a GitLab job's script starts with when it trades: the trade,
|
|
410
|
-
*
|
|
411
|
-
*
|
|
432
|
+
* its `export` lines captured in {@link GITLAB_TRADE_VARS}, the unset of
|
|
433
|
+
* the token variables (and, with `extraUnset`, the forge tokens'), and the
|
|
434
|
+
* evaluation of what the trade printed, then the unset of the variable
|
|
435
|
+
* that held it. No file of credentials is written (#4912), as ci-login's
|
|
436
|
+
* `gitlabCloudLogin`. An assignment's status is its command substitution's,
|
|
437
|
+
* so a failed trade stops the script.
|
|
412
438
|
*/
|
|
413
439
|
export declare function gitlabTradeLines(extraUnset?: readonly string[]): string[];
|
|
414
440
|
/** GitLab's `id_tokens:` for a trade: one per cloud, with the cloud's audience. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-identity.d.ts","sourceRoot":"","sources":["../src/ci-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAIH,qDAAqD;AACrD,eAAO,MAAM,MAAM,YAAI,KAAK,EAAE,KAAK,EAAE,OAAO,CAAU,CAAC;AACvD,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,C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442
|
export const CLOUD_TARGETS_ENV = "CHANT_CLOUD_TARGETS";
|
|
443
|
+
/**
|
|
444
|
+
* The variable the trade sets (#4930): the clouds it traded the job's
|
|
445
|
+
* token for, comma-separated (`aws,gcp`). The trade and ci-login's login
|
|
446
|
+
* both write a {@link CLOUD_TARGETS_ENV} file, so a product that hands a
|
|
447
|
+
* target traded credentials (terragucci's re-plan) reads this, not the
|
|
448
|
+
* file, to know the job traded. The login never sets it.
|
|
449
|
+
*/
|
|
450
|
+
export const CLOUD_TRADED_ENV = "CHANT_CLOUD_TRADED";
|
|
451
|
+
/** 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). */
|
|
452
|
+
export function cloudsTraded(env) {
|
|
453
|
+
const v = env[CLOUD_TRADED_ENV];
|
|
454
|
+
if (!v)
|
|
455
|
+
return [];
|
|
456
|
+
return v.split(",").filter((c) => IDENTITY_CLOUDS.includes(c));
|
|
457
|
+
}
|
|
443
458
|
/**
|
|
444
459
|
* The trade, a script for `node -e` with no dependency, so it runs before
|
|
445
460
|
* the checkout and reads none of the change's files. argv 1 is the file it
|
|
@@ -485,7 +500,8 @@ export const TRADE_JS = [
|
|
|
485
500
|
"if(a.role)Object.assign(vars,by.aws[a.role])}",
|
|
486
501
|
'if(spec.gcp){const c=spec.gcp;const tok=await idToken("gcp",c.audience);by.gcp={};',
|
|
487
502
|
'const sts=trim(c.stsEndpoint||"https://sts.googleapis.com"),iam=trim(c.iamEndpoint||"https://iamcredentials.googleapis.com");',
|
|
488
|
-
'
|
|
503
|
+
// #4912: stsEndpoint is Google's STS, or its full token URL (terragucci's `token_url`).
|
|
504
|
+
'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;',
|
|
489
505
|
'if(!clean(fed))throw new Error("Google STS gave no token");',
|
|
490
506
|
'for(const sa of ids("gcp")){',
|
|
491
507
|
'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;',
|
|
@@ -517,9 +533,11 @@ export const TRADE_JS = [
|
|
|
517
533
|
'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]}}',
|
|
518
534
|
'const tf=trim(process.env.RUNNER_TEMP||process.env.TMPDIR||"/tmp")+"/chant-cloud-targets-"+require("crypto").randomBytes(8).toString("hex")+".json";',
|
|
519
535
|
`fs.writeFileSync(tf,JSON.stringify(doc),{mode:0o600,flag:"wx"});vars.${CLOUD_TARGETS_ENV}=tf}`,
|
|
536
|
+
// #4930: which clouds this job traded, so a product tells the trade's targets file from a login's.
|
|
537
|
+
`if(clouds.length)vars.${CLOUD_TRADED_ENV}=clouds.join(",");`,
|
|
520
538
|
'for(const [k,v] of Object.entries(vars))if(!clean(v))throw new Error(k+" is not a value the job can hold");',
|
|
521
539
|
'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(""))}',
|
|
522
|
-
'else
|
|
540
|
+
'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})}',
|
|
523
541
|
'for(const s of said)console.error("chant: traded the job\\u0027s OIDC token for "+s)};',
|
|
524
542
|
"run().catch((e)=>fail(e&&e.message?e.message:String(e)));",
|
|
525
543
|
].join("");
|
|
@@ -531,24 +549,36 @@ export const TRADE_JS = [
|
|
|
531
549
|
export function tradeLine(out, format) {
|
|
532
550
|
return `(cd / && node -e '${TRADE_JS}' "${out}" ${format})`;
|
|
533
551
|
}
|
|
534
|
-
/**
|
|
552
|
+
/**
|
|
553
|
+
* The file GitLab's trade wrote and sourced before #4912. `gitlabTradeLines`
|
|
554
|
+
* writes none now; kept for a product that names it.
|
|
555
|
+
* @deprecated `gitlabTradeLines` captures the trade's `export` lines in {@link GITLAB_TRADE_VARS}.
|
|
556
|
+
*/
|
|
535
557
|
export const GITLAB_TRADE_FILE = "${TMPDIR:-/tmp}/chant-cloud-$CI_JOB_ID.sh";
|
|
558
|
+
/** 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. */
|
|
559
|
+
export const GITLAB_TRADE_VARS = "CHANT_CLOUD_TRADE_VARS";
|
|
536
560
|
/**
|
|
537
561
|
* The lines a GitLab job's script starts with when it trades: the trade,
|
|
538
|
-
*
|
|
539
|
-
*
|
|
562
|
+
* its `export` lines captured in {@link GITLAB_TRADE_VARS}, the unset of
|
|
563
|
+
* the token variables (and, with `extraUnset`, the forge tokens'), and the
|
|
564
|
+
* evaluation of what the trade printed, then the unset of the variable
|
|
565
|
+
* that held it. No file of credentials is written (#4912), as ci-login's
|
|
566
|
+
* `gitlabCloudLogin`. An assignment's status is its command substitution's,
|
|
567
|
+
* so a failed trade stops the script.
|
|
540
568
|
*/
|
|
541
569
|
export function gitlabTradeLines(extraUnset = []) {
|
|
542
570
|
return [
|
|
543
|
-
tradeLine(
|
|
571
|
+
`${GITLAB_TRADE_VARS}="$${tradeLine("-", "sh")}"`,
|
|
544
572
|
`unset ${[...extraUnset, ...OIDC_REQUEST_VARS].join(" ")}`,
|
|
545
|
-
|
|
573
|
+
`eval "$${GITLAB_TRADE_VARS}"; unset ${GITLAB_TRADE_VARS}`,
|
|
546
574
|
];
|
|
547
575
|
}
|
|
548
576
|
/** GitLab's `id_tokens:` for a trade: one per cloud, with the cloud's audience. */
|
|
549
577
|
export function gitlabTradeIdTokens(spec) {
|
|
550
578
|
return Object.fromEntries(tradedClouds(spec).map((c) => [idTokenVar(c), { aud: spec[c].audience }]));
|
|
551
579
|
}
|
|
580
|
+
/** The AWS region variables, which {@link targetCloudEnv} replaces only when the target's identity sets them. */
|
|
581
|
+
const JOB_REGION_VARS = new Set(["AWS_REGION", "AWS_DEFAULT_REGION"]);
|
|
552
582
|
/**
|
|
553
583
|
* `env` for one target's tool (#4332): the job's environment with each
|
|
554
584
|
* cloud's credentials replaced by those of the identity `target` takes, as
|
|
@@ -573,8 +603,10 @@ export function targetCloudEnv(env, target, read = (p) => readFileSync(p, "utf-8
|
|
|
573
603
|
const vars = c.vars[id];
|
|
574
604
|
if (!vars)
|
|
575
605
|
throw new Error(`${CLOUD_TARGETS_ENV} (${path}) holds no ${cloud} credentials for ${id}`);
|
|
606
|
+
// 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.
|
|
576
607
|
for (const k of TRADED_VARS[cloud])
|
|
577
|
-
|
|
608
|
+
if (!JOB_REGION_VARS.has(k))
|
|
609
|
+
delete out[k];
|
|
578
610
|
Object.assign(out, vars);
|
|
579
611
|
}
|
|
580
612
|
return out;
|
package/dist/ci-image.d.ts
CHANGED
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
* product records others in its own config and passes them as `sha256`.
|
|
17
17
|
* - {@link ciToolFetchScript} is the shell that downloads one release and
|
|
18
18
|
* checks it, for an image's fetch stage; {@link ciToolInstallLine} is the
|
|
19
|
-
* job line that runs it unless the binary is there
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* job line that runs it unless the binary is there (with `sudo`, or under
|
|
20
|
+
* a root such as `$RUNNER_TEMP/chant-tools`, for a job that is not root,
|
|
21
|
+
* #4908). With `download: "node"` both fetch and unpack with node, for
|
|
22
|
+
* an image with no curl or unzip (#4952). {@link installCiTool} does the same from Node, for a product
|
|
23
|
+
* that installs a pinned release at run time.
|
|
22
24
|
* - {@link productImageStages} is a product's image as stages a Dockerfile
|
|
23
25
|
* takes (the docker lexicon's `new Dockerfile({ stages })`), and
|
|
24
26
|
* {@link productImageDockerfile} is the same as text. The product passes
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
* project publishes a checksums file is checked against that file's line
|
|
31
33
|
* for the archive, and against the recorded sha256 when there is one, so a
|
|
32
34
|
* tampered checksums file fails as a tampered archive does. A release with
|
|
33
|
-
* no checksums file (the AWS CLI, just
|
|
35
|
+
* no checksums file (the AWS CLI, just before 1.35.0) needs a recorded sha256. An
|
|
34
36
|
* image always needs a recorded sha256 for both architectures, and a caller
|
|
35
37
|
* passes `requirePin` to ask the same of a job line or a run-time install.
|
|
36
38
|
*
|
|
@@ -38,8 +40,8 @@
|
|
|
38
40
|
* chant's release floors, so a product can bundle it or import it from a
|
|
39
41
|
* plain Node script.
|
|
40
42
|
*/
|
|
41
|
-
import { CI_IMAGE_FLOOR } from "./release-floors.js";
|
|
42
|
-
export { CI_IMAGE_FLOOR };
|
|
43
|
+
import { CI_IMAGE_DOCKER_STAGES_FLOOR, CI_IMAGE_FLOOR, CI_IMAGE_NON_ROOT_FLOOR, CI_TOOL_NODE_DOWNLOAD_FLOOR } from "./release-floors.js";
|
|
44
|
+
export { CI_IMAGE_DOCKER_STAGES_FLOOR, CI_IMAGE_FLOOR, CI_IMAGE_NON_ROOT_FLOOR, CI_TOOL_NODE_DOWNLOAD_FLOOR };
|
|
43
45
|
export type CiTool = "tofu" | "terraform" | "terragrunt" | "choudoufu" | "infracost" | "cosign" | "atmos" | "terramate" | "pulumi" | "plunge" | "aws-cli" | "just" | "act";
|
|
44
46
|
/** The architectures chant fetches, as Docker's `TARGETARCH` names them. */
|
|
45
47
|
export type CiToolArch = "amd64" | "arm64";
|
|
@@ -85,7 +87,7 @@ export interface CiToolRelease {
|
|
|
85
87
|
export declare function ciToolRelease(tool: CiTool, version: string, arch: CiToolArch): CiToolRelease;
|
|
86
88
|
/** The recorded sha256 of `tool` at `version` by architecture: the caller's, else {@link CI_TOOL_SHA256}'s. */
|
|
87
89
|
export declare function ciToolSha256(tool: CiTool, version: string, given?: Partial<Record<CiToolArch, string>>): Partial<Record<CiToolArch, string>>;
|
|
88
|
-
/** Where a tool lives once installed: `<root>/<tool>-<version>`. */
|
|
90
|
+
/** Where a tool lives once installed: `<root>/<tool>-<version>`. A job line's root may start with a shell variable (#4908). */
|
|
89
91
|
export declare function ciToolDir(tool: CiTool, version: string, root: string): string;
|
|
90
92
|
/** The binary's path once installed under `root`. */
|
|
91
93
|
export declare function ciToolBin(tool: CiTool, version: string, root: string): string;
|
|
@@ -99,6 +101,14 @@ export interface CiToolCheckOptions {
|
|
|
99
101
|
/** Refuse a release with no recorded sha256 for an architecture, rather than trust its checksums file alone. Default false. */
|
|
100
102
|
requirePin?: boolean;
|
|
101
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* How a fetch line downloads and unpacks a release (#4952): `curl` (the
|
|
106
|
+
* default) with `unzip` for a zip, or `node`, which downloads with node's
|
|
107
|
+
* `fetch` and unpacks a zip with node, for a job whose image carries node
|
|
108
|
+
* but neither curl nor unzip. The check is the same either way; tar,
|
|
109
|
+
* sha256sum and sed are still the image's.
|
|
110
|
+
*/
|
|
111
|
+
export type CiToolDownload = "curl" | "node";
|
|
102
112
|
export interface CiToolFetchOptions extends CiToolCheckOptions {
|
|
103
113
|
/** The directory the tool installs into, an absolute path: {@link ciToolDir} under the image's tool root. */
|
|
104
114
|
dir: string;
|
|
@@ -106,6 +116,14 @@ export interface CiToolFetchOptions extends CiToolCheckOptions {
|
|
|
106
116
|
arch?: string;
|
|
107
117
|
/** A shell word for the checksums file's URL, such as `"$CHECKSUMS_URL"`. Default the release's own. */
|
|
108
118
|
checksumsUrl?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Write into `dir` with `sudo` (#4908), for a job that runs as a user who
|
|
121
|
+
* cannot write the tool root, such as GitHub's hosted runners under
|
|
122
|
+
* /opt. The download and the check run as the job's user. Default false.
|
|
123
|
+
*/
|
|
124
|
+
sudo?: boolean;
|
|
125
|
+
/** Download with curl (the default) or with node, for an image with no curl or unzip (#4952). */
|
|
126
|
+
download?: CiToolDownload;
|
|
109
127
|
}
|
|
110
128
|
/**
|
|
111
129
|
* Shell that downloads one release into `dir` and checks it (#4784). Run it
|
|
@@ -115,12 +133,34 @@ export interface CiToolFetchOptions extends CiToolCheckOptions {
|
|
|
115
133
|
*/
|
|
116
134
|
export declare function ciToolFetchScript(tool: CiTool, version: string, options: CiToolFetchOptions): string;
|
|
117
135
|
export interface CiToolInstallOptions extends CiToolCheckOptions {
|
|
118
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* Where the versioned directories live. Default {@link CI_TOOL_ROOT}. It
|
|
138
|
+
* may start with a variable the job's shell expands (#4908), such as
|
|
139
|
+
* `$RUNNER_TEMP/chant-tools`, for a job that is not root.
|
|
140
|
+
*/
|
|
119
141
|
root?: string;
|
|
120
|
-
/** Link the binary into
|
|
142
|
+
/** Link the binary into `binDir` (default true). `false` leaves PATH alone, for a pin a step runs by its path. */
|
|
121
143
|
link?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Where the link goes. Default /usr/local/bin. Like `root` it may start
|
|
146
|
+
* with a variable (#4908), such as `$HOME/.local/bin`; the job puts it on
|
|
147
|
+
* PATH.
|
|
148
|
+
*/
|
|
149
|
+
binDir?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Install into `root` and link into `binDir` with `sudo` (#4908), for a
|
|
152
|
+
* job that runs as a user who cannot write them, as on GitHub's hosted
|
|
153
|
+
* runners. The download and the check run as the job's user. Default false.
|
|
154
|
+
*/
|
|
155
|
+
sudo?: boolean;
|
|
122
156
|
/** Skip the install when any `<bin>` is on PATH, whatever its version. Default false: only the versioned directory counts. */
|
|
123
157
|
onPath?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Download with curl (the default) or with node (#4952), for a job whose
|
|
160
|
+
* image carries node but neither curl nor unzip, such as terragucci's
|
|
161
|
+
* images installing the AWS CLI for drift attribution.
|
|
162
|
+
*/
|
|
163
|
+
download?: CiToolDownload;
|
|
124
164
|
}
|
|
125
165
|
/** Where a job line installs each release by default. */
|
|
126
166
|
export declare const CI_TOOL_ROOT = "/opt/chant";
|
|
@@ -169,7 +209,22 @@ export declare const CI_BASE_IMAGES: {
|
|
|
169
209
|
/** The build argument a release passes its label in (chant's release.version). */
|
|
170
210
|
export declare const CI_IMAGE_LABEL_ARG = "CHANT_RELEASE_LABEL";
|
|
171
211
|
/** One Dockerfile instruction, as the docker lexicon's stage `steps` take it: `{ run: "..." }`. */
|
|
172
|
-
|
|
212
|
+
/** The Dockerfile instructions a {@link CiImageStep} names. */
|
|
213
|
+
export type CiImageInstruction = "arg" | "env" | "run" | "copy" | "label" | "cmd" | "user" | "workdir" | "expose" | "entrypoint";
|
|
214
|
+
/**
|
|
215
|
+
* One Dockerfile instruction, as the docker lexicon's stage `steps` take it:
|
|
216
|
+
* `{ run: "..." }`. One key each, the others `never`, the shape of the
|
|
217
|
+
* lexicon's `DockerfileStep`, so `new Dockerfile({ stages:
|
|
218
|
+
* productImageStages(spec) })` compiles under `exactOptionalPropertyTypes`
|
|
219
|
+
* (#4932).
|
|
220
|
+
*/
|
|
221
|
+
export type CiImageStep = {
|
|
222
|
+
[K in CiImageInstruction]: {
|
|
223
|
+
readonly [P in K]: string;
|
|
224
|
+
} & {
|
|
225
|
+
readonly [P in Exclude<CiImageInstruction, K>]?: never;
|
|
226
|
+
};
|
|
227
|
+
}[CiImageInstruction];
|
|
173
228
|
/** One stage, as the docker lexicon's `new Dockerfile({ stages })` takes it. */
|
|
174
229
|
export interface CiImageStage {
|
|
175
230
|
from: string;
|