@intentius/chant 0.124.88 → 0.124.90
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/actor.d.ts +36 -1
- package/dist/actor.d.ts.map +1 -1
- package/dist/actor.js +39 -1
- package/dist/chant-install.d.ts.map +1 -1
- package/dist/chant-install.js +1 -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 +193 -0
- package/dist/ci-comment-commands.d.ts.map +1 -0
- package/dist/ci-comment-commands.js +353 -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-evidence-from-job.d.ts +25 -0
- package/dist/ci-evidence-from-job.d.ts.map +1 -1
- package/dist/ci-evidence-from-job.js +43 -2
- package/dist/ci-evidence-jobs.d.ts +30 -1
- package/dist/ci-evidence-jobs.d.ts.map +1 -1
- package/dist/ci-evidence-jobs.js +46 -3
- package/dist/ci-image.d.ts +21 -4
- package/dist/ci-image.d.ts.map +1 -1
- package/dist/ci-image.js +62 -10
- package/dist/ci-job-guard.d.ts +42 -45
- package/dist/ci-job-guard.d.ts.map +1 -1
- package/dist/ci-job-guard.js +206 -3
- package/dist/ci-note-commands.d.ts +104 -4
- package/dist/ci-note-commands.d.ts.map +1 -1
- package/dist/ci-note-commands.js +131 -38
- package/dist/ci-product-words.d.ts +42 -0
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +25 -0
- package/dist/ci-product.d.ts +72 -1
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +73 -6
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +29 -2
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +2 -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 +17 -7
- package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
- package/dist/cli/handlers/ci-evidence.js +33 -7
- 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 +8 -0
- package/dist/cli/handlers/generated-check.d.ts.map +1 -1
- package/dist/cli/handlers/generated-check.js +31 -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 +33 -0
- package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
- package/dist/cli/handlers/pr-comment.js +201 -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-notes.d.ts.map +1 -1
- package/dist/cli/handlers/pr-notes.js +23 -1
- 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 +71 -23
- 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 +180 -4
- 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 +41 -2
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +31 -0
- package/dist/cli/registry.d.ts +19 -1
- 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/pr-checks.d.ts +97 -6
- package/dist/components/pr-checks.d.ts.map +1 -1
- package/dist/components/pr-checks.js +107 -13
- package/dist/components/pr-pipeline.d.ts +19 -14
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +7 -13
- package/dist/components/product-pipeline.d.ts +96 -3
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +120 -14
- package/dist/components/product-plan.d.ts +203 -6
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +250 -43
- package/dist/drift-record.d.ts +7 -0
- package/dist/drift-record.d.ts.map +1 -1
- package/dist/drift-record.js +19 -0
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +63 -31
- package/dist/forge-check/contract.d.ts +11 -1
- package/dist/forge-check/contract.d.ts.map +1 -1
- package/dist/forge-check/contract.js +4 -1
- package/dist/forge-check/index.d.ts +2 -0
- package/dist/forge-check/index.d.ts.map +1 -1
- package/dist/forge-check/index.js +2 -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 +18 -4
- package/dist/generated-check.d.ts.map +1 -1
- package/dist/generated-check.js +37 -5
- 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 +93 -4
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-applied.d.ts +9 -0
- package/dist/lifecycle/gate-applied.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 +11 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +27 -1
- 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.map +1 -1
- package/dist/lifecycle/release-images.js +1 -2
- 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/apply-status.d.ts +84 -0
- package/dist/op/apply-status.d.ts.map +1 -0
- package/dist/op/apply-status.js +106 -0
- package/dist/op/before-merge-decide.d.ts +102 -0
- package/dist/op/before-merge-decide.d.ts.map +1 -0
- package/dist/op/before-merge-decide.js +142 -0
- package/dist/op/before-merge-done.d.ts +56 -0
- package/dist/op/before-merge-done.d.ts.map +1 -0
- package/dist/op/before-merge-done.js +69 -0
- package/dist/op/before-merge-store.d.ts +20 -0
- package/dist/op/before-merge-store.d.ts.map +1 -0
- package/dist/op/before-merge-store.js +48 -0
- package/dist/op/before-merge.d.ts +150 -0
- package/dist/op/before-merge.d.ts.map +1 -0
- package/dist/op/before-merge.js +207 -0
- package/dist/op/follow-on-run.d.ts +117 -0
- package/dist/op/follow-on-run.d.ts.map +1 -0
- package/dist/op/follow-on-run.js +154 -0
- package/dist/op/follow-on-store.d.ts +17 -0
- package/dist/op/follow-on-store.d.ts.map +1 -0
- package/dist/op/follow-on-store.js +54 -0
- package/dist/op/gate.d.ts +6 -0
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +10 -1
- package/dist/op/index.d.ts +5 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +2 -0
- package/dist/op/op-waves-after-plan.d.ts +13 -0
- package/dist/op/op-waves-after-plan.d.ts.map +1 -1
- package/dist/op/op-waves-evidence-jobs.d.ts +10 -2
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
- package/dist/op/op-waves-evidence-jobs.js +19 -5
- package/dist/op/op-waves-follow-on.d.ts +162 -0
- package/dist/op/op-waves-follow-on.d.ts.map +1 -0
- package/dist/op/op-waves-follow-on.js +355 -0
- 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 +148 -6
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +873 -100
- package/dist/op/op-waves-split.d.ts +122 -0
- package/dist/op/op-waves-split.d.ts.map +1 -0
- package/dist/op/op-waves-split.js +166 -0
- package/dist/op/op-waves.d.ts +24 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +18 -1
- package/dist/op/schedule-overdue.d.ts +15 -1
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +77 -5
- package/dist/op/stage-hooks.d.ts +36 -1
- package/dist/op/stage-hooks.d.ts.map +1 -1
- package/dist/op/stage-hooks.js +17 -3
- package/dist/op/wave-stop.d.ts +67 -0
- package/dist/op/wave-stop.d.ts.map +1 -0
- package/dist/op/wave-stop.js +129 -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-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 +97 -0
- package/dist/pr-plan-note.d.ts.map +1 -1
- package/dist/pr-plan-note.js +94 -1
- package/dist/pr-post.d.ts +28 -3
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +146 -13
- 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 +16 -2
- package/dist/ref-gate-init.d.ts.map +1 -1
- package/dist/ref-gate-init.js +24 -13
- package/dist/release-floors.d.ts +39 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +63 -25
- 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.map +1 -1
- package/dist/state-migration.js +1 -2
- package/dist/wave-blocked.d.ts +7 -1
- package/dist/wave-blocked.d.ts.map +1 -1
- package/dist/wave-blocked.js +7 -2
- package/dist/wave-runtime.mjs +366 -350
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +3 -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 +4 -3
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +10 -7
- package/dist/workspace/trust/check-evidence-report.d.ts +7 -2
- package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence-report.js +15 -8
- 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 +30 -10
- 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/actor.test.ts +68 -2
- package/src/actor.ts +61 -1
- package/src/chant-install.test.ts +2 -3
- package/src/chant-install.ts +1 -2
- package/src/ci-base.test.ts +41 -0
- package/src/ci-base.ts +43 -0
- package/src/ci-comment-commands.test.ts +439 -0
- package/src/ci-comment-commands.ts +428 -0
- package/src/ci-comment-replies.ts +78 -0
- package/src/ci-commit.test.ts +2 -3
- package/src/ci-evidence-from-job.test.ts +18 -0
- package/src/ci-evidence-from-job.ts +58 -2
- package/src/ci-evidence-jobs.ts +50 -5
- package/src/ci-image.test.ts +130 -10
- package/src/ci-image.ts +85 -12
- package/src/ci-job-guard.before-merge.test.ts +148 -0
- package/src/ci-job-guard.follow-on-record.test.ts +137 -0
- package/src/ci-job-guard.follow-on.test.ts +144 -0
- package/src/ci-job-guard.ts +221 -3
- package/src/ci-note-commands.test.ts +76 -1
- package/src/ci-note-commands.ts +198 -46
- package/src/ci-product-words.ts +59 -0
- package/src/ci-product.ts +90 -6
- package/src/cli/commands/build.test.ts +41 -0
- package/src/cli/commands/build.ts +27 -2
- package/src/cli/handlers/approve.ts +2 -1
- package/src/cli/handlers/ci-check.ts +19 -7
- package/src/cli/handlers/ci-evidence.ts +29 -8
- package/src/cli/handlers/components.ts +3 -1
- package/src/cli/handlers/generated-check.ts +31 -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 +187 -0
- package/src/cli/handlers/pr-env.ts +6 -3
- package/src/cli/handlers/pr-notes.ts +30 -6
- package/src/cli/handlers/pr-record.test.ts +1 -1
- package/src/cli/handlers/pr.ts +64 -21
- 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 +170 -4
- package/src/cli/handlers/run.ts +2 -1
- package/src/cli/main.ts +41 -2
- package/src/cli/parse-args.ts +23 -0
- package/src/cli/registry.ts +19 -1
- package/src/components/auto-release.ts +2 -1
- package/src/components/pr-checks.ts +165 -17
- package/src/components/pr-pipeline.ts +22 -18
- package/src/components/product-pipeline.apply-status.test.ts +50 -0
- package/src/components/product-pipeline.ts +204 -17
- package/src/components/product-plan.test.ts +60 -4
- package/src/components/product-plan.ts +367 -50
- package/src/drift-record.test.ts +20 -0
- package/src/drift-record.ts +16 -0
- package/src/floor-table.data.ts +63 -31
- package/src/forge-check/contract.ts +12 -1
- package/src/forge-check/forge-check.test.ts +17 -0
- package/src/forge-check/index.ts +2 -0
- package/src/gate-resume-run.ts +27 -3
- package/src/generated-check.e2e.test.ts +21 -1
- package/src/generated-check.test.ts +66 -0
- package/src/generated-check.ts +51 -10
- package/src/image-pins.ts +31 -0
- package/src/lexicon.ts +89 -1
- package/src/lifecycle/gate-applied.ts +7 -0
- package/src/lifecycle/git.test.ts +48 -0
- package/src/lifecycle/git.ts +27 -4
- package/src/lifecycle/publish-npm.ts +31 -1
- package/src/lifecycle/reach-locks.test.ts +87 -0
- package/src/lifecycle/reach-locks.ts +169 -0
- package/src/lifecycle/release-cut.ts +17 -1
- package/src/lifecycle/release-images.test.ts +56 -0
- package/src/lifecycle/release-images.ts +1 -2
- 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/apply-status.test.ts +83 -0
- package/src/op/apply-status.ts +132 -0
- package/src/op/before-merge-decide.ts +190 -0
- package/src/op/before-merge-done.ts +99 -0
- package/src/op/before-merge-store.ts +44 -0
- package/src/op/before-merge.test.ts +201 -0
- package/src/op/before-merge.ts +266 -0
- package/src/op/follow-on-run.ts +206 -0
- package/src/op/follow-on-store.ts +54 -0
- package/src/op/gate-resume.test.ts +27 -0
- package/src/op/gate.ts +16 -1
- package/src/op/index.ts +15 -0
- package/src/op/op-waves-after-plan.ts +13 -0
- package/src/op/op-waves-evidence-jobs.ts +21 -7
- package/src/op/op-waves-follow-on-record.test.ts +152 -0
- package/src/op/op-waves-follow-on.test.ts +247 -0
- package/src/op/op-waves-follow-on.ts +385 -0
- package/src/op/op-waves-notify-words.test.ts +18 -0
- package/src/op/op-waves-render-spec.test.ts +159 -0
- package/src/op/op-waves-render-spec.ts +171 -0
- package/src/op/op-waves-run.ts +973 -94
- package/src/op/op-waves-split-product.test.ts +288 -0
- package/src/op/op-waves-split-step.test.ts +298 -0
- package/src/op/op-waves-split.test.ts +196 -0
- package/src/op/op-waves-split.ts +189 -0
- package/src/op/op-waves.ts +31 -3
- package/src/op/schedule-overdue.test.ts +72 -1
- package/src/op/schedule-overdue.ts +84 -6
- package/src/op/stage-hooks.ts +52 -4
- package/src/op/wave-stop.test.ts +72 -0
- package/src/op/wave-stop.ts +139 -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-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 +155 -3
- package/src/pr-post-replan.test.ts +144 -0
- package/src/pr-post-subject.test.ts +230 -0
- package/src/pr-post.test.ts +2 -1
- package/src/pr-post.ts +151 -15
- package/src/pr-status.ts +91 -0
- package/src/ref-gate-init.ts +30 -11
- package/src/release-floors.ts +81 -25
- package/src/render-module.ts +73 -0
- package/src/state-migration-record.test.ts +2 -3
- package/src/state-migration.ts +1 -2
- package/src/wave-blocked.ts +9 -4
- package/src/workspace/ci-green-cli.ts +3 -2
- package/src/workspace/ci-green-workflow.test.ts +32 -1
- package/src/workspace/release-train.ts +2 -1
- package/src/workspace/release-workflow.test.ts +36 -5
- package/src/workspace/release-workflow.ts +10 -7
- package/src/workspace/trust/check-evidence-report.ts +15 -8
- package/src/workspace/trust/check-evidence.test.ts +5 -0
- package/src/workspace/trust/ref-gate-cli.ts +30 -8
- package/src/workspace/trust/ref-gate-pieces.test.ts +46 -1
- package/src/workspace/trust/ref-gate.test.ts +10 -0
- package/src/workspace/workspace-run.ts +2 -1
package/dist/ci-job-guard.js
CHANGED
|
@@ -41,9 +41,41 @@
|
|
|
41
41
|
* label. Someone who can edit the workflow can delete it too: the forge's
|
|
42
42
|
* environment and runner settings and the cloud role's trust are what keep
|
|
43
43
|
* a job out.
|
|
44
|
+
*
|
|
45
|
+
* Before merge (#4984): a waves workflow with a before-merge mode carries
|
|
46
|
+
* `beforeMerge: { op }`. A run started for an open pull request's head
|
|
47
|
+
* names it in `CHANT_BEFORE_MERGE_PR`, `CHANT_BEFORE_MERGE_HEAD` and
|
|
48
|
+
* `CHANT_BEFORE_MERGE_DIGEST` (./op/before-merge.ts), and still runs on one
|
|
49
|
+
* of the spec's branches. The guard then fetches `chant/lifecycle` into a
|
|
50
|
+
* directory of its own, with the job's token (GitHub and Forgejo
|
|
51
|
+
* `GITHUB_TOKEN`, GitLab `CI_JOB_TOKEN`), reads the decision for that head,
|
|
52
|
+
* and admits the run only when the pull request and the digest are the
|
|
53
|
+
* decision's and the decision's fields still give its digest. A job of a
|
|
54
|
+
* workflow without the mode refuses any run that names a head.
|
|
55
|
+
*
|
|
56
|
+
* A follow-on run (#4992, ./op/follow-on-run.ts): a job of a `rest` wave
|
|
57
|
+
* carries `rest: <its wave number>`. A run the rest wave's record job
|
|
58
|
+
* started names a later wave in `CHANT_WAVES_WAVE`, with the same decision
|
|
59
|
+
* (admitted as above, so a follow-on for another head or digest is refused)
|
|
60
|
+
* or, for a push, the pushed commit in `CHANT_WAVES_COMMIT`. The guard
|
|
61
|
+
* admits it only in a job of the rest wave and only for a wave after it; any
|
|
62
|
+
* other job refuses a run that names either variable.
|
|
63
|
+
*
|
|
64
|
+
* #4998: and only for the wave the newest record job of its chain started.
|
|
65
|
+
* The guard reads the follow-on records of the op (`_waves/<op>.follow-on.json`
|
|
66
|
+
* on `chant/lifecycle`, as it reads the decisions) and admits the run when
|
|
67
|
+
* the entry for its decided head, or a push's commit, names the run's wave
|
|
68
|
+
* and, before merge, the run's decision digest. A wave started by hand past
|
|
69
|
+
* the one the chain reached is refused, though each wave's gate would ask.
|
|
44
70
|
*/
|
|
71
|
+
import { spawnSync } from "node:child_process";
|
|
72
|
+
import { mkdtempSync } from "node:fs";
|
|
73
|
+
import { tmpdir } from "node:os";
|
|
74
|
+
import { join } from "node:path";
|
|
45
75
|
import { isRunnerGroup } from "./ci-jobs.js";
|
|
46
76
|
import { CHANT_EXIT } from "./exit-codes.js";
|
|
77
|
+
import { BEFORE_MERGE_DIGEST_ENV, BEFORE_MERGE_HEAD_ENV, BEFORE_MERGE_PR_ENV, beforeMergePath, beforeMergeProblems, beforeMergeRunFromEnv, isBeforeMergeRun, parseBeforeMerge } from "./op/before-merge.js";
|
|
78
|
+
import { followOnPath, followOnProblems, followOnRecordProblems, followOnRunFromEnv, OP_WAVES_COMMIT_ENV, OP_WAVES_WAVE_ENV, parseFollowOn } from "./op/follow-on-run.js";
|
|
47
79
|
/** The variable the generated step carries its expectation in. */
|
|
48
80
|
export const JOB_GUARD_ENV = "CHANT_JOB_GUARD";
|
|
49
81
|
/** The audience of the token the guard requests on GitHub, which no cloud role should trust. */
|
|
@@ -63,6 +95,8 @@ export function jobGuardSpec(input) {
|
|
|
63
95
|
branches: [...input.branches],
|
|
64
96
|
...(input.forge === "gitlab" && labels.length > 0 ? { runnerTags: labels } : {}),
|
|
65
97
|
...(input.forge !== "gitlab" && labels.includes("self-hosted") ? { selfHosted: true } : {}),
|
|
98
|
+
...(input.beforeMerge ? { beforeMerge: { op: input.beforeMerge.op } } : {}),
|
|
99
|
+
...(input.rest !== undefined ? { rest: input.rest } : {}),
|
|
66
100
|
};
|
|
67
101
|
}
|
|
68
102
|
/** Read {@link JOB_GUARD_ENV}'s JSON, refusing one that is not a guard spec. */
|
|
@@ -89,6 +123,10 @@ export function parseJobGuardSpec(raw) {
|
|
|
89
123
|
throw new Error(`${JOB_GUARD_ENV}.forgeEnvironment is not a name`);
|
|
90
124
|
if (o.runnerTags !== undefined && (!Array.isArray(o.runnerTags) || o.runnerTags.some((t) => typeof t !== "string")))
|
|
91
125
|
throw new Error(`${JOB_GUARD_ENV}.runnerTags is not a list of tags`);
|
|
126
|
+
if (o.beforeMerge !== undefined && (typeof o.beforeMerge !== "object" || o.beforeMerge === null || typeof o.beforeMerge.op !== "string"))
|
|
127
|
+
throw new Error(`${JOB_GUARD_ENV}.beforeMerge is { op }`);
|
|
128
|
+
if (o.rest !== undefined && (!Number.isInteger(o.rest) || o.rest < 1))
|
|
129
|
+
throw new Error(`${JOB_GUARD_ENV}.rest is the rest wave's number`);
|
|
92
130
|
return o;
|
|
93
131
|
}
|
|
94
132
|
const shown = (v) => (v === undefined || v === null || v === "" ? "none" : v);
|
|
@@ -154,6 +192,38 @@ export function checkJob(expect, seen) {
|
|
|
154
192
|
else
|
|
155
193
|
out.checked.push(`ref ${seen.ref}`);
|
|
156
194
|
}
|
|
195
|
+
// #4984: a run started for an open pull request's head runs only as the decision recorded for it.
|
|
196
|
+
const run = seen.beforeMerge;
|
|
197
|
+
if (run && isBeforeMergeRun(run)) {
|
|
198
|
+
if (!expect.beforeMerge)
|
|
199
|
+
out.problems.push(`before merge: the run names pull request ${run.pr ?? "none"}'s head ${run.head ?? "none"}, and this job applies only the pushes to its branches`);
|
|
200
|
+
else if (seen.beforeMergeError !== undefined)
|
|
201
|
+
out.problems.push(`before merge: the decisions on chant/lifecycle could not be read: ${seen.beforeMergeError}`);
|
|
202
|
+
else {
|
|
203
|
+
const problems = beforeMergeProblems(expect.beforeMerge.op, run, seen.beforeMergeRecord ?? undefined);
|
|
204
|
+
if (problems.length > 0)
|
|
205
|
+
out.problems.push(...problems);
|
|
206
|
+
else
|
|
207
|
+
out.checked.push(`before merge: pull request ${run.pr}'s decided head ${run.head.slice(0, 12)}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
// #4992: a follow-on run of the rest wave, admitted in the rest wave's jobs alone and for a later wave.
|
|
211
|
+
const bmRun = run !== undefined && isBeforeMergeRun(run);
|
|
212
|
+
const follow = followOnProblems(expect.rest, seen.followOn ?? {}, bmRun);
|
|
213
|
+
out.problems.push(...follow.problems);
|
|
214
|
+
if (follow.checked) {
|
|
215
|
+
// #4998: and only for the wave the newest record job of its chain started.
|
|
216
|
+
const key = (bmRun ? run.head : seen.followOn?.commit) ?? "";
|
|
217
|
+
const rec = !expect.beforeMerge
|
|
218
|
+
? ["follow-on: this job names no op whose follow-on records it reads, so it admits no follow-on"]
|
|
219
|
+
: seen.followOnError !== undefined
|
|
220
|
+
? [`follow-on: the follow-on records on chant/lifecycle could not be read: ${seen.followOnError}`]
|
|
221
|
+
: followOnRecordProblems(expect.beforeMerge.op, seen.followOn.wave, key, bmRun ? (run.digest ?? "") : undefined, seen.followOnRecord);
|
|
222
|
+
if (rec.length > 0)
|
|
223
|
+
out.problems.push(...rec);
|
|
224
|
+
else
|
|
225
|
+
out.checked.push(follow.checked);
|
|
226
|
+
}
|
|
157
227
|
if (expect.forge === "gitlab") {
|
|
158
228
|
const want = expect.runnerTags ?? [];
|
|
159
229
|
if (want.length > 0) {
|
|
@@ -192,7 +262,72 @@ async function githubClaims(env, fetchFn) {
|
|
|
192
262
|
return tokenClaims(value);
|
|
193
263
|
}
|
|
194
264
|
/** What the job sees, from the forge's variables, and on GitHub from its token's claims when the forge environment is to be checked. */
|
|
195
|
-
export async function jobSeen(expect, env = process.env, fetchFn = fetch) {
|
|
265
|
+
export async function jobSeen(expect, env = process.env, fetchFn = fetch, readLifecycle = lifecycleFileByGit) {
|
|
266
|
+
const seen = await forgeSeen(expect, env, fetchFn);
|
|
267
|
+
// #4992: the follow-on variables, whatever else the run names.
|
|
268
|
+
const follow = followOnRunFromEnv(env);
|
|
269
|
+
if (follow.wave !== undefined || follow.commit !== undefined)
|
|
270
|
+
seen.followOn = follow;
|
|
271
|
+
// #4984: the decision a run names, read only when the spec has a before-merge mode.
|
|
272
|
+
const run = beforeMergeRunFromEnv(env);
|
|
273
|
+
const bm = isBeforeMergeRun(run);
|
|
274
|
+
if (bm) {
|
|
275
|
+
seen.beforeMerge = run;
|
|
276
|
+
if (expect.beforeMerge && run.head) {
|
|
277
|
+
try {
|
|
278
|
+
const text = readLifecycle(expect.forge, env, beforeMergePath(expect.beforeMerge.op));
|
|
279
|
+
seen.beforeMergeRecord = parseBeforeMerge(text).heads[run.head] ?? null;
|
|
280
|
+
}
|
|
281
|
+
catch (e) {
|
|
282
|
+
seen.beforeMergeError = e.message;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
// #4998: the record of the run's chain, read only for a follow-on the rest wave's job would admit.
|
|
287
|
+
const key = bm ? run.head : follow.commit;
|
|
288
|
+
if (expect.beforeMerge && key && followOnProblems(expect.rest, follow, bm).checked !== undefined) {
|
|
289
|
+
try {
|
|
290
|
+
seen.followOnRecord = parseFollowOn(readLifecycle(expect.forge, env, followOnPath(expect.beforeMerge.op))).chains[key] ?? null;
|
|
291
|
+
}
|
|
292
|
+
catch (e) {
|
|
293
|
+
seen.followOnError = e.message;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return seen;
|
|
297
|
+
}
|
|
298
|
+
/** The repository's git URL and the job token's basic credentials, as the guard fetches with them (#4984). */
|
|
299
|
+
export function guardRemote(forge, env) {
|
|
300
|
+
if (forge === "gitlab") {
|
|
301
|
+
if (!env.CI_SERVER_URL || !env.CI_PROJECT_PATH)
|
|
302
|
+
throw new Error("the job names no repository (no CI_SERVER_URL or CI_PROJECT_PATH)");
|
|
303
|
+
return { url: `${env.CI_SERVER_URL.replace(/\/+$/, "")}/${env.CI_PROJECT_PATH}.git`, user: "gitlab-ci-token", token: env.CI_JOB_TOKEN ?? "" };
|
|
304
|
+
}
|
|
305
|
+
if (!env.GITHUB_SERVER_URL || !env.GITHUB_REPOSITORY)
|
|
306
|
+
throw new Error("the job names no repository (no GITHUB_SERVER_URL or GITHUB_REPOSITORY)");
|
|
307
|
+
return { url: `${env.GITHUB_SERVER_URL.replace(/\/+$/, "")}/${env.GITHUB_REPOSITORY}.git`, user: "x-access-token", token: env.GITHUB_TOKEN ?? "" };
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* {@link LifecycleFileReader} through git: `chant/lifecycle` fetched at depth
|
|
311
|
+
* one into a directory of the guard's own, outside the checkout, with the
|
|
312
|
+
* token as a basic credential header, and the file shown from it. The
|
|
313
|
+
* `node -e` program does the same.
|
|
314
|
+
*/
|
|
315
|
+
export const lifecycleFileByGit = (forge, env, path) => {
|
|
316
|
+
const remote = guardRemote(forge, env);
|
|
317
|
+
const dir = mkdtempSync(join(tmpdir(), "chant-guard-"));
|
|
318
|
+
const git = (args) => spawnSync("git", args, { cwd: dir, encoding: "utf-8", env: { ...env, GIT_TERMINAL_PROMPT: "0" } });
|
|
319
|
+
const init = git(["init", "-q"]);
|
|
320
|
+
if (init.status !== 0)
|
|
321
|
+
throw new Error(`git init failed: ${(init.stderr || "").trim()}`);
|
|
322
|
+
const auth = `Authorization: Basic ${Buffer.from(`${remote.user}:${remote.token}`).toString("base64")}`;
|
|
323
|
+
const fetched = git(["-c", `http.extraHeader=${auth}`, "fetch", "-q", "--depth=1", remote.url, "refs/heads/chant/lifecycle"]);
|
|
324
|
+
if (fetched.status !== 0)
|
|
325
|
+
throw new Error(`could not fetch chant/lifecycle: ${(fetched.stderr || "").trim().split("\n").pop()}`);
|
|
326
|
+
const shown = git(["show", `FETCH_HEAD:${path}`]);
|
|
327
|
+
return shown.status === 0 ? shown.stdout : null;
|
|
328
|
+
};
|
|
329
|
+
/** What the forge's own variables and token say, before the decision is read. */
|
|
330
|
+
async function forgeSeen(expect, env, fetchFn) {
|
|
196
331
|
if (expect.forge === "gitlab") {
|
|
197
332
|
return {
|
|
198
333
|
forgeEnvironment: env.CI_ENVIRONMENT_NAME || null,
|
|
@@ -230,6 +365,66 @@ export function describeJobGuard(expect, result) {
|
|
|
230
365
|
const skipped = result.skipped.length ? `; not checked: ${result.skipped.join(", ")}` : "";
|
|
231
366
|
return { ok: true, out: [`${at}: ${result.checked.length ? result.checked.join(", ") : "nothing to check"}${skipped}`], err: [] };
|
|
232
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* The before-merge part of the `node -e` program (#4984): the run's three
|
|
370
|
+
* variables, the read of `chant/lifecycle` as {@link lifecycleFileByGit}
|
|
371
|
+
* does it, the decision entry as {@link parseBeforeMerge} keeps it, and the
|
|
372
|
+
* lines of {@link beforeMergeProblems}, digest included. No single quote,
|
|
373
|
+
* since the program is one shell word in single quotes.
|
|
374
|
+
*/
|
|
375
|
+
const BM_PATH = beforeMergePath("\u0000").split("\u0000");
|
|
376
|
+
/** Each apostrophe in the program's strings as `'`, since the whole program is one single-quoted shell word. */
|
|
377
|
+
const noQuote = (s) => s.replace(/'/g, "\\u0027");
|
|
378
|
+
const BEFORE_MERGE_JS = [
|
|
379
|
+
`const bmV=[${JSON.stringify(BEFORE_MERGE_PR_ENV)},${JSON.stringify(BEFORE_MERGE_HEAD_ENV)},${JSON.stringify(BEFORE_MERGE_DIGEST_ENV)}].map((k)=>String(E[k]||"").trim());`,
|
|
380
|
+
'const bmRun={};if(bmV[0])bmRun.pr=bmV[0];if(bmV[1])bmRun.head=bmV[1];if(bmV[2])bmRun.digest=bmV[2];const bmOn=Boolean(bmV[0]||bmV[1]||bmV[2]);',
|
|
381
|
+
"const SHA=/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;",
|
|
382
|
+
String.raw `const bmRead=(file)=>{const cp=require("child_process"),fs=require("fs"),os=require("os"),pa=require("path");let url,user,tok;`,
|
|
383
|
+
String.raw `if(x.forge==="gitlab"){if(!E.CI_SERVER_URL||!E.CI_PROJECT_PATH)throw new Error("the job names no repository (no CI_SERVER_URL or CI_PROJECT_PATH)");url=E.CI_SERVER_URL.replace(/\/+$/,"")+"/"+E.CI_PROJECT_PATH+".git";user="gitlab-ci-token";tok=E.CI_JOB_TOKEN||""}`,
|
|
384
|
+
String.raw `else{if(!E.GITHUB_SERVER_URL||!E.GITHUB_REPOSITORY)throw new Error("the job names no repository (no GITHUB_SERVER_URL or GITHUB_REPOSITORY)");url=E.GITHUB_SERVER_URL.replace(/\/+$/,"")+"/"+E.GITHUB_REPOSITORY+".git";user="x-access-token";tok=E.GITHUB_TOKEN||""}`,
|
|
385
|
+
String.raw `const d=fs.mkdtempSync(pa.join(os.tmpdir(),"chant-guard-"));const g=(a)=>cp.spawnSync("git",a,{cwd:d,encoding:"utf-8",env:Object.assign({},E,{GIT_TERMINAL_PROMPT:"0"})});`,
|
|
386
|
+
String.raw `const i=g(["init","-q"]);if(i.status!==0)throw new Error("git init failed: "+String(i.stderr||"").trim());`,
|
|
387
|
+
String.raw `const f=g(["-c","http.extraHeader=Authorization: Basic "+Buffer.from(user+":"+tok).toString("base64"),"fetch","-q","--depth=1",url,"refs/heads/chant/lifecycle"]);`,
|
|
388
|
+
String.raw `if(f.status!==0)throw new Error("could not fetch chant/lifecycle: "+String(f.stderr||"").trim().split("\n").pop());`,
|
|
389
|
+
String.raw `const o=g(["show","FETCH_HEAD:"+file]);return o.status===0?o.stdout:null};`,
|
|
390
|
+
String.raw `const bmEntry=(t,h)=>{let v;try{v=JSON.parse(t===null?"null":t)}catch(e){return null}const hs=v&&typeof v==="object"&&v.version===1?v.heads:undefined;if(!hs||typeof hs!=="object"||!SHA.test(h))return null;const e=hs[h];`,
|
|
391
|
+
String.raw `if(!e||typeof e!=="object"||e.head!==h||!Number.isInteger(e.pr)||e.pr<1||typeof e.base!=="string"||!SHA.test(e.base)||typeof e.at!=="string"||typeof e.by!=="string"||typeof e.digest!=="string")return null;`,
|
|
392
|
+
String.raw `if(e.through!==undefined&&(!Number.isInteger(e.through)||e.through<1))return null;const r={pr:e.pr,head:h,base:e.base,at:e.at,by:e.by,digest:e.digest};if(e.through!==undefined)r.through=e.through;return r};`,
|
|
393
|
+
`const bmSeen=(s)=>{if(!bmOn)return s;s.beforeMerge=bmRun;if(!x.beforeMerge||!bmRun.head)return s;try{s.rec=bmEntry(bmRead(${JSON.stringify(BM_PATH[0])}+x.beforeMerge.op+${JSON.stringify(BM_PATH[1])}),bmRun.head)}catch(e){s.bmErr=e&&e.message?e.message:String(e)}return s};`,
|
|
394
|
+
'const shownJ=(v)=>v===undefined||v===""?"none":JSON.stringify(v);',
|
|
395
|
+
String.raw `const bmProblems=(op,r,rec)=>{const p=[];if(!r.pr||!/^[1-9][0-9]{0,9}$/.test(r.pr))p.push("before merge: the run's pull request "+shownJ(r.pr)+" is not a number");`,
|
|
396
|
+
String.raw `if(!r.head||!SHA.test(r.head))p.push("before merge: the run's head "+shownJ(r.head)+" is not a commit sha");`,
|
|
397
|
+
String.raw `if(!r.digest||!/^sha256:[0-9a-f]{64}$/.test(r.digest))p.push("before merge: the run's digest "+shownJ(r.digest)+" is not a sha256 digest");`,
|
|
398
|
+
String.raw `if(p.length)return p;const h=r.head.slice(0,12);if(!rec)return["before merge: no decision on chant/lifecycle names head "+h+" of "+op+", so this run applies nothing"];`,
|
|
399
|
+
String.raw `if(rec.pr!==Number(r.pr))p.push("before merge: the decision for head "+h+" is pull request "+rec.pr+"'s, not "+r.pr+"'s");`,
|
|
400
|
+
String.raw `if(rec.digest!==r.digest)p.push("before merge: the run carries digest "+r.digest+", and the decision for head "+h+" has "+rec.digest);`,
|
|
401
|
+
String.raw `const dg="sha256:"+require("crypto").createHash("sha256").update(JSON.stringify(["chant-before-merge/1",op,rec.pr,rec.head,rec.base,rec.through===undefined?0:rec.through,rec.at,rec.by])).digest("hex");`,
|
|
402
|
+
String.raw `if(dg!==rec.digest)p.push("before merge: the decision for head "+h+" was changed after it was made: its fields give another digest");return p};`,
|
|
403
|
+
].map(noQuote);
|
|
404
|
+
const FO_PATH = followOnPath("\u0000").split("\u0000");
|
|
405
|
+
/**
|
|
406
|
+
* The follow-on part of the program (#4992): the run's two variables and the lines of {@link followOnProblems}, and
|
|
407
|
+
* (#4998) the read of the chain's record and the lines of {@link followOnRecordProblems}. After {@link BEFORE_MERGE_JS},
|
|
408
|
+
* whose `SHA`, `bmRead` and decision variables it reads.
|
|
409
|
+
*/
|
|
410
|
+
const FOLLOW_ON_JS = [
|
|
411
|
+
`const foV=[${JSON.stringify(OP_WAVES_WAVE_ENV)},${JSON.stringify(OP_WAVES_COMMIT_ENV)}].map((k)=>String(E[k]||"").trim());const foRun={};if(foV[0])foRun.wave=foV[0];if(foV[1])foRun.commit=foV[1];`,
|
|
412
|
+
String.raw `const foProblems=(rest,r,bm)=>{const w=r.wave,c=r.commit;`,
|
|
413
|
+
String.raw `if(rest===undefined){if(w===undefined&&c===undefined)return{p:[]};return{p:["follow-on: the run names wave "+(w===undefined?"none":w)+" and commit "+(c===undefined?"none":c)+", and this job is none of the rest wave's, which alone runs in a follow-on"]}}`,
|
|
414
|
+
String.raw `if(w===undefined||w===String(rest)){if(c===undefined)return{p:[]};return{p:["follow-on: the run names the commit "+c+" and no wave after wave "+rest+", so it is no follow-on"]}}`,
|
|
415
|
+
String.raw `if(!/^[1-9][0-9]{0,5}$/.test(w)||Number(w)<=rest)return{p:["follow-on: the run's wave "+JSON.stringify(w)+" is no wave after wave "+rest]};`,
|
|
416
|
+
String.raw `if(bm){if(c!==undefined)return{p:["follow-on: a follow-on of a decided head checks out that head, and the run names the commit "+c+" too"]};return{p:[],c:"follow-on wave "+w}}`,
|
|
417
|
+
String.raw `if(c===undefined||!SHA.test(c))return{p:["follow-on: a push's follow-on names the commit it goes on with, and the run's "+(c===undefined?"none":JSON.stringify(c))+" is not a commit sha"]};`,
|
|
418
|
+
String.raw `return{p:[],c:"follow-on wave "+w+" at "+c.slice(0,12)}};`,
|
|
419
|
+
// #4998: the record of the run's chain, as parseFollowOn keeps an entry, and the lines of followOnRecordProblems.
|
|
420
|
+
String.raw `const foEntry=(t,k)=>{let v;try{v=JSON.parse(t===null?"null":t)}catch(e){return null}const cs=v&&typeof v==="object"&&v.version===1?v.chains:undefined;if(!cs||typeof cs!=="object"||!SHA.test(k))return null;const e=cs[k];const W=(n,m)=>Number.isInteger(n)&&n>=m;`,
|
|
421
|
+
String.raw `if(!e||typeof e!=="object"||e.key!==k||!W(e.wave,2)||!W(e.from,1)||typeof e.run!=="string"||typeof e.at!=="string")return null;`,
|
|
422
|
+
String.raw `if((e.digest!==undefined&&typeof e.digest!=="string")||(e.pr!==undefined&&!W(e.pr,1))||(e.commit!==undefined&&(typeof e.commit!=="string"||!SHA.test(e.commit)))||!e.outcomes||typeof e.outcomes!=="object")return null;return e};`,
|
|
423
|
+
`const foSeen=(s)=>{const k=bmOn?bmRun.head:foRun.commit;if(!x.beforeMerge||!k||foProblems(x.rest,foRun,bmOn).c===undefined)return s;try{s.foRec=foEntry(bmRead(${JSON.stringify(FO_PATH[0])}+x.beforeMerge.op+${JSON.stringify(FO_PATH[1])}),k)}catch(e){s.foErr=e&&e.message?e.message:String(e)}return s};`,
|
|
424
|
+
String.raw `const foRecProblems=(op,w,k,dg,rec)=>{const what=dg!==undefined?"head":"commit";const sh=k.slice(0,12);if(!rec)return["follow-on: no record job of "+op+" started a follow-on for "+what+" "+sh+", so this run applies nothing"];const p=[];`,
|
|
425
|
+
String.raw `if(String(rec.wave)!==w)p.push("follow-on: the newest record job of "+op+" for "+what+" "+sh+" started wave "+rec.wave+", and this run names wave "+w);`,
|
|
426
|
+
String.raw `if(dg!==undefined&&rec.digest!==dg)p.push("follow-on: wave "+rec.wave+" of "+what+" "+sh+" was started for the decision with digest "+(rec.digest===undefined?"none":rec.digest)+", and the run carries "+dg);return p};`,
|
|
427
|
+
].map(noQuote);
|
|
233
428
|
/**
|
|
234
429
|
* The guard as one `node -e` program: the same checks as {@link checkJob},
|
|
235
430
|
* {@link jobSeen} and {@link describeJobGuard}, reading {@link JOB_GUARD_ENV}.
|
|
@@ -246,15 +441,17 @@ export const JOB_GUARD_JS = [
|
|
|
246
441
|
"if(!x||![\"github\",\"gitlab\",\"forgejo\"].includes(x.forge)||!Array.isArray(x.branches))fail(\"" + JOB_GUARD_ENV + " is not a guard spec\");",
|
|
247
442
|
'const tags=(r)=>{if(r===undefined)return undefined;const t=r.trim();if(t.startsWith("[")){try{const v=JSON.parse(t);if(Array.isArray(v))return v.map(String)}catch(e){}}return t===""?[]:t.split(",").map((s)=>s.trim()).filter((s)=>s!=="")};',
|
|
248
443
|
'const claimsOf=(tok)=>{const p=tok.split(".")[1];if(!p)throw new Error("the forge\\u0027s OIDC token is not a JWT");const c=JSON.parse(Buffer.from(p.replace(/-/g,"+").replace(/_/g,"/"),"base64").toString("utf-8"));if(!c||typeof c!=="object")throw new Error("the forge\\u0027s OIDC token has no claims");return c};',
|
|
444
|
+
...BEFORE_MERGE_JS,
|
|
445
|
+
...FOLLOW_ON_JS,
|
|
249
446
|
"async function seenOf(){",
|
|
250
|
-
'if(x.forge==="gitlab")return{forgeEnvironment:E.CI_ENVIRONMENT_NAME||null,ref:E.CI_COMMIT_REF_NAME,refProtected:E.CI_COMMIT_REF_PROTECTED,runnerTags:tags(E.CI_RUNNER_TAGS)};',
|
|
447
|
+
'if(x.forge==="gitlab")return foSeen(bmSeen({forgeEnvironment:E.CI_ENVIRONMENT_NAME||null,ref:E.CI_COMMIT_REF_NAME,refProtected:E.CI_COMMIT_REF_PROTECTED,runnerTags:tags(E.CI_RUNNER_TAGS)}));',
|
|
251
448
|
"const s={ref:E.GITHUB_REF};let c;",
|
|
252
449
|
'if(x.forge==="github"&&x.forgeEnvironment!==undefined){try{',
|
|
253
450
|
'if(!E.ACTIONS_ID_TOKEN_REQUEST_URL||!E.ACTIONS_ID_TOKEN_REQUEST_TOKEN)throw new Error("the job may request no OIDC token (no ACTIONS_ID_TOKEN_REQUEST_URL); it needs the id-token: write permission");',
|
|
254
451
|
'const r=await fetch(E.ACTIONS_ID_TOKEN_REQUEST_URL+"&audience="+encodeURIComponent(A),{headers:{authorization:"bearer "+E.ACTIONS_ID_TOKEN_REQUEST_TOKEN}});',
|
|
255
452
|
'if(!r.ok)throw new Error("the OIDC token request answered "+r.status);const v=(await r.json()).value;if(typeof v!=="string")throw new Error("the OIDC token request answered no token");',
|
|
256
453
|
'c=claimsOf(v);s.forgeEnvironment=typeof c.environment==="string"&&c.environment!==""?c.environment:null}catch(e){s.forgeEnvironmentError=e&&e.message?e.message:String(e)}}',
|
|
257
|
-
'const run=c&&typeof c.runner_environment==="string"?c.runner_environment:E.RUNNER_ENVIRONMENT;if(run)s.runnerEnvironment=run;return s}',
|
|
454
|
+
'const run=c&&typeof c.runner_environment==="string"?c.runner_environment:E.RUNNER_ENVIRONMENT;if(run)s.runnerEnvironment=run;return foSeen(bmSeen(s))}',
|
|
258
455
|
"seenOf().then((s)=>{const P=[],C=[],S=[];const fe=x.forgeEnvironment;",
|
|
259
456
|
'if(x.forge==="forgejo")S.push("forge environment (Forgejo has none)");',
|
|
260
457
|
'else if(fe!==undefined){if(s.forgeEnvironmentError!==undefined)P.push("forge environment: expected "+fe+", and it could not be read: "+s.forgeEnvironmentError);else if(s.forgeEnvironment!==fe)P.push("forge environment: expected "+fe+", found "+shown(s.forgeEnvironment));else C.push("forge environment "+fe)}',
|
|
@@ -263,6 +460,12 @@ export const JOB_GUARD_JS = [
|
|
|
263
460
|
'else if(x.forge==="gitlab"){if(!s.ref||!b.includes(s.ref))P.push("ref: expected "+b.join(" or ")+", found "+shown(s.ref));else C.push("ref "+s.ref);',
|
|
264
461
|
'if(s.refProtected!=="true")P.push("ref: expected a protected ref (CI_COMMIT_REF_PROTECTED true), found "+shown(s.refProtected));else C.push("protected ref")}',
|
|
265
462
|
'else{const refs=b.map((v)=>"refs/heads/"+v);if(!s.ref||!refs.includes(s.ref))P.push("ref: expected "+refs.join(" or ")+", found "+shown(s.ref));else C.push("ref "+s.ref)}',
|
|
463
|
+
...[
|
|
464
|
+
String.raw `if(s.beforeMerge){const r=s.beforeMerge;if(!x.beforeMerge)P.push("before merge: the run names pull request "+(r.pr||"none")+"'s head "+(r.head||"none")+", and this job applies only the pushes to its branches");`,
|
|
465
|
+
String.raw `else if(s.bmErr!==undefined)P.push("before merge: the decisions on chant/lifecycle could not be read: "+s.bmErr);`,
|
|
466
|
+
String.raw `else{const Q=bmProblems(x.beforeMerge.op,r,s.rec||undefined);if(Q.length)P.push(...Q);else C.push("before merge: pull request "+r.pr+"'s decided head "+r.head.slice(0,12))}}`,
|
|
467
|
+
].map(noQuote),
|
|
468
|
+
"{const F=foProblems(x.rest,foRun,bmOn);P.push(...F.p);if(F.c){const G=!x.beforeMerge?[\"follow-on: this job names no op whose follow-on records it reads, so it admits no follow-on\"]:s.foErr!==undefined?[\"follow-on: the follow-on records on chant/lifecycle could not be read: \"+s.foErr]:foRecProblems(x.beforeMerge.op,foRun.wave,(bmOn?bmRun.head:foRun.commit)||\"\",bmOn?(bmRun.digest||\"\"):undefined,s.foRec);if(G.length)P.push(...G);else C.push(F.c)}}",
|
|
266
469
|
'if(x.forge==="gitlab"){const w=x.runnerTags||[];if(w.length>0){const h=s.runnerTags;const miss=w.filter((t)=>!(h||[]).includes(t));',
|
|
267
470
|
'if(h===undefined)P.push("runner: expected tags "+w.join(", ")+", and the job has no CI_RUNNER_TAGS");else if(miss.length>0)P.push("runner: expected tags "+w.join(", ")+", found "+(h.length?h.join(", "):"none"));else C.push("runner tags "+w.join(", "))}}',
|
|
268
471
|
'else if(x.selfHosted){if(s.runnerEnvironment===undefined)S.push("runner (the runner says nothing about itself: no RUNNER_ENVIRONMENT)");else if(s.runnerEnvironment!=="self-hosted")P.push("runner: expected self-hosted, found "+s.runnerEnvironment);else C.push("self-hosted runner")}',
|
|
@@ -27,8 +27,9 @@
|
|
|
27
27
|
* token and holds no cloud credentials.
|
|
28
28
|
*/
|
|
29
29
|
import { type CiProductWords, type ParsedProductComment } from "./ci-product-words.js";
|
|
30
|
-
import { type GitlabForgeOptions, type PrForge } from "./pr-forge.js";
|
|
31
|
-
import type { ForgeReads, PullRequestDetail, PullRequestNote } from "./pr-forge-reads.js";
|
|
30
|
+
import { type ForgeKind, type GitlabForgeOptions, type PrForge } from "./pr-forge.js";
|
|
31
|
+
import type { ForgeReads, PullRequestDetail, PullRequestNote, RunJob, WorkflowRun } from "./pr-forge-reads.js";
|
|
32
|
+
import type { DecideBeforeMergeInput, WavesBeforeMergeJobs } from "./op/before-merge-decide.js";
|
|
32
33
|
export { GITLAB_NOTE_COMMANDS_VAR } from "./components/pr-pipeline.js";
|
|
33
34
|
/** How far back the poll reads: merge requests updated, and notes written, in this many minutes. */
|
|
34
35
|
export declare const NOTE_COMMANDS_WINDOW_MINUTES: number;
|
|
@@ -93,6 +94,15 @@ export type NoteRun =
|
|
|
93
94
|
kind: "retry";
|
|
94
95
|
sha: string;
|
|
95
96
|
jobs?: RegExp;
|
|
97
|
+
/**
|
|
98
|
+
* With the waves' op (#4984, the GitLab half of #4979's stop): the
|
|
99
|
+
* stop written for `sha` on `chant/lifecycle` just before the retry,
|
|
100
|
+
* the last wave that runs, or null to clear an earlier one.
|
|
101
|
+
*/
|
|
102
|
+
stop?: {
|
|
103
|
+
op: string;
|
|
104
|
+
through: number | null;
|
|
105
|
+
};
|
|
96
106
|
}
|
|
97
107
|
/** A reply, and nothing runs. */
|
|
98
108
|
| {
|
|
@@ -155,6 +165,13 @@ export interface NoteCommandsOptions {
|
|
|
155
165
|
env?: Record<string, string | undefined>;
|
|
156
166
|
/** The commit words that take an argument, as `parseProductComment` takes them. */
|
|
157
167
|
commitArgs?: Readonly<Record<string, RegExp>>;
|
|
168
|
+
/** Writes a retry's wave stop for op `op` at `sha`, or clears it (#4984). Absent: a retry that carries a stop is refused. */
|
|
169
|
+
stops?: (op: string, sha: string, stop: {
|
|
170
|
+
through: number;
|
|
171
|
+
at: string;
|
|
172
|
+
by?: string;
|
|
173
|
+
pr?: number;
|
|
174
|
+
} | null) => Promise<void>;
|
|
158
175
|
}
|
|
159
176
|
export interface NotePoll {
|
|
160
177
|
outcomes: NoteOutcome[];
|
|
@@ -165,6 +182,56 @@ export interface NotePoll {
|
|
|
165
182
|
export declare function pollNoteCommands(o: NoteCommandsOptions): Promise<NotePoll>;
|
|
166
183
|
/** chant's apply jobs and terragucci's: `apply`, `apply-wave-<n>` and `apply-wave-<n>-share-<m>`, a member's prefixed with its name. */
|
|
167
184
|
export declare const APPLY_JOBS: RegExp;
|
|
185
|
+
/** What starting a merge commit's apply again came to: a reply alone, a run started (`ran`), or a forge answer that broke it. */
|
|
186
|
+
export type ApplyRetried = {
|
|
187
|
+
kind: "reply";
|
|
188
|
+
text: string;
|
|
189
|
+
} | {
|
|
190
|
+
kind: "ran";
|
|
191
|
+
text: string;
|
|
192
|
+
url?: string;
|
|
193
|
+
} | {
|
|
194
|
+
kind: "fail";
|
|
195
|
+
reason: string;
|
|
196
|
+
};
|
|
197
|
+
/** What {@link ApplyRerun} is told: the merge commit, the pull request's name in a reply, who asked, and the default branch. */
|
|
198
|
+
export interface ApplyRerunContext {
|
|
199
|
+
sha: string;
|
|
200
|
+
/** `!12`, or `pull request 12`. */
|
|
201
|
+
at: string;
|
|
202
|
+
user: string;
|
|
203
|
+
base: string;
|
|
204
|
+
/** The pattern the apply jobs matched, whose groups are the wave and the share. */
|
|
205
|
+
pattern: RegExp;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* How a forge starts a merge commit's apply again (#4946), once
|
|
209
|
+
* {@link retryApply} found the push run at the commit with apply jobs and no
|
|
210
|
+
* later apply. GitLab retries the first apply job that did not succeed
|
|
211
|
+
* ({@link gitlabRetry}); GitHub and Forgejo answer in ./ci-comment-commands.ts.
|
|
212
|
+
*/
|
|
213
|
+
export type ApplyRerun = (run: WorkflowRun, jobs: RunJob[], c: ApplyRerunContext) => Promise<ApplyRetried>;
|
|
214
|
+
/** What {@link retryApply} reads with. */
|
|
215
|
+
export interface ApplyRetryReads {
|
|
216
|
+
reads: ForgeReads;
|
|
217
|
+
/** chant's client: it reads the later commits' statuses. */
|
|
218
|
+
forge: Pick<PrForge, "commitStatuses">;
|
|
219
|
+
words: CiProductWords;
|
|
220
|
+
/** The default branch. */
|
|
221
|
+
base: string;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Start a merged pull request's apply again (#4785; shared with GitHub and
|
|
225
|
+
* Forgejo in #4946): the newest push run at the merge commit that has an
|
|
226
|
+
* apply job, refused when a later commit of the default branch already
|
|
227
|
+
* carries the product's apply status, since going back to this one would
|
|
228
|
+
* undo it. `rerun` is the forge's own start.
|
|
229
|
+
*/
|
|
230
|
+
export declare function retryApply(o: ApplyRetryReads, forgeKind: ForgeKind, mr: PullRequestDetail, user: string, run: Extract<NoteRun, {
|
|
231
|
+
kind: "retry";
|
|
232
|
+
}>, rerun: ApplyRerun): Promise<ApplyRetried>;
|
|
233
|
+
/** GitLab's start: retry the first apply job, by wave and share, that did not succeed; the jobs after it follow by themselves. */
|
|
234
|
+
export declare function gitlabRetry(pipelines: Pick<GitlabPipelines, "retryJob">): ApplyRerun;
|
|
168
235
|
/** The jobs chant's GitLab pipeline has, which {@link chantNoteRuns} starts. */
|
|
169
236
|
export interface ChantNoteJobs {
|
|
170
237
|
/** The comment preview (`--preview-comment`): a plan starts it with `CHANT_PREVIEW_PR`. Without it a plan starts a merge request pipeline. */
|
|
@@ -179,9 +246,42 @@ export interface ChantNoteJobs {
|
|
|
179
246
|
agent?: boolean;
|
|
180
247
|
/** The commit jobs, started with `CHANT_COMMIT_PR`, `CHANT_COMMIT` and `CHANT_COMMIT_ARG`. */
|
|
181
248
|
commits?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* The members the pipeline was written with (#4946), such as terragucci's
|
|
251
|
+
* roots: a plan or an action naming any other gets the words' `member`
|
|
252
|
+
* reply, and nothing starts. Absent: any member a comment may name.
|
|
253
|
+
*/
|
|
254
|
+
members?: readonly string[];
|
|
255
|
+
/**
|
|
256
|
+
* The waves on merge (#4984, as the comment job's #4979): their op and
|
|
257
|
+
* count. With them a merged merge request's `wave-<n>` writes a stop for
|
|
258
|
+
* the merge commit before the retry, and an apply without a wave clears
|
|
259
|
+
* it; without them a `wave-<n>` is refused, as before.
|
|
260
|
+
*/
|
|
261
|
+
waves?: {
|
|
262
|
+
op: string;
|
|
263
|
+
count: number;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* The waves before merge (#4984), with `waves`: an open merge request's
|
|
267
|
+
* apply is decided here (./op/before-merge-decide.ts), recorded on
|
|
268
|
+
* `chant/lifecycle`, and runs in a pipeline of the default branch started
|
|
269
|
+
* with `CHANT_BEFORE_MERGE_PR`, `CHANT_BEFORE_MERGE_HEAD` and
|
|
270
|
+
* `CHANT_BEFORE_MERGE_DIGEST`.
|
|
271
|
+
*/
|
|
272
|
+
wavesBeforeMerge?: WavesBeforeMergeJobs;
|
|
182
273
|
}
|
|
183
|
-
/** What
|
|
184
|
-
export
|
|
274
|
+
/** What {@link chantNoteRuns} reads and writes with besides the jobs (#4984). */
|
|
275
|
+
export interface ChantNoteRunsOptions {
|
|
276
|
+
/** With `jobs.wavesBeforeMerge`: what the decision before merge reads and writes with. */
|
|
277
|
+
beforeMerge?: Pick<DecideBeforeMergeInput, "requires" | "statuses" | "git" | "cwd" | "lock" | "record" | "stop" | "now">;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* What a command runs in chant's own GitLab pipeline, for the jobs it has.
|
|
281
|
+
* A command no job runs gets the words' reply for it (`words.replies`,
|
|
282
|
+
* #4946), else chant's.
|
|
283
|
+
*/
|
|
284
|
+
export declare function chantNoteRuns(jobs: ChantNoteJobs, opts?: ChantNoteRunsOptions): NoteCommandRuns;
|
|
185
285
|
/** The directory on `chant/lifecycle` that keeps the notes the poll answered. */
|
|
186
286
|
export declare const NOTES_DIR = "_notes";
|
|
187
287
|
/** A note's file in {@link NOTES_DIR}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-note-commands.d.ts","sourceRoot":"","sources":["../src/ci-note-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"ci-note-commands.d.ts","sourceRoot":"","sources":["../src/ci-note-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,EAAoE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGtJ,OAAO,EAAkC,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AACnH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,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