@intentius/chant 0.124.89 → 0.124.91
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 +5 -3
- package/dist/actor.d.ts.map +1 -1
- package/dist/actor.js +7 -5
- package/dist/audit/core.d.ts.map +1 -1
- package/dist/audit/core.js +11 -1
- package/dist/ci-comment-commands.d.ts +18 -2
- package/dist/ci-comment-commands.d.ts.map +1 -1
- package/dist/ci-comment-commands.js +30 -2
- 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 +41 -1
- package/dist/ci-note-commands.d.ts.map +1 -1
- package/dist/ci-note-commands.js +64 -5
- package/dist/ci-product.d.ts +50 -1
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +52 -6
- package/dist/cli/handlers/pr-comment.d.ts +13 -1
- package/dist/cli/handlers/pr-comment.d.ts.map +1 -1
- package/dist/cli/handlers/pr-comment.js +90 -1
- 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 +2 -2
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +41 -20
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +154 -4
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +17 -0
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +28 -0
- package/dist/cli/registry.d.ts +12 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/pr-checks.d.ts +39 -1
- package/dist/components/pr-checks.d.ts.map +1 -1
- package/dist/components/pr-checks.js +45 -2
- package/dist/components/pr-pipeline.d.ts +11 -3
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +20 -7
- package/dist/components/product-pipeline.d.ts +54 -2
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +63 -6
- package/dist/components/product-plan.d.ts +92 -2
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +172 -22
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +37 -23
- package/dist/lexicon-module.d.ts +2 -0
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon-module.js +6 -2
- package/dist/lexicon.d.ts +82 -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/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 +3 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -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 +4 -1
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
- package/dist/op/op-waves-evidence-jobs.js +10 -2
- 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-run.d.ts +146 -6
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +871 -99
- 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 +20 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +15 -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 +18 -2
- 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 +4 -1
- package/dist/op/wave-stop.d.ts.map +1 -1
- package/dist/op/wave-stop.js +4 -2
- package/dist/planned-files.d.ts +16 -8
- package/dist/planned-files.d.ts.map +1 -1
- package/dist/planned-files.js +12 -8
- package/dist/pr-post.d.ts +6 -0
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +7 -5
- package/dist/release-floors.d.ts +9 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +27 -19
- 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 +364 -351
- package/package.json +1 -1
- package/src/actor.test.ts +14 -1
- package/src/actor.ts +8 -6
- package/src/audit/core.ts +13 -1
- package/src/audit/first-load.test.ts +101 -0
- package/src/ci-comment-commands.test.ts +63 -0
- package/src/ci-comment-commands.ts +43 -4
- package/src/ci-image.test.ts +1 -2
- 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 +96 -7
- package/src/ci-product.ts +65 -6
- package/src/cli/handlers/pr-comment.ts +85 -2
- package/src/cli/handlers/pr-notes.ts +30 -6
- package/src/cli/handlers/pr.ts +34 -17
- package/src/cli/handlers/run-wave.ts +144 -4
- package/src/cli/main.ts +17 -0
- package/src/cli/parse-args.ts +20 -0
- package/src/cli/registry.ts +12 -1
- package/src/components/pr-checks.ts +66 -2
- package/src/components/pr-pipeline.ts +21 -9
- package/src/components/product-pipeline.apply-status.test.ts +50 -0
- package/src/components/product-pipeline.ts +117 -9
- package/src/components/product-plan-names.test.ts +135 -0
- package/src/components/product-plan.test.ts +23 -5
- package/src/components/product-plan.ts +248 -25
- package/src/floor-table.data.ts +37 -23
- package/src/lexicon-module.ts +6 -2
- package/src/lexicon.ts +78 -1
- package/src/lifecycle/gate-applied.ts +7 -0
- 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.ts +16 -1
- package/src/op/index.ts +5 -0
- package/src/op/op-waves-after-plan.ts +13 -0
- package/src/op/op-waves-evidence-jobs.ts +11 -3
- 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-render-spec.test.ts +1 -2
- package/src/op/op-waves-run.ts +971 -93
- 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 +28 -3
- package/src/op/schedule-overdue.test.ts +29 -1
- package/src/op/schedule-overdue.ts +27 -3
- package/src/op/stage-hooks.ts +52 -4
- package/src/op/wave-stop.ts +5 -3
- package/src/planned-files.test.ts +33 -0
- package/src/planned-files.ts +26 -10
- package/src/pr-post.ts +13 -5
- package/src/release-floors.ts +31 -19
- package/src/wave-blocked.ts +9 -4
package/dist/ci-product.js
CHANGED
|
@@ -59,27 +59,64 @@ export const COMMENT_LEAVES_COMMIT_FLOOR = "0.124.88";
|
|
|
59
59
|
/**
|
|
60
60
|
* The first chant with the comment job on GitHub and Forgejo and the replies to commands no job runs (#4946): `commentJob` in the product pipeline (`chant components pr-comment`, `answerProductComment` in `@intentius/chant/ci-comment-commands`), which replies to a refusal and to a command the pipeline runs no job for, and with waves on merge starts a merged pull request's apply again; the words' `replies` and an alias's `refuse`, which the GitLab note poll reads too, as `chantNoteRuns`' `members`; `retryApply`; and `locks: "plan"` in GitHub's and Forgejo's product plan, with the lock, unlock and comment lock jobs.
|
|
61
61
|
*/
|
|
62
|
-
export const COMMENT_COMMANDS_FLOOR =
|
|
62
|
+
export const COMMENT_COMMANDS_FLOOR = "0.124.89";
|
|
63
63
|
export { answerProductComment, answeredElsewhere, COMMENT_JOBS_ENV, commentRuns, PR_COMMENT_JOB, RERUN_APPLY_JOBS } from "./ci-comment-commands.js";
|
|
64
64
|
export { forkReply, memberReply, notRunReply } from "./ci-comment-replies.js";
|
|
65
65
|
export { productCommentJob } from "./components/product-pipeline.js";
|
|
66
66
|
/**
|
|
67
67
|
* The first chant whose product plan locks what a change reaches (#4979): `productPlan.reach`, a reach line the lock job runs at the target branch's commit with `chant lock --reach` (`@intentius/chant/lifecycle/reach-locks`), on GitHub, Forgejo and GitLab, where the lock job runs in the plan notes pipeline with `--open` beside the comment lock and unlock jobs; and whose comment job answers a re-plan comment with flags the product plan's re-plan cannot take (`noPlanFlags`).
|
|
68
68
|
*/
|
|
69
|
-
export const PRODUCT_PLAN_REACH_LOCKS_FLOOR =
|
|
69
|
+
export const PRODUCT_PLAN_REACH_LOCKS_FLOOR = "0.124.89";
|
|
70
70
|
export { LOCK_REACH_ENV, reachedTargets, reachOpen } from "./lifecycle/reach-locks.js";
|
|
71
71
|
export { productPlanReachLock } from "./components/product-plan.js";
|
|
72
72
|
export { planFlagsReply } from "./ci-comment-commands.js";
|
|
73
73
|
/**
|
|
74
74
|
* The first chant whose comment job stops a merged pull request's re-run at a wave (#4979): `/<product> apply wave-<n>` writes a stop for the merge commit on `chant/lifecycle` (`_waves/<op>.stops.json`, `@intentius/chant/op/wave-stop`) before GitHub's re-run or Forgejo's dispatch, and `chant run wave` leaves each wave after n waiting (exit 3).
|
|
75
75
|
*/
|
|
76
|
-
export const WAVE_STOP_FLOOR =
|
|
76
|
+
export const WAVE_STOP_FLOOR = "0.124.89";
|
|
77
77
|
export { setWaveStop, waveStopAt, waveStopLine } from "./op/wave-stop.js";
|
|
78
|
+
/**
|
|
79
|
+
* The first chant whose Op waves run before merge (#4984): `wavesBeforeMerge` in the product pipeline, where the comment job (GitHub, Forgejo) or the note poll (GitLab) decides `/<product> apply [wave-<n>]` on an open pull request (`decideWavesBeforeMerge`, `@intentius/chant/op/before-merge-decide`), records the head and its digest on `chant/lifecycle` (`_waves/<op>.before-merge.json`) and starts the waves for it; the generators' `beforeMerge`, whose guard admits that head alone, whose jobs check it out and read the base from the default branch, and whose `before-merge-done` job merges and releases the locks (`chant run wave --merge`); `waveJobs.<wave>.prelude`; the GitLab note poll's wave stop (`chantNoteRuns`' `waves`); a re-plan word that never starts with `-`; and the terraform lexicon's reach helpers (`@intentius/chant-lexicon-terraform/reach`).
|
|
80
|
+
*/
|
|
81
|
+
export const WAVES_BEFORE_MERGE_FLOOR = "0.124.90";
|
|
82
|
+
export { BEFORE_MERGE_DIGEST_ENV, BEFORE_MERGE_DONE_JOB, BEFORE_MERGE_HEAD_ENV, BEFORE_MERGE_PR_ENV, beforeMergeDigest, beforeMergePath, beforeMergeProblems, WAVES_BASE_ENV } from "./op/before-merge.js";
|
|
83
|
+
export { decideWavesBeforeMerge, defaultPipelineFiles } from "./op/before-merge-decide.js";
|
|
84
|
+
/**
|
|
85
|
+
* The first chant whose Op waves post the apply statuses (#4987): the generators' `applyStatus`, a job `apply-status-<n>` after each wave at the default branch's commit that posts `<product>/apply` on the commit the waves applied (a before-merge run's decided head) with `chant run wave --apply-status` (`@intentius/chant/op/apply-status`), and the product pipeline's `applyStatus`; whose product plan takes `staleNotes`, each target's note carrying the target branch's commit and a `stale-notes` job beside wave 1 on a push marking each target's note (`pr-post --stale` with one `--member` per target); whose `productPipelineJobs` returns `waves.pipeline` for the generators; and whose GitLab reach line reaches the lock and note-commands jobs unexpanded (`expand: false`).
|
|
86
|
+
*/
|
|
87
|
+
export const WAVES_APPLY_STATUS_FLOOR = "0.124.90";
|
|
88
|
+
export { applyStatusJobName, opWaveApplyStatus, postOpWaveApplyStatus } from "./op/apply-status.js";
|
|
89
|
+
/**
|
|
90
|
+
* The first chant whose before-merge waves never run the change's code beside a write token (#4987): with `beforeMerge` each wave is a plan job (the change's code, a checkout with no credentials kept, a read-only token; GitLab drops `CHANT_FORGE_TOKEN` and the job token), a gate job at the default branch with the token, an applying job on the saved plan with no write token, and a record job at the default branch that writes the run records (`chant run wave --phase plan|gate|apply|record`, `@intentius/chant/op/op-waves-split`). A `rest` wave is refused with `beforeMerge`.
|
|
91
|
+
*/
|
|
92
|
+
export const WAVES_BEFORE_MERGE_SPLIT_FLOOR = "0.124.90";
|
|
93
|
+
export { opWaveSplitJobs } from "./op/op-waves-split.js";
|
|
94
|
+
/**
|
|
95
|
+
* The first chant whose split before-merge waves take a `step` spec, Forgejo's hand-off, holds on other gates and one approval per wave (#4992): the plan job saves each run's step plan, the gate job leases the rows they change (no heartbeat; the decision names the lease) before it spends the approval, the applying job plans its runs again through the step and applies each whose digest the decision holds, and the record job writes the release records and lets go of the rows; a hook in the plan or apply job that holds the wave on another gate reads it with no write token and leaves its pending fact to the gate or record job; on Forgejo the plan and applying jobs hand their files on as job outputs (`packJs`), never through the artifact upload, and the gate and record jobs keep them as the artifacts; the plan job names no environment on GitHub (a wave's `planEnvironment` when set; on GitLab it prepares it), so the environment's reviewers are asked once. A `rest` wave splits from {@link WAVES_BEFORE_MERGE_REST_FLOOR} on.
|
|
96
|
+
*/
|
|
97
|
+
export const WAVES_BEFORE_MERGE_STEP_FLOOR = "0.124.90";
|
|
98
|
+
/**
|
|
99
|
+
* The first chant whose split waves run a product's own process in every job (#4994): the product wave hook's `hooks` (`runChantInProcess(["run", "wave", ..., "--phase", <phase>], words, { wave: { afterPlan, capabilities, hookExec, runHooks, hooks } })`, `RunOpWaveOptions.inProcessHooks`) serves a spec hook by its name in the process of whichever job runs it, plan, gate or applying job or the one-job shape, in place of a command that called back over a socket; `opWaveProductStateDir` is where the plan job's code keeps what the later jobs read; a `record: true` hold in the plan job is spent by the gate job for a re-run of the hook at the wave's commit (an applied line with `rerun.head`), which the next run's plan job runs and its gate job finishes (`holdsFinished`); and `waveJobs.<wave>.artifact.path` takes a list and `waveJobs.<wave>.gate` gives the gate job a report and an artifact, so a product's own upload steps go through chant's Forgejo hand-off.
|
|
100
|
+
*/
|
|
101
|
+
export const WAVES_PRODUCT_HOOKS_FLOOR = "0.124.90";
|
|
102
|
+
export { opWaveProductStateDir } from "./op/op-waves-split.js";
|
|
103
|
+
/**
|
|
104
|
+
* The first chant whose split before-merge waves take a `rest` wave (#4992): its four jobs run one wave per run, the wave `CHANT_WAVES_WAVE` names (their own by default), and its record job, once the run applied and the plan found another wave, starts the waves workflow again for it (GitHub and Forgejo: a dispatch with the inputs `wave` and the decision's `pr`, `head` and `digest`, or a push's `commit`; GitLab: a pipeline with the same variables, with `CHANT_FORGE_TOKEN`), whose guard admits it as the same decided head; the jobs of the waves before it do not run in that follow-on; the record job's note (`rest-wave.json` beside the outcomes, `@intentius/chant/op/op-waves-follow-on`) tells `before-merge-done`, the control dispatch and the apply status that a run which started a follow-on is not the last.
|
|
105
|
+
*/
|
|
106
|
+
export const WAVES_BEFORE_MERGE_REST_FLOOR = "0.124.90";
|
|
107
|
+
/**
|
|
108
|
+
* The first chant whose rest wave's record job records each follow-on it starts on `chant/lifecycle` before it starts it (#4998): `_waves/<op>.follow-on.json` keeps, per decided head or pushed commit, the wave started, the run that started it, the decision (`pr`, `digest`) or the `commit`, and the outcomes of every run of the chain so far; the guard admits a follow-on only for the wave that record names, so a wave started by hand past it is refused; and the last run's control dispatch, apply status and `before-merge-done` add up the outcomes of every run of the chain (the note's `chain`), so a chain whose last wave changed nothing reports `applied`.
|
|
109
|
+
*/
|
|
110
|
+
export const WAVES_FOLLOW_ON_RECORD_FLOOR = "0.124.90";
|
|
78
111
|
/**
|
|
79
112
|
* The first chant whose product plan takes `watches`, the product's own scheduled jobs the note job's `pr-post` checks for having stopped with the job's token (#4888), and whose `checkOverdueOps` and `overdueOpsAt` take a product's `logPrefix` and `label`.
|
|
80
113
|
*/
|
|
81
114
|
export const PRODUCT_PLAN_WATCHES_FLOOR = "0.124.88";
|
|
82
|
-
export { PLAN_WATCHES_ENV } from "./op/schedule-overdue.js";
|
|
115
|
+
export { PLAN_WATCHES_ENV, watchesForTarget } from "./op/schedule-overdue.js";
|
|
116
|
+
/**
|
|
117
|
+
* The first chant whose product plan's `watches` take `targets` (#4988): a watch scoped to those targets is checked by their notes alone, and the note of another target checks neither it nor the discovered Op of its name (`watchesForTarget`).
|
|
118
|
+
*/
|
|
119
|
+
export const PRODUCT_PLAN_WATCH_TARGETS_FLOOR = "0.124.90";
|
|
83
120
|
/**
|
|
84
121
|
* The first chant whose product plan takes `record` (#4899): the plan step writes the plan job's run record into the hand-off, and the note job keeps it as Op `pr-plan` on `chant/lifecycle` with `pr-post --record-run <plan job>` (`--open` on GitLab), as `chant ci run plan --in-place` records `pr-plan`'s.
|
|
85
122
|
*/
|
|
@@ -88,14 +125,23 @@ export { PLAN_RUN_OP, PLAN_RUN_RECORD_FILE, readPlanRunRecord } from "./pr-plan-
|
|
|
88
125
|
/**
|
|
89
126
|
* The first chant whose product plan carries what terragucci's and sql-yodeler's plan jobs did themselves (#4963, #4951): `trade` (a plan's or a target's) before the checkout, `replan: { dispatch, reply, notAffected }` (a re-plan from `workflow_dispatch`, a reply to a comment no other job takes, `pr-post --not-affected`), `previousMarker` (`CHANT_PLAN_PREVIOUS_MARKER`), `noteSteps.pullRequest`, a `PrReport`'s `marker`, and a hand-off of the product's own note text (`planBodyHandoff`).
|
|
90
127
|
*/
|
|
91
|
-
export const PRODUCT_PLAN_REPLAN_FLOOR =
|
|
128
|
+
export const PRODUCT_PLAN_REPLAN_FLOOR = "0.124.89";
|
|
92
129
|
export { gitlabReplanArgumentLines, PREVIOUS_MARKER_JS, replanDecideJs } from "./components/product-plan.js";
|
|
93
130
|
export { planBodyHandoff, PLAN_BODY_LIMIT } from "./pr-plan-note.js";
|
|
94
131
|
/**
|
|
95
132
|
* The first chant whose note job compares the plan's subject with the previous note's (#4972), on GitHub, Forgejo and GitLab: a plan note hand-off's `subject` (`PrPlanSubject`, an id and named parts) is kept in the note, and `pr-post` adds the note words' `sinceLast` line, naming the parts added, gone and changed (`subjectParts`), when the previous note kept another id. The plan job reads no note, and `previousMarker` is deprecated.
|
|
96
133
|
*/
|
|
97
|
-
export const PRODUCT_PLAN_SUBJECT_FLOOR =
|
|
134
|
+
export const PRODUCT_PLAN_SUBJECT_FLOOR = "0.124.89";
|
|
98
135
|
export { PLAN_SUBJECT_LIMIT, planSubjectProblem, sinceLastLine, subjectChanges } from "./pr-plan-note.js";
|
|
136
|
+
/**
|
|
137
|
+
* The first chant whose product plan keeps a product's own names (#5003): `workflowFile` (the generators' `path`), `jobNames` (the plan, note, re-plan and re-plan note jobs, with `{target}`), `statusContext` (which `pr-post --context`, the pending step, the stale job and the apply before merge use) and `reportDir` (`{output}`, the hand-off, the artifact's path and `pr-post --output`), and whose `pr-post --open` finds a plan job of the product's name (`--plan-job`).
|
|
138
|
+
*/
|
|
139
|
+
export const PRODUCT_PLAN_NAMES_FLOOR = NEXT_RELEASE;
|
|
140
|
+
export { productPlanContext, productPlanReportDir, productPlanWorkflowFile } from "./components/product-plan.js";
|
|
141
|
+
/**
|
|
142
|
+
* The first chant whose GitLab product plan job keeps a product's own artifacts beside the report directory (#5004): `productPlan.artifacts: { paths, reports }`, as `artifacts:paths` and `artifacts:reports`, such as terragucci's `terraform` report for the merge request's widget, with `{target}` and `{output}` filled. GitHub and Forgejo refuse it.
|
|
143
|
+
*/
|
|
144
|
+
export const PRODUCT_PLAN_ARTIFACTS_FLOOR = NEXT_RELEASE;
|
|
99
145
|
/**
|
|
100
146
|
* Day-2 actions in the product pipeline (#4654): the `action` comment
|
|
101
147
|
* command counted as answered by the product's own workflow
|
|
@@ -13,9 +13,21 @@
|
|
|
13
13
|
* (`GITHUB_TOKEN`), so none of the change's code runs here, and it loads no
|
|
14
14
|
* plugins.
|
|
15
15
|
*/
|
|
16
|
-
import { type CommentJobs } from "../../ci-comment-commands.js";
|
|
16
|
+
import { type CommentBeforeMerge, type CommentJobs } from "../../ci-comment-commands.js";
|
|
17
|
+
import type { WavesBeforeMergeJobs } from "../../op/before-merge-decide.js";
|
|
18
|
+
import { type PrForge } from "../../pr-forge.js";
|
|
17
19
|
import type { CommandContext } from "../registry.js";
|
|
18
20
|
/** The jobs named in {@link COMMENT_JOBS_ENV}: each a boolean, `targets` a list of names, and anything else is refused. */
|
|
19
21
|
export declare function commentJobsFromEnv(raw: string | undefined): CommentJobs;
|
|
22
|
+
/** {@link COMMENT_JOBS_ENV}'s `wavesBeforeMerge` (#4984), each field checked, since the comment job pushes and dispatches with what it names. */
|
|
23
|
+
export declare function wavesBeforeMergeOf(x: unknown): WavesBeforeMergeJobs;
|
|
24
|
+
/**
|
|
25
|
+
* What the decision before merge reads and writes with (#4984), in the
|
|
26
|
+
* comment job (GitHub, Forgejo) and the note poll (GitLab): the requires
|
|
27
|
+
* and statuses through the job's client, git in the checkout of the
|
|
28
|
+
* default branch, the reach line's locks at stage apply, and the decision
|
|
29
|
+
* and the wave stop on this checkout's `chant/lifecycle`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function beforeMergeDeps(forge: PrForge, jobs: CommentJobs, env?: NodeJS.ProcessEnv): Promise<CommentBeforeMerge>;
|
|
20
32
|
export declare function runComponentsPrComment(ctx: CommandContext): Promise<number>;
|
|
21
33
|
//# sourceMappingURL=pr-comment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-comment.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr-comment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAuD,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"pr-comment.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr-comment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAuD,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC3I,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAoC,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAOlD,2HAA2H;AAC3H,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CA8BvE;AAED,iJAAiJ;AACjJ,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAiBnE;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4C1I;AAED,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiDjF"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { readFileSync } from "node:fs";
|
|
17
17
|
import { activeProductWords } from "../../ci-product-words.js";
|
|
18
18
|
import { answerProductComment, COMMENT_JOBS_ENV, commentRuns } from "../../ci-comment-commands.js";
|
|
19
|
+
import { PR_APPLY_REQUIRES } from "../../pr-requires.js";
|
|
19
20
|
import { forgeFromEnv, forgeTargetFromEnv } from "../../pr-forge.js";
|
|
20
21
|
import { forgeReadsFor } from "../../pr-forge-reads.js";
|
|
21
22
|
import { formatError, formatInfo } from "../format.js";
|
|
@@ -30,11 +31,16 @@ export function commentJobsFromEnv(raw) {
|
|
|
30
31
|
const v = JSON.parse(raw);
|
|
31
32
|
if (typeof v !== "object" || v === null || Array.isArray(v))
|
|
32
33
|
throw new Error(`${COMMENT_JOBS_ENV} is a JSON object of the jobs the pipeline has`);
|
|
33
|
-
const known = new Set(["preview", "applyBeforeMerge", "applyOnMerge", "locks", "agent", "commits", "actions", "skipForks", "targets", "noPlanFlags", "waves"]);
|
|
34
|
+
const known = new Set(["preview", "applyBeforeMerge", "applyOnMerge", "locks", "agent", "commits", "actions", "skipForks", "targets", "noPlanFlags", "waves", "wavesBeforeMerge"]);
|
|
34
35
|
const jobs = {};
|
|
35
36
|
for (const [k, x] of Object.entries(v)) {
|
|
36
37
|
if (!known.has(k))
|
|
37
38
|
throw new Error(`${COMMENT_JOBS_ENV} names ${JSON.stringify(k)}, which is not one of ${[...known].join(", ")}`);
|
|
39
|
+
// #4984: the waves before merge.
|
|
40
|
+
if (k === "wavesBeforeMerge") {
|
|
41
|
+
jobs.wavesBeforeMerge = wavesBeforeMergeOf(x);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
38
44
|
// #4979: the waves' op and count, for a wave stop on a re-run.
|
|
39
45
|
if (k === "waves") {
|
|
40
46
|
const w = x;
|
|
@@ -55,8 +61,89 @@ export function commentJobsFromEnv(raw) {
|
|
|
55
61
|
if (x)
|
|
56
62
|
jobs[k] = true;
|
|
57
63
|
}
|
|
64
|
+
if (jobs.wavesBeforeMerge && !jobs.waves)
|
|
65
|
+
throw new Error(`${COMMENT_JOBS_ENV}.wavesBeforeMerge needs waves: { op, count }, the waves it starts`);
|
|
58
66
|
return jobs;
|
|
59
67
|
}
|
|
68
|
+
/** {@link COMMENT_JOBS_ENV}'s `wavesBeforeMerge` (#4984), each field checked, since the comment job pushes and dispatches with what it names. */
|
|
69
|
+
export function wavesBeforeMergeOf(x) {
|
|
70
|
+
const what = `${COMMENT_JOBS_ENV}.wavesBeforeMerge`;
|
|
71
|
+
const o = x;
|
|
72
|
+
if (!o || typeof o !== "object" || Array.isArray(o))
|
|
73
|
+
throw new Error(`${what} is { workflow?, requires?, plan, pipelineFiles, locks? }`);
|
|
74
|
+
const strings = (v) => Array.isArray(v) && v.every((s) => typeof s === "string" && s.trim() !== "" && !/[\r\n]/.test(s));
|
|
75
|
+
if (o.workflow !== undefined && (typeof o.workflow !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]*\.ya?ml$/.test(o.workflow)))
|
|
76
|
+
throw new Error(`${what}.workflow is a workflow file name, like deploy.yml`);
|
|
77
|
+
if (o.requires !== undefined && (!Array.isArray(o.requires) || o.requires.some((r) => !PR_APPLY_REQUIRES.includes(r))))
|
|
78
|
+
throw new Error(`${what}.requires is a list of ${PR_APPLY_REQUIRES.join(", ")}`);
|
|
79
|
+
if (!strings(o.plan))
|
|
80
|
+
throw new Error(`${what}.plan is the list of plan statuses that must pass on the head`);
|
|
81
|
+
if (!strings(o.pipelineFiles))
|
|
82
|
+
throw new Error(`${what}.pipelineFiles is the list of paths a change may not touch`);
|
|
83
|
+
if (o.locks !== undefined && (typeof o.locks !== "object" || o.locks === null || (o.locks.gate !== undefined && (typeof o.locks.gate !== "string" || !/^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/.test(o.locks.gate)))))
|
|
84
|
+
throw new Error(`${what}.locks is { gate? }`);
|
|
85
|
+
return {
|
|
86
|
+
...(o.workflow ? { workflow: o.workflow } : {}),
|
|
87
|
+
...(o.requires ? { requires: [...o.requires] } : {}),
|
|
88
|
+
plan: [...o.plan],
|
|
89
|
+
pipelineFiles: [...o.pipelineFiles],
|
|
90
|
+
...(o.locks ? { locks: { ...(o.locks.gate ? { gate: o.locks.gate } : {}) } } : {}),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* What the decision before merge reads and writes with (#4984), in the
|
|
95
|
+
* comment job (GitHub, Forgejo) and the note poll (GitLab): the requires
|
|
96
|
+
* and statuses through the job's client, git in the checkout of the
|
|
97
|
+
* default branch, the reach line's locks at stage apply, and the decision
|
|
98
|
+
* and the wave stop on this checkout's `chant/lifecycle`.
|
|
99
|
+
*/
|
|
100
|
+
export async function beforeMergeDeps(forge, jobs, env = process.env) {
|
|
101
|
+
const bm = jobs.wavesBeforeMerge;
|
|
102
|
+
const op = jobs.waves.op;
|
|
103
|
+
const { spawnSync } = await import("node:child_process");
|
|
104
|
+
const { checkPrRequires, unmetRequires } = await import("../../pr-requires.js");
|
|
105
|
+
const { productStatusContext, activeProductWords } = await import("../../ci-product-words.js");
|
|
106
|
+
const { LOCK_REACH_ENV, reachedTargets } = await import("../../lifecycle/reach-locks.js");
|
|
107
|
+
const { takeTargetLocks, describeHeldTargetLocks } = await import("../../lifecycle/target-lock.js");
|
|
108
|
+
const { recordBeforeMerge } = await import("../../op/before-merge-store.js");
|
|
109
|
+
const { setWaveStop } = await import("../../op/wave-stop.js");
|
|
110
|
+
const { PR_APPLY_GATE } = await import("../../pr-loop.js");
|
|
111
|
+
const words = activeProductWords();
|
|
112
|
+
const line = env[LOCK_REACH_ENV];
|
|
113
|
+
const name = (n) => (forge.kind === "gitlab" ? `!${n}` : `pull request ${n}`);
|
|
114
|
+
return {
|
|
115
|
+
// The plan and apply statuses never hold the apply back: the plan status is asked for by name (#5003: the product plan's own names too).
|
|
116
|
+
requires: async (pr, head) => unmetRequires(await checkPrRequires(forge, pr, head, { ignore: [...new Set([productStatusContext(words, "apply"), productStatusContext(words, "plan"), `${productStatusContext(words, "plan")}/`, ...bm.plan])], ...(bm.requires ? { only: bm.requires } : {}) })),
|
|
117
|
+
statuses: async (sha) => (await forge.commitStatuses?.(sha)) ?? [],
|
|
118
|
+
git: (argv, o) => {
|
|
119
|
+
const r = spawnSync(argv[0], argv.slice(1), { encoding: "utf8", ...(o.cwd ? { cwd: o.cwd } : {}) });
|
|
120
|
+
return { status: r.status, stdout: r.stdout ?? "", stderr: r.error ? r.error.message : (r.stderr ?? "") };
|
|
121
|
+
},
|
|
122
|
+
// #4979's reach line says what the change reaches; the locks go up at stage apply, refused while another holds one.
|
|
123
|
+
...(line && line.trim()
|
|
124
|
+
? {
|
|
125
|
+
lock: async (pr, head, base, by) => {
|
|
126
|
+
const reached = reachedTargets({ forge: forge.kind, pr, head, base, line });
|
|
127
|
+
if ("error" in reached)
|
|
128
|
+
throw new Error(reached.error);
|
|
129
|
+
if ("moved" in reached)
|
|
130
|
+
return { ok: false, text: `${name(pr)} moved while this comment was read, so nothing is ${words.verbs.apply[1]}; comment again once its checks pass` };
|
|
131
|
+
const isOpen = forge.pullRequestOpen?.bind(forge);
|
|
132
|
+
const r = await takeTargetLocks(bm.locks?.gate ?? PR_APPLY_GATE, reached.targets, { pr, by, at: new Date().toISOString(), stage: "apply", head }, { ...(isOpen ? { isOpen } : {}) });
|
|
133
|
+
if (!r.ok) {
|
|
134
|
+
const request = forge.kind === "gitlab" ? "merge request" : "pull request";
|
|
135
|
+
return { ok: false, text: `${describeHeldTargetLocks(r.held, name)}, so ${name(pr)} is not ${words.verbs.apply[1]}. It ${words.verbs.apply[0]}s once that ${request} merges or closes, or someone with write access unlocks it` };
|
|
136
|
+
}
|
|
137
|
+
return { ok: true, targets: r.taken };
|
|
138
|
+
},
|
|
139
|
+
}
|
|
140
|
+
: {}),
|
|
141
|
+
record: (d) => recordBeforeMerge(op, d),
|
|
142
|
+
stop: async (head, through) => {
|
|
143
|
+
await setWaveStop(op, head, through === null ? null : { through, at: new Date().toISOString() });
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}
|
|
60
147
|
export async function runComponentsPrComment(ctx) {
|
|
61
148
|
const { args } = ctx;
|
|
62
149
|
const kind = args.forge;
|
|
@@ -94,6 +181,8 @@ export async function runComponentsPrComment(ctx) {
|
|
|
94
181
|
base,
|
|
95
182
|
jobs,
|
|
96
183
|
env,
|
|
184
|
+
// #4984: the decision before merge, its record and its wave stop on this checkout's chant/lifecycle.
|
|
185
|
+
...(jobs.wavesBeforeMerge ? { beforeMerge: await beforeMergeDeps(poster, jobs, env) } : {}),
|
|
97
186
|
// #4979: the wave stop goes on this checkout's chant/lifecycle, which the job pushes with its token.
|
|
98
187
|
...(jobs.waves
|
|
99
188
|
? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-notes.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr-notes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"pr-notes.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr-notes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAOlD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmE/E"}
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
import { resolve } from "node:path";
|
|
12
12
|
import { activeProductWords } from "../../ci-product-words.js";
|
|
13
13
|
import { chantNoteRuns, gitlabPipelines, ledgerNoteLog, pollNoteCommands } from "../../ci-note-commands.js";
|
|
14
|
+
import { COMMENT_JOBS_ENV } from "../../ci-comment-commands.js";
|
|
15
|
+
import { beforeMergeDeps, commentJobsFromEnv } from "./pr-comment.js";
|
|
14
16
|
import { forgeFromEnv, forgeTargetFromEnv } from "../../pr-forge.js";
|
|
15
17
|
import { forgeReadsFor } from "../../pr-forge-reads.js";
|
|
16
18
|
import { formatError, formatInfo, formatWarning } from "../format.js";
|
|
@@ -40,6 +42,15 @@ export async function runComponentsPrNotes(ctx) {
|
|
|
40
42
|
// The ledger keeps the notes answered: read it as the remote has it.
|
|
41
43
|
await fetchLifecycle({ cwd });
|
|
42
44
|
const words = activeProductWords();
|
|
45
|
+
// #4984: the waves' op and count, and the waves before merge, as the pipeline wrote them in CHANT_COMMENT_JOBS.
|
|
46
|
+
let more;
|
|
47
|
+
try {
|
|
48
|
+
more = commentJobsFromEnv(env[COMMENT_JOBS_ENV]);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
52
|
+
}
|
|
53
|
+
const beforeMerge = more.wavesBeforeMerge && more.waves ? await beforeMergeDeps(forge, more, env) : undefined;
|
|
43
54
|
const polled = await pollNoteCommands({
|
|
44
55
|
reads: forgeReadsFor(target),
|
|
45
56
|
forge,
|
|
@@ -51,9 +62,20 @@ export async function runComponentsPrNotes(ctx) {
|
|
|
51
62
|
...(args.applyBeforeMerge ? { applyBeforeMerge: true } : {}),
|
|
52
63
|
...(args.applyOnMerge ? { applyOnMerge: true } : {}),
|
|
53
64
|
...(args.locks ? { locks: true } : {}),
|
|
54
|
-
|
|
65
|
+
...(more.waves ? { waves: more.waves } : {}),
|
|
66
|
+
...(more.wavesBeforeMerge ? { wavesBeforeMerge: more.wavesBeforeMerge } : {}),
|
|
67
|
+
}, beforeMerge ? { beforeMerge } : {}),
|
|
55
68
|
log: ledgerNoteLog({ cwd }),
|
|
56
69
|
env,
|
|
70
|
+
// #4984: a merged merge request's wave-<n> stops the retried waves after it.
|
|
71
|
+
...(more.waves
|
|
72
|
+
? {
|
|
73
|
+
stops: async (op, sha, stop) => {
|
|
74
|
+
const { setWaveStop } = await import("../../op/wave-stop.js");
|
|
75
|
+
await setWaveStop(op, sha, stop, { cwd });
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
: {}),
|
|
57
79
|
});
|
|
58
80
|
let failed = polled.fail !== undefined;
|
|
59
81
|
for (const o of polled.outcomes) {
|
|
@@ -222,8 +222,8 @@ export declare function runComponentsPlanWave(ctx: CommandContext): Promise<numb
|
|
|
222
222
|
*/
|
|
223
223
|
export declare function runComponentsApplyWave(ctx: CommandContext): Promise<number>;
|
|
224
224
|
/**
|
|
225
|
-
* chant components pr-post --pr <n> --head <sha> --env <env> --forge <kind> [--member <name>] [--output <dir>] [--result <result>] [--not-affected <argument>] (#4295, #4963)
|
|
226
|
-
* chant components pr-post --open --env <env> --forge gitlab [--branch <branch>] [--member <name>] [--output <dir>] (#4328)
|
|
225
|
+
* chant components pr-post --pr <n> --head <sha> --env <env> --forge <kind> [--member <name>] [--output <dir>] [--result <result>] [--not-affected <argument>] [--context <context>] (#4295, #4963, #5003)
|
|
226
|
+
* chant components pr-post --open --env <env> --forge gitlab [--branch <branch>] [--member <name>] [--output <dir>] [--context <context>] [--plan-job <name>] (#4328, #5003)
|
|
227
227
|
*
|
|
228
228
|
* Post the plan note and the `chant/plan` status from the report a plan job
|
|
229
229
|
* wrote with `pr-plan --no-status`, in a job that runs none of the change's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAOH,OAAO,EAA+C,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAI7F,OAAO,EACL,UAAU,EAUV,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAA0C,KAAK,YAAY,EAAu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M,EAAE,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CAGpI;AA+oBD;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAMhF;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAMjF;AA6LD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA+C9E"}
|
package/dist/cli/handlers/pr.js
CHANGED
|
@@ -2733,8 +2733,8 @@ function writeWaveChangeSet(ctx, wave, doc, upload) {
|
|
|
2733
2733
|
upload?.file(name, body);
|
|
2734
2734
|
}
|
|
2735
2735
|
/**
|
|
2736
|
-
* chant components pr-post --pr <n> --head <sha> --env <env> --forge <kind> [--member <name>] [--output <dir>] [--result <result>] [--not-affected <argument>] (#4295, #4963)
|
|
2737
|
-
* chant components pr-post --open --env <env> --forge gitlab [--branch <branch>] [--member <name>] [--output <dir>] (#4328)
|
|
2736
|
+
* chant components pr-post --pr <n> --head <sha> --env <env> --forge <kind> [--member <name>] [--output <dir>] [--result <result>] [--not-affected <argument>] [--context <context>] (#4295, #4963, #5003)
|
|
2737
|
+
* chant components pr-post --open --env <env> --forge gitlab [--branch <branch>] [--member <name>] [--output <dir>] [--context <context>] [--plan-job <name>] (#4328, #5003)
|
|
2738
2738
|
*
|
|
2739
2739
|
* Post the plan note and the `chant/plan` status from the report a plan job
|
|
2740
2740
|
* wrote with `pr-plan --no-status`, in a job that runs none of the change's
|
|
@@ -2759,6 +2759,10 @@ export async function runComponentsPrPost(ctx) {
|
|
|
2759
2759
|
return fail(`pr-post posts to a forge: --forge ${FORGE_KINDS.join("|")}`);
|
|
2760
2760
|
if (args.members && args.members.length > 1)
|
|
2761
2761
|
return fail(`pr-post takes one --member, not ${args.members.join(", ")}`);
|
|
2762
|
+
if (args.statusContexts && args.statusContexts.length > 1)
|
|
2763
|
+
return fail(`pr-post takes one --context, not ${args.statusContexts.join(", ")}`);
|
|
2764
|
+
if (args.planJob)
|
|
2765
|
+
return fail("pr-post --plan-job names the GitLab plan job pr-post --open reads; a post for one pull request reads its report from --output");
|
|
2762
2766
|
let forge;
|
|
2763
2767
|
try {
|
|
2764
2768
|
forge = forgeFromJobEnv(args.forge);
|
|
@@ -2768,6 +2772,8 @@ export async function runComponentsPrPost(ctx) {
|
|
|
2768
2772
|
}
|
|
2769
2773
|
const { postPlanReport } = await import("../../pr-post.js");
|
|
2770
2774
|
const member = args.members?.[0];
|
|
2775
|
+
// #5003: the product plan's own status context.
|
|
2776
|
+
const context = args.statusContexts?.[0];
|
|
2771
2777
|
const description = await descriptionCheckOf(ctx, forge);
|
|
2772
2778
|
if (typeof description === "number")
|
|
2773
2779
|
return description;
|
|
@@ -2778,6 +2784,7 @@ export async function runComponentsPrPost(ctx) {
|
|
|
2778
2784
|
head: args.head,
|
|
2779
2785
|
env: args.env,
|
|
2780
2786
|
...(member ? { member } : {}),
|
|
2787
|
+
...(context ? { context } : {}),
|
|
2781
2788
|
...(args.planResult ? { result: args.planResult } : {}),
|
|
2782
2789
|
// #4289: the plan job could not ask the forge, so the note job does, from the Ops at the commit it checked out.
|
|
2783
2790
|
overdue: () => overdueOps(forge, member),
|
|
@@ -2794,7 +2801,7 @@ export async function runComponentsPrPost(ctx) {
|
|
|
2794
2801
|
console.error(formatWarning({ message }));
|
|
2795
2802
|
if (posted.refused)
|
|
2796
2803
|
console.error(formatWarning({ message: `the plan report was not used: ${posted.refused}` }));
|
|
2797
|
-
console.error(formatInfo(`pr-post: ${prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}${posted.recorded ? `; run ${posted.recorded} recorded` : ""}`));
|
|
2804
|
+
console.error(formatInfo(`pr-post: ${context ?? prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}${posted.recorded ? `; run ${posted.recorded} recorded` : ""}`));
|
|
2798
2805
|
return 0;
|
|
2799
2806
|
}
|
|
2800
2807
|
/**
|
|
@@ -2865,7 +2872,8 @@ async function descriptionCheckOf(ctx, forge) {
|
|
|
2865
2872
|
* `--preview-comment`, and set its plan status back to pending
|
|
2866
2873
|
* (`markStaleNotes`, ../../pr-post.ts). The branch is `--branch`, else the
|
|
2867
2874
|
* job's (`GITHUB_REF_NAME`, `CI_COMMIT_BRANCH`). It exits 0 once it has
|
|
2868
|
-
* marked, as `pr-post` does.
|
|
2875
|
+
* marked, as `pr-post` does. `--member` given more than once (#4987, a
|
|
2876
|
+
* product plan's targets) marks each member's note in turn.
|
|
2869
2877
|
*/
|
|
2870
2878
|
async function runComponentsPrPostStale(ctx) {
|
|
2871
2879
|
const { args } = ctx;
|
|
@@ -2877,8 +2885,6 @@ async function runComponentsPrPostStale(ctx) {
|
|
|
2877
2885
|
return fail("pr-post needs the environment the plan was for: --env <env>");
|
|
2878
2886
|
if (!args.forge || !FORGE_KINDS.includes(args.forge))
|
|
2879
2887
|
return fail(`pr-post posts to a forge: --forge ${FORGE_KINDS.join("|")}`);
|
|
2880
|
-
if (args.members && args.members.length > 1)
|
|
2881
|
-
return fail(`pr-post takes one --member, not ${args.members.join(", ")}`);
|
|
2882
2888
|
const branch = args.branch ?? process.env.CI_COMMIT_BRANCH ?? process.env.GITHUB_REF_NAME;
|
|
2883
2889
|
if (!branch)
|
|
2884
2890
|
return fail("pr-post --stale marks the notes of the pull requests into a branch: run it in a job of a push, or pass --branch <branch>");
|
|
@@ -2889,19 +2895,28 @@ async function runComponentsPrPostStale(ctx) {
|
|
|
2889
2895
|
catch (err) {
|
|
2890
2896
|
return fail(err instanceof Error ? err.message : String(err));
|
|
2891
2897
|
}
|
|
2892
|
-
|
|
2898
|
+
// #4987: a product plan's targets each have their note, so --member may be given once per target.
|
|
2899
|
+
// #5003: a product plan's own status contexts, one a --member in the same order (one with none).
|
|
2900
|
+
const contexts = args.statusContexts;
|
|
2901
|
+
const members = args.members?.length ? (contexts ? [...args.members] : [...new Set(args.members)]) : [undefined];
|
|
2902
|
+
if (contexts && contexts.length !== members.length)
|
|
2903
|
+
return fail(`pr-post --stale takes one --context a --member (one with none), and got ${contexts.length} for ${members.length}`);
|
|
2904
|
+
if (args.planJob)
|
|
2905
|
+
return fail("pr-post --plan-job names the GitLab plan job pr-post --open reads; --stale reads no plan job");
|
|
2893
2906
|
const { markStaleNotes } = await import("../../pr-post.js");
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2907
|
+
for (const [i, member] of members.entries()) {
|
|
2908
|
+
let done;
|
|
2909
|
+
try {
|
|
2910
|
+
done = await markStaleNotes({ forge, branch, tip: args.tip, env: args.env, ...(member ? { member } : {}), ...(contexts ? { context: contexts[i] } : {}), ...(args.previewComment ? { previewComment: true } : {}) });
|
|
2911
|
+
}
|
|
2912
|
+
catch (err) {
|
|
2913
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
2914
|
+
}
|
|
2915
|
+
for (const message of done.warnings)
|
|
2916
|
+
console.error(formatWarning({ message }));
|
|
2917
|
+
const marked = done.marks.filter((m) => m.marked).map((m) => `#${m.pr}`);
|
|
2918
|
+
console.error(formatInfo(`pr-post --stale${member ? ` (${member})` : ""}: ${marked.length > 0 ? `marked ${marked.join(", ")} stale` : "no note to mark"} after ${branch} moved to ${args.tip.slice(0, 12)}`));
|
|
2900
2919
|
}
|
|
2901
|
-
for (const message of done.warnings)
|
|
2902
|
-
console.error(formatWarning({ message }));
|
|
2903
|
-
const marked = done.marks.filter((m) => m.marked).map((m) => `#${m.pr}`);
|
|
2904
|
-
console.error(formatInfo(`pr-post --stale: ${marked.length > 0 ? `marked ${marked.join(", ")} stale` : "no note to mark"} after ${branch} moved to ${args.tip.slice(0, 12)}`));
|
|
2905
2920
|
return 0;
|
|
2906
2921
|
}
|
|
2907
2922
|
/**
|
|
@@ -2940,21 +2955,27 @@ async function runComponentsPrPostOpen(ctx) {
|
|
|
2940
2955
|
if (top.status !== 0)
|
|
2941
2956
|
return fail("pr-post --open reads the plan report's path from the repository root, and this directory is not in a git repository");
|
|
2942
2957
|
const member = args.members?.[0];
|
|
2958
|
+
if (args.statusContexts && args.statusContexts.length > 1)
|
|
2959
|
+
return fail(`pr-post --open takes one --context, not ${args.statusContexts.join(", ")}`);
|
|
2960
|
+
// #5003: the product plan's own status context and plan job.
|
|
2961
|
+
const context = args.statusContexts?.[0];
|
|
2943
2962
|
const description = await descriptionCheckOf(ctx, forge);
|
|
2944
2963
|
if (typeof description === "number")
|
|
2945
2964
|
return description;
|
|
2946
2965
|
const artifactDir = relative(realpathSync(top.stdout.trim()), resolve(args.output ?? PR_REPORT_DIR)).split(sep).join("/");
|
|
2947
2966
|
const { postOpenPlanReports } = await import("../../pr-post.js");
|
|
2948
2967
|
const { gitlabPlanJobName } = await import("../../components/pr-pipeline.js");
|
|
2968
|
+
const planJob = args.planJob ?? gitlabPlanJobName(member);
|
|
2949
2969
|
let done;
|
|
2950
2970
|
try {
|
|
2951
2971
|
done = await postOpenPlanReports({
|
|
2952
2972
|
forge,
|
|
2953
2973
|
branch,
|
|
2954
|
-
job:
|
|
2974
|
+
job: planJob,
|
|
2955
2975
|
artifactDir,
|
|
2956
2976
|
env: args.env,
|
|
2957
2977
|
...(member ? { member } : {}),
|
|
2978
|
+
...(context ? { context } : {}),
|
|
2958
2979
|
// #4289: the Ops at the commit this pipeline checked out, the target branch's.
|
|
2959
2980
|
overdue: () => overdueOps(forge, member),
|
|
2960
2981
|
...(description ? { description } : {}),
|
|
@@ -2981,9 +3002,9 @@ async function runComponentsPrPostOpen(ctx) {
|
|
|
2981
3002
|
console.error(formatWarning({ message: `!${p.pr}: ${message}` }));
|
|
2982
3003
|
if (posted.refused)
|
|
2983
3004
|
console.error(formatWarning({ message: `!${p.pr}: the plan report was not used: ${posted.refused}` }));
|
|
2984
|
-
console.error(formatInfo(`pr-post: !${p.pr} ${prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}${posted.recorded ? `; run ${posted.recorded} recorded` : ""}`));
|
|
3005
|
+
console.error(formatInfo(`pr-post: !${p.pr} ${context ?? prStatusContext("plan", member)} ${posted.state}: ${posted.description}${posted.noted ? "; note posted" : ""}${posted.recorded ? `; run ${posted.recorded} recorded` : ""}`));
|
|
2985
3006
|
}
|
|
2986
3007
|
if (done.posts.length === 0)
|
|
2987
|
-
console.error(formatInfo(`pr-post: no open merge request into ${branch} has a ${
|
|
3008
|
+
console.error(formatInfo(`pr-post: no open merge request into ${branch} has a ${planJob} job`));
|
|
2988
3009
|
return 0;
|
|
2989
3010
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-wave.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/run-wave.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"run-wave.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/run-wave.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAkB3E"}
|