@intentius/chant 0.124.78 → 0.124.80
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/action-pins.d.ts.map +1 -1
- package/dist/action-pins.js +1 -2
- package/dist/change-set.d.ts +10 -1
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +4 -1
- package/dist/ci-agent.d.ts +16 -2
- package/dist/ci-agent.d.ts.map +1 -1
- package/dist/ci-agent.js +6 -1
- package/dist/ci-commit.d.ts.map +1 -1
- package/dist/ci-commit.js +2 -3
- package/dist/ci-note-commands.d.ts +199 -0
- package/dist/ci-note-commands.d.ts.map +1 -0
- package/dist/ci-note-commands.js +372 -0
- package/dist/ci-product.d.ts +6 -2
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +5 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +7 -1
- package/dist/cli/handlers/pr-notes.d.ts +13 -0
- package/dist/cli/handlers/pr-notes.d.ts.map +1 -0
- package/dist/cli/handlers/pr-notes.js +73 -0
- package/dist/cli/handlers/release.d.ts +8 -0
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +64 -2
- package/dist/cli/handlers/run-wave.js +1 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +17 -1
- package/dist/cli/mcp/product-tools.d.ts +6 -0
- package/dist/cli/mcp/product-tools.d.ts.map +1 -1
- package/dist/cli/mcp/product-tools.js +6 -0
- package/dist/cli/mcp/read-only.d.ts +12 -0
- package/dist/cli/mcp/read-only.d.ts.map +1 -1
- package/dist/cli/mcp/read-only.js +16 -0
- package/dist/cli/mcp/server.d.ts +11 -0
- package/dist/cli/mcp/server.d.ts.map +1 -1
- package/dist/cli/mcp/server.js +26 -5
- package/dist/cli/mcp/types.d.ts +5 -1
- package/dist/cli/mcp/types.d.ts.map +1 -1
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +10 -0
- package/dist/cli/registry.d.ts +4 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/capability.d.ts +53 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/group-digest.d.ts +17 -0
- package/dist/components/group-digest.d.ts.map +1 -0
- package/dist/components/group-digest.js +18 -0
- package/dist/components/groups.d.ts +2 -11
- package/dist/components/groups.d.ts.map +1 -1
- package/dist/components/groups.js +2 -12
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/pr-pipeline.d.ts +22 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +26 -0
- package/dist/components/product-pipeline.d.ts +12 -0
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +5 -1
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lexicon.js +1 -2
- package/dist/lifecycle/release-cut.d.ts +7 -1
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +1 -0
- package/dist/lifecycle/release-images.d.ts +12 -3
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +6 -7
- package/dist/lifecycle/release-publish.d.ts +8 -1
- package/dist/lifecycle/release-publish.d.ts.map +1 -1
- package/dist/lifecycle/release-publish.js +30 -3
- package/dist/lifecycle/release-version.d.ts +86 -0
- package/dist/lifecycle/release-version.d.ts.map +1 -0
- package/dist/lifecycle/release-version.js +208 -0
- package/dist/mcp/types.d.ts +26 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/notify-product.d.ts.map +1 -1
- package/dist/notify-product.js +1 -2
- package/dist/op/activities/review-product.d.ts.map +1 -1
- package/dist/op/activities/review-product.js +1 -2
- package/dist/op/gate.d.ts +17 -0
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +36 -0
- package/dist/op/index.d.ts +8 -6
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +5 -4
- package/dist/op/op-waves-after-plan.d.ts +109 -1
- package/dist/op/op-waves-after-plan.d.ts.map +1 -1
- package/dist/op/op-waves-after-plan.js +180 -3
- package/dist/op/op-waves-capability-spec.js +1 -2
- package/dist/op/op-waves-capability.d.ts +93 -3
- package/dist/op/op-waves-capability.d.ts.map +1 -1
- package/dist/op/op-waves-capability.js +218 -10
- package/dist/op/op-waves-run-hooks.d.ts +104 -0
- package/dist/op/op-waves-run-hooks.d.ts.map +1 -0
- package/dist/op/op-waves-run-hooks.js +145 -0
- package/dist/op/op-waves-run.d.ts +21 -0
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +307 -21
- package/dist/op/op-waves.d.ts +11 -1
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +7 -1
- package/dist/op/runtime.d.ts +2 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/pr-forge-reads.d.ts +151 -1
- package/dist/pr-forge-reads.d.ts.map +1 -1
- package/dist/pr-forge-reads.js +265 -1
- package/dist/pr-plan-note.d.ts.map +1 -1
- package/dist/pr-plan-note.js +1 -2
- package/dist/release-floors.d.ts +19 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +23 -5
- package/dist/wave-runtime.mjs +312 -312
- package/dist/workspace/change-set.schema.json +7 -0
- package/dist/workspace/release-workflow.d.ts +7 -0
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +11 -1
- package/package.json +1 -1
- package/src/action-pins.test.ts +1 -2
- package/src/action-pins.ts +1 -3
- package/src/change-set.test.ts +20 -0
- package/src/change-set.ts +11 -1
- package/src/ci-agent.test.ts +9 -0
- package/src/ci-agent.ts +15 -2
- package/src/ci-commit.test.ts +2 -3
- package/src/ci-commit.ts +2 -3
- package/src/ci-note-commands.test.ts +377 -0
- package/src/ci-note-commands.ts +479 -0
- package/src/ci-product.ts +6 -2
- package/src/cli/handlers/build.ts +7 -1
- package/src/cli/handlers/pr-notes.ts +70 -0
- package/src/cli/handlers/release.ts +55 -2
- package/src/cli/handlers/run-wave.ts +1 -0
- package/src/cli/main.ts +17 -1
- package/src/cli/mcp/product-tools.test.ts +49 -0
- package/src/cli/mcp/product-tools.ts +7 -0
- package/src/cli/mcp/read-only.ts +19 -0
- package/src/cli/mcp/server.test.ts +30 -0
- package/src/cli/mcp/server.ts +28 -5
- package/src/cli/mcp/types.ts +6 -1
- package/src/cli/parse-args.ts +8 -0
- package/src/cli/registry.ts +4 -0
- package/src/components/capability.ts +52 -0
- package/src/components/group-digest.ts +20 -0
- package/src/components/groups.ts +3 -13
- package/src/components/index.ts +2 -0
- package/src/components/pr-pipeline.ts +35 -0
- package/src/components/product-pipeline.test.ts +14 -0
- package/src/components/product-pipeline.ts +13 -1
- package/src/config.ts +15 -0
- package/src/lexicon.ts +1 -2
- package/src/lifecycle/release-cut.ts +11 -0
- package/src/lifecycle/release-images-dockerfile.test.ts +10 -2
- package/src/lifecycle/release-images.ts +12 -8
- package/src/lifecycle/release-publish.ts +34 -3
- package/src/lifecycle/release-version.test.ts +155 -0
- package/src/lifecycle/release-version.ts +226 -0
- package/src/mcp/types.ts +27 -0
- package/src/notify-message-words.test.ts +1 -2
- package/src/notify-product.ts +1 -2
- package/src/op/activities/review-product.ts +1 -2
- package/src/op/gate.ts +46 -0
- package/src/op/index.ts +10 -4
- package/src/op/op-waves-after-plan-wave.test.ts +225 -0
- package/src/op/op-waves-after-plan.ts +228 -5
- package/src/op/op-waves-capability-spec.ts +1 -1
- package/src/op/op-waves-capability.test.ts +9 -1
- package/src/op/op-waves-capability.ts +246 -13
- package/src/op/op-waves-gate-port.test.ts +232 -0
- package/src/op/op-waves-run-hooks.test.ts +183 -0
- package/src/op/op-waves-run-hooks.ts +194 -0
- package/src/op/op-waves-run.ts +313 -25
- package/src/op/op-waves-step-wave.test.ts +276 -0
- package/src/op/op-waves.ts +15 -2
- package/src/op/runtime.ts +2 -0
- package/src/pr-forge-reads-compare.test.ts +145 -0
- package/src/pr-forge-reads.test.ts +203 -0
- package/src/pr-forge-reads.ts +398 -1
- package/src/pr-plan-note.ts +1 -2
- package/src/release-floors.ts +32 -5
- package/src/workspace/change-set.schema.json +7 -0
- package/src/workspace/release-workflow.test.ts +18 -0
- package/src/workspace/release-workflow.ts +21 -1
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comment commands on GitLab by polling merge request notes (#4785, moved
|
|
3
|
+
* from terragucci's comment-gitlab.ts).
|
|
4
|
+
*
|
|
5
|
+
* GitLab starts no pipeline for a merge request note. So a scheduled
|
|
6
|
+
* pipeline of the default branch runs {@link pollNoteCommands}: it lists the
|
|
7
|
+
* merge requests updated in the last day, reads their notes through chant's
|
|
8
|
+
* forge reads, and answers each note addressed to the product once.
|
|
9
|
+
*
|
|
10
|
+
* - A note is read against the product's words (`parseProductComment`): the
|
|
11
|
+
* product supplies its command words, and chant's grammar refuses the rest.
|
|
12
|
+
* - Its author must hold `minRole` or more on the project (Developer by
|
|
13
|
+
* default). Anyone else gets no reply and nothing runs, as on GitHub.
|
|
14
|
+
* - Each note is answered once: the note's id is recorded on the ledger
|
|
15
|
+
* ({@link NoteLog}, `_notes/<mr>-<note>.json` on `chant/lifecycle` in
|
|
16
|
+
* {@link ledgerNoteLog}), and the reply carries the note's marker, so a
|
|
17
|
+
* poll that runs twice answers once.
|
|
18
|
+
* - What a command runs is the product's ({@link NoteCommandRuns}): a
|
|
19
|
+
* pipeline of a branch started with the command's variables, a new merge
|
|
20
|
+
* request pipeline, the retry of the first apply job that did not succeed
|
|
21
|
+
* at a merged merge request's merge commit, or a reply alone.
|
|
22
|
+
* {@link chantNoteRuns} answers for the jobs chant's own GitLab pipeline
|
|
23
|
+
* writes (`CHANT_PREVIEW_PR`, `CHANT_APPLY_PR`, `CHANT_LOCK_PR`,
|
|
24
|
+
* `CHANT_UNLOCK_PR`, `CHANT_AGENT_PR`, `CHANT_COMMIT_PR`).
|
|
25
|
+
*
|
|
26
|
+
* The job runs nothing it reads: it calls GitLab's API with the project's
|
|
27
|
+
* token and holds no cloud credentials.
|
|
28
|
+
*/
|
|
29
|
+
import { GITLAB_AGENT_ASK_VAR, GITLAB_AGENT_PR_VAR } from "./ci-agent.js";
|
|
30
|
+
import { GITLAB_COMMIT_ARG_VAR, GITLAB_COMMIT_PR_VAR, GITLAB_COMMIT_WORD_VAR } from "./ci-commit.js";
|
|
31
|
+
import { parseProductComment, productStatusContext } from "./ci-product-words.js";
|
|
32
|
+
import { GITLAB_APPLY_PR_VAR, GITLAB_LOCK_PR_VAR, GITLAB_PREVIEW_PR_VAR, GITLAB_UNLOCK_PR_VAR, PREVIEW_COMMENT_ENV } from "./components/pr-pipeline.js";
|
|
33
|
+
import { ForgeApiError } from "./pr-forge.js";
|
|
34
|
+
export { GITLAB_NOTE_COMMANDS_VAR } from "./components/pr-pipeline.js";
|
|
35
|
+
/** How far back the poll reads: merge requests updated, and notes written, in this many minutes. */
|
|
36
|
+
export const NOTE_COMMANDS_WINDOW_MINUTES = 24 * 60;
|
|
37
|
+
/** How many pipelines of the default branch after the merge commit's are read for a later apply. */
|
|
38
|
+
export const NOTE_COMMANDS_NEWER_PIPELINES = 50;
|
|
39
|
+
/** GitLab's roles, least first, as `ForgeReads.permission` names them. */
|
|
40
|
+
export const GITLAB_ROLES = ["minimal", "guest", "planner", "reporter", "developer", "maintainer", "owner"];
|
|
41
|
+
/** The marker a reply carries, naming the note it answers: `<!-- <product>:note=<id> -->`, terragucci's own. */
|
|
42
|
+
export function noteCommandMarker(product, id) {
|
|
43
|
+
return `<!-- ${product}:note=${id} -->`;
|
|
44
|
+
}
|
|
45
|
+
/** The writes for a GitLab client's options. */
|
|
46
|
+
export function gitlabPipelines(opts) {
|
|
47
|
+
const fetchImpl = opts.fetch ?? globalThis.fetch;
|
|
48
|
+
const root = opts.apiBase.replace(/\/+$/, "");
|
|
49
|
+
const project = `/projects/${encodeURIComponent(decodeURIComponent(opts.project))}`;
|
|
50
|
+
const headers = { "Content-Type": "application/json", ...(opts.token ? { [opts.tokenHeader ?? "PRIVATE-TOKEN"]: opts.token } : {}) };
|
|
51
|
+
const post = async (path, body) => {
|
|
52
|
+
const url = `${root}${project}${path}`;
|
|
53
|
+
const res = await fetchImpl(url, { method: "POST", headers, ...(body === undefined ? {} : { body: JSON.stringify(body) }) });
|
|
54
|
+
const text = await res.text();
|
|
55
|
+
if (!res.ok)
|
|
56
|
+
throw new ForgeApiError("POST", url, res.status, text);
|
|
57
|
+
let v;
|
|
58
|
+
try {
|
|
59
|
+
v = text ? JSON.parse(text) : null;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
v = null;
|
|
63
|
+
}
|
|
64
|
+
const o = typeof v === "object" && v !== null ? v : {};
|
|
65
|
+
return { ...(typeof o.id === "number" ? { id: o.id } : {}), ...(typeof o.web_url === "string" && /^https?:\/\//.test(o.web_url) ? { url: o.web_url } : {}) };
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
start: (ref, variables) => post("/pipeline", { ref, variables: Object.entries(variables).map(([key, value]) => ({ key, value, variable_type: "env_var" })) }),
|
|
69
|
+
startMergeRequest: (iid) => post(`/merge_requests/${iid}/pipelines`),
|
|
70
|
+
retryJob: (job) => post(`/jobs/${job}/retry`),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** A log in memory, for tests and a dry run. */
|
|
74
|
+
export function memoryNoteLog(seen = []) {
|
|
75
|
+
return {
|
|
76
|
+
outcomes: seen,
|
|
77
|
+
answered: async (mr, note) => seen.some((o) => o.mr === mr && o.note === note),
|
|
78
|
+
record: async (o) => void seen.push(o),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const short = (sha) => sha.slice(0, 8);
|
|
82
|
+
const message = (e) => (e instanceof Error ? e.message : String(e)).split("\n")[0];
|
|
83
|
+
/** Read, answer and record every new command note of the merge requests updated in the window. */
|
|
84
|
+
export async function pollNoteCommands(o) {
|
|
85
|
+
const now = o.now ?? new Date();
|
|
86
|
+
const since = new Date(now.getTime() - (o.windowMinutes ?? NOTE_COMMANDS_WINDOW_MINUTES) * 60000).toISOString();
|
|
87
|
+
const at = now.toISOString();
|
|
88
|
+
const least = GITLAB_ROLES.indexOf(o.minRole ?? "developer");
|
|
89
|
+
let me;
|
|
90
|
+
let mrs;
|
|
91
|
+
try {
|
|
92
|
+
me = await o.reads.tokenUser();
|
|
93
|
+
mrs = await o.reads.pullRequestsUpdated(since);
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
return { outcomes: [], fail: `could not list the merge requests (${message(e)})` };
|
|
97
|
+
}
|
|
98
|
+
if (!me)
|
|
99
|
+
return { outcomes: [], fail: "GitLab did not say which user the job's token acts as, so no reply can be told apart" };
|
|
100
|
+
const mine = (n) => (me.id !== undefined && n.authorId === me.id) || n.author === me.login;
|
|
101
|
+
const marker = new RegExp(`<!-- ${o.words.product.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}:note=(\\d+) -->`, "g");
|
|
102
|
+
const outcomes = [];
|
|
103
|
+
let unrecorded;
|
|
104
|
+
for (const mr of mrs) {
|
|
105
|
+
let notes;
|
|
106
|
+
try {
|
|
107
|
+
notes = await o.reads.pullRequestNotes(mr.number);
|
|
108
|
+
}
|
|
109
|
+
catch (e) {
|
|
110
|
+
return { outcomes, fail: `could not read the notes of !${mr.number} (${message(e)})${unrecorded ? `; and ${unrecorded}` : ""}` };
|
|
111
|
+
}
|
|
112
|
+
// Only the job's own replies mark a note answered: anyone else writing the marker answers nothing.
|
|
113
|
+
const replied = new Set();
|
|
114
|
+
for (const n of notes)
|
|
115
|
+
if (mine(n))
|
|
116
|
+
for (const m of n.body.matchAll(marker))
|
|
117
|
+
replied.add(Number(m[1]));
|
|
118
|
+
const asks = notes
|
|
119
|
+
.filter((n) => !n.system && !mine(n) && !replied.has(n.id) && n.created !== undefined && Date.parse(n.created) >= Date.parse(since))
|
|
120
|
+
.filter((n) => parseProductComment(o.words, n.body, o.env ?? {}, o.commitArgs ?? {}) !== undefined)
|
|
121
|
+
.sort((a, b) => Date.parse(a.created) - Date.parse(b.created) || a.id - b.id);
|
|
122
|
+
for (const note of asks) {
|
|
123
|
+
if (await o.log.answered(mr.number, note.id))
|
|
124
|
+
continue;
|
|
125
|
+
const out = await answer(o, mr, note, least, at, me.login);
|
|
126
|
+
if (out.ran || out.replied || !out.fail) {
|
|
127
|
+
try {
|
|
128
|
+
await o.log.record(out);
|
|
129
|
+
}
|
|
130
|
+
catch (e) {
|
|
131
|
+
// The reply's marker still answers the note once.
|
|
132
|
+
unrecorded = `could not record note ${note.id} of !${mr.number} on the ledger (${message(e)})`;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
outcomes.push(out);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return { outcomes, ...(unrecorded ? { fail: unrecorded } : {}) };
|
|
139
|
+
}
|
|
140
|
+
async function answer(o, mr, note, least, at, me) {
|
|
141
|
+
const parsed = parseProductComment(o.words, note.body, o.env ?? {}, o.commitArgs ?? {});
|
|
142
|
+
const base = { mr: mr.number, note: note.id, ...(note.author ? { author: note.author } : {}), ...(parsed.kind !== "refused" ? { command: parsed.kind } : {}), at };
|
|
143
|
+
const marker = noteCommandMarker(o.words.product, note.id);
|
|
144
|
+
const reply = async (text, ran = false, url) => {
|
|
145
|
+
const done = { ...base, ran, ...(url ? { url } : {}) };
|
|
146
|
+
try {
|
|
147
|
+
// One reply per note, found again by its marker.
|
|
148
|
+
await o.forge.upsertComment(mr.number, marker, `${o.words.product}: ${text}\n\n${marker}`, { match: "anywhere", author: me });
|
|
149
|
+
}
|
|
150
|
+
catch (e) {
|
|
151
|
+
return { ...done, replied: false, fail: true, reason: `${text}; and the reply failed (${message(e)})` };
|
|
152
|
+
}
|
|
153
|
+
return { ...done, replied: true, reason: text };
|
|
154
|
+
};
|
|
155
|
+
const broke = (reason) => ({ ...base, ran: false, replied: false, fail: true, reason });
|
|
156
|
+
const silent = (reason) => ({ ...base, ran: false, replied: false, reason });
|
|
157
|
+
// Who asked comes first: someone below the role gets no reply and nothing runs.
|
|
158
|
+
if (!note.author)
|
|
159
|
+
return silent("the note has no usable author");
|
|
160
|
+
let role;
|
|
161
|
+
try {
|
|
162
|
+
role = await o.reads.permission(note.author);
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
return broke(`could not read ${note.author}'s access, so nothing runs (${message(e)})`);
|
|
166
|
+
}
|
|
167
|
+
if (role === undefined)
|
|
168
|
+
return silent(`${note.author} is not a member of the project, so the note is ignored`);
|
|
169
|
+
const level = GITLAB_ROLES.indexOf(role);
|
|
170
|
+
if (level < least)
|
|
171
|
+
return silent(`${note.author} is ${role} on the project, below ${GITLAB_ROLES[least]}, so the note is ignored`);
|
|
172
|
+
if (parsed.kind === "refused")
|
|
173
|
+
return reply(parsed.reason);
|
|
174
|
+
let run;
|
|
175
|
+
try {
|
|
176
|
+
run = await o.runs({ mr, note, parsed, role, base: o.base, words: o.words });
|
|
177
|
+
}
|
|
178
|
+
catch (e) {
|
|
179
|
+
return broke(`could not decide what ${note.author}'s command runs (${message(e)})`);
|
|
180
|
+
}
|
|
181
|
+
const link = (r) => (r.url ? ` ${r.url}` : "");
|
|
182
|
+
switch (run.kind) {
|
|
183
|
+
case "reply":
|
|
184
|
+
return reply(run.text);
|
|
185
|
+
case "fail":
|
|
186
|
+
return broke(run.reason);
|
|
187
|
+
case "pipeline": {
|
|
188
|
+
let started;
|
|
189
|
+
try {
|
|
190
|
+
started = await (run.with ?? o.pipelines).start(run.ref, run.variables);
|
|
191
|
+
}
|
|
192
|
+
catch (e) {
|
|
193
|
+
return broke(`could not start a pipeline on ${run.ref} for !${mr.number} (${message(e)})`);
|
|
194
|
+
}
|
|
195
|
+
return reply(`started pipeline${link(started)} on ${run.ref} to ${run.doing} for ${note.author}`, true, started.url);
|
|
196
|
+
}
|
|
197
|
+
case "merge-request-pipeline": {
|
|
198
|
+
let started;
|
|
199
|
+
try {
|
|
200
|
+
started = await o.pipelines.startMergeRequest(mr.number);
|
|
201
|
+
}
|
|
202
|
+
catch (e) {
|
|
203
|
+
return broke(`could not start a pipeline for !${mr.number} (${message(e)})`);
|
|
204
|
+
}
|
|
205
|
+
return reply(`started pipeline${link(started)} to ${run.doing} for ${note.author}`, true, started.url);
|
|
206
|
+
}
|
|
207
|
+
case "retry":
|
|
208
|
+
return retry(o, mr, note.author, run, reply, broke);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/** chant's apply jobs and terragucci's: `apply`, `apply-wave-<n>` and `apply-wave-<n>-share-<m>`, a member's prefixed with its name. */
|
|
212
|
+
export const APPLY_JOBS = /^(?:[a-z0-9][a-z0-9-]*-)?apply(?:-wave-([1-9][0-9]*)(?:-share-([1-9][0-9]*))?)?$/;
|
|
213
|
+
const NOT_DONE = new Set(["created", "pending", "running", "waiting_for_resource", "preparing", "scheduled"]);
|
|
214
|
+
async function retry(o, mr, user, run, reply, broke) {
|
|
215
|
+
const { sha } = run;
|
|
216
|
+
const pattern = run.jobs ?? APPLY_JOBS;
|
|
217
|
+
const iid = mr.number;
|
|
218
|
+
// The newest push pipeline at the merge commit with an apply job: a branch pipeline, or a ci/green tag's.
|
|
219
|
+
let pipeline;
|
|
220
|
+
let jobs = [];
|
|
221
|
+
let newer;
|
|
222
|
+
try {
|
|
223
|
+
for (const p of await o.reads.headRuns(sha, { event: "push" })) {
|
|
224
|
+
const js = (await o.reads.runJobs(p.id)).filter((j) => pattern.test(j.name));
|
|
225
|
+
if (js.length > 0) {
|
|
226
|
+
pipeline = p;
|
|
227
|
+
jobs = js;
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (!pipeline)
|
|
232
|
+
return reply(`no pipeline at the merge commit ${short(sha)} of !${iid} has an apply job, so there is nothing to retry; push to ${o.base} again`);
|
|
233
|
+
newer = await o.reads.branchRuns(o.base, { event: "push", limit: NOTE_COMMANDS_NEWER_PIPELINES });
|
|
234
|
+
}
|
|
235
|
+
catch (e) {
|
|
236
|
+
return broke(`could not read the pipelines at ${short(sha)} (${message(e)})`);
|
|
237
|
+
}
|
|
238
|
+
// A later commit whose apply started applied a newer tree: going back to this one would undo it.
|
|
239
|
+
const applyContext = productStatusContext(o.words, "apply");
|
|
240
|
+
const later = [...new Set(newer.filter((p) => p.id > pipeline.id && p.headSha !== sha).map((p) => p.headSha))];
|
|
241
|
+
for (const c of later) {
|
|
242
|
+
let applied;
|
|
243
|
+
try {
|
|
244
|
+
applied = (await o.forge.commitStatuses?.(c))?.find((s) => s.context === applyContext);
|
|
245
|
+
}
|
|
246
|
+
catch (e) {
|
|
247
|
+
return broke(`could not read the statuses of ${short(c)} (${message(e)})`);
|
|
248
|
+
}
|
|
249
|
+
if (applied) {
|
|
250
|
+
const at = applied.targetUrl && /^https?:\/\//.test(applied.targetUrl) ? ` (${applied.targetUrl})` : "";
|
|
251
|
+
return reply(`a later apply already ran on ${o.base} at ${short(c)}${at}, so the merge commit ${short(sha)} of !${iid} is not applied: comment on the merge request that commit came from, or push again`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
const order = (j) => {
|
|
255
|
+
const m = pattern.exec(j.name);
|
|
256
|
+
return [m?.[1] ? Number(m[1]) : 0, m?.[2] ? Number(m[2]) : 0];
|
|
257
|
+
};
|
|
258
|
+
const sorted = [...jobs].sort((a, b) => order(a)[0] - order(b)[0] || order(a)[1] - order(b)[1]);
|
|
259
|
+
const next = sorted.find((j) => j.status !== "success");
|
|
260
|
+
if (!next)
|
|
261
|
+
return reply(`every apply job of !${iid}'s merge commit ${short(sha)} already succeeded`);
|
|
262
|
+
if (NOT_DONE.has(next.status))
|
|
263
|
+
return reply(`${next.name} at ${short(sha)} is ${next.status} already, so it is not retried`);
|
|
264
|
+
if (next.status !== "failed" && next.status !== "canceled") {
|
|
265
|
+
return reply(`${next.name} at ${short(sha)} was ${next.status}, and GitLab retries only a failed or canceled job; push to ${o.base} again`);
|
|
266
|
+
}
|
|
267
|
+
let retried;
|
|
268
|
+
try {
|
|
269
|
+
retried = await o.pipelines.retryJob(next.id);
|
|
270
|
+
}
|
|
271
|
+
catch (e) {
|
|
272
|
+
return broke(`could not retry ${next.name} of pipeline ${pipeline.id} (${message(e)})`);
|
|
273
|
+
}
|
|
274
|
+
const link = retried.url ? ` (${retried.url})` : "";
|
|
275
|
+
return reply(`retried ${next.name} of !${iid}'s merge commit ${short(sha)}${link} for ${user}; its gate decides again, and the jobs after it follow, each behind its own gate`, true, retried.url);
|
|
276
|
+
}
|
|
277
|
+
/** What a command runs in chant's own GitLab pipeline, for the jobs it has. */
|
|
278
|
+
export function chantNoteRuns(jobs) {
|
|
279
|
+
return ({ mr, note, parsed, base, words }) => {
|
|
280
|
+
const iid = String(mr.number);
|
|
281
|
+
const at = `!${mr.number}`;
|
|
282
|
+
const line = (kind) => `\`/${words.product} ${Object.entries(words.commands).find(([, c]) => c === kind)?.[0] ?? kind}\``;
|
|
283
|
+
if (!mr.sameRepo)
|
|
284
|
+
return { kind: "reply", text: `a merge request from a fork runs no command: its code never runs with this project's credentials` };
|
|
285
|
+
const open = mr.state === "open";
|
|
286
|
+
const intoBase = mr.base === undefined || mr.base === base;
|
|
287
|
+
switch (parsed.kind) {
|
|
288
|
+
case "plan":
|
|
289
|
+
if (!open)
|
|
290
|
+
return { kind: "reply", text: `${at} is not open, so it is not ${words.verbs.plan[1]}` };
|
|
291
|
+
if (jobs.preview)
|
|
292
|
+
return { kind: "pipeline", ref: base, variables: { [GITLAB_PREVIEW_PR_VAR]: iid, [PREVIEW_COMMENT_ENV]: note.body.trim() }, doing: `${words.verbs.plan[0]} ${at}'s head again` };
|
|
293
|
+
return { kind: "merge-request-pipeline", doing: `${words.verbs.plan[0]} ${at} again` };
|
|
294
|
+
case "apply":
|
|
295
|
+
if (open) {
|
|
296
|
+
if (!jobs.applyBeforeMerge)
|
|
297
|
+
return { kind: "reply", text: `${at} is not merged, and this project ${words.verbs.apply[0]}s after a merge request merges, never from its branch` };
|
|
298
|
+
if (!intoBase)
|
|
299
|
+
return { kind: "reply", text: `${at} targets ${mr.base}, not the default branch ${base}, so it is not ${words.verbs.apply[1]}` };
|
|
300
|
+
return { kind: "pipeline", ref: base, variables: { [GITLAB_APPLY_PR_VAR]: iid }, doing: `${words.verbs.apply[0]} ${at}'s head${mr.headSha ? ` ${short(mr.headSha)}` : ""}` };
|
|
301
|
+
}
|
|
302
|
+
if (mr.state === "closed")
|
|
303
|
+
return { kind: "reply", text: `${at} was closed without merging, so there is nothing of it to ${words.verbs.apply[0]}` };
|
|
304
|
+
if (!jobs.applyOnMerge) {
|
|
305
|
+
return { kind: "reply", text: jobs.applyBeforeMerge ? `${at} is merged, and this project ${words.verbs.apply[0]}s a merge request before it merges, so there is nothing of it left to ${words.verbs.apply[0]}` : `${at} is merged, and a merge here records the plan: a release deploys it` };
|
|
306
|
+
}
|
|
307
|
+
if (parsed.wave !== undefined)
|
|
308
|
+
return { kind: "reply", text: `GitLab runs the waves after a retried apply job by itself, so \`wave-${parsed.wave}\` cannot stop them; write ${line("apply")}, and each wave still waits behind its own gate` };
|
|
309
|
+
if (!intoBase)
|
|
310
|
+
return { kind: "reply", text: `${at} was merged into ${mr.base}, not the default branch ${base}, so nothing applies from it` };
|
|
311
|
+
if (!mr.mergeCommit)
|
|
312
|
+
return { kind: "fail", reason: `${at} has no merge commit` };
|
|
313
|
+
return { kind: "retry", sha: mr.mergeCommit };
|
|
314
|
+
case "lock":
|
|
315
|
+
case "unlock":
|
|
316
|
+
if (!jobs.locks)
|
|
317
|
+
return { kind: "reply", text: `${line(parsed.kind)} does not run here: this project takes no locks` };
|
|
318
|
+
if (parsed.kind === "lock" && !open)
|
|
319
|
+
return { kind: "reply", text: `${at} is not open, so it takes no lock` };
|
|
320
|
+
return { kind: "pipeline", ref: base, variables: { [parsed.kind === "lock" ? GITLAB_LOCK_PR_VAR : GITLAB_UNLOCK_PR_VAR]: iid }, doing: `${parsed.kind} the ${words.noun[1]} of ${at}` };
|
|
321
|
+
case "agent":
|
|
322
|
+
if (!jobs.agent)
|
|
323
|
+
return { kind: "reply", text: `the agent command is off in this project` };
|
|
324
|
+
if (!open)
|
|
325
|
+
return { kind: "reply", text: `${at} is not open, so the agent does not run` };
|
|
326
|
+
if (mr.head === base)
|
|
327
|
+
return { kind: "reply", text: `${at}'s source branch is the default branch, and an agent never pushes there` };
|
|
328
|
+
return { kind: "pipeline", ref: base, variables: { [GITLAB_AGENT_PR_VAR]: iid, [GITLAB_AGENT_ASK_VAR]: parsed.ask }, doing: `run the agent on ${at}` };
|
|
329
|
+
case "commit":
|
|
330
|
+
if (!jobs.commits)
|
|
331
|
+
return { kind: "reply", text: `\`/${words.product} ${parsed.word}\` does not run here` };
|
|
332
|
+
if (!open)
|
|
333
|
+
return { kind: "reply", text: `${at} is not open, so \`/${words.product} ${parsed.word}\` does not run` };
|
|
334
|
+
return { kind: "pipeline", ref: base, variables: { [GITLAB_COMMIT_PR_VAR]: iid, [GITLAB_COMMIT_WORD_VAR]: parsed.word, ...(parsed.arg !== undefined ? { [GITLAB_COMMIT_ARG_VAR]: parsed.arg } : {}) }, doing: `run \`${parsed.word}\` on ${at}` };
|
|
335
|
+
case "action":
|
|
336
|
+
return { kind: "reply", text: `${line("action")} does not run from a merge request note on GitLab: run \`${words.bin ?? words.product} action ${parsed.member} ${parsed.address}\` from a checkout of the default branch` };
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
/** The directory on `chant/lifecycle` that keeps the notes the poll answered. */
|
|
341
|
+
export const NOTES_DIR = "_notes";
|
|
342
|
+
/** A note's file in {@link NOTES_DIR}. */
|
|
343
|
+
export function noteFile(mr, note) {
|
|
344
|
+
return `${mr}-${note}.json`;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* The notes the poll answered, kept on the local `chant/lifecycle` of `cwd`:
|
|
348
|
+
* one file per note, `_notes/<mr>-<note>.json`, written and pushed as each
|
|
349
|
+
* note is answered. The caller fetches the branch first. `push: false`
|
|
350
|
+
* writes the local branch alone.
|
|
351
|
+
*/
|
|
352
|
+
export function ledgerNoteLog(opts = {}) {
|
|
353
|
+
return {
|
|
354
|
+
async answered(mr, note) {
|
|
355
|
+
const { readBlobFromPath } = await import("./lifecycle/git.js");
|
|
356
|
+
return (await readBlobFromPath(NOTES_DIR, noteFile(mr, note), opts)) !== null;
|
|
357
|
+
},
|
|
358
|
+
async record(outcome) {
|
|
359
|
+
const { ledgerDir, pushLifecycleRebasing, readPathSha, writeLedgerFiles } = await import("./lifecycle/git.js");
|
|
360
|
+
const file = noteFile(outcome.mr, outcome.note);
|
|
361
|
+
const dir = await ledgerDir(NOTES_DIR, opts);
|
|
362
|
+
const prior = await readPathSha(NOTES_DIR, file, opts);
|
|
363
|
+
await writeLedgerFiles([{ path: `${dir}/${file}`, content: `${JSON.stringify(outcome)}\n`, expectPriorSha: prior }], `Note ${outcome.note} on !${outcome.mr}`, opts);
|
|
364
|
+
if (opts.push === false)
|
|
365
|
+
return;
|
|
366
|
+
const pushed = await pushLifecycleRebasing(opts);
|
|
367
|
+
if (pushWarned(pushed))
|
|
368
|
+
throw new Error(`answered note ${outcome.note} on !${outcome.mr}, and could not push chant/lifecycle (${pushed.pushWarning})`);
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
const pushWarned = (p) => !p.pushed && p.pushWarning !== undefined;
|
package/dist/ci-product.d.ts
CHANGED
|
@@ -173,8 +173,12 @@ export type { ProductMcpContext, ProductMcpHook } from "./cli/mcp/product-tools.
|
|
|
173
173
|
* true` for these, and its hook gains `propose?: boolean`. Feature-detect on
|
|
174
174
|
* `PRODUCT_MCP_PROPOSE_FLOOR`: on an older chant the read-only server drops a
|
|
175
175
|
* `forgeWrite` tool, and `--propose` is not a flag it parses.
|
|
176
|
+
*
|
|
177
|
+
* `tools/list` gives each tool's MCP annotations from `MCP_TOOL_ANNOTATIONS_FLOOR`
|
|
178
|
+
* on (chant#4823): `readOnly: true` and `forgeWrite: true` set `readOnlyHint`
|
|
179
|
+
* and `destructiveHint`, and a contribution's `annotations` add the rest.
|
|
176
180
|
*/
|
|
177
|
-
export { PRODUCT_MCP_PROPOSE_FLOOR, PRODUCT_TOOL_PROPOSE_WORDS } from "./cli/mcp/product-tools.js";
|
|
178
|
-
export type { McpToolContribution } from "./mcp/types.js";
|
|
181
|
+
export { MCP_TOOL_ANNOTATIONS_FLOOR, PRODUCT_MCP_PROPOSE_FLOOR, PRODUCT_TOOL_PROPOSE_WORDS } from "./cli/mcp/product-tools.js";
|
|
182
|
+
export type { McpToolContribution, ToolAnnotations } from "./mcp/types.js";
|
|
179
183
|
export { activeOtlp, configureOtlp, OTLP_EXPORTER_FLOOR, RunEventTrace, type CapabilityTraceFacts, type CapabilityTraceSpan, type OtlpExporter, } from "./otlp.js";
|
|
180
184
|
//# sourceMappingURL=ci-product.d.ts.map
|
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;AAGhE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,WAAW,EACX,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,WAA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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;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC5H,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxE,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
|
@@ -169,6 +169,10 @@ export const PRODUCT_MCP_HOOK_FLOOR = OTLP_EXPORTER_FLOOR;
|
|
|
169
169
|
* true` for these, and its hook gains `propose?: boolean`. Feature-detect on
|
|
170
170
|
* `PRODUCT_MCP_PROPOSE_FLOOR`: on an older chant the read-only server drops a
|
|
171
171
|
* `forgeWrite` tool, and `--propose` is not a flag it parses.
|
|
172
|
+
*
|
|
173
|
+
* `tools/list` gives each tool's MCP annotations from `MCP_TOOL_ANNOTATIONS_FLOOR`
|
|
174
|
+
* on (chant#4823): `readOnly: true` and `forgeWrite: true` set `readOnlyHint`
|
|
175
|
+
* and `destructiveHint`, and a contribution's `annotations` add the rest.
|
|
172
176
|
*/
|
|
173
|
-
export { PRODUCT_MCP_PROPOSE_FLOOR, PRODUCT_TOOL_PROPOSE_WORDS } from "./cli/mcp/product-tools.js";
|
|
177
|
+
export { MCP_TOOL_ANNOTATIONS_FLOOR, PRODUCT_MCP_PROPOSE_FLOOR, PRODUCT_TOOL_PROPOSE_WORDS } from "./cli/mcp/product-tools.js";
|
|
174
178
|
export { activeOtlp, configureOtlp, OTLP_EXPORTER_FLOOR, RunEventTrace, } from "./otlp.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAyGlD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,kBAAkB,GAAG,OAAO,GAAG,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,aAAa,GAAG,kBAAkB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,iBAAiB,CAAC,CAAC,GAAG,MAAM,GAAG,SAAS,CAgClT;AAsTD,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsJnE"}
|
|
@@ -51,6 +51,8 @@ async function engineSetupFor(path) {
|
|
|
51
51
|
* `--pr-env` (#4298) adds the jobs of a pull request's environment.
|
|
52
52
|
* `--apply-before-merge` (#4301) writes the apply job that applies an open
|
|
53
53
|
* pull request before it merges, beside the record job.
|
|
54
|
+
* `--note-commands` (#4785) writes GitLab's scheduled job that answers the
|
|
55
|
+
* product's comment commands by polling the merge requests' notes.
|
|
54
56
|
* `--preview-comment` (#4620) writes the jobs that answer the product's plan
|
|
55
57
|
* comment with a preview of the pull request's head. `--action-job` (#4654)
|
|
56
58
|
* writes the job that answers the product's action comment and a dispatch
|
|
@@ -86,6 +88,8 @@ function prLoopOption(args, reportUrl, requireReview = false, requireRunnerStart
|
|
|
86
88
|
...(args.actionJob ? { actionJob: true } : {}),
|
|
87
89
|
// #4628: the note carries its target commit, and a push marks the open notes stale.
|
|
88
90
|
...(args.staleNotes ? { staleNotes: true } : {}),
|
|
91
|
+
// #4785: GitLab's scheduled job that answers the comment commands from the merge requests' notes.
|
|
92
|
+
...(args.noteCommands ? { noteCommands: true } : {}),
|
|
89
93
|
...(args.requires ? { applyRequires: args.requires } : {}),
|
|
90
94
|
// #4625: where the jobs run, and what the jobs that plan or apply get.
|
|
91
95
|
...(args.prRunners ? { runners: Object.fromEntries(Object.entries(args.prRunners).map(([stage, labels]) => [stage, labels.length === 1 ? labels[0] : labels])) } : {}),
|
|
@@ -241,7 +245,9 @@ async function runGenerateComponents(ctx) {
|
|
|
241
245
|
const { args } = ctx;
|
|
242
246
|
const lexicon = args.generate;
|
|
243
247
|
// #4636, #4629, #4627: the pull request loop's flags are checked before anything loads.
|
|
244
|
-
|
|
248
|
+
// #4785: the note-commands job polls GitLab's notes; GitHub and Forgejo start a workflow on a comment.
|
|
249
|
+
const notesProblem = args.noteCommands && !args.prLoop ? "--note-commands adds a job to the pull request loop, so it needs --pr-loop" : args.noteCommands && lexicon !== "gitlab" ? `--note-commands polls GitLab's merge request notes, and ${lexicon} starts a workflow on a comment; drop --note-commands` : undefined;
|
|
250
|
+
const flagsProblem = notesProblem ?? prLoopFlagsProblem(args);
|
|
245
251
|
if (flagsProblem) {
|
|
246
252
|
console.error(formatError({ message: flagsProblem }));
|
|
247
253
|
return 1;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant components pr-notes --forge gitlab` (#4785): the note-commands job.
|
|
3
|
+
*
|
|
4
|
+
* GitLab starts no pipeline on a note, so a scheduled pipeline of the default
|
|
5
|
+
* branch runs this: it reads the merge requests' notes through chant's forge
|
|
6
|
+
* reads, and for each new command from a Developer or above starts the job
|
|
7
|
+
* that answers it (`../../ci-note-commands.ts`). The flags name the jobs the
|
|
8
|
+
* pipeline has, as `chant build --pr-loop --note-commands` wrote them. Each
|
|
9
|
+
* answered note is recorded on `chant/lifecycle`.
|
|
10
|
+
*/
|
|
11
|
+
import type { CommandContext } from "../registry.js";
|
|
12
|
+
export declare function runComponentsPrNotes(ctx: CommandContext): Promise<number>;
|
|
13
|
+
//# sourceMappingURL=pr-notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pr-notes.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr-notes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAOlD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6C/E"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant components pr-notes --forge gitlab` (#4785): the note-commands job.
|
|
3
|
+
*
|
|
4
|
+
* GitLab starts no pipeline on a note, so a scheduled pipeline of the default
|
|
5
|
+
* branch runs this: it reads the merge requests' notes through chant's forge
|
|
6
|
+
* reads, and for each new command from a Developer or above starts the job
|
|
7
|
+
* that answers it (`../../ci-note-commands.ts`). The flags name the jobs the
|
|
8
|
+
* pipeline has, as `chant build --pr-loop --note-commands` wrote them. Each
|
|
9
|
+
* answered note is recorded on `chant/lifecycle`.
|
|
10
|
+
*/
|
|
11
|
+
import { resolve } from "node:path";
|
|
12
|
+
import { activeProductWords } from "../../ci-product-words.js";
|
|
13
|
+
import { chantNoteRuns, gitlabPipelines, ledgerNoteLog, pollNoteCommands } from "../../ci-note-commands.js";
|
|
14
|
+
import { forgeFromEnv, forgeTargetFromEnv } from "../../pr-forge.js";
|
|
15
|
+
import { forgeReadsFor } from "../../pr-forge-reads.js";
|
|
16
|
+
import { formatError, formatInfo, formatWarning } from "../format.js";
|
|
17
|
+
const fail = (message) => {
|
|
18
|
+
console.error(formatError({ message }));
|
|
19
|
+
return 1;
|
|
20
|
+
};
|
|
21
|
+
export async function runComponentsPrNotes(ctx) {
|
|
22
|
+
const { args } = ctx;
|
|
23
|
+
if (args.forge !== "gitlab")
|
|
24
|
+
return fail("pr-notes polls GitLab's merge request notes: --forge gitlab (GitHub and Forgejo start a workflow on a comment)");
|
|
25
|
+
const env = process.env;
|
|
26
|
+
const base = args.branch ?? env.CI_DEFAULT_BRANCH;
|
|
27
|
+
if (!base)
|
|
28
|
+
return fail("pr-notes needs the target branch: --branch <name>, or CI_DEFAULT_BRANCH in the environment");
|
|
29
|
+
let forge;
|
|
30
|
+
let target;
|
|
31
|
+
try {
|
|
32
|
+
forge = forgeFromEnv("gitlab", env);
|
|
33
|
+
target = forgeTargetFromEnv(env, { kind: "gitlab" });
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
37
|
+
}
|
|
38
|
+
const cwd = resolve(".");
|
|
39
|
+
const { fetchLifecycle } = await import("../../lifecycle/git.js");
|
|
40
|
+
// The ledger keeps the notes answered: read it as the remote has it.
|
|
41
|
+
await fetchLifecycle({ cwd });
|
|
42
|
+
const words = activeProductWords();
|
|
43
|
+
const polled = await pollNoteCommands({
|
|
44
|
+
reads: forgeReadsFor(target),
|
|
45
|
+
forge,
|
|
46
|
+
pipelines: gitlabPipelines({ apiBase: target.apiBase, project: target.repo, token: target.token, host: target.host, ...(target.tokenHeader ? { tokenHeader: target.tokenHeader } : {}) }),
|
|
47
|
+
words,
|
|
48
|
+
base,
|
|
49
|
+
runs: chantNoteRuns({
|
|
50
|
+
...(args.previewComment ? { preview: true } : {}),
|
|
51
|
+
...(args.applyBeforeMerge ? { applyBeforeMerge: true } : {}),
|
|
52
|
+
...(args.applyOnMerge ? { applyOnMerge: true } : {}),
|
|
53
|
+
...(args.locks ? { locks: true } : {}),
|
|
54
|
+
}),
|
|
55
|
+
log: ledgerNoteLog({ cwd }),
|
|
56
|
+
env,
|
|
57
|
+
});
|
|
58
|
+
let failed = polled.fail !== undefined;
|
|
59
|
+
for (const o of polled.outcomes) {
|
|
60
|
+
const line = `pr-notes: !${o.mr} note ${o.note}: ${o.reason}`;
|
|
61
|
+
if (o.fail) {
|
|
62
|
+
failed = true;
|
|
63
|
+
console.error(formatWarning({ message: line }));
|
|
64
|
+
}
|
|
65
|
+
else
|
|
66
|
+
console.error(formatInfo(line));
|
|
67
|
+
}
|
|
68
|
+
if (polled.fail)
|
|
69
|
+
console.error(formatError({ message: `pr-notes: ${polled.fail}` }));
|
|
70
|
+
if (polled.outcomes.length === 0 && !polled.fail)
|
|
71
|
+
console.error(formatInfo("pr-notes: no new command"));
|
|
72
|
+
return failed ? 1 : 0;
|
|
73
|
+
}
|
|
@@ -65,6 +65,14 @@ export declare function copyImageArchives(images: ReadonlyArray<{
|
|
|
65
65
|
* publish job runs it before the build that packs the package.
|
|
66
66
|
*/
|
|
67
67
|
export declare function runReleaseImages(ctx: CommandContext): Promise<number>;
|
|
68
|
+
/**
|
|
69
|
+
* `release stamp <label> [--json]` (#4840): write the label into the files
|
|
70
|
+
* `release.version` names, as the cut does before its build, and leave them
|
|
71
|
+
* so. The publish job runs it before its build; `chant release publish`
|
|
72
|
+
* takes those files, stamped with the release's label, as the commit's.
|
|
73
|
+
* `git checkout -- <files>` puts them back.
|
|
74
|
+
*/
|
|
75
|
+
export declare function runReleaseStamp(ctx: CommandContext): Promise<number>;
|
|
68
76
|
/**
|
|
69
77
|
* `release cut [<label>]` (#4026, #4027). A dry run unless `--yes`: it
|
|
70
78
|
* refuses a dirty tree, a commit that is not on trunk and pushed, and one
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/release.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAQH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAyBlD,0HAA0H;AAC1H,wBAAgB,YAAY,CAAC,GAAG,EAAE;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uFAAuF;IACvF,YAAY,EAAE,OAAO,CAAC;CACvB,GAAG,MAAM,EAAE,CASX;AAED,wGAAwG;AACxG,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAG3D;
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/release.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAQH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAyBlD,0HAA0H;AAC1H,wBAAgB,YAAY,CAAC,GAAG,EAAE;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uFAAuF;IACvF,YAAY,EAAE,OAAO,CAAC;CACvB,GAAG,MAAM,EAAE,C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