@intentius/chant 0.124.77 → 0.124.78
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/__fixtures__/notify-messages/events.d.ts +9 -0
- package/dist/__fixtures__/notify-messages/events.d.ts.map +1 -0
- package/dist/__fixtures__/notify-messages/events.js +21 -0
- package/dist/__fixtures__/product-words.d.ts +14 -0
- package/dist/__fixtures__/product-words.d.ts.map +1 -1
- package/dist/__fixtures__/product-words.js +11 -0
- package/dist/__fixtures__/terragucci-notify.d.ts +66 -0
- package/dist/__fixtures__/terragucci-notify.d.ts.map +1 -0
- package/dist/__fixtures__/terragucci-notify.js +133 -0
- package/dist/action-pins.d.ts +8 -0
- package/dist/action-pins.d.ts.map +1 -1
- package/dist/action-pins.js +9 -0
- package/dist/agent-guard.d.ts.map +1 -1
- package/dist/agent-guard.js +1 -2
- package/dist/ci-commit.d.ts +66 -2
- package/dist/ci-commit.d.ts.map +1 -1
- package/dist/ci-commit.js +148 -19
- package/dist/ci-own-jobs.d.ts.map +1 -1
- package/dist/ci-own-jobs.js +1 -2
- package/dist/ci-product-words.d.ts +18 -4
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +26 -6
- package/dist/ci-product.d.ts +1 -1
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +3 -4
- package/dist/cli/handlers/release.js +4 -4
- package/dist/components/pr-env-components.d.ts.map +1 -1
- package/dist/components/pr-env-components.js +1 -2
- package/dist/config.d.ts +14 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -1
- package/dist/lexicon.d.ts +8 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lexicon.js +9 -0
- package/dist/lifecycle/release-images.d.ts +77 -3
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +132 -6
- package/dist/notify-product.d.ts +11 -2
- package/dist/notify-product.d.ts.map +1 -1
- package/dist/notify-product.js +16 -4
- package/dist/notify-relay.d.ts.map +1 -1
- package/dist/notify-relay.js +1 -2
- package/dist/notify.d.ts +36 -4
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +31 -21
- package/dist/notify.schema.json +1 -0
- package/dist/op/activities/review-product.d.ts +111 -0
- package/dist/op/activities/review-product.d.ts.map +1 -0
- package/dist/op/activities/review-product.js +116 -0
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +1 -2
- package/dist/pr-forge-reads.d.ts +124 -0
- package/dist/pr-forge-reads.d.ts.map +1 -0
- package/dist/pr-forge-reads.js +322 -0
- package/dist/pr-forge.d.ts +14 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +21 -13
- package/dist/pr-plan-note.d.ts +293 -0
- package/dist/pr-plan-note.d.ts.map +1 -0
- package/dist/pr-plan-note.js +362 -0
- package/dist/release-floors.d.ts +9 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +9 -1
- package/dist/state-export.d.ts.map +1 -1
- package/dist/state-export.js +1 -2
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +1 -2
- package/dist/state-unlock.d.ts.map +1 -1
- package/dist/state-unlock.js +1 -2
- package/dist/wave-runtime.mjs +271 -271
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +2 -1
- package/package.json +1 -1
- package/src/__fixtures__/notify-messages/events.ts +23 -0
- package/src/__fixtures__/notify-messages/messages.json +50 -0
- package/src/__fixtures__/pr-loop/terragucci-plan.note.golden.md +53 -0
- package/src/__fixtures__/pr-loop/terragucci-plan.note.json +83 -0
- package/src/__fixtures__/product-words.ts +12 -0
- package/src/__fixtures__/review-agent/terragucci-review.json +94 -0
- package/src/__fixtures__/terragucci-notify.ts +170 -0
- package/src/action-pins.test.ts +12 -1
- package/src/action-pins.ts +11 -0
- package/src/agent-guard.test.ts +1 -2
- package/src/agent-guard.ts +1 -2
- package/src/ci-commit.test.ts +163 -0
- package/src/ci-commit.ts +168 -21
- package/src/ci-own-jobs.test.ts +1 -2
- package/src/ci-own-jobs.ts +1 -2
- package/src/ci-product-words.ts +35 -7
- package/src/ci-product.ts +3 -4
- package/src/cli/handlers/build-pr-loop-control.test.ts +1 -2
- package/src/cli/handlers/build-run-group.test.ts +1 -2
- package/src/cli/handlers/release.ts +5 -5
- package/src/components/pr-env-components.test.ts +1 -2
- package/src/components/pr-env-components.ts +1 -2
- package/src/config.ts +23 -3
- package/src/gate-policy-bundle.test.ts +1 -1
- package/src/lexicon.ts +10 -0
- package/src/lifecycle/release-images-dockerfile.test.ts +221 -0
- package/src/lifecycle/release-images.ts +167 -8
- package/src/notify-message-words.test.ts +186 -0
- package/src/notify-product.ts +17 -4
- package/src/notify-relay.ts +1 -2
- package/src/notify.schema.json +1 -0
- package/src/notify.ts +59 -19
- package/src/op/activities/review-product.test.ts +116 -0
- package/src/op/activities/review-product.ts +200 -0
- package/src/op/schedule-overdue.test.ts +26 -0
- package/src/policy-engine.test.ts +1 -2
- package/src/policy-engine.ts +1 -2
- package/src/pr-forge-reads.test.ts +285 -0
- package/src/pr-forge-reads.ts +424 -0
- package/src/pr-forge.ts +30 -16
- package/src/pr-plan-note.test.ts +105 -0
- package/src/pr-plan-note.ts +521 -0
- package/src/release-floors.ts +13 -1
- package/src/state-export.test.ts +1 -2
- package/src/state-export.ts +1 -2
- package/src/state-migration.test.ts +1 -2
- package/src/state-migration.ts +1 -2
- package/src/state-unlock.test.ts +1 -2
- package/src/state-unlock.ts +1 -2
- package/src/workspace/release-workflow.ts +2 -1
package/dist/ci-commit.js
CHANGED
|
@@ -29,9 +29,9 @@ import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "no
|
|
|
29
29
|
import { join } from "node:path";
|
|
30
30
|
import { CHANT_EXIT } from "./exit-codes.js";
|
|
31
31
|
import { FORGE_TOKEN_VARS } from "./ci-handover.js";
|
|
32
|
-
import { NEXT_RELEASE } from "./release-floors.js";
|
|
33
32
|
import { agentForbiddenPaths, AgentError, branchOk, errText, LOGIN, readSmall, SHA } from "./ci-agent.js";
|
|
34
|
-
import { parseProductComment } from "./ci-product-words.js";
|
|
33
|
+
import { COMMIT_COMMENT_ARG, parseProductComment } from "./ci-product-words.js";
|
|
34
|
+
import { NEXT_RELEASE } from "./release-floors.js";
|
|
35
35
|
/** The first chant with the commit job and the scheduled Op spec's `commit` (#4722). Products feature-detect on it. */
|
|
36
36
|
export const CI_COMMIT_FLOOR = "0.124.71";
|
|
37
37
|
/** The first chant with a commit job after a check that runs on push, `jobToken` and `after` (#4749). Products feature-detect on it. */
|
|
@@ -43,7 +43,11 @@ export const CI_COMMIT_FILES_FLOOR = "0.124.73";
|
|
|
43
43
|
* `CHANT_COMMIT_PR`, keeps the tail of its standard error and replies with a
|
|
44
44
|
* product's refusal text ({@link setCommitRefusalReply}) (#4724).
|
|
45
45
|
*/
|
|
46
|
-
export const CI_COMMIT_REPLY_FLOOR =
|
|
46
|
+
export const CI_COMMIT_REPLY_FLOOR = "0.124.77";
|
|
47
|
+
/** The first chant whose commit job takes `commentArg`, one argument after the comment's word passed into the argv (#4820). */
|
|
48
|
+
export const CI_COMMIT_ARG_FLOOR = NEXT_RELEASE;
|
|
49
|
+
/** The first chant whose `commit land` reads {@link COMMIT_HARNESS_BREAK_ENV} in a BREAK arm of chant's e2e harness (#4836). */
|
|
50
|
+
export const CI_COMMIT_HARNESS_BREAK_FLOOR = NEXT_RELEASE;
|
|
47
51
|
export const COMMIT_TRIGGERS = ["comment", "check"];
|
|
48
52
|
export const COMMIT_MAX_RUNS = 3;
|
|
49
53
|
export const COMMIT_TIMEOUT_MINUTES = 10;
|
|
@@ -66,12 +70,15 @@ export const COMMIT_ENV = {
|
|
|
66
70
|
env: "CHANT_COMMIT_ENV",
|
|
67
71
|
mergeBase: "CHANT_COMMIT_MERGE_BASE",
|
|
68
72
|
commandEnv: "CHANT_COMMIT_COMMAND_ENV",
|
|
73
|
+
commentArg: "CHANT_COMMIT_COMMENT_ARG",
|
|
69
74
|
};
|
|
70
75
|
/** The variable the command reads the pull request's number from (#4724), such as for a default name. */
|
|
71
76
|
export const COMMIT_PR_ENV = "CHANT_COMMIT_PR";
|
|
72
77
|
/** GitLab starts no pipeline on a note: a pipeline of the default branch started with these runs a comment commit job. */
|
|
73
78
|
export const GITLAB_COMMIT_PR_VAR = "CHANT_COMMIT_PR";
|
|
74
79
|
export const GITLAB_COMMIT_WORD_VAR = "CHANT_COMMIT";
|
|
80
|
+
/** With `commentArg` (#4820): the argument, as the comment would give it after the word. */
|
|
81
|
+
export const GITLAB_COMMIT_ARG_VAR = "CHANT_COMMIT_ARG";
|
|
75
82
|
/** Where the jobs keep the decision, the exit code and the patch, from the job's directory. */
|
|
76
83
|
export const COMMIT_DIR = ".chant/commit";
|
|
77
84
|
/** The local ref the checkout fetches a pull request's head into. */
|
|
@@ -165,6 +172,22 @@ export function resolveCommitSpec(name, spec, product = "chant") {
|
|
|
165
172
|
const tokens = commandEnv.filter((v) => FORGE_TOKEN_VARS.includes(v) || v === spec.tokenEnv || v.startsWith("CHANT_COMMIT_"));
|
|
166
173
|
if (tokens.length > 0)
|
|
167
174
|
throw new AgentError(`${where}: commandEnv may not pass ${tokens.join(", ")}: the command never sees a forge token or the job's own settings`);
|
|
175
|
+
let commentArg;
|
|
176
|
+
if (spec.commentArg !== undefined) {
|
|
177
|
+
const a = spec.commentArg;
|
|
178
|
+
if (spec.on !== "comment")
|
|
179
|
+
throw new AgentError(`${where}: commentArg is for the comment trigger, which has a comment to read it from`);
|
|
180
|
+
if (typeof a.pattern !== "string" || !a.pattern.startsWith("^") || !a.pattern.endsWith("$") || a.pattern.length > 200) {
|
|
181
|
+
throw new AgentError(`${where}: commentArg's pattern is a regular expression's source anchored with ^ and $, such as "^[a-z0-9]+(?:[-_][a-z0-9]+)*$"`);
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
new RegExp(a.pattern);
|
|
185
|
+
}
|
|
186
|
+
catch (e) {
|
|
187
|
+
throw new AgentError(`${where}: commentArg's pattern is not a regular expression (${e.message})`);
|
|
188
|
+
}
|
|
189
|
+
commentArg = { pattern: a.pattern, position: intIn(`${where}: commentArg's position`, a.position, 1, spec.command.length) };
|
|
190
|
+
}
|
|
168
191
|
return {
|
|
169
192
|
name,
|
|
170
193
|
on: spec.on,
|
|
@@ -181,8 +204,28 @@ export function resolveCommitSpec(name, spec, product = "chant") {
|
|
|
181
204
|
jobToken: spec.jobToken === true,
|
|
182
205
|
after: [...after],
|
|
183
206
|
commandEnv: [...new Set(commandEnv)],
|
|
207
|
+
...(commentArg ? { commentArg } : {}),
|
|
184
208
|
};
|
|
185
209
|
}
|
|
210
|
+
/** The words that take an argument, for {@link parseProductComment}: this job's word, when it has `commentArg`. */
|
|
211
|
+
function commentArgPatterns(s) {
|
|
212
|
+
const word = s.comment?.split(" ")[1];
|
|
213
|
+
return word && s.commentArg ? { [word]: new RegExp(s.commentArg.pattern) } : {};
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The argv the command runs (#4820): `command`, with the comment's argument
|
|
217
|
+
* at `commentArg.position` when there is one. An argument the settings do
|
|
218
|
+
* not take, or one off its pattern, throws.
|
|
219
|
+
*/
|
|
220
|
+
export function commitArgv(s, arg) {
|
|
221
|
+
if (arg === undefined)
|
|
222
|
+
return [...s.command];
|
|
223
|
+
if (!s.commentArg)
|
|
224
|
+
throw new AgentError("this commit job takes no argument after its word");
|
|
225
|
+
if (!COMMIT_COMMENT_ARG.test(arg) || !new RegExp(s.commentArg.pattern).test(arg))
|
|
226
|
+
throw new AgentError(`${JSON.stringify(arg)} is not a name this commit job takes`);
|
|
227
|
+
return [...s.command.slice(0, s.commentArg.position), arg, ...s.command.slice(s.commentArg.position)];
|
|
228
|
+
}
|
|
186
229
|
/** The settings as the generated jobs' variables. */
|
|
187
230
|
export function commitSettingsEnv(s) {
|
|
188
231
|
return {
|
|
@@ -199,6 +242,7 @@ export function commitSettingsEnv(s) {
|
|
|
199
242
|
[COMMIT_ENV.env]: s.env,
|
|
200
243
|
...(s.mergeBase ? { [COMMIT_ENV.mergeBase]: "1" } : {}),
|
|
201
244
|
...(s.commandEnv.length > 0 ? { [COMMIT_ENV.commandEnv]: JSON.stringify(s.commandEnv) } : {}),
|
|
245
|
+
...(s.commentArg ? { [COMMIT_ENV.commentArg]: JSON.stringify(s.commentArg) } : {}),
|
|
202
246
|
};
|
|
203
247
|
}
|
|
204
248
|
/** The settings back from the job's variables, checked as {@link resolveCommitSpec} checks a spec. */
|
|
@@ -234,6 +278,19 @@ export function commitSettingsFromEnv(env, product = "chant") {
|
|
|
234
278
|
const maxRuns = num(COMMIT_ENV.maxRuns);
|
|
235
279
|
const timeout = num(COMMIT_ENV.timeout);
|
|
236
280
|
const guarded = list(COMMIT_ENV.guarded);
|
|
281
|
+
let commentArg;
|
|
282
|
+
const argText = env[COMMIT_ENV.commentArg];
|
|
283
|
+
if (argText) {
|
|
284
|
+
try {
|
|
285
|
+
const parsed = JSON.parse(argText);
|
|
286
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
287
|
+
throw new Error("not an object");
|
|
288
|
+
commentArg = parsed;
|
|
289
|
+
}
|
|
290
|
+
catch (e) {
|
|
291
|
+
throw new AgentError(`${COMMIT_ENV.commentArg} is a JSON object with pattern and position (${e.message})`);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
237
294
|
const spec = {
|
|
238
295
|
on: env[COMMIT_ENV.on],
|
|
239
296
|
...(env[COMMIT_ENV.comment] ? { comment: env[COMMIT_ENV.comment] } : {}),
|
|
@@ -247,6 +304,7 @@ export function commitSettingsFromEnv(env, product = "chant") {
|
|
|
247
304
|
...(env[COMMIT_ENV.env] ? { env: env[COMMIT_ENV.env] } : {}),
|
|
248
305
|
...(env[COMMIT_ENV.mergeBase] === "1" ? { mergeBase: true } : {}),
|
|
249
306
|
...(list(COMMIT_ENV.commandEnv) ? { commandEnv: list(COMMIT_ENV.commandEnv) } : {}),
|
|
307
|
+
...(commentArg ? { commentArg } : {}),
|
|
250
308
|
};
|
|
251
309
|
return resolveCommitSpec(name, spec, product);
|
|
252
310
|
}
|
|
@@ -288,7 +346,8 @@ export function commitRequestFromRun(words, s, env, event) {
|
|
|
288
346
|
const word = s.comment?.split(" ")[1];
|
|
289
347
|
if (gitlab) {
|
|
290
348
|
pr = Number(env[GITLAB_COMMIT_PR_VAR]);
|
|
291
|
-
|
|
349
|
+
const arg = env[GITLAB_COMMIT_ARG_VAR];
|
|
350
|
+
body = env[GITLAB_COMMIT_WORD_VAR] === word ? `${s.comment}${arg ? ` ${arg}` : ""}` : `/${words.product} ${env[GITLAB_COMMIT_WORD_VAR] ?? ""}`;
|
|
292
351
|
user = env.GITLAB_USER_LOGIN;
|
|
293
352
|
}
|
|
294
353
|
else {
|
|
@@ -301,12 +360,12 @@ export function commitRequestFromRun(words, s, env, event) {
|
|
|
301
360
|
return { refused: "the run names no pull request" };
|
|
302
361
|
if (typeof user !== "string" || !LOGIN.test(user))
|
|
303
362
|
return { refused: "the run names nobody who asked" };
|
|
304
|
-
const parsed = parseProductComment(words, body, env);
|
|
363
|
+
const parsed = parseProductComment(words, body, env, commentArgPatterns(s));
|
|
305
364
|
if (parsed?.kind === "refused")
|
|
306
365
|
return { refused: parsed.reason };
|
|
307
366
|
if (parsed?.kind !== "commit" || parsed.word !== word)
|
|
308
367
|
return { refused: `the comment is not ${s.comment}` };
|
|
309
|
-
return { pr, user };
|
|
368
|
+
return { pr, user, ...(parsed.arg !== undefined ? { arg: parsed.arg } : {}) };
|
|
310
369
|
}
|
|
311
370
|
/**
|
|
312
371
|
* GitLab, a branch pipeline (a check that runs on push): the merge request
|
|
@@ -366,6 +425,8 @@ export function readCommitDecision(dir) {
|
|
|
366
425
|
return undefined;
|
|
367
426
|
if (d.baseSha !== undefined && !SHA.test(d.baseSha))
|
|
368
427
|
return undefined;
|
|
428
|
+
if (d.arg !== undefined && !(typeof d.arg === "string" && COMMIT_COMMENT_ARG.test(d.arg)))
|
|
429
|
+
return undefined;
|
|
369
430
|
return d;
|
|
370
431
|
}
|
|
371
432
|
catch {
|
|
@@ -456,7 +517,7 @@ export async function prepareCommitRun(i) {
|
|
|
456
517
|
const req = await resolveCommitRequest(i.words, s, i.env, i.event, i.forge);
|
|
457
518
|
if ("refused" in req)
|
|
458
519
|
return no(req.refused, s.on === "check" ? "skipped" : "refused");
|
|
459
|
-
const who = { pr: req.pr, ...(req.user ? { user: req.user } : {}) };
|
|
520
|
+
const who = { pr: req.pr, ...(req.user ? { user: req.user } : {}), ...(req.arg !== undefined ? { arg: req.arg } : {}) };
|
|
460
521
|
if (req.user && i.forge?.userCanWrite && !(await i.forge.userCanWrite(req.user)))
|
|
461
522
|
return no(`${req.user} cannot write to the repository, so ${s.name} does not run for them`, "refused", who);
|
|
462
523
|
let sha;
|
|
@@ -576,6 +637,14 @@ export async function runCommit(i) {
|
|
|
576
637
|
writeFileSync(rcFile, "refused\n");
|
|
577
638
|
return { rc: "refused", changed: false };
|
|
578
639
|
}
|
|
640
|
+
let argv;
|
|
641
|
+
try {
|
|
642
|
+
argv = commitArgv(i.settings, decision.arg);
|
|
643
|
+
}
|
|
644
|
+
catch {
|
|
645
|
+
writeFileSync(rcFile, "refused\n");
|
|
646
|
+
return { rc: "refused", changed: false };
|
|
647
|
+
}
|
|
579
648
|
i.git(["worktree", "add", "--detach", "--force", i.workDir, decision.sha]);
|
|
580
649
|
if (i.settings.mergeBase) {
|
|
581
650
|
if (!decision.baseSha) {
|
|
@@ -592,7 +661,7 @@ export async function runCommit(i) {
|
|
|
592
661
|
}
|
|
593
662
|
}
|
|
594
663
|
const env = commitCommandEnv(i.env, i.checkout, { names: i.settings.commandEnv, ...(decision.pr !== undefined ? { pr: decision.pr } : {}) });
|
|
595
|
-
const out = await i.runCommand(
|
|
664
|
+
const out = await i.runCommand(argv, { cwd: i.workDir, env, timeoutMs: i.settings.timeout * 60000 });
|
|
596
665
|
const rc = out.timedOut ? "timeout" : out.exitCode === null ? "no-exit" : String(out.exitCode);
|
|
597
666
|
writeFileSync(rcFile, `${rc}\n`);
|
|
598
667
|
if (out.output)
|
|
@@ -602,6 +671,46 @@ export async function runCommit(i) {
|
|
|
602
671
|
writeFileSync(join(i.dir, COMMIT_PATCH_FILE), patch);
|
|
603
672
|
return { rc, changed: patch.length > 0 };
|
|
604
673
|
}
|
|
674
|
+
// ── the harness's BREAK switch (#4836) ─────────────────────────────────────
|
|
675
|
+
/**
|
|
676
|
+
* The push job's variable that turns one of land's checks off, for a BREAK
|
|
677
|
+
* arm of a product's e2e harness scenario: a comma list of
|
|
678
|
+
* {@link COMMIT_HARNESS_CHECKS}. It proves the check matters: with it off,
|
|
679
|
+
* the scenario's expectations must fail. Read only by `chant commit land`,
|
|
680
|
+
* and refused anywhere but chant's harness ({@link commitHarnessBreaks}).
|
|
681
|
+
* The command never sees it: `commandEnv` refuses every `CHANT_COMMIT_*`.
|
|
682
|
+
*/
|
|
683
|
+
export const COMMIT_HARNESS_BREAK_ENV = "CHANT_COMMIT_HARNESS_BREAK";
|
|
684
|
+
/**
|
|
685
|
+
* The checks the switch may turn off. `paths`: a change outside `allowed`
|
|
686
|
+
* and `allowedFiles` lands (a guarded path is still refused). `moved-base`:
|
|
687
|
+
* with `mergeBase`, a base that moved while the command ran lands the merge
|
|
688
|
+
* of the tip the command ran on.
|
|
689
|
+
*/
|
|
690
|
+
export const COMMIT_HARNESS_CHECKS = ["paths", "moved-base"];
|
|
691
|
+
/** The forge a job of chant's e2e harness reaches, `HARNESS_HOSTS.forgejo` (./e2e-harness/stack.ts). */
|
|
692
|
+
export const COMMIT_HARNESS_FORGE = "http://forgejo:3000";
|
|
693
|
+
const HARNESS_WORDS = { paths: "the path check", "moved-base": "the moved-base check" };
|
|
694
|
+
/**
|
|
695
|
+
* The checks {@link COMMIT_HARNESS_BREAK_ENV} turns off, or why it is
|
|
696
|
+
* refused. It is read only in a BREAK arm of chant's e2e harness: `BREAK=1`,
|
|
697
|
+
* not GitLab, and a job whose `GITHUB_SERVER_URL` is the harness's Forgejo,
|
|
698
|
+
* {@link COMMIT_HARNESS_FORGE}. Unset or empty, no check is off.
|
|
699
|
+
*/
|
|
700
|
+
export function commitHarnessBreaks(env) {
|
|
701
|
+
const raw = env[COMMIT_HARNESS_BREAK_ENV]?.trim() ?? "";
|
|
702
|
+
if (raw === "")
|
|
703
|
+
return { checks: [] };
|
|
704
|
+
const server = env.GITHUB_SERVER_URL?.replace(/\/+$/, "");
|
|
705
|
+
if (env.BREAK !== "1" || env.GITLAB_CI === "true" || server !== COMMIT_HARNESS_FORGE) {
|
|
706
|
+
return { refused: `${COMMIT_HARNESS_BREAK_ENV} is read only in a BREAK arm of chant's e2e harness (BREAK=1 on the harness's Forgejo, ${COMMIT_HARNESS_FORGE}), and this job is not one` };
|
|
707
|
+
}
|
|
708
|
+
const named = raw.split(",").map((c) => c.trim()).filter((c) => c !== "");
|
|
709
|
+
const bad = named.filter((c) => !COMMIT_HARNESS_CHECKS.includes(c));
|
|
710
|
+
if (bad.length > 0)
|
|
711
|
+
return { refused: `${COMMIT_HARNESS_BREAK_ENV} names ${bad.join(", ")}; the checks it turns off are ${COMMIT_HARNESS_CHECKS.join(" and ")}` };
|
|
712
|
+
return { checks: [...new Set(named)] };
|
|
713
|
+
}
|
|
605
714
|
let activeRefusalReply;
|
|
606
715
|
/** Set the refusal reply for this process (a product's bin, once, as it sets its words). Returns the one it replaced. */
|
|
607
716
|
export function setCommitRefusalReply(reply) {
|
|
@@ -672,18 +781,31 @@ export async function landCommitChange(i) {
|
|
|
672
781
|
if ("refused" in req)
|
|
673
782
|
return finish({ result: s.on === "check" ? "skipped" : "refused", reason: req.refused });
|
|
674
783
|
({ pr, user } = req);
|
|
784
|
+
// #4836: a BREAK arm of the harness may turn a check off; anywhere else the switch fails the land.
|
|
785
|
+
const harness = commitHarnessBreaks(i.env);
|
|
786
|
+
if ("refused" in harness)
|
|
787
|
+
return finish({ result: "failed", reason: harness.refused }, `${harness.refused}, so nothing was pushed.`);
|
|
788
|
+
const off = new Set(harness.checks);
|
|
675
789
|
const decision = readCommitDecision(i.dir);
|
|
676
|
-
if (!decision || decision.name !== s.name || decision.on !== s.on || (decision.pr !== undefined && decision.pr !== pr)) {
|
|
790
|
+
if (!decision || decision.name !== s.name || decision.on !== s.on || (decision.pr !== undefined && decision.pr !== pr) || (decision.go && decision.arg !== req.arg)) {
|
|
677
791
|
return finish({ result: "failed", reason: "the commit job left no decision this job can read" }, "the commit job left nothing to land, so nothing was pushed.");
|
|
678
792
|
}
|
|
679
793
|
if (!decision.go)
|
|
680
794
|
return finish({ result: decision.stop ?? "refused", reason: decision.reason ?? "refused" }, `${decision.reason ?? `${s.name} did not run`}, so nothing was pushed.`);
|
|
795
|
+
// What ran, as the replies and the commit name it: the command with the comment's argument (#4820).
|
|
796
|
+
let ranArgv;
|
|
797
|
+
try {
|
|
798
|
+
ranArgv = commitArgv(s, req.arg).join(" ");
|
|
799
|
+
}
|
|
800
|
+
catch (e) {
|
|
801
|
+
return finish({ result: "refused", reason: errText(e) }, `${errText(e)}, so nothing was pushed.`);
|
|
802
|
+
}
|
|
681
803
|
const rc = readSmall(join(i.dir, COMMIT_RC_FILE))?.trim() ?? "";
|
|
682
804
|
if (rc === "conflict") {
|
|
683
805
|
return finish({ result: "refused", reason: `merging ${decision.base ?? "the base"} into the head conflicts` }, `merging ${code(decision.base ?? "the base")} into the ${what} conflicts, so ${s.name} did not run and nothing was pushed. Resolve the conflict on the branch.`);
|
|
684
806
|
}
|
|
685
807
|
if (rc === "timeout")
|
|
686
|
-
return finish({ result: "stopped", reason: `the command passed its ${s.timeout} minute limit` }, `${code(
|
|
808
|
+
return finish({ result: "stopped", reason: `the command passed its ${s.timeout} minute limit` }, `${code(ranArgv)} was stopped at its ${s.timeout} minute limit, so nothing was pushed.`);
|
|
687
809
|
if (rc !== "0" && /^[0-9]+$/.test(rc) && i.refusalReply) {
|
|
688
810
|
let said;
|
|
689
811
|
try {
|
|
@@ -696,7 +818,7 @@ export async function landCommitChange(i) {
|
|
|
696
818
|
return finish({ result: "refused", reason: `the command refused, exiting ${rc}` }, `${said.trim()} Nothing was pushed.`);
|
|
697
819
|
}
|
|
698
820
|
if (rc !== "0")
|
|
699
|
-
return finish({ result: "failed", reason: `the command exited ${rc || "with no code"}` }, `${code(
|
|
821
|
+
return finish({ result: "failed", reason: `the command exited ${rc || "with no code"}` }, `${code(ranArgv)} stopped with ${rc ? `exit code ${rc}` : "no exit code"}, so nothing was pushed. The commit job's log has its output.`);
|
|
700
822
|
const head = await i.forge.pullRequestHead?.(pr).catch(() => undefined);
|
|
701
823
|
if (!head || !head.open || !head.sameRepo || !branchOk(head.branch))
|
|
702
824
|
return finish({ result: "refused", reason: `#${pr} is not an open ${what} from this repository` }, `#${pr} is not an open ${what} from this repository, so nothing was pushed.`);
|
|
@@ -721,8 +843,12 @@ export async function landCommitChange(i) {
|
|
|
721
843
|
catch (e) {
|
|
722
844
|
return finish({ result: "failed", reason: `could not fetch ${target} (${errText(e)})` });
|
|
723
845
|
}
|
|
724
|
-
if (baseSha !== decision.baseSha)
|
|
725
|
-
|
|
846
|
+
if (baseSha !== decision.baseSha) {
|
|
847
|
+
if (!off.has("moved-base"))
|
|
848
|
+
return finish({ result: s.on === "check" ? "skipped" : "refused", reason: "the base moved" }, `${code(target)} moved while ${s.name} ran, so nothing was pushed. Ask again.`);
|
|
849
|
+
// BREAK: land the merge of the tip the command ran on, which the check exists to stop.
|
|
850
|
+
baseSha = decision.baseSha;
|
|
851
|
+
}
|
|
726
852
|
}
|
|
727
853
|
// The limit and the approval again, on this job's own read.
|
|
728
854
|
const earlier = (await i.readRuns().catch(() => [])).filter((r) => Date.parse(r.started) < Date.parse(started));
|
|
@@ -739,7 +865,7 @@ export async function landCommitChange(i) {
|
|
|
739
865
|
if (approved && s.on === "check")
|
|
740
866
|
return finish({ result: "refused", reason: `the plan of ${sha.slice(0, 8)} is approved by ${approved}, and a commit would void that approval` });
|
|
741
867
|
const patch = join(i.dir, COMMIT_PATCH_FILE);
|
|
742
|
-
const nothing = () => finish({ result: s.on === "check" ? "skipped" : "refused", reason: "the command changed nothing" }, `${code(
|
|
868
|
+
const nothing = () => finish({ result: s.on === "check" ? "skipped" : "refused", reason: "the command changed nothing" }, `${code(ranArgv)} changed nothing, so nothing was pushed.`);
|
|
743
869
|
if (!existsSync(patch) || statSync(patch).size === 0)
|
|
744
870
|
return nothing();
|
|
745
871
|
let paths;
|
|
@@ -764,13 +890,15 @@ export async function landCommitChange(i) {
|
|
|
764
890
|
}
|
|
765
891
|
if (paths.length === 0)
|
|
766
892
|
return nothing();
|
|
767
|
-
const
|
|
893
|
+
const refusedPaths = commitRefusedPaths(paths, s);
|
|
894
|
+
const forbidden = refusedPaths.forbidden;
|
|
895
|
+
const outside = off.has("paths") ? [] : refusedPaths.outside;
|
|
768
896
|
if (forbidden.length > 0 || outside.length > 0) {
|
|
769
897
|
const bad = [...new Set([...forbidden, ...outside])];
|
|
770
|
-
return finish({ result: "refused", reason: `the change touches ${bad.join(", ")}`, paths }, `${code(
|
|
898
|
+
return finish({ result: "refused", reason: `the change touches ${bad.join(", ")}`, paths }, `${code(ranArgv)} changed ${bad.map(code).join(", ")}, which ${s.name} may not change (it may change ${[...s.allowed, ...s.allowedFiles].map(code).join(", ")}, and never CI, chant's settings and state, code owners, agent instructions or git settings), so nothing was pushed.`);
|
|
771
899
|
}
|
|
772
|
-
const title = s.on === "comment" ? `${s.comment} asked for by ${user} on ${what} #${pr}` : `${s.name} after the check found something at ${sha.slice(0, 8)}`;
|
|
773
|
-
const ran = baseSha ? `Merged ${decision.base} at ${baseSha.slice(0, 12)} into ${sha.slice(0, 12)}, then ran ${
|
|
900
|
+
const title = s.on === "comment" ? `${s.comment}${req.arg !== undefined ? ` ${req.arg}` : ""} asked for by ${user} on ${what} #${pr}` : `${s.name} after the check found something at ${sha.slice(0, 8)}`;
|
|
901
|
+
const ran = baseSha ? `Merged ${decision.base} at ${baseSha.slice(0, 12)} into ${sha.slice(0, 12)}, then ran ${ranArgv}.` : `Ran ${ranArgv} on ${sha.slice(0, 12)}.`;
|
|
774
902
|
const message = [title, "", ran, "", ...(user ? [`Requested-by: ${user}`] : []), `${COMMIT_TRAILER}: ${s.name}`, ""].join("\n");
|
|
775
903
|
let commitSha;
|
|
776
904
|
try {
|
|
@@ -787,8 +915,9 @@ export async function landCommitChange(i) {
|
|
|
787
915
|
catch (e) {
|
|
788
916
|
return finish({ result: "failed", reason: `could not push to ${head.branch} (${errText(e)})`, commit: commitSha }, `could not push to ${code(head.branch)} (${errText(e)}), so nothing was pushed.`);
|
|
789
917
|
}
|
|
918
|
+
const breakNote = off.size > 0 ? ` (BREAK: ${[...off].map((c) => HARNESS_WORDS[c]).join(" and ")} ${off.size === 1 ? "was" : "were"} off)` : "";
|
|
790
919
|
const voided = approved ? ` The plan of ${code(sha.slice(0, 8))} was approved by ${approved}; the new commit is planned again and needs approval again.` : "";
|
|
791
|
-
return finish({ result: "pushed", reason: `pushed ${commitSha} to ${head.branch}`, commit: commitSha, paths, ...(approved ? { approvalVoided: approved } : {}) }, `pushed ${code(commitSha.slice(0, 8))} to ${code(head.branch)}${user ? ` for ${user}` : ""}, from ${baseSha ? `a merge of ${code(decision.base)} and ` : ""}${code(
|
|
920
|
+
return finish({ result: "pushed", reason: `pushed ${commitSha} to ${head.branch}${breakNote}`, commit: commitSha, paths, ...(approved ? { approvalVoided: approved } : {}) }, `pushed ${code(commitSha.slice(0, 8))} to ${code(head.branch)}${user ? ` for ${user}` : ""}, from ${baseSha ? `a merge of ${code(decision.base)} and ` : ""}${code(ranArgv)}, changing ${paths.map(code).join(", ")}.${voided} Nothing was applied, approved or merged.${breakNote}`);
|
|
792
921
|
}
|
|
793
922
|
// ── what the generated jobs run ────────────────────────────────────────────
|
|
794
923
|
/** The three commands of the commit jobs, through the product's bin. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-own-jobs.d.ts","sourceRoot":"","sources":["../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AG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAIpK"}
|
package/dist/ci-own-jobs.js
CHANGED
|
@@ -21,9 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { readFileSync } from "node:fs";
|
|
23
23
|
import { emitYAMLEntry, parseYAMLDocument } from "./yaml.js";
|
|
24
|
-
import { NEXT_RELEASE } from "./release-floors.js";
|
|
25
24
|
/** The first chant with `mergeOwnJobs`, `keepOwnJobs` and `chant build --own-jobs` / `--keep-own-jobs` (#4769). Products feature-detect on it. */
|
|
26
|
-
export const OWN_JOBS_FLOOR =
|
|
25
|
+
export const OWN_JOBS_FLOOR = "0.124.77";
|
|
27
26
|
export const OWN_JOBS_FORGES = ["github", "gitlab", "forgejo"];
|
|
28
27
|
/** The default line above the own jobs. A product passes its own as `line`. */
|
|
29
28
|
export const OWN_JOBS_LINE = "# Your own jobs, kept as they are when chant writes this file again.";
|
|
@@ -19,9 +19,10 @@
|
|
|
19
19
|
* command's lifetime. Every renderer here reads {@link activeProductWords}
|
|
20
20
|
* when it is given none.
|
|
21
21
|
*
|
|
22
|
-
* This module imports nothing
|
|
23
|
-
* pr-loop-bundle.test.ts) carries it.
|
|
22
|
+
* This module imports nothing at run time (the one import is a type): the
|
|
23
|
+
* pull request loop bundle (pr-loop.ts, pr-loop-bundle.test.ts) carries it.
|
|
24
24
|
*/
|
|
25
|
+
import type { NotifyMessageWords } from "./notify.js";
|
|
25
26
|
/** The stages a product names: the status context after the prefix, and the word in the note. */
|
|
26
27
|
export type CiProductStage = "plan" | "apply" | "record" | "check" | "drift" | "lock" | "approval" | "control";
|
|
27
28
|
/** Every stage slot, in the order {@link assertProductWords} reports them. */
|
|
@@ -132,12 +133,15 @@ export interface CiProductNotifyWordsInput {
|
|
|
132
133
|
wave?: string;
|
|
133
134
|
/** The signed webhook's header prefix. Default `x-<product>`, so chant's stays `x-chant`. */
|
|
134
135
|
headers?: string;
|
|
136
|
+
/** The labels, re-run button and other words of chant's Slack and Teams messages (#4818). Default: chant's. */
|
|
137
|
+
message?: NotifyMessageWords;
|
|
135
138
|
}
|
|
136
139
|
/** The notify slots, filled. */
|
|
137
140
|
export interface CiProductNotifyWords {
|
|
138
141
|
source: string;
|
|
139
142
|
wave: string;
|
|
140
143
|
headers: string;
|
|
144
|
+
message?: NotifyMessageWords;
|
|
141
145
|
}
|
|
142
146
|
/** chant's own wave label in a notify summary. */
|
|
143
147
|
export declare const CHANT_NOTIFY_WAVE_TEMPLATE = "wave {k} ({name}) of {spec}";
|
|
@@ -295,10 +299,17 @@ export type ParsedProductComment =
|
|
|
295
299
|
| {
|
|
296
300
|
kind: "commit";
|
|
297
301
|
word: string;
|
|
302
|
+
arg?: string;
|
|
298
303
|
} | {
|
|
299
304
|
kind: "refused";
|
|
300
305
|
reason: string;
|
|
301
306
|
};
|
|
307
|
+
/**
|
|
308
|
+
* The one argument a commit word may take after it (#4820), on top of the
|
|
309
|
+
* product's own pattern: a plain name, no leading dash, no path or shell
|
|
310
|
+
* syntax, at most 100 characters.
|
|
311
|
+
*/
|
|
312
|
+
export declare const COMMIT_COMMENT_ARG: RegExp;
|
|
302
313
|
/** The longest ask an agent comment may carry. */
|
|
303
314
|
export declare const PRODUCT_COMMENT_ASK_MAX = 2000;
|
|
304
315
|
/**
|
|
@@ -309,9 +320,12 @@ export declare const PRODUCT_COMMENT_ASK_MAX = 2000;
|
|
|
309
320
|
* comment is untrusted input: only a member path checked against a pattern
|
|
310
321
|
* with no shell syntax, and a wave number, leave this function.
|
|
311
322
|
*
|
|
312
|
-
* `env` turns on an alias whose `when` variable is `1` there.
|
|
323
|
+
* `env` turns on an alias whose `when` variable is `1` there. `commitArgs`
|
|
324
|
+
* names the commit words that take one argument after them (#4820), each
|
|
325
|
+
* with the pattern it must match; it must also match
|
|
326
|
+
* {@link COMMIT_COMMENT_ARG}. Any other commit word takes nothing.
|
|
313
327
|
*/
|
|
314
|
-
export declare function parseProductComment(words: CiProductWords, body: unknown, env?: Record<string, string | undefined
|
|
328
|
+
export declare function parseProductComment(words: CiProductWords, body: unknown, env?: Record<string, string | undefined>, commitArgs?: Readonly<Record<string, RegExp>>): ParsedProductComment | undefined;
|
|
315
329
|
/**
|
|
316
330
|
* The variables the generated action job (#4654) hands the product's action
|
|
317
331
|
* verb: the comment that started it, on a comment, and the dispatch's two
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-product-words.d.ts","sourceRoot":"","sources":["../src/ci-product-words.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,iGAAiG;AACjG,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAE/G,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAAiF,CAAC;AAEzI;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEpG,eAAO,MAAM,mBAAmB,EAAE,SAAS,gBAAgB,EAAqE,CAAC;AAEjI;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,cAAc,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,SAAS,GAAG,cAAc,CAAC;AAEzE,eAAO,MAAM,sBAAsB,EAAE,SAAS,kBAAkB,EAA4C,CAAC;AAE7G,qGAAqG;AACrG,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,8GAA8G;IAC9G,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,uFAAuF;AACvF,MAA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C,UAAU,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,GAChD,oBAAoB,GAAG,SAAS,CAqGlC;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;aAAK,OAAO,EAAE,sBAAsB;aAAE,MAAM,EAAE,qBAAqB;aAAE,MAAM,EAAE,cAAc;CAAW,CAAC;AAEtI,0HAA0H;AAC1H,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AAExD,sGAAsG;AACtG,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3J;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,oBAAoB,CAiBzH"}
|
package/dist/ci-product-words.js
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* command's lifetime. Every renderer here reads {@link activeProductWords}
|
|
20
20
|
* when it is given none.
|
|
21
21
|
*
|
|
22
|
-
* This module imports nothing
|
|
23
|
-
* pr-loop-bundle.test.ts) carries it.
|
|
22
|
+
* This module imports nothing at run time (the one import is a type): the
|
|
23
|
+
* pull request loop bundle (pr-loop.ts, pr-loop-bundle.test.ts) carries it.
|
|
24
24
|
*/
|
|
25
25
|
/** Every stage slot, in the order {@link assertProductWords} reports them. */
|
|
26
26
|
export const CI_PRODUCT_STAGES = ["plan", "apply", "record", "check", "drift", "lock", "approval", "control"];
|
|
@@ -74,6 +74,7 @@ export function resolveProductWords(input = {}) {
|
|
|
74
74
|
source: input.notify?.source ?? product,
|
|
75
75
|
wave: input.notify?.wave ?? CHANT_NOTIFY_WAVE_TEMPLATE,
|
|
76
76
|
headers: input.notify?.headers ?? `x-${product}`,
|
|
77
|
+
...(input.notify?.message ? { message: input.notify.message } : {}),
|
|
77
78
|
},
|
|
78
79
|
};
|
|
79
80
|
}
|
|
@@ -286,6 +287,12 @@ const TARGET = /^[A-Za-z0-9_][A-Za-z0-9_.:\/\[\]"*@=+$,-]{0,499}$/;
|
|
|
286
287
|
* No leading dash, no spaces, no shell or glob syntax.
|
|
287
288
|
*/
|
|
288
289
|
const ACTION = /^[A-Za-z_][A-Za-z0-9_.\[\]"-]{0,299}$/;
|
|
290
|
+
/**
|
|
291
|
+
* The one argument a commit word may take after it (#4820), on top of the
|
|
292
|
+
* product's own pattern: a plain name, no leading dash, no path or shell
|
|
293
|
+
* syntax, at most 100 characters.
|
|
294
|
+
*/
|
|
295
|
+
export const COMMIT_COMMENT_ARG = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,99}$/;
|
|
289
296
|
/** The longest ask an agent comment may carry. */
|
|
290
297
|
export const PRODUCT_COMMENT_ASK_MAX = 2000;
|
|
291
298
|
/** Commands a comment never runs, named in the reply so nobody waits on them. */
|
|
@@ -298,9 +305,12 @@ const NEVER = new Set(["approve", "override", "force-unlock", "unlock-state", "i
|
|
|
298
305
|
* comment is untrusted input: only a member path checked against a pattern
|
|
299
306
|
* with no shell syntax, and a wave number, leave this function.
|
|
300
307
|
*
|
|
301
|
-
* `env` turns on an alias whose `when` variable is `1` there.
|
|
308
|
+
* `env` turns on an alias whose `when` variable is `1` there. `commitArgs`
|
|
309
|
+
* names the commit words that take one argument after them (#4820), each
|
|
310
|
+
* with the pattern it must match; it must also match
|
|
311
|
+
* {@link COMMIT_COMMENT_ARG}. Any other commit word takes nothing.
|
|
302
312
|
*/
|
|
303
|
-
export function parseProductComment(words, body, env = {}) {
|
|
313
|
+
export function parseProductComment(words, body, env = {}, commitArgs = {}) {
|
|
304
314
|
if (typeof body !== "string")
|
|
305
315
|
return undefined;
|
|
306
316
|
let text = body.trim();
|
|
@@ -356,8 +366,18 @@ export function parseProductComment(words, body, env = {}) {
|
|
|
356
366
|
case "lock":
|
|
357
367
|
case "unlock":
|
|
358
368
|
return parts.length === 2 ? { kind: command } : { kind: "refused", reason: `${line} takes nothing after it` };
|
|
359
|
-
case "commit":
|
|
360
|
-
|
|
369
|
+
case "commit": {
|
|
370
|
+
if (parts.length === 2)
|
|
371
|
+
return { kind: "commit", word: typed };
|
|
372
|
+
const pattern = Object.prototype.hasOwnProperty.call(commitArgs, typed) ? commitArgs[typed] : undefined;
|
|
373
|
+
if (pattern === undefined)
|
|
374
|
+
return { kind: "refused", reason: `${line} takes nothing after it` };
|
|
375
|
+
const arg = parts[2];
|
|
376
|
+
if (parts.length !== 3 || !COMMIT_COMMENT_ARG.test(arg) || !pattern.test(arg)) {
|
|
377
|
+
return { kind: "refused", reason: `${line} takes nothing, or one name after it matching \`${pattern.source}\`` };
|
|
378
|
+
}
|
|
379
|
+
return { kind: "commit", word: typed, arg };
|
|
380
|
+
}
|
|
361
381
|
case "agent": {
|
|
362
382
|
const ask = text.slice(`${prefix} ${typed}`.length).trim();
|
|
363
383
|
if (ask === "")
|
package/dist/ci-product.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type { ProductWaveHook } from "./op/op-waves-after-plan.js";
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const CI_PRODUCT_FLOOR = "0.124.55";
|
|
21
21
|
export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productActionFromEnv, PRODUCT_ACTION_ENV, PRODUCT_ACTION_EVENT_FLAG, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, type ApproveLineInput, type CiProductAlias, type CiProductApplyMode, type CiProductApproval, type CiProductCommand, type CiProductNotifyWords, type CiProductNotifyWordsInput, type CiProductStage, type CiProductWords, type CiProductWordsInput, type OverrideLineInput, type ParsedProductComment, type ProductActionRequest, } from "./ci-product-words.js";
|
|
22
|
-
export { driftNotifyFields, productNotifySource, productNotifyWords, productSendOptions, type DriftNotifyInput } from "./notify-product.js";
|
|
22
|
+
export { driftNotifyFields, NOTIFY_MESSAGE_WORDS_FLOOR, productNotifySource, productNotifyWords, productSendOptions, type DriftNotifyInput } from "./notify-product.js";
|
|
23
23
|
/** The first chant with `chant notify relay` and the notify relay buttons (#4611). */
|
|
24
24
|
export declare const NOTIFY_RELAY_FLOOR = "0.124.55";
|
|
25
25
|
/**
|
package/dist/ci-product.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-product.d.ts","sourceRoot":"","sources":["../src/ci-product.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ci-product.d.ts","sourceRoot":"","sources":["../src/ci-product.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGhE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,sBAAsB,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,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AAEvB;;;;;GAKG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhI;;;;;;GAMG;AACH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AACtK,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,aAAsB,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEjF;;;;;;;;;;GAUG;AACH,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAChG,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACL,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,YAAY,GAClB,MAAM,QAAQ,CAAC"}
|
package/dist/ci-product.js
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* and `assertProductWords` present means the rest is too.
|
|
10
10
|
*/
|
|
11
11
|
import { OTLP_EXPORTER_FLOOR } from "./otlp.js";
|
|
12
|
-
import { NEXT_RELEASE } from "./release-floors.js";
|
|
13
12
|
/**
|
|
14
13
|
* The first chant with the product pipeline (#4550): the words, the
|
|
15
14
|
* `pull-request` op-wave approval source, `runCommandInProcess(argv, {
|
|
@@ -18,7 +17,7 @@ import { NEXT_RELEASE } from "./release-floors.js";
|
|
|
18
17
|
*/
|
|
19
18
|
export const CI_PRODUCT_FLOOR = "0.124.55";
|
|
20
19
|
export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productActionFromEnv, PRODUCT_ACTION_ENV, PRODUCT_ACTION_EVENT_FLAG, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, } from "./ci-product-words.js";
|
|
21
|
-
export { driftNotifyFields, productNotifySource, productNotifyWords, productSendOptions } from "./notify-product.js";
|
|
20
|
+
export { driftNotifyFields, NOTIFY_MESSAGE_WORDS_FLOOR, productNotifySource, productNotifyWords, productSendOptions } from "./notify-product.js";
|
|
22
21
|
/** The first chant with `chant notify relay` and the notify relay buttons (#4611). */
|
|
23
22
|
export const NOTIFY_RELAY_FLOOR = "0.124.55";
|
|
24
23
|
/**
|
|
@@ -97,7 +96,7 @@ export { GITLAB_RESERVED_JOB_NAMES, GITLAB_TOP_KEYWORDS, isGeneratedJob, jobBloc
|
|
|
97
96
|
* group of its own keeps it, and GitHub and GitLab files are unchanged. A
|
|
98
97
|
* product feature-detects on this floor.
|
|
99
98
|
*/
|
|
100
|
-
export const FORGEJO_RUN_GROUP_FLOOR =
|
|
99
|
+
export const FORGEJO_RUN_GROUP_FLOOR = "0.124.77";
|
|
101
100
|
export { RUN_GROUP_KEYS } from "./lexicon.js";
|
|
102
101
|
/**
|
|
103
102
|
* `chant build --pr-loop` takes the control repo (#4772): `--control <repo>`
|
|
@@ -107,7 +106,7 @@ export { RUN_GROUP_KEYS } from "./lexicon.js";
|
|
|
107
106
|
* the step `productPipelineJobs(...).post.control` returns. A product that
|
|
108
107
|
* writes its pipeline with the build feature-detects on this floor.
|
|
109
108
|
*/
|
|
110
|
-
export const PR_LOOP_CONTROL_FLOOR =
|
|
109
|
+
export const PR_LOOP_CONTROL_FLOOR = "0.124.77";
|
|
111
110
|
export { CI_RESPOND_DEFAULTS, CI_RESPOND_ENV, CI_RESPONSES, parseRespondList, renderRefusedDiff, renderTriage, respondList, resolveResponses, } from "./ci-respond.js";
|
|
112
111
|
export { respondDescription, respondOpWave, respondPrApply, triageOfOpWave, triageOfPrReport, refusedOfOpWave, refusedOfPrReport } from "./ci-respond-run.js";
|
|
113
112
|
/**
|