@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
|
@@ -6,12 +6,17 @@
|
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
import { relative, resolve } from "node:path";
|
|
8
8
|
import { notifyOpWave } from "../../op/op-waves-notify";
|
|
9
|
-
import { parseOpWavesSpec, recordOpWaveHeadPlans, runOpWave } from "../../op/op-waves-run";
|
|
9
|
+
import { gitShowAtBase, parseOpWavesSpec, recordOpWaveHeadPlans, runOpWave } from "../../op/op-waves-run";
|
|
10
10
|
import { activeProductWaveHook } from "../../op/op-waves-after-plan";
|
|
11
11
|
import type { OpWavesSpec } from "../../op/op-waves";
|
|
12
|
+
import type { OpWaveShowAtBase } from "../../op/op-waves-run";
|
|
12
13
|
import { formatError, formatWarning } from "../format";
|
|
13
14
|
import { ledgerRecordingOff, NO_RECORD_ENV, noRecordEndNote, noRecordStartNote, resetNoRecordLedger } from "../../lifecycle/no-record";
|
|
14
15
|
import type { CommandContext } from "../registry";
|
|
16
|
+
import { waveStopLine } from "../../op/wave-stop";
|
|
17
|
+
import { OP_WAVE_PHASES, type OpWavePhase } from "../../op/op-waves-split";
|
|
18
|
+
import { beforeMergeRunFromEnv } from "../../op/before-merge";
|
|
19
|
+
import { CHANT_EXIT } from "../../exit-codes";
|
|
15
20
|
|
|
16
21
|
/**
|
|
17
22
|
* `chant run wave`, with recording off under `--no-record` or
|
|
@@ -43,6 +48,10 @@ export async function runOpWaveCommand(ctx: CommandContext): Promise<number> {
|
|
|
43
48
|
|
|
44
49
|
async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
|
|
45
50
|
const { args } = ctx;
|
|
51
|
+
// #4984: the job after a before-merge run's last wave merges the pull request, or says it is ready.
|
|
52
|
+
if (args.merge !== undefined) return runBeforeMergeDone(ctx);
|
|
53
|
+
// #4987: the job after a wave posts its apply status, at the default branch's commit.
|
|
54
|
+
if (args.applyStatus !== undefined) return runApplyStatus(ctx);
|
|
46
55
|
const specFile = args.opsSpec;
|
|
47
56
|
if (specFile && args.recordPlans) {
|
|
48
57
|
try {
|
|
@@ -64,7 +73,16 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
|
|
|
64
73
|
const { opWaveOutcomeDir } = await import("../../op/op-waves");
|
|
65
74
|
const { earlierWaveOutcomes } = await import("../../wave-blocked");
|
|
66
75
|
const { applyOutcomeOf } = await import("../../control/applied");
|
|
67
|
-
|
|
76
|
+
// #4992: a run that started a follow-on is not the last; the follow-on's control job tells the control repo.
|
|
77
|
+
const { readOpWaveRestNote } = await import("../../op/op-waves-follow-on");
|
|
78
|
+
const note = readOpWaveRestNote([resolve(opWaveOutcomeDir(spec))]);
|
|
79
|
+
if (note?.next !== undefined) {
|
|
80
|
+
console.error(`${spec.name}: wave ${note.wave} started a follow-on run for wave ${note.next}, so this run's outcome is not the waves'; that run sends it`);
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
// #4998: the last run of a chain adds up the earlier runs' outcomes, which its note carries.
|
|
84
|
+
const { withChainOutcomes } = await import("../../op/op-waves-follow-on");
|
|
85
|
+
const summary = applyOutcomeOf(withChainOutcomes(earlierWaveOutcomes([resolve(opWaveOutcomeDir(spec))], Number.MAX_SAFE_INTEGER).members, note));
|
|
68
86
|
if (args.json) console.log(JSON.stringify(summary, null, 2));
|
|
69
87
|
else {
|
|
70
88
|
console.log(summary.outcome);
|
|
@@ -92,6 +110,14 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
|
|
|
92
110
|
console.error(formatError({ message: `--policy-only runs a wave's policy in its own or its deciding job; a --${args.share !== undefined ? "share" : "group"} job has none of its own` }));
|
|
93
111
|
return 1;
|
|
94
112
|
}
|
|
113
|
+
// #4987: one of a split wave's four jobs before merge.
|
|
114
|
+
const phase = args.phase as OpWavePhase | undefined;
|
|
115
|
+
if (phase !== undefined && !OP_WAVE_PHASES.includes(phase)) {
|
|
116
|
+
console.error(formatError({ message: `--phase is one of ${OP_WAVE_PHASES.join(", ")}: a split wave's plan, gate, apply or record job`, hint: `got ${JSON.stringify(args.phase ?? "")}` }));
|
|
117
|
+
return 1;
|
|
118
|
+
}
|
|
119
|
+
// The gate and record jobs run at the default branch; a before-merge run's applied commit is its decided head.
|
|
120
|
+
const decidedHead = phase === "gate" || phase === "record" ? beforeMergeRunFromEnv().head : undefined;
|
|
95
121
|
let spec: OpWavesSpec | undefined;
|
|
96
122
|
const job = { ...(args.share !== undefined ? { share: args.share } : {}), ...(args.group !== undefined ? { group: args.group } : {}) };
|
|
97
123
|
if (args.eventsJson && args.json) {
|
|
@@ -100,7 +126,30 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
|
|
|
100
126
|
}
|
|
101
127
|
try {
|
|
102
128
|
const path = resolve(specFile);
|
|
103
|
-
spec
|
|
129
|
+
// #4982: --render-spec has the product's command print the spec at base, and reads the rules from it there too.
|
|
130
|
+
let show: OpWaveShowAtBase | undefined;
|
|
131
|
+
if (args.renderSpec) {
|
|
132
|
+
const at = await import("../../op/op-waves-render-spec");
|
|
133
|
+
const file = relative(process.cwd(), path);
|
|
134
|
+
show = at.renderedSpecShow(file, at.commandSpecRender(at.opWavesSpecCommandFromEnv(), file, process.cwd()), gitShowAtBase);
|
|
135
|
+
spec = at.renderOpWavesSpecFile({ specFile: file, base: args.base ?? "HEAD^1", cwd: process.cwd(), show, parse: parseOpWavesSpec }).spec;
|
|
136
|
+
const missing = at.renderedJobMissing(spec, args.wave, job);
|
|
137
|
+
if (missing) {
|
|
138
|
+
console.error(`${missing}, so this job has nothing to apply`);
|
|
139
|
+
return 0;
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
spec = parseOpWavesSpec(readFileSync(path, "utf-8"), `--spec ${specFile}`);
|
|
143
|
+
}
|
|
144
|
+
// #4979: a comment that ran the apply again through wave n leaves the waves after it waiting, as a gate does.
|
|
145
|
+
// #4987: in a split wave the gate job reads the stop, with the token, at the decided head.
|
|
146
|
+
if (!args.policyOnly && (phase === undefined || phase === "gate")) {
|
|
147
|
+
const stopped = await waveStopLine(spec.name, args.wave, decidedHead ? { sha: decidedHead } : {});
|
|
148
|
+
if (stopped) {
|
|
149
|
+
console.error(stopped);
|
|
150
|
+
return CHANT_EXIT.waiting;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
104
153
|
// #4555: --events-json streams the job's run events, a phase per wave and a step per run target.
|
|
105
154
|
const stream = args.eventsJson
|
|
106
155
|
? await (await import("../run-events")).openCliRunEvents(args, { kind: "op", name: spec.name, cwd: process.cwd() })
|
|
@@ -113,6 +162,8 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
|
|
|
113
162
|
...(product?.capabilities ? { capabilities: product.capabilities } : {}),
|
|
114
163
|
...(product?.hookExec ? { hookExec: product.hookExec } : {}),
|
|
115
164
|
...(product?.runHooks ? { runHooks: product.runHooks } : {}),
|
|
165
|
+
// #4994: the spec's hooks the product serves in this process, in whichever job of a split wave runs them.
|
|
166
|
+
...(product?.hooks ? { inProcessHooks: product.hooks } : {}),
|
|
116
167
|
spec,
|
|
117
168
|
specFile: relative(process.cwd(), path),
|
|
118
169
|
wave: args.wave,
|
|
@@ -121,10 +172,18 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
|
|
|
121
172
|
...(args.share !== undefined ? { share: args.share } : {}),
|
|
122
173
|
...(args.group !== undefined ? { group: args.group } : {}),
|
|
123
174
|
...(args.base ? { base: args.base } : {}),
|
|
175
|
+
...(show ? { show } : {}),
|
|
176
|
+
...(phase ? { phase } : {}),
|
|
177
|
+
...(decidedHead ? { head: decidedHead } : {}),
|
|
124
178
|
});
|
|
179
|
+
// #4992: the rest wave's record job starts the follow-on run for the next wave its plan found.
|
|
180
|
+
if (phase === "record") result.exitCode = await (await import("../../op/op-waves-follow-on")).followOnAfterRecord({ spec, wave: args.wave, exitCode: result.exitCode });
|
|
125
181
|
if (args.json) console.log(JSON.stringify(result, null, 2));
|
|
126
182
|
// #4926: the policy step applied nothing; the wave's own step tells people how it went.
|
|
127
183
|
if (args.policyOnly) return result.exitCode;
|
|
184
|
+
// #4987: the plan and apply jobs run the change's code and hold no token; the gate job tells people when the wave stops
|
|
185
|
+
// there, and the record job how it applied.
|
|
186
|
+
if (phase === "plan" || phase === "apply" || (phase === "gate" && result.exitCode === CHANT_EXIT.done)) return result.exitCode;
|
|
128
187
|
// #3761: tell people, when the spec says where. Delivery never changes the exit code.
|
|
129
188
|
await notifyOpWave(spec, args.wave, { result }, job);
|
|
130
189
|
// #4629: a refused wave's diff and a failed apply's triage, on the pull request or a tracking issue.
|
|
@@ -133,7 +192,7 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
|
|
|
133
192
|
} catch (err) {
|
|
134
193
|
const message = err instanceof Error ? err.message : String(err);
|
|
135
194
|
console.error(formatError({ message }));
|
|
136
|
-
if (spec) {
|
|
195
|
+
if (spec && phase !== "plan" && phase !== "apply") {
|
|
137
196
|
await notifyOpWave(spec, args.wave, { error: message }, job);
|
|
138
197
|
await respondWave(spec, args.wave, { error: message });
|
|
139
198
|
}
|
|
@@ -141,6 +200,113 @@ async function runOpWaveJobCommand(ctx: CommandContext): Promise<number> {
|
|
|
141
200
|
}
|
|
142
201
|
}
|
|
143
202
|
|
|
203
|
+
/**
|
|
204
|
+
* `chant run wave --op <op> --wave <last> --merge auto|manual --forge <kind>
|
|
205
|
+
* [--gate <name>] [--merge-token-env <VAR>]` (#4984): the job after a
|
|
206
|
+
* before-merge run's last wave (`../../op/before-merge-done.ts`). A push run
|
|
207
|
+
* names no decided head, and the job does nothing.
|
|
208
|
+
*/
|
|
209
|
+
async function runBeforeMergeDone(ctx: CommandContext): Promise<number> {
|
|
210
|
+
const { args } = ctx;
|
|
211
|
+
const fail = (message: string): number => {
|
|
212
|
+
console.error(formatError({ message }));
|
|
213
|
+
return 1;
|
|
214
|
+
};
|
|
215
|
+
if (args.merge !== "auto" && args.merge !== "manual") return fail("--merge is auto or manual: auto merges the pull request once every wave applied its decided head, manual says it is ready");
|
|
216
|
+
const op = args.op;
|
|
217
|
+
if (!op || args.wave === undefined) return fail("--merge closes a before-merge run: --op <name> --wave <last wave> --merge auto|manual --forge <kind>");
|
|
218
|
+
const { FORGE_KINDS } = await import("../../pr-forge");
|
|
219
|
+
if (!args.forge || !(FORGE_KINDS as readonly string[]).includes(args.forge)) return fail(`--merge replies on the pull request: --forge ${FORGE_KINDS.join("|")}`);
|
|
220
|
+
const kind = args.forge as (typeof FORGE_KINDS)[number];
|
|
221
|
+
const { beforeMergeRunFromEnv, isBeforeMergeRun } = await import("../../op/before-merge");
|
|
222
|
+
const run = beforeMergeRunFromEnv();
|
|
223
|
+
if (!isBeforeMergeRun(run)) {
|
|
224
|
+
console.error("this run names no decided head: a push applies on its own, so nothing is merged here");
|
|
225
|
+
return 0;
|
|
226
|
+
}
|
|
227
|
+
try {
|
|
228
|
+
const { beforeMergeRecordAt } = await import("../../op/before-merge-store");
|
|
229
|
+
const { beforeMergeDone } = await import("../../op/before-merge-done");
|
|
230
|
+
const { opWaveOutcomeDir } = await import("../../op/op-waves");
|
|
231
|
+
const { earlierWaveOutcomes } = await import("../../wave-blocked");
|
|
232
|
+
const { applyOutcomeOf } = await import("../../control/applied");
|
|
233
|
+
const { forgeFromJobEnv } = await import("../../pr-forge-job");
|
|
234
|
+
const { mergeTokenEnv } = await import("../../pr-merge");
|
|
235
|
+
const { releaseTargetLocks } = await import("../../lifecycle/target-lock");
|
|
236
|
+
const { PR_APPLY_GATE } = await import("../../pr-loop");
|
|
237
|
+
const { activeProductWords } = await import("../../ci-product-words");
|
|
238
|
+
const record = run.head ? await beforeMergeRecordAt(op, run.head) : undefined;
|
|
239
|
+
// #4992: a run whose rest wave started a follow-on leaves the merge to that run.
|
|
240
|
+
const { readOpWaveRestNote, withChainOutcomes } = await import("../../op/op-waves-follow-on");
|
|
241
|
+
const note = readOpWaveRestNote([resolve(opWaveOutcomeDir({ name: op }))]);
|
|
242
|
+
// #4998: the last run of a chain adds up the earlier runs' outcomes, which its note carries.
|
|
243
|
+
const outcome = applyOutcomeOf(withChainOutcomes(earlierWaveOutcomes([resolve(opWaveOutcomeDir({ name: op }))], Number.MAX_SAFE_INTEGER).members, note));
|
|
244
|
+
let merger;
|
|
245
|
+
if (args.merge === "auto" && args.mergeTokenEnv) {
|
|
246
|
+
const env = mergeTokenEnv(args.mergeTokenEnv);
|
|
247
|
+
if ("error" in env) return fail(String(env.error));
|
|
248
|
+
merger = forgeFromJobEnv(kind, env);
|
|
249
|
+
}
|
|
250
|
+
const gate = args.gate ?? PR_APPLY_GATE;
|
|
251
|
+
const done = await beforeMergeDone({
|
|
252
|
+
op,
|
|
253
|
+
waves: args.wave,
|
|
254
|
+
run,
|
|
255
|
+
record,
|
|
256
|
+
outcome,
|
|
257
|
+
...(note?.next !== undefined ? { followOn: { wave: note.wave, next: note.next, found: note.found } } : {}),
|
|
258
|
+
merge: args.merge,
|
|
259
|
+
forge: forgeFromJobEnv(kind),
|
|
260
|
+
...(merger ? { merger } : {}),
|
|
261
|
+
release: async (pr) => (await releaseTargetLocks(gate, pr)).released,
|
|
262
|
+
words: activeProductWords(),
|
|
263
|
+
});
|
|
264
|
+
console.error(done.text);
|
|
265
|
+
return done.code;
|
|
266
|
+
} catch (err) {
|
|
267
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* `chant run wave --op <op> --wave <n> --of <count> --apply-status <context>
|
|
273
|
+
* --at <sha> --forge <kind>` (#4987): the job after wave n posts its apply
|
|
274
|
+
* status on the commit the waves applied, from every outcome file the job
|
|
275
|
+
* downloaded (`../../op/apply-status.ts`). It runs at the default branch's
|
|
276
|
+
* commit and none of the change's code. A refused post fails the job.
|
|
277
|
+
*/
|
|
278
|
+
async function runApplyStatus(ctx: CommandContext): Promise<number> {
|
|
279
|
+
const { args } = ctx;
|
|
280
|
+
const fail = (message: string): number => {
|
|
281
|
+
console.error(formatError({ message }));
|
|
282
|
+
return 1;
|
|
283
|
+
};
|
|
284
|
+
const op = args.op;
|
|
285
|
+
if (!op || args.wave === undefined || args.of === undefined || !args.at) return fail("--apply-status posts one wave's apply status: --op <name> --wave <n> --of <count> --apply-status <context> --at <sha> --forge <kind>");
|
|
286
|
+
const { FORGE_KINDS } = await import("../../pr-forge");
|
|
287
|
+
if (!args.forge || !(FORGE_KINDS as readonly string[]).includes(args.forge)) return fail(`--apply-status posts on a forge: --forge ${FORGE_KINDS.join("|")}`);
|
|
288
|
+
const kind = args.forge as (typeof FORGE_KINDS)[number];
|
|
289
|
+
try {
|
|
290
|
+
const { postOpWaveApplyStatus } = await import("../../op/apply-status");
|
|
291
|
+
const { opWaveOutcomeDir } = await import("../../op/op-waves");
|
|
292
|
+
const { forgeFromJobEnv } = await import("../../pr-forge-job");
|
|
293
|
+
const pipeline = kind === "gitlab" && args.at === process.env.CI_COMMIT_SHA && /^[0-9]+$/.test(process.env.CI_PIPELINE_ID ?? "") ? Number(process.env.CI_PIPELINE_ID) : undefined;
|
|
294
|
+
const line = await postOpWaveApplyStatus({
|
|
295
|
+
forge: forgeFromJobEnv(kind),
|
|
296
|
+
dirs: [resolve(opWaveOutcomeDir({ name: op }))],
|
|
297
|
+
wave: args.wave,
|
|
298
|
+
of: args.of,
|
|
299
|
+
context: args.applyStatus!,
|
|
300
|
+
at: args.at,
|
|
301
|
+
...(pipeline !== undefined ? { pipelineId: pipeline } : {}),
|
|
302
|
+
});
|
|
303
|
+
console.error(line);
|
|
304
|
+
return 0;
|
|
305
|
+
} catch (err) {
|
|
306
|
+
return fail(`the apply status was not posted: ${err instanceof Error ? err.message : String(err)}`);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
144
310
|
/**
|
|
145
311
|
* The wave job's responses (#4629), through the forge the job's variables
|
|
146
312
|
* name. A job with no forge token posts nothing. Never throws.
|
package/src/cli/handlers/run.ts
CHANGED
|
@@ -40,6 +40,7 @@ import { adoptionReview, loadDeployAdoption, type DeployAdoption } from "../../c
|
|
|
40
40
|
import { isApplyRecord, resolveCiRun, type ReleaseRecord, type RunOrigin } from "../../lifecycle/release-ledger";
|
|
41
41
|
import { gateAdmission, gateApprover } from "../../components/promote";
|
|
42
42
|
import { runOpGenerate } from "./run-generate";
|
|
43
|
+
import { actorFromEnv } from "../../actor";
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
46
|
* The exit code a run that stopped at an unapproved gate uses (#2119).
|
|
@@ -1132,7 +1133,7 @@ export async function recordSkips(
|
|
|
1132
1133
|
): Promise<ReleaseRecord[]> {
|
|
1133
1134
|
const fresh = [...skipped.values()].filter((v) => !v.recorded);
|
|
1134
1135
|
if (fresh.length === 0) return [];
|
|
1135
|
-
const actor = process.env
|
|
1136
|
+
const actor = actorFromEnv(process.env, "");
|
|
1136
1137
|
if (!actor) {
|
|
1137
1138
|
console.error(formatWarning({ message: `the skips of ${fresh.map((v) => v.since.component).join(", ")} were not recorded: no actor (GITHUB_ACTOR, GITLAB_USER_LOGIN or USER)` }));
|
|
1138
1139
|
return [];
|
package/src/cli/main.ts
CHANGED
|
@@ -267,14 +267,17 @@ E2E harness:
|
|
|
267
267
|
CLEAN, or the rejecting lines and exits 3.
|
|
268
268
|
|
|
269
269
|
CI:
|
|
270
|
-
ci check --base <rev> [<target>...] [--output <dir>] [--summary <file>] [--json]
|
|
270
|
+
ci check [--base <rev>] [<target>...] [--output <dir>] [--summary <file>] [--json]
|
|
271
271
|
Run the ci.hooks.check hooks the workspace declaration
|
|
272
272
|
at --base names, once each, or once per target with
|
|
273
273
|
perRun, with no forge token or cloud credentials in
|
|
274
274
|
their environment. Writes check-hooks.json under
|
|
275
275
|
--output (default .chant/check), and with --summary
|
|
276
276
|
appends the report's markdown section to the file;
|
|
277
|
-
exits 1 when one failed.
|
|
277
|
+
exits 1 when one failed. With no --base, a pull
|
|
278
|
+
request's target branch, else origin/<default> for a
|
|
279
|
+
push to another branch (--branch names the default
|
|
280
|
+
branch where the job does not).
|
|
278
281
|
ci evidence sign --check-id <id>[,<id>...] [--at <rev>] [--base <rev>] [--no-push]
|
|
279
282
|
Sign that each named check passed at --at, with the
|
|
280
283
|
runner key in CHANT_RUNNER_KEY or --key, and keep it on
|
|
@@ -612,6 +615,27 @@ Ops:
|
|
|
612
615
|
hold, applying nothing, and exits 0 only when the
|
|
613
616
|
policy ran and denied nothing: the wave job's
|
|
614
617
|
policy step, whose result its evidence job reads (#4926).
|
|
618
|
+
--render-spec runs the command CHANT_WAVES_SPEC_COMMAND
|
|
619
|
+
names (a JSON argv) with CHANT_WAVES_SPEC_AT set to
|
|
620
|
+
the base, writes the spec it prints over --spec, and
|
|
621
|
+
reads the rules at base from it (#4982).
|
|
622
|
+
--phase plan|gate|apply|record: one of a wave's four
|
|
623
|
+
jobs before merge (#4987). plan saves the plan and
|
|
624
|
+
writes nothing to chant/lifecycle; gate decides the
|
|
625
|
+
gate on the saved plan at the default branch; apply
|
|
626
|
+
applies the saved plans the decision holds; record
|
|
627
|
+
writes the applying jobs' run records.
|
|
628
|
+
--op <name> --wave <last> --merge auto|manual
|
|
629
|
+
--forge <kind> [--gate <name>] [--merge-token-env
|
|
630
|
+
<VAR>]: the job after a before-merge run's last wave
|
|
631
|
+
(#4984): checks the decided head and that every wave
|
|
632
|
+
applied, then merges the pull request at that head
|
|
633
|
+
and releases its locks (auto), or says it is ready.
|
|
634
|
+
--op <name> --wave <n> --of <count> --apply-status
|
|
635
|
+
<context> --at <sha> --forge <kind>: the job after
|
|
636
|
+
wave n posts <context> on the commit the waves
|
|
637
|
+
applied, from the outcome files: pending until the
|
|
638
|
+
last wave's success, failed for a failed run (#4987).
|
|
615
639
|
--record-plans (no --wave), in a pull request's
|
|
616
640
|
pipeline: plan every wave at its head and record the
|
|
617
641
|
digests a pr-review approval mode compares.
|
|
@@ -776,6 +800,8 @@ Ops:
|
|
|
776
800
|
(--pr <n>, --stage plan|apply|lock, --head <sha>,
|
|
777
801
|
--by <who>, --gate <name>, --json). --from-report
|
|
778
802
|
<pr-plan.json> locks the components a plan selected.
|
|
803
|
+
--reach locks what the line in CHANT_LOCK_REACH prints
|
|
804
|
+
for --base..--head (--open: every open merge request).
|
|
779
805
|
--forge <kind> reads which holders are still open and
|
|
780
806
|
posts chant/lock on --head. Exits 3 when another open
|
|
781
807
|
pull request holds a target. --list prints the locks
|
|
@@ -1350,6 +1376,12 @@ Component release ledger + status:
|
|
|
1350
1376
|
[--preview-comment] [--apply-before-merge]
|
|
1351
1377
|
[--apply-on-merge] [--locks]); each answered
|
|
1352
1378
|
note is recorded on chant/lifecycle
|
|
1379
|
+
components pr-comment GitHub and Forgejo (#4946): answer a comment
|
|
1380
|
+
command no other job of the pipeline takes:
|
|
1381
|
+
a refusal, a command the pipeline runs no job
|
|
1382
|
+
for, or a merged pull request's apply run
|
|
1383
|
+
again (--forge github|forgejo [--branch <b>];
|
|
1384
|
+
the jobs from CHANT_COMMENT_JOBS)
|
|
1353
1385
|
components pr-record On merge (#4168): plan the same members again,
|
|
1354
1386
|
store the change set and write the merge record
|
|
1355
1387
|
_merges/<commit>.json; applies and refuses
|
|
@@ -1499,6 +1531,9 @@ Lexicon development:
|
|
|
1499
1531
|
Render the files package.json's chantGenerated declares into a
|
|
1500
1532
|
directory under the OS temp dir, compare each with the committed
|
|
1501
1533
|
file, and fail naming the ones that drifted
|
|
1534
|
+
dev render <module> <export> [--output <root>]
|
|
1535
|
+
Import the module and write the { path: text } files its export
|
|
1536
|
+
returns below the root (the working directory by default)
|
|
1502
1537
|
dev dead-guards [<product-dir>]
|
|
1503
1538
|
Fail naming each feature-detect on a chant floor (a floor read off
|
|
1504
1539
|
a lazily loaded module, a subpath loaded behind a catch, the
|
|
@@ -2018,6 +2053,8 @@ export const commandRegistry: CommandDef[] = [
|
|
|
2018
2053
|
{ name: "dev bundle-check", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/local-chant")).runDevBundleCheck(ctx) },
|
|
2019
2054
|
{ name: "dev local-image", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/local-chant")).runDevLocalImage(ctx) },
|
|
2020
2055
|
{ name: "dev generated-check", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/generated-check")).runDevGeneratedCheck(ctx) },
|
|
2056
|
+
// #4950: a module's { path: text } export, written in place.
|
|
2057
|
+
{ name: "dev render", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/generated-check")).runDevRender(ctx) },
|
|
2021
2058
|
// #4792: the feature-detects on a chant floor the product's pin already meets.
|
|
2022
2059
|
{ name: "dev dead-guards", runsNoConfig: true, handler: async (ctx) => (await import("./handlers/dead-guards")).runDevDeadGuards(ctx) },
|
|
2023
2060
|
|
|
@@ -2156,6 +2193,8 @@ export const commandRegistry: CommandDef[] = [
|
|
|
2156
2193
|
{ name: "components pr-post", handler: async (ctx) => (await import("./handlers/pr")).runComponentsPrPost(ctx) },
|
|
2157
2194
|
// #4785: GitLab's comment commands, polled from the notes in a job that runs none of the change's code, so it loads no plugins.
|
|
2158
2195
|
{ name: "components pr-notes", handler: async (ctx) => (await import("./handlers/pr-notes")).runComponentsPrNotes(ctx) },
|
|
2196
|
+
// #4946: GitHub's and Forgejo's comment job, at the target branch's commit, so it loads no plugins.
|
|
2197
|
+
{ name: "components pr-comment", handler: async (ctx) => (await import("./handlers/pr-comment")).runComponentsPrComment(ctx) },
|
|
2159
2198
|
{ name: "components pr-record", requiresPlugins: true, handler: async (ctx) => (await import("./handlers/pr")).runComponentsPrRecord(ctx) },
|
|
2160
2199
|
// #4616: the agent jobs' three steps. Imported on first use; none loads plugins.
|
|
2161
2200
|
{ name: "agent prepare", handler: async (ctx) => (await import("./handlers/agent")).runAgentCommandLine(ctx) },
|
package/src/cli/parse-args.ts
CHANGED
|
@@ -24,6 +24,7 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
24
24
|
"--check-job",
|
|
25
25
|
"--ref-gate-status",
|
|
26
26
|
"--locks",
|
|
27
|
+
"--reach",
|
|
27
28
|
"--version",
|
|
28
29
|
"--agents",
|
|
29
30
|
"--agent",
|
|
@@ -106,6 +107,7 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
106
107
|
"--generated",
|
|
107
108
|
"--decide",
|
|
108
109
|
"--policy-only",
|
|
110
|
+
"--render-spec",
|
|
109
111
|
"--record-plans",
|
|
110
112
|
"--approval-status",
|
|
111
113
|
"--waves-outcome",
|
|
@@ -429,6 +431,9 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
429
431
|
} else if (arg === "--keep") {
|
|
430
432
|
// `chant lock --keep --pr <n>` (#4588): keep the locks the pull request's plan took, as `/<product> lock` asks.
|
|
431
433
|
result.keepLocks = true;
|
|
434
|
+
} else if (arg === "--reach") {
|
|
435
|
+
// `chant lock --reach --pr <n> --head <sha> --base <sha>` (#4979): lock what the reach line in CHANT_LOCK_REACH prints.
|
|
436
|
+
result.lockReach = true;
|
|
432
437
|
} else if (arg === "--runs" || arg === "--plans" || arg === "--wave-outputs") {
|
|
433
438
|
// `chant components plan-wave|apply-wave` (#4588): the op-waves runs and plans files, and the outputs the waves hand on.
|
|
434
439
|
const value = args[++i];
|
|
@@ -490,6 +495,9 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
490
495
|
} else if (arg === "--policy-only") {
|
|
491
496
|
// `chant run wave --policy-only` (#4926): plan the wave and run its policy hold, as a step of its own.
|
|
492
497
|
result.policyOnly = true;
|
|
498
|
+
} else if (arg === "--render-spec") {
|
|
499
|
+
// `chant run wave --render-spec` (#4982): the product's command prints the spec at base.
|
|
500
|
+
result.renderSpec = true;
|
|
493
501
|
} else if (arg === "--record-plans") {
|
|
494
502
|
result.recordPlans = true;
|
|
495
503
|
} else if (arg === "--approval-status") {
|
|
@@ -497,6 +505,16 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
497
505
|
result.approvalStatus = true;
|
|
498
506
|
} else if (arg === "--waves-outcome") {
|
|
499
507
|
result.wavesOutcome = true;
|
|
508
|
+
} else if (arg === "--apply-status") {
|
|
509
|
+
// `chant run wave --op <op> --wave <n> --of <count> --apply-status <context> --at <sha>` (#4987): post wave n's apply status.
|
|
510
|
+
const value = args[++i];
|
|
511
|
+
if (!value || value.startsWith("-")) throw new Error("--apply-status needs the status's name: --apply-status <context>");
|
|
512
|
+
result.applyStatus = value;
|
|
513
|
+
} else if (arg === "--of") {
|
|
514
|
+
const raw = args[++i];
|
|
515
|
+
const of = Number(raw);
|
|
516
|
+
if (!Number.isInteger(of) || of < 1) throw new Error(`--of needs the number of waves: got "${raw ?? ""}"`);
|
|
517
|
+
result.of = of;
|
|
500
518
|
} else if (arg === "--group") {
|
|
501
519
|
const raw = args[++i];
|
|
502
520
|
if (!raw || raw.startsWith("-")) throw new Error("--group needs a job group's name: --group <name>");
|
|
@@ -964,6 +982,10 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
964
982
|
// `chant components pr-post --record-run <plan job>` (#4899): keep the product plan job's run record on chant/lifecycle.
|
|
965
983
|
result.recordRun = args[++i];
|
|
966
984
|
if (!result.recordRun || !/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(result.recordRun)) throw new Error(`--record-run needs the plan job's name: got "${result.recordRun ?? ""}"`);
|
|
985
|
+
} else if (arg === "--not-affected") {
|
|
986
|
+
// `chant components pr-post --not-affected <argument>` (#4963): the re-plan's argument, which may be empty; pr-post checks it.
|
|
987
|
+
if (i + 1 >= args.length) throw new Error('--not-affected needs the re-plan\'s argument, empty for none: --not-affected "$CHANT_PLAN_ARGUMENT"');
|
|
988
|
+
result.notAffected = args[++i];
|
|
967
989
|
} else if (arg === "--evidence-dir") {
|
|
968
990
|
// `chant components pr-post --open --evidence-dir <dir>` (#4914): each merge request's evidence.json, from the GitLab signing job.
|
|
969
991
|
result.evidenceDir = args[++i];
|
|
@@ -1369,6 +1391,7 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
1369
1391
|
result.quarantineOnly = true;
|
|
1370
1392
|
} else if (arg === "--phase") {
|
|
1371
1393
|
// `chant ci base --phase <name>` (#4643): the ci.green phase whose base to find.
|
|
1394
|
+
// `chant run wave --phase plan|gate|apply|record` (#4987): one job of a split wave; the handler checks the word.
|
|
1372
1395
|
result.phase = args[++i];
|
|
1373
1396
|
} else if (arg === "--audit-log") {
|
|
1374
1397
|
// `chant audit-log attribute|unrecorded --audit-log aws[:<region>]` (#4632).
|
package/src/cli/registry.ts
CHANGED
|
@@ -336,12 +336,18 @@ export interface ParsedArgs {
|
|
|
336
336
|
decide?: boolean;
|
|
337
337
|
/** `chant run wave --policy-only` (#4926) — plan the wave and run its policy hold, applying nothing: the wave job's policy step. */
|
|
338
338
|
policyOnly?: boolean;
|
|
339
|
+
/** `chant run wave --render-spec` (#4982) — run the command `CHANT_WAVES_SPEC_COMMAND` names to print the spec at base, and run the wave on it. */
|
|
340
|
+
renderSpec?: boolean;
|
|
339
341
|
/** `chant run wave --record-plans` (#3684) — plan every wave at a pull request's head and record the digests for a `pr-review` gate. */
|
|
340
342
|
recordPlans?: boolean;
|
|
341
343
|
/** `chant run wave --approval-status` (#4630) — post `<product>/approval` on an open pull request's head under `pr-review` or `pull-request`. */
|
|
342
344
|
approvalStatus?: boolean;
|
|
343
345
|
/** `chant run wave --waves-outcome` (#4617) — print how every wave job's outcome file adds up: the outcome a control dispatch carries. */
|
|
344
346
|
wavesOutcome?: boolean;
|
|
347
|
+
/** `chant run wave --op <op> --wave <n> --of <count> --apply-status <context> --at <sha> --forge <kind>` (#4987) — post wave n's apply status from the outcome files. */
|
|
348
|
+
applyStatus?: string;
|
|
349
|
+
/** `chant run wave --of <count>` (#4987) — how many waves the run has, with `--apply-status`. */
|
|
350
|
+
of?: number;
|
|
345
351
|
/** `chant run wave --share <i>` (#3679) — apply share `i` of a decided wide wave. */
|
|
346
352
|
share?: number;
|
|
347
353
|
/** `chant run wave --group <name>` (#3914) — apply one job group's runs of a decided wave. */
|
|
@@ -607,6 +613,8 @@ export interface ParsedArgs {
|
|
|
607
613
|
evidenceAudience?: string;
|
|
608
614
|
/** `chant components pr-post --record-run <plan job>` (#4899): keep the product plan job's run record on chant/lifecycle. */
|
|
609
615
|
recordRun?: string;
|
|
616
|
+
/** `chant components pr-post --not-affected <argument>` (#4963): the argument a re-plan was narrowed to, which gets a "not affected" reply when the change reaches nothing. */
|
|
617
|
+
notAffected?: string;
|
|
610
618
|
/** `chant components pr-post --open --evidence-dir <dir>` (#4914): where the GitLab signing job kept each merge request's `evidence.json`, for the note's checks line. */
|
|
611
619
|
evidenceDir?: string;
|
|
612
620
|
/** `chant ci evidence sign --open --no-forks` (#4914): sign for no merge request from a fork. */
|
|
@@ -914,6 +922,13 @@ export interface ParsedArgs {
|
|
|
914
922
|
* until it closes or `chant unlock`. What `/<product> lock` runs.
|
|
915
923
|
*/
|
|
916
924
|
keepLocks?: boolean;
|
|
925
|
+
/**
|
|
926
|
+
* `chant lock --reach` (#4979): lock the targets the reach line in
|
|
927
|
+
* `CHANT_LOCK_REACH` prints for the change from `--base` to `--head`,
|
|
928
|
+
* after fetching the pull request's head; with `--open`, every open merge
|
|
929
|
+
* request's (GitLab's plan notes pipeline).
|
|
930
|
+
*/
|
|
931
|
+
lockReach?: boolean;
|
|
917
932
|
/** `chant components plan-wave|apply-wave --runs <file>` (#4588): the runs file `chant run wave` writes, `{runs}`. */
|
|
918
933
|
runsFile?: string;
|
|
919
934
|
/** `chant components plan-wave|apply-wave --plans <file>` (#4588): the wave's plans file, `{plans}`. */
|
|
@@ -1001,7 +1016,10 @@ export interface ParsedArgs {
|
|
|
1001
1016
|
ciTimeoutMinutes?: number;
|
|
1002
1017
|
/** `chant ci last-green --lane <name>` and `chant ci base --lane <name>` (#4662) — a ci.green lane. `chant release cut --lane <name>` and `chant release candidates --lane <name>` (#4692) — check that lane's green tags. */
|
|
1003
1018
|
lane?: string;
|
|
1004
|
-
/**
|
|
1019
|
+
/**
|
|
1020
|
+
* `chant ci base --phase <name>` (#4643) — the ci.green phase whose base to find. `chant ci quarantine filter --phase <name>` (#4677) — the phase whose runner takes the filter.
|
|
1021
|
+
* `chant run wave --phase plan|gate|apply|record` (#4987) — one of a split wave's four jobs before merge.
|
|
1022
|
+
*/
|
|
1005
1023
|
phase?: string;
|
|
1006
1024
|
/** `chant ci quarantine filter --runner nextest|playwright|list` (#4677). */
|
|
1007
1025
|
quarantineRunner?: string;
|
|
@@ -30,6 +30,7 @@ import { appendReleaseRecord, InvalidReleaseRecordError, type ReleaseAdmission,
|
|
|
30
30
|
import { changeSetDigest } from "../change-set";
|
|
31
31
|
import type { DriverComponent, DriverStepRecord } from "./driver";
|
|
32
32
|
import { componentInputDigests } from "./fan-out-inputs";
|
|
33
|
+
import { actorFromEnv } from "../actor";
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* A step output that represents a *promoted* artifact — a publish-family result
|
|
@@ -165,7 +166,7 @@ export interface AutoReleaseOptions {
|
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
function resolveActor(override?: string): string | undefined {
|
|
168
|
-
return override ?? process.env
|
|
169
|
+
return override ?? (actorFromEnv(process.env, "") || undefined);
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
/**
|