@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
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The comment job on GitHub and Forgejo (#4946): one job that reads every
|
|
3
|
+
* `/<product>` comment and answers the ones no other job of the pipeline
|
|
4
|
+
* takes, the GitHub and Forgejo half of what the GitLab note poll does
|
|
5
|
+
* (./ci-note-commands.ts). Moved from terragucci's `decideComment` and
|
|
6
|
+
* `decideApplyComment` (comment.ts, comment-apply.ts).
|
|
7
|
+
*
|
|
8
|
+
* GitHub and Forgejo start a workflow on the comment itself, so each job
|
|
9
|
+
* that answers a command (the re-plan, the comment lock and unlock, the
|
|
10
|
+
* action job, the agent, the commit jobs, the apply before merge) starts on
|
|
11
|
+
* its own comment, and this job leaves those comments alone. It answers the
|
|
12
|
+
* rest:
|
|
13
|
+
*
|
|
14
|
+
* - a comment the grammar refuses (`parseProductComment` with
|
|
15
|
+
* `leaveCommit`, so a commit word stays the commit job's), with the
|
|
16
|
+
* grammar's reason, an alias's product reason among them
|
|
17
|
+
* (`CiProductAlias.refuse`);
|
|
18
|
+
* - a command no job runs (`plan`, `apply`, `lock`, `unlock`, `action`,
|
|
19
|
+
* `agent`), with the words' reply for it (`words.replies`) or chant's;
|
|
20
|
+
* - with `applyOnMerge`, `/<product> apply` on a merged pull request: the
|
|
21
|
+
* newest push run at its merge commit that has an apply job is started
|
|
22
|
+
* again, unless a later commit of the default branch already carries the
|
|
23
|
+
* product's apply status. On GitHub the run's failed jobs run again
|
|
24
|
+
* (`rerun-failed-jobs`), each wave behind its own gate. Forgejo has no
|
|
25
|
+
* call that runs a run again, so the waves workflow is dispatched on the
|
|
26
|
+
* default branch, and only while the merge commit is still the branch's
|
|
27
|
+
* newest push. A forge re-run cannot stop the waves after one, so with
|
|
28
|
+
* the waves' op (`jobs.waves`, #4979) a `wave-<n>` writes a stop for the
|
|
29
|
+
* merge commit on `chant/lifecycle` before the run starts, and the waves
|
|
30
|
+
* after n wait (./op/wave-stop.ts); without it a wave-n is refused. On a
|
|
31
|
+
* fork, a pull request merged elsewhere, or one closed without merging,
|
|
32
|
+
* the reply says so.
|
|
33
|
+
* - with `noPlanFlags` (#4979), a plan comment with flags the product
|
|
34
|
+
* plan's re-plan cannot take, with the reason.
|
|
35
|
+
* - with `wavesBeforeMerge` (#4984), `/<product> apply [wave-<n>]` on an
|
|
36
|
+
* open pull request: the decision before merge
|
|
37
|
+
* (./op/before-merge-decide.ts) records the head on `chant/lifecycle`
|
|
38
|
+
* and dispatches the waves workflow on the default branch for it.
|
|
39
|
+
*
|
|
40
|
+
* Who asked comes first. On GitHub the commenter's permission is read from
|
|
41
|
+
* the forge; Forgejo answers 403 when a job's token asks for another user's
|
|
42
|
+
* permission, so there the event's `repository.permissions`, computed for
|
|
43
|
+
* the comment's author when the comment was created, is read, and the
|
|
44
|
+
* event must be for this repository and from the comment's author. Someone
|
|
45
|
+
* without write access gets no reply and nothing runs, as on GitLab.
|
|
46
|
+
*
|
|
47
|
+
* The comment is untrusted input: it is read from the event file, never
|
|
48
|
+
* from an expression in a script, and nothing of it reaches a shell. The
|
|
49
|
+
* job runs at the target branch's commit, so none of the change's code
|
|
50
|
+
* runs here.
|
|
51
|
+
*/
|
|
52
|
+
import { commentTerms, forkReply, memberReply, notRunReply } from "./ci-comment-replies.js";
|
|
53
|
+
import { retryApply } from "./ci-note-commands.js";
|
|
54
|
+
import { parseProductComment } from "./ci-product-words.js";
|
|
55
|
+
import { ForgeApiError } from "./pr-forge.js";
|
|
56
|
+
/** The comment job's name in a generated workflow (#4946). */
|
|
57
|
+
export const PR_COMMENT_JOB = "comment";
|
|
58
|
+
/** The variable the comment job reads the pipeline's jobs from, as JSON ({@link CommentJobs}), written by the generator (#4946). */
|
|
59
|
+
export const COMMENT_JOBS_ENV = "CHANT_COMMENT_JOBS";
|
|
60
|
+
/**
|
|
61
|
+
* The apply jobs a re-run looks for at a merge commit: chant's op waves
|
|
62
|
+
* (`wave-<k>-<name>`, its decide and share jobs) and chant's and
|
|
63
|
+
* terragucci's pull request loop jobs (`apply`, `apply-wave-<k>`).
|
|
64
|
+
*/
|
|
65
|
+
export const RERUN_APPLY_JOBS = /^(?:wave-([1-9][0-9]*)-[a-z0-9][a-z0-9_-]*|(?:[a-z0-9][a-z0-9-]*-)?apply(?:-wave-([1-9][0-9]*)(?:-share-[1-9][0-9]*)?)?)$/;
|
|
66
|
+
/** The writes for a GitHub or Forgejo API root, repository and token. */
|
|
67
|
+
export function commentRuns(opts) {
|
|
68
|
+
const fetchImpl = opts.fetch ?? globalThis.fetch;
|
|
69
|
+
const root = `${opts.apiBase.replace(/\/+$/, "")}/repos/${opts.repo}`;
|
|
70
|
+
const post = async (path, body) => {
|
|
71
|
+
const url = `${root}${path}`;
|
|
72
|
+
const res = await fetchImpl(url, { method: "POST", headers: { Authorization: `token ${opts.token}`, Accept: "application/json", "Content-Type": "application/json" }, body: JSON.stringify(body) });
|
|
73
|
+
const text = await res.text();
|
|
74
|
+
if (!res.ok)
|
|
75
|
+
throw new ForgeApiError("POST", url, res.status, text);
|
|
76
|
+
return {};
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
rerunFailed: (run) => post(`/actions/runs/${run}/rerun-failed-jobs`, {}),
|
|
80
|
+
dispatch: (workflow, ref, inputs) => post(`/actions/workflows/${encodeURIComponent(workflow)}/dispatches`, { ref, ...(inputs ? { inputs } : {}) }),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** Permissions on GitHub that may ask for a command: the same as may push. */
|
|
84
|
+
const MAY_ASK = new Set(["admin", "maintain", "write"]);
|
|
85
|
+
const LOGIN = /^[A-Za-z0-9_][A-Za-z0-9_.@-]{0,99}$/;
|
|
86
|
+
const short = (sha) => sha.slice(0, 8);
|
|
87
|
+
const message = (e) => (e instanceof Error ? e.message : String(e)).split("\n")[0];
|
|
88
|
+
const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
89
|
+
/** The command a comment asks for, for a job that only needs to know: the grammar's reading, leaving a commit word to the commit job. */
|
|
90
|
+
export function readProductComment(words, body, env = {}, commitArgs = {}) {
|
|
91
|
+
return parseProductComment(words, body, env, commitArgs, { leaveCommit: true });
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Whether another job of the pipeline answers `parsed` on an open or a
|
|
95
|
+
* merged pull request, so the comment job says nothing (#4946).
|
|
96
|
+
*/
|
|
97
|
+
export function answeredElsewhere(parsed, jobs, open) {
|
|
98
|
+
switch (parsed.kind) {
|
|
99
|
+
case "plan":
|
|
100
|
+
return Boolean(jobs.preview);
|
|
101
|
+
case "lock":
|
|
102
|
+
case "unlock":
|
|
103
|
+
return Boolean(jobs.locks);
|
|
104
|
+
case "action":
|
|
105
|
+
return Boolean(jobs.actions);
|
|
106
|
+
case "agent":
|
|
107
|
+
return Boolean(jobs.agent);
|
|
108
|
+
case "commit":
|
|
109
|
+
return true;
|
|
110
|
+
case "apply":
|
|
111
|
+
// The apply before merge answers an open pull request's apply comment; a merged one's is this job's.
|
|
112
|
+
return Boolean(jobs.applyBeforeMerge) && open !== false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Read the comment, and answer it when no other job does (#4946). */
|
|
116
|
+
export async function answerProductComment(o) {
|
|
117
|
+
const e = o.event;
|
|
118
|
+
const t = commentTerms(o.forge);
|
|
119
|
+
const silent = (reason, command) => ({ ...(command ? { command } : {}), ran: false, replied: false, reason });
|
|
120
|
+
const broke = (reason, command) => ({ ...(command ? { command } : {}), ran: false, replied: false, fail: true, reason });
|
|
121
|
+
if (!isObject(e))
|
|
122
|
+
return broke("the event is not a JSON object");
|
|
123
|
+
if (e.action !== "created")
|
|
124
|
+
return silent("not a new comment");
|
|
125
|
+
const comment = isObject(e.comment) ? e.comment : {};
|
|
126
|
+
const parsed = readProductComment(o.words, comment.body, o.env ?? {}, o.commitArgs ?? {});
|
|
127
|
+
if (parsed === undefined)
|
|
128
|
+
return silent(`the comment is not addressed to ${o.words.product}, or another job answers it`);
|
|
129
|
+
const command = parsed.kind === "refused" ? undefined : parsed.kind;
|
|
130
|
+
const issue = isObject(e.issue) ? e.issue : {};
|
|
131
|
+
const n = issue.number;
|
|
132
|
+
if (typeof n !== "number" || !Number.isInteger(n) || n < 1)
|
|
133
|
+
return silent("the comment has no issue number", command);
|
|
134
|
+
if (!issue.pull_request && issue.is_pull !== true && e.is_pull !== true)
|
|
135
|
+
return silent(`the comment is not on a ${t.request}`, command);
|
|
136
|
+
const user = isObject(comment.user) ? comment.user.login : undefined;
|
|
137
|
+
if (typeof user !== "string" || !LOGIN.test(user))
|
|
138
|
+
return silent("the comment has no usable author", command);
|
|
139
|
+
// Who asked comes first: someone without write access gets no reply and nothing runs.
|
|
140
|
+
if (o.forge === "forgejo") {
|
|
141
|
+
const repository = isObject(e.repository) ? e.repository : {};
|
|
142
|
+
if (repository.full_name !== o.repo)
|
|
143
|
+
return silent("the event is not for this repository", command);
|
|
144
|
+
const sender = isObject(e.sender) ? e.sender.login : undefined;
|
|
145
|
+
if (sender !== user)
|
|
146
|
+
return silent("the comment's author is not the event's sender", command);
|
|
147
|
+
const p = isObject(repository.permissions) ? repository.permissions : {};
|
|
148
|
+
if (p.push !== true && p.admin !== true)
|
|
149
|
+
return silent(`${user} has no write access, so the comment is ignored`, command);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
let permission;
|
|
153
|
+
try {
|
|
154
|
+
permission = await o.reads.permission(user);
|
|
155
|
+
}
|
|
156
|
+
catch (err) {
|
|
157
|
+
return broke(`could not read ${user}'s permission, so nothing runs (${message(err)})`, command);
|
|
158
|
+
}
|
|
159
|
+
if (permission === undefined || !MAY_ASK.has(permission))
|
|
160
|
+
return silent(`${user} has no write access, so the comment is ignored`, command);
|
|
161
|
+
}
|
|
162
|
+
const reply = async (text, ran = false, url) => {
|
|
163
|
+
const done = { ...(command ? { command } : {}), ran, ...(url ? { url } : {}) };
|
|
164
|
+
try {
|
|
165
|
+
await o.poster.addComment(n, `${o.words.product}: ${text}`);
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
return { ...done, replied: false, fail: true, reason: `${text}; and the reply failed (${message(err)})` };
|
|
169
|
+
}
|
|
170
|
+
return { ...done, replied: true, reason: text };
|
|
171
|
+
};
|
|
172
|
+
if (parsed.kind === "refused")
|
|
173
|
+
return reply(parsed.reason);
|
|
174
|
+
// The product plan's re-plan skips these without a word: a target that is none of its own, and a fork with forks: "skip".
|
|
175
|
+
if (parsed.kind === "plan" && o.jobs.preview) {
|
|
176
|
+
// #4979: the product plan's re-plan plans what its verb plans, and takes no flag the grammar reads.
|
|
177
|
+
if (o.jobs.noPlanFlags && (parsed.targets?.length || parsed.refresh || parsed.targetDependents))
|
|
178
|
+
return reply(planFlagsReply(o.words));
|
|
179
|
+
if (parsed.member !== undefined && o.jobs.targets?.length && !o.jobs.targets.includes(parsed.member))
|
|
180
|
+
return reply(memberReply(o.words, parsed.member, o.jobs.targets, o.forge));
|
|
181
|
+
if (o.jobs.skipForks) {
|
|
182
|
+
let pr;
|
|
183
|
+
try {
|
|
184
|
+
pr = await o.reads.pullRequest(n);
|
|
185
|
+
}
|
|
186
|
+
catch (err) {
|
|
187
|
+
return broke(`could not read ${t.at(n)} (${message(err)})`, command);
|
|
188
|
+
}
|
|
189
|
+
if (pr && !pr.sameRepo)
|
|
190
|
+
return reply(forkReply(o.words, o.forge));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// A command another job answers starts that job on this same comment.
|
|
194
|
+
if (parsed.kind !== "apply" && answeredElsewhere(parsed, o.jobs, true))
|
|
195
|
+
return silent("another job answers this comment", command);
|
|
196
|
+
switch (parsed.kind) {
|
|
197
|
+
case "plan":
|
|
198
|
+
case "lock":
|
|
199
|
+
case "unlock":
|
|
200
|
+
case "action":
|
|
201
|
+
case "agent":
|
|
202
|
+
return reply(notRunReply(o.words, parsed.kind, o.forge));
|
|
203
|
+
case "commit":
|
|
204
|
+
return silent("the commit job answers this comment", command);
|
|
205
|
+
case "apply":
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
// An apply: the apply before merge answers an open pull request; this job a merged one, with applyOnMerge.
|
|
209
|
+
if (!o.jobs.applyBeforeMerge && !o.jobs.applyOnMerge && !o.jobs.wavesBeforeMerge)
|
|
210
|
+
return reply(notRunReply(o.words, "apply", o.forge));
|
|
211
|
+
let pr;
|
|
212
|
+
try {
|
|
213
|
+
pr = await o.reads.pullRequest(n);
|
|
214
|
+
}
|
|
215
|
+
catch (err) {
|
|
216
|
+
return broke(`could not read ${t.at(n)} (${message(err)})`, command);
|
|
217
|
+
}
|
|
218
|
+
if (!pr)
|
|
219
|
+
return broke(`the forge has no ${t.at(n)}`, command);
|
|
220
|
+
const at = t.at(n);
|
|
221
|
+
const verb = o.words.verbs.apply;
|
|
222
|
+
if (pr.state === "open") {
|
|
223
|
+
if (o.jobs.applyBeforeMerge)
|
|
224
|
+
return silent("the apply before merge answers this comment", command);
|
|
225
|
+
// #4984: the waves before merge: decide, record the head and dispatch the waves workflow for it.
|
|
226
|
+
const bm = o.jobs.wavesBeforeMerge;
|
|
227
|
+
if (bm && o.jobs.waves && o.beforeMerge) {
|
|
228
|
+
const workflow = bm.workflow;
|
|
229
|
+
if (!workflow)
|
|
230
|
+
return broke("the waves before merge name no workflow to dispatch", command);
|
|
231
|
+
const { decideWavesBeforeMerge } = await import("./op/before-merge-decide.js");
|
|
232
|
+
const done = await decideWavesBeforeMerge({
|
|
233
|
+
...o.beforeMerge,
|
|
234
|
+
forge: o.forge,
|
|
235
|
+
pr,
|
|
236
|
+
user,
|
|
237
|
+
base: o.base,
|
|
238
|
+
...(parsed.wave !== undefined ? { wave: parsed.wave } : {}),
|
|
239
|
+
op: o.jobs.waves.op,
|
|
240
|
+
count: o.jobs.waves.count,
|
|
241
|
+
jobs: bm,
|
|
242
|
+
words: o.words,
|
|
243
|
+
start: (r) => o.runs.dispatch(workflow, o.base, { pr: String(r.pr), head: r.head, digest: r.digest }),
|
|
244
|
+
});
|
|
245
|
+
if (done.kind === "fail")
|
|
246
|
+
return broke(done.reason, command);
|
|
247
|
+
return reply(done.text, done.kind === "ran", done.kind === "ran" ? done.url : undefined);
|
|
248
|
+
}
|
|
249
|
+
return reply(`${at} is not merged: \`/${o.words.product} ${typedApply(o.words)}\` runs the ${verb[0]} of a merged ${t.request} again, from the default branch, and never ${verb[0]}s a ${t.request}'s branch`);
|
|
250
|
+
}
|
|
251
|
+
if (pr.state === "closed")
|
|
252
|
+
return reply(`${at} was closed without merging, so there is nothing of it to ${verb[0]}`);
|
|
253
|
+
if (!o.jobs.applyOnMerge)
|
|
254
|
+
return reply(`${at} is merged, and this ${t.place} ${verb[0]}s a ${t.request} before it merges, so there is nothing of it left to ${verb[0]}`);
|
|
255
|
+
if (!pr.sameRepo)
|
|
256
|
+
return reply(forkReply(o.words, o.forge));
|
|
257
|
+
// #4979: with the waves' op the stop is written for the run; without it a re-run cannot stop.
|
|
258
|
+
const waves = o.stops ? o.jobs.waves : undefined;
|
|
259
|
+
const wave = parsed.wave;
|
|
260
|
+
if (wave !== undefined && !waves) {
|
|
261
|
+
return reply(`a run started again runs the waves after the one that stopped by itself, so \`wave-${wave}\` cannot stop them; write \`/${o.words.product} ${typedApply(o.words)}\`, and each wave still waits behind its own gate`);
|
|
262
|
+
}
|
|
263
|
+
if (wave !== undefined && waves && wave > waves.count)
|
|
264
|
+
return reply(`the ${verb[0]} of this ${t.place} runs in ${waves.count} wave${waves.count === 1 ? "" : "s"}, so there is no \`wave-${wave}\``);
|
|
265
|
+
if (pr.base !== undefined && pr.base !== o.base)
|
|
266
|
+
return reply(`${at} was merged into ${pr.base}, not the default branch ${o.base}, so nothing ${verb[1]} from it`);
|
|
267
|
+
if (!pr.mergeCommit)
|
|
268
|
+
return broke(`${at} has no merge commit`, command);
|
|
269
|
+
const mergeCommit = pr.mergeCommit;
|
|
270
|
+
const start = o.forge === "github" ? githubRerun(o.runs) : forgejoRerun(o.runs, o.reads);
|
|
271
|
+
// The stop goes on chant/lifecycle just before the run starts, so every wave job of the run reads it; an apply without a wave clears it.
|
|
272
|
+
const rerun = waves
|
|
273
|
+
? async (run, jobs, ctx) => {
|
|
274
|
+
try {
|
|
275
|
+
await o.stops(waves.op, mergeCommit, wave !== undefined ? { through: wave, at: (o.now ?? (() => new Date().toISOString()))(), by: user, pr: n } : null);
|
|
276
|
+
}
|
|
277
|
+
catch (err) {
|
|
278
|
+
return { kind: "fail", reason: `could not write the wave stop for ${short(mergeCommit)}, so nothing was started (${message(err)})` };
|
|
279
|
+
}
|
|
280
|
+
return start(run, jobs, ctx);
|
|
281
|
+
}
|
|
282
|
+
: start;
|
|
283
|
+
const done = await retryApply({ reads: o.reads, forge: o.poster, words: o.words, base: o.base }, o.forge, pr, user, { kind: "retry", sha: mergeCommit, jobs: RERUN_APPLY_JOBS }, rerun);
|
|
284
|
+
if (done.kind === "fail")
|
|
285
|
+
return broke(done.reason, command);
|
|
286
|
+
const stopped = done.kind === "ran" && wave !== undefined && waves && wave < waves.count ? `; it stops after \`wave-${wave}\`, and the waves after it wait until \`/${o.words.product} ${typedApply(o.words)}\` runs it again` : "";
|
|
287
|
+
return reply(`${done.text}${stopped}`, done.kind === "ran", done.kind === "ran" ? done.url : undefined);
|
|
288
|
+
}
|
|
289
|
+
/** The reply to a plan comment with flags the product plan's re-plan cannot take (#4979). */
|
|
290
|
+
export function planFlagsReply(words) {
|
|
291
|
+
const line = Object.entries(words.commands).find(([, c]) => c === "plan")?.[0] ?? "plan";
|
|
292
|
+
const typed = `/${words.product} ${line}`;
|
|
293
|
+
return `\`${typed}\` plans whole ${words.noun[1]} again, every one or the one named after it, so it takes no \`--target\`, \`--refresh\` or \`--target-dependents\`; write \`${typed}\` or \`${typed} <${words.noun[0]}>\``;
|
|
294
|
+
}
|
|
295
|
+
/** The typed apply word. */
|
|
296
|
+
function typedApply(words) {
|
|
297
|
+
return Object.entries(words.commands).find(([, c]) => c === "apply")?.[0] ?? "apply";
|
|
298
|
+
}
|
|
299
|
+
/** Whether every apply job of a run succeeded, and the reply that says the run is still going. */
|
|
300
|
+
function finished(run, jobs, sha, at) {
|
|
301
|
+
if (!run.done)
|
|
302
|
+
return { kind: "reply", text: `workflow run ${run.id} at ${short(sha)} is ${run.status} already, so it is not started again` };
|
|
303
|
+
if (jobs.every((j) => j.conclusion === "success" || j.status === "success"))
|
|
304
|
+
return { kind: "reply", text: `every apply job of ${at}'s merge commit ${short(sha)} already succeeded` };
|
|
305
|
+
return undefined;
|
|
306
|
+
}
|
|
307
|
+
/** GitHub's start: run the run's failed jobs again, and the jobs that need them. */
|
|
308
|
+
export function githubRerun(runs) {
|
|
309
|
+
return async (run, jobs, { sha, at, user }) => {
|
|
310
|
+
const stop = finished(run, jobs, sha, at);
|
|
311
|
+
if (stop)
|
|
312
|
+
return stop;
|
|
313
|
+
try {
|
|
314
|
+
await runs.rerunFailed(run.id);
|
|
315
|
+
}
|
|
316
|
+
catch (e) {
|
|
317
|
+
return { kind: "fail", reason: `could not run the failed jobs of workflow run ${run.id} again (${message(e)})` };
|
|
318
|
+
}
|
|
319
|
+
const link = run.url ? ` (${run.url})` : "";
|
|
320
|
+
return { kind: "ran", text: `started the failed jobs of workflow run ${run.id}${link} at ${at}'s merge commit ${short(sha)} again for ${user}; each wave's gate decides again, and the waves after it follow, each behind its own gate`, ...(run.url ? { url: run.url } : {}) };
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Forgejo's start: Forgejo has no call that runs a run again, so the run's
|
|
325
|
+
* workflow is dispatched on the default branch, which runs its head. That
|
|
326
|
+
* is the merge commit only while no push came after it.
|
|
327
|
+
*/
|
|
328
|
+
export function forgejoRerun(runs, reads) {
|
|
329
|
+
return async (run, jobs, { sha, at, user, base }) => {
|
|
330
|
+
const stop = finished(run, jobs, sha, at);
|
|
331
|
+
if (stop)
|
|
332
|
+
return stop;
|
|
333
|
+
if (!run.workflow)
|
|
334
|
+
return { kind: "fail", reason: `Forgejo did not name the workflow of run ${run.id}, so it cannot be dispatched` };
|
|
335
|
+
let newest;
|
|
336
|
+
try {
|
|
337
|
+
newest = (await reads.branchRuns(base, { event: "push", limit: 1 }))[0];
|
|
338
|
+
}
|
|
339
|
+
catch (e) {
|
|
340
|
+
return { kind: "fail", reason: `could not read the newest push on ${base} (${message(e)})` };
|
|
341
|
+
}
|
|
342
|
+
if (newest && newest.headSha !== sha) {
|
|
343
|
+
return { kind: "reply", text: `Forgejo starts a workflow again only at the head of ${base}, which is now ${short(newest.headSha)}, so the merge commit ${short(sha)} of ${at} is not applied again: push to ${base} again` };
|
|
344
|
+
}
|
|
345
|
+
try {
|
|
346
|
+
await runs.dispatch(run.workflow, base);
|
|
347
|
+
}
|
|
348
|
+
catch (e) {
|
|
349
|
+
return { kind: "fail", reason: `could not dispatch ${run.workflow} on ${base} (${message(e)})` };
|
|
350
|
+
}
|
|
351
|
+
return { kind: "ran", text: `dispatched ${run.workflow} on ${base} at ${at}'s merge commit ${short(sha)} for ${user}; each wave's gate decides again, and a wave that already applied plans nothing new` };
|
|
352
|
+
};
|
|
353
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The replies to comment commands no job runs (#4946), shared by the GitLab
|
|
3
|
+
* note poll (./ci-note-commands.ts) and the GitHub and Forgejo comment job
|
|
4
|
+
* (./ci-comment-commands.ts), so the two forges answer a command the same
|
|
5
|
+
* way and a product's own sentences (`words.replies`) reach both.
|
|
6
|
+
*
|
|
7
|
+
* A reply names the forge's things in the forge's words: `!12`, a merge
|
|
8
|
+
* request and a project on GitLab; pull request 12 and a repository on
|
|
9
|
+
* GitHub and Forgejo. GitLab's sentences are the ones the note poll wrote
|
|
10
|
+
* before #4946.
|
|
11
|
+
*
|
|
12
|
+
* This module imports nothing at run time.
|
|
13
|
+
*/
|
|
14
|
+
import type { CiProductCommand, CiProductCommentReplies, CiProductWords } from "./ci-product-words.js";
|
|
15
|
+
import type { ForgeKind } from "./pr-forge.js";
|
|
16
|
+
/** How a reply names the forge's things. */
|
|
17
|
+
export interface CommentTerms {
|
|
18
|
+
/** The pull request by number: `!12`, or `pull request 12`. */
|
|
19
|
+
at(n: number): string;
|
|
20
|
+
/** `merge request` or `pull request`. */
|
|
21
|
+
request: string;
|
|
22
|
+
/** `project` or `repository`. */
|
|
23
|
+
place: string;
|
|
24
|
+
}
|
|
25
|
+
/** The terms for `forge`. */
|
|
26
|
+
export declare function commentTerms(forge: ForgeKind): CommentTerms;
|
|
27
|
+
/** `/<product> <word>` in backticks, for the word the words map onto `command`. */
|
|
28
|
+
export declare function commandLine(words: CiProductWords, command: CiProductCommand): string;
|
|
29
|
+
/** The commands no job runs, by the slot a product's reply fills. */
|
|
30
|
+
export type NotRunCommand = Exclude<keyof CiProductCommentReplies, "fork" | "member">;
|
|
31
|
+
/**
|
|
32
|
+
* The reply to a command the pipeline runs no job for: the product's
|
|
33
|
+
* sentence when its words give one, else chant's.
|
|
34
|
+
*/
|
|
35
|
+
export declare function notRunReply(words: CiProductWords, command: NotRunCommand, forge: ForgeKind): string;
|
|
36
|
+
/** The reply to a command on a pull request from a fork. */
|
|
37
|
+
export declare function forkReply(words: CiProductWords, forge: ForgeKind): string;
|
|
38
|
+
/** The reply to a comment that names a member the pipeline was not written with. */
|
|
39
|
+
export declare function memberReply(words: CiProductWords, member: string, members: readonly string[], forge: ForgeKind): string;
|
|
40
|
+
//# sourceMappingURL=ci-comment-replies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-comment-replies.d.ts","sourceRoot":"","sources":["../src/ci-comment-replies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,6BAA6B;AAC7B,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,CAI3D;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAEpF;AAED,qEAAqE;AACrE,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,uBAAuB,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;AAEtF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAiBnG;AAED,4DAA4D;AAC5D,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAGzE;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAKvH"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The replies to comment commands no job runs (#4946), shared by the GitLab
|
|
3
|
+
* note poll (./ci-note-commands.ts) and the GitHub and Forgejo comment job
|
|
4
|
+
* (./ci-comment-commands.ts), so the two forges answer a command the same
|
|
5
|
+
* way and a product's own sentences (`words.replies`) reach both.
|
|
6
|
+
*
|
|
7
|
+
* A reply names the forge's things in the forge's words: `!12`, a merge
|
|
8
|
+
* request and a project on GitLab; pull request 12 and a repository on
|
|
9
|
+
* GitHub and Forgejo. GitLab's sentences are the ones the note poll wrote
|
|
10
|
+
* before #4946.
|
|
11
|
+
*
|
|
12
|
+
* This module imports nothing at run time.
|
|
13
|
+
*/
|
|
14
|
+
/** The terms for `forge`. */
|
|
15
|
+
export function commentTerms(forge) {
|
|
16
|
+
return forge === "gitlab"
|
|
17
|
+
? { at: (n) => `!${n}`, request: "merge request", place: "project" }
|
|
18
|
+
: { at: (n) => `pull request ${n}`, request: "pull request", place: "repository" };
|
|
19
|
+
}
|
|
20
|
+
/** `/<product> <word>` in backticks, for the word the words map onto `command`. */
|
|
21
|
+
export function commandLine(words, command) {
|
|
22
|
+
return `\`/${words.product} ${Object.entries(words.commands).find(([, c]) => c === command)?.[0] ?? command}\``;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The reply to a command the pipeline runs no job for: the product's
|
|
26
|
+
* sentence when its words give one, else chant's.
|
|
27
|
+
*/
|
|
28
|
+
export function notRunReply(words, command, forge) {
|
|
29
|
+
const own = words.replies?.[command];
|
|
30
|
+
if (own !== undefined)
|
|
31
|
+
return own;
|
|
32
|
+
const t = commentTerms(forge);
|
|
33
|
+
switch (command) {
|
|
34
|
+
case "plan":
|
|
35
|
+
return `this ${t.place} ${words.verbs.plan[0]}s a ${t.request} on each push to it, and no job ${words.verbs.plan[0]}s on a comment`;
|
|
36
|
+
case "apply":
|
|
37
|
+
return `this ${t.place} does not ${words.verbs.apply[0]} on a comment: re-run the ${words.verbs.apply[0]} job on the forge, or push to the default branch again`;
|
|
38
|
+
case "lock":
|
|
39
|
+
case "unlock":
|
|
40
|
+
return `${commandLine(words, command)} does not run here: this ${t.place} takes no locks`;
|
|
41
|
+
case "action":
|
|
42
|
+
return `this ${t.place} has no workflow that runs actions, so ${commandLine(words, "action")} does not run`;
|
|
43
|
+
case "agent":
|
|
44
|
+
return `the agent command is off in this ${t.place}`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** The reply to a command on a pull request from a fork. */
|
|
48
|
+
export function forkReply(words, forge) {
|
|
49
|
+
const t = commentTerms(forge);
|
|
50
|
+
return words.replies?.fork ?? `a ${t.request} from a fork runs no command: its code never runs with this ${t.place}'s credentials`;
|
|
51
|
+
}
|
|
52
|
+
/** The reply to a comment that names a member the pipeline was not written with. */
|
|
53
|
+
export function memberReply(words, member, members, forge) {
|
|
54
|
+
const listed = [...members].sort().map((m) => `\`${m}\``).join(", ");
|
|
55
|
+
const own = words.replies?.member;
|
|
56
|
+
if (own !== undefined)
|
|
57
|
+
return own.split("{member}").join(member).split("{members}").join(listed);
|
|
58
|
+
return `${member} is not a ${words.noun[0]} of this ${commentTerms(forge).place}. The ${words.noun[1]} are ${listed}.`;
|
|
59
|
+
}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
*
|
|
22
22
|
* Each check signed carries `source: { run, job, step }`, the ids it relied
|
|
23
23
|
* on, so a verifier can look them up.
|
|
24
|
+
*
|
|
25
|
+
* A job it reads that has not finished is waited for, up to
|
|
26
|
+
* {@link FROM_JOB_WAIT_MS} (#4978): `chant run resume` retries a GitLab
|
|
27
|
+
* wave job's evidence job with the wave job, and the two may start
|
|
28
|
+
* together.
|
|
24
29
|
*/
|
|
25
30
|
import type { ForgeReads } from "./pr-forge-reads.js";
|
|
26
31
|
import { type CheckSource } from "./workspace/trust/check-evidence.js";
|
|
@@ -39,6 +44,16 @@ export interface ChecksFromJobInput {
|
|
|
39
44
|
sources?: Readonly<Record<string, EvidenceSourceSpec>>;
|
|
40
45
|
/** The directory of the jobs' claim files. Without it, a check needs only its step's success and signs no claim. */
|
|
41
46
|
claims?: string;
|
|
47
|
+
/**
|
|
48
|
+
* How long to wait for a job it reads that has not finished (#4978), in
|
|
49
|
+
* milliseconds, reading the run's jobs again every `pollMs` (default 15
|
|
50
|
+
* seconds). A GitLab evidence job retried with its wave job can start
|
|
51
|
+
* before the new try ends. Default 0: a job not finished is not signed.
|
|
52
|
+
*/
|
|
53
|
+
waitMs?: number;
|
|
54
|
+
pollMs?: number;
|
|
55
|
+
/** For tests: in place of a timer. */
|
|
56
|
+
sleep?: (ms: number) => Promise<void>;
|
|
42
57
|
}
|
|
43
58
|
/** What may be signed, and what not and why. */
|
|
44
59
|
export type ChecksFromJob = {
|
|
@@ -73,7 +88,17 @@ export interface SignFromJobInput {
|
|
|
73
88
|
push?: boolean;
|
|
74
89
|
fetch?: typeof fetch;
|
|
75
90
|
log?: (line: string) => void;
|
|
91
|
+
/** How long to wait for an unfinished job it reads (#4978). Default {@link FROM_JOB_WAIT_MS}. */
|
|
92
|
+
waitMs?: number;
|
|
93
|
+
pollMs?: number;
|
|
94
|
+
sleep?: (ms: number) => Promise<void>;
|
|
76
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* How long `sign --from-job` waits for a job it reads to finish (#4978): a
|
|
98
|
+
* GitLab `<wave job>-evidence` retried with its wave job by `chant run
|
|
99
|
+
* resume` may start before the wave job's new try ends. 30 minutes.
|
|
100
|
+
*/
|
|
101
|
+
export declare const FROM_JOB_WAIT_MS: number;
|
|
77
102
|
/** What {@link signFromJob} signed and skipped, or why it refused. */
|
|
78
103
|
export type SignFromJobResult = {
|
|
79
104
|
signed: Array<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-evidence-from-job.d.ts","sourceRoot":"","sources":["../src/ci-evidence-from-job.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ci-evidence-from-job.d.ts","sourceRoot":"","sources":["../src/ci-evidence-from-job.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAmF,KAAK,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACrJ,OAAO,EAAkE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/H,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACnC,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,wFAAwF;IACxF,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC;IACvD,oHAAoH;IACpH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED,gDAAgD;AAChD,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAC1H;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AA4BxB,6GAA6G;AAC7G,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,CAmErF;AAED,8CAA8C;AAC9C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,iGAAiG;IACjG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAAc,CAAC;AAE5C,sEAAsE;AACtE,MAAM,MAAM,iBAAiB,GACzB;IAAE,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAChL;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAExB;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA8CrF"}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
*
|
|
22
22
|
* Each check signed carries `source: { run, job, step }`, the ids it relied
|
|
23
23
|
* on, so a verifier can look them up.
|
|
24
|
+
*
|
|
25
|
+
* A job it reads that has not finished is waited for, up to
|
|
26
|
+
* {@link FROM_JOB_WAIT_MS} (#4978): `chant run resume` retries a GitLab
|
|
27
|
+
* wave job's evidence job with the wave job, and the two may start
|
|
28
|
+
* together.
|
|
24
29
|
*/
|
|
25
30
|
import { commitAndTree, noRunnerIdentity, recordChecks, runnerEvidenceSigner, signChecks } from "./workspace/trust/check-evidence.js";
|
|
26
31
|
import { EVIDENCE_SOURCES_ENV, parseEvidenceSources, readCheckClaimFile } from "./ci-evidence-claims.js";
|
|
@@ -29,9 +34,28 @@ const SUCCESS = "success";
|
|
|
29
34
|
function jobPassed(job) {
|
|
30
35
|
return job.conclusion !== undefined ? job.conclusion === SUCCESS : job.status === SUCCESS;
|
|
31
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* The run's jobs once every job the checks read has finished, or as they
|
|
39
|
+
* are when `waitMs` runs out (#4978). A job not in the run is left to
|
|
40
|
+
* {@link checksFromJob} to refuse.
|
|
41
|
+
*/
|
|
42
|
+
async function settledJobs(input) {
|
|
43
|
+
const names = new Set(input.checks.map((c) => input.sources?.[c]?.job ?? input.fromJob));
|
|
44
|
+
const sleep = input.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
45
|
+
const poll = Math.max(1, input.pollMs ?? 15000);
|
|
46
|
+
let left = input.waitMs ?? 0;
|
|
47
|
+
for (;;) {
|
|
48
|
+
const jobs = await input.reads.runJobs(input.run);
|
|
49
|
+
const going = jobs.some((j) => names.has(j.name) && !j.done);
|
|
50
|
+
if (!going || left <= 0)
|
|
51
|
+
return jobs;
|
|
52
|
+
await sleep(Math.min(poll, left));
|
|
53
|
+
left -= poll;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
32
56
|
/** The checks the run's record lets this job sign (#4926), or why the job it names does not count at all. */
|
|
33
57
|
export async function checksFromJob(input) {
|
|
34
|
-
const jobs = await
|
|
58
|
+
const jobs = await settledJobs(input);
|
|
35
59
|
const found = new Map();
|
|
36
60
|
const jobNamed = (name) => {
|
|
37
61
|
const had = found.get(name);
|
|
@@ -107,6 +131,12 @@ export async function checksFromJob(input) {
|
|
|
107
131
|
}
|
|
108
132
|
return { sign, skipped };
|
|
109
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* How long `sign --from-job` waits for a job it reads to finish (#4978): a
|
|
136
|
+
* GitLab `<wave job>-evidence` retried with its wave job by `chant run
|
|
137
|
+
* resume` may start before the wave job's new try ends. 30 minutes.
|
|
138
|
+
*/
|
|
139
|
+
export const FROM_JOB_WAIT_MS = 30 * 60000;
|
|
110
140
|
/**
|
|
111
141
|
* `chant ci evidence sign --from-job` (#4926): this run's id and commit from
|
|
112
142
|
* the job's environment (`GITHUB_RUN_ID` and `GITHUB_SHA` on GitHub and
|
|
@@ -134,7 +164,18 @@ export async function signFromJob(input) {
|
|
|
134
164
|
const parsed = parseEvidenceSources(env[EVIDENCE_SOURCES_ENV]);
|
|
135
165
|
if ("problem" in parsed)
|
|
136
166
|
return { refused: parsed.problem };
|
|
137
|
-
const decided = await checksFromJob({
|
|
167
|
+
const decided = await checksFromJob({
|
|
168
|
+
reads: input.reads,
|
|
169
|
+
run: Number(rawRun),
|
|
170
|
+
sha,
|
|
171
|
+
fromJob: input.fromJob,
|
|
172
|
+
checks: input.checks,
|
|
173
|
+
sources: parsed.sources,
|
|
174
|
+
...(input.claims !== undefined ? { claims: input.claims } : {}),
|
|
175
|
+
waitMs: input.waitMs ?? FROM_JOB_WAIT_MS,
|
|
176
|
+
...(input.pollMs !== undefined ? { pollMs: input.pollMs } : {}),
|
|
177
|
+
...(input.sleep ? { sleep: input.sleep } : {}),
|
|
178
|
+
});
|
|
138
179
|
if ("refused" in decided)
|
|
139
180
|
return decided;
|
|
140
181
|
for (const s of decided.skipped)
|
|
@@ -48,7 +48,7 @@ export declare const EVIDENCE_IDENTITY_ENV = "CHANT_RUNNER_IDENTITY";
|
|
|
48
48
|
export declare const EVIDENCE_ID_TOKEN_VAR = "CHANT_ID_TOKEN_SIGSTORE";
|
|
49
49
|
/** The audience a keyless signing job's token is requested for unless told: sigstore's. */
|
|
50
50
|
export declare const EVIDENCE_DEFAULT_AUDIENCE = "sigstore";
|
|
51
|
-
export { CHECK_EVIDENCE_FLOOR, CHECK_JOB_FLOOR, GITLAB_OPEN_EVIDENCE_FLOOR, KEYLESS_EVIDENCE_FLOOR, LOCAL_EVIDENCE_FLOOR, PR_LOOP_EVIDENCE_FLOOR, REF_GATE_STATUS_JOB_FLOOR, WAVE_EVIDENCE_JOB_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
52
|
/**
|
|
53
53
|
* The GitLab environment every signing job names (#4914), with `action:
|
|
54
54
|
* access`, so it creates no deployment. Scope the runner key's CI/CD
|
|
@@ -74,7 +74,35 @@ export declare function openEvidenceLines(opts: {
|
|
|
74
74
|
out: string;
|
|
75
75
|
bin?: string;
|
|
76
76
|
noForks?: boolean;
|
|
77
|
+
member?: string;
|
|
77
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;
|
|
78
106
|
/**
|
|
79
107
|
* A pipeline's runner identity (#4870): a runner key's secret, or (#4869)
|
|
80
108
|
* the job's own OIDC identity. Exactly one.
|
|
@@ -109,5 +137,6 @@ export declare function planEvidenceLines(opts: {
|
|
|
109
137
|
base: string;
|
|
110
138
|
result: string;
|
|
111
139
|
bin?: string;
|
|
140
|
+
member?: string;
|
|
112
141
|
}): string[];
|
|
113
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;
|
|
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,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CAG7I;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAErF;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAErF;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAG/E;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAgC,CAAC;AASlE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6FAA6F;IAC7F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qIAAqI;IACrI,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oHAAoH;IACpH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,kHAAkH;AAClH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,GAAG,IAAI,CASnF;AAED,uGAAuG;AACvG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,GAAG,OAAO,CAE/E;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAExG;AAED,8GAA8G;AAC9G,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,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"}
|