@intentius/chant 0.124.89 → 0.124.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actor.d.ts +5 -3
- package/dist/actor.d.ts.map +1 -1
- package/dist/actor.js +7 -5
- package/dist/audit/core.d.ts.map +1 -1
- package/dist/audit/core.js +11 -1
- package/dist/ci-comment-commands.d.ts +18 -2
- package/dist/ci-comment-commands.d.ts.map +1 -1
- package/dist/ci-comment-commands.js +30 -2
- package/dist/ci-job-guard.d.ts +42 -45
- package/dist/ci-job-guard.d.ts.map +1 -1
- package/dist/ci-job-guard.js +206 -3
- package/dist/ci-note-commands.d.ts +41 -1
- package/dist/ci-note-commands.d.ts.map +1 -1
- package/dist/ci-note-commands.js +64 -5
- package/dist/ci-product.d.ts +50 -1
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +52 -6
- package/dist/cli/handlers/pr-comment.d.ts +13 -1
- package/dist/cli/handlers/pr-comment.d.ts.map +1 -1
- package/dist/cli/handlers/pr-comment.js +90 -1
- package/dist/cli/handlers/pr-notes.d.ts.map +1 -1
- package/dist/cli/handlers/pr-notes.js +23 -1
- package/dist/cli/handlers/pr.d.ts +2 -2
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +41 -20
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +154 -4
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +17 -0
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +28 -0
- package/dist/cli/registry.d.ts +12 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/pr-checks.d.ts +39 -1
- package/dist/components/pr-checks.d.ts.map +1 -1
- package/dist/components/pr-checks.js +45 -2
- package/dist/components/pr-pipeline.d.ts +11 -3
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +20 -7
- package/dist/components/product-pipeline.d.ts +54 -2
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +63 -6
- package/dist/components/product-plan.d.ts +92 -2
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +172 -22
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +37 -23
- package/dist/lexicon-module.d.ts +2 -0
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon-module.js +6 -2
- package/dist/lexicon.d.ts +82 -4
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-applied.d.ts +9 -0
- package/dist/lifecycle/gate-applied.d.ts.map +1 -1
- package/dist/op/apply-status.d.ts +84 -0
- package/dist/op/apply-status.d.ts.map +1 -0
- package/dist/op/apply-status.js +106 -0
- package/dist/op/before-merge-decide.d.ts +102 -0
- package/dist/op/before-merge-decide.d.ts.map +1 -0
- package/dist/op/before-merge-decide.js +142 -0
- package/dist/op/before-merge-done.d.ts +56 -0
- package/dist/op/before-merge-done.d.ts.map +1 -0
- package/dist/op/before-merge-done.js +69 -0
- package/dist/op/before-merge-store.d.ts +20 -0
- package/dist/op/before-merge-store.d.ts.map +1 -0
- package/dist/op/before-merge-store.js +48 -0
- package/dist/op/before-merge.d.ts +150 -0
- package/dist/op/before-merge.d.ts.map +1 -0
- package/dist/op/before-merge.js +207 -0
- package/dist/op/follow-on-run.d.ts +117 -0
- package/dist/op/follow-on-run.d.ts.map +1 -0
- package/dist/op/follow-on-run.js +154 -0
- package/dist/op/follow-on-store.d.ts +17 -0
- package/dist/op/follow-on-store.d.ts.map +1 -0
- package/dist/op/follow-on-store.js +54 -0
- package/dist/op/gate.d.ts +6 -0
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +10 -1
- package/dist/op/index.d.ts +3 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -0
- package/dist/op/op-waves-after-plan.d.ts +13 -0
- package/dist/op/op-waves-after-plan.d.ts.map +1 -1
- package/dist/op/op-waves-evidence-jobs.d.ts +4 -1
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
- package/dist/op/op-waves-evidence-jobs.js +10 -2
- package/dist/op/op-waves-follow-on.d.ts +162 -0
- package/dist/op/op-waves-follow-on.d.ts.map +1 -0
- package/dist/op/op-waves-follow-on.js +355 -0
- package/dist/op/op-waves-run.d.ts +146 -6
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +871 -99
- package/dist/op/op-waves-split.d.ts +122 -0
- package/dist/op/op-waves-split.d.ts.map +1 -0
- package/dist/op/op-waves-split.js +166 -0
- package/dist/op/op-waves.d.ts +20 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +15 -1
- package/dist/op/schedule-overdue.d.ts +15 -1
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +18 -2
- package/dist/op/stage-hooks.d.ts +36 -1
- package/dist/op/stage-hooks.d.ts.map +1 -1
- package/dist/op/stage-hooks.js +17 -3
- package/dist/op/wave-stop.d.ts +4 -1
- package/dist/op/wave-stop.d.ts.map +1 -1
- package/dist/op/wave-stop.js +4 -2
- package/dist/planned-files.d.ts +16 -8
- package/dist/planned-files.d.ts.map +1 -1
- package/dist/planned-files.js +12 -8
- package/dist/pr-post.d.ts +6 -0
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +7 -5
- package/dist/release-floors.d.ts +9 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +27 -19
- package/dist/wave-blocked.d.ts +7 -1
- package/dist/wave-blocked.d.ts.map +1 -1
- package/dist/wave-blocked.js +7 -2
- package/dist/wave-runtime.mjs +364 -351
- package/package.json +1 -1
- package/src/actor.test.ts +14 -1
- package/src/actor.ts +8 -6
- package/src/audit/core.ts +13 -1
- package/src/audit/first-load.test.ts +101 -0
- package/src/ci-comment-commands.test.ts +63 -0
- package/src/ci-comment-commands.ts +43 -4
- package/src/ci-image.test.ts +1 -2
- package/src/ci-job-guard.before-merge.test.ts +148 -0
- package/src/ci-job-guard.follow-on-record.test.ts +137 -0
- package/src/ci-job-guard.follow-on.test.ts +144 -0
- package/src/ci-job-guard.ts +221 -3
- package/src/ci-note-commands.test.ts +76 -1
- package/src/ci-note-commands.ts +96 -7
- package/src/ci-product.ts +65 -6
- package/src/cli/handlers/pr-comment.ts +85 -2
- package/src/cli/handlers/pr-notes.ts +30 -6
- package/src/cli/handlers/pr.ts +34 -17
- package/src/cli/handlers/run-wave.ts +144 -4
- package/src/cli/main.ts +17 -0
- package/src/cli/parse-args.ts +20 -0
- package/src/cli/registry.ts +12 -1
- package/src/components/pr-checks.ts +66 -2
- package/src/components/pr-pipeline.ts +21 -9
- package/src/components/product-pipeline.apply-status.test.ts +50 -0
- package/src/components/product-pipeline.ts +117 -9
- package/src/components/product-plan-names.test.ts +135 -0
- package/src/components/product-plan.test.ts +23 -5
- package/src/components/product-plan.ts +248 -25
- package/src/floor-table.data.ts +37 -23
- package/src/lexicon-module.ts +6 -2
- package/src/lexicon.ts +78 -1
- package/src/lifecycle/gate-applied.ts +7 -0
- package/src/op/apply-status.test.ts +83 -0
- package/src/op/apply-status.ts +132 -0
- package/src/op/before-merge-decide.ts +190 -0
- package/src/op/before-merge-done.ts +99 -0
- package/src/op/before-merge-store.ts +44 -0
- package/src/op/before-merge.test.ts +201 -0
- package/src/op/before-merge.ts +266 -0
- package/src/op/follow-on-run.ts +206 -0
- package/src/op/follow-on-store.ts +54 -0
- package/src/op/gate.ts +16 -1
- package/src/op/index.ts +5 -0
- package/src/op/op-waves-after-plan.ts +13 -0
- package/src/op/op-waves-evidence-jobs.ts +11 -3
- package/src/op/op-waves-follow-on-record.test.ts +152 -0
- package/src/op/op-waves-follow-on.test.ts +247 -0
- package/src/op/op-waves-follow-on.ts +385 -0
- package/src/op/op-waves-render-spec.test.ts +1 -2
- package/src/op/op-waves-run.ts +971 -93
- package/src/op/op-waves-split-product.test.ts +288 -0
- package/src/op/op-waves-split-step.test.ts +298 -0
- package/src/op/op-waves-split.test.ts +196 -0
- package/src/op/op-waves-split.ts +189 -0
- package/src/op/op-waves.ts +28 -3
- package/src/op/schedule-overdue.test.ts +29 -1
- package/src/op/schedule-overdue.ts +27 -3
- package/src/op/stage-hooks.ts +52 -4
- package/src/op/wave-stop.ts +5 -3
- package/src/planned-files.test.ts +33 -0
- package/src/planned-files.ts +26 -10
- package/src/pr-post.ts +13 -5
- package/src/release-floors.ts +31 -19
- package/src/wave-blocked.ts +9 -4
package/dist/ci-job-guard.js
CHANGED
|
@@ -41,9 +41,41 @@
|
|
|
41
41
|
* label. Someone who can edit the workflow can delete it too: the forge's
|
|
42
42
|
* environment and runner settings and the cloud role's trust are what keep
|
|
43
43
|
* a job out.
|
|
44
|
+
*
|
|
45
|
+
* Before merge (#4984): a waves workflow with a before-merge mode carries
|
|
46
|
+
* `beforeMerge: { op }`. A run started for an open pull request's head
|
|
47
|
+
* names it in `CHANT_BEFORE_MERGE_PR`, `CHANT_BEFORE_MERGE_HEAD` and
|
|
48
|
+
* `CHANT_BEFORE_MERGE_DIGEST` (./op/before-merge.ts), and still runs on one
|
|
49
|
+
* of the spec's branches. The guard then fetches `chant/lifecycle` into a
|
|
50
|
+
* directory of its own, with the job's token (GitHub and Forgejo
|
|
51
|
+
* `GITHUB_TOKEN`, GitLab `CI_JOB_TOKEN`), reads the decision for that head,
|
|
52
|
+
* and admits the run only when the pull request and the digest are the
|
|
53
|
+
* decision's and the decision's fields still give its digest. A job of a
|
|
54
|
+
* workflow without the mode refuses any run that names a head.
|
|
55
|
+
*
|
|
56
|
+
* A follow-on run (#4992, ./op/follow-on-run.ts): a job of a `rest` wave
|
|
57
|
+
* carries `rest: <its wave number>`. A run the rest wave's record job
|
|
58
|
+
* started names a later wave in `CHANT_WAVES_WAVE`, with the same decision
|
|
59
|
+
* (admitted as above, so a follow-on for another head or digest is refused)
|
|
60
|
+
* or, for a push, the pushed commit in `CHANT_WAVES_COMMIT`. The guard
|
|
61
|
+
* admits it only in a job of the rest wave and only for a wave after it; any
|
|
62
|
+
* other job refuses a run that names either variable.
|
|
63
|
+
*
|
|
64
|
+
* #4998: and only for the wave the newest record job of its chain started.
|
|
65
|
+
* The guard reads the follow-on records of the op (`_waves/<op>.follow-on.json`
|
|
66
|
+
* on `chant/lifecycle`, as it reads the decisions) and admits the run when
|
|
67
|
+
* the entry for its decided head, or a push's commit, names the run's wave
|
|
68
|
+
* and, before merge, the run's decision digest. A wave started by hand past
|
|
69
|
+
* the one the chain reached is refused, though each wave's gate would ask.
|
|
44
70
|
*/
|
|
71
|
+
import { spawnSync } from "node:child_process";
|
|
72
|
+
import { mkdtempSync } from "node:fs";
|
|
73
|
+
import { tmpdir } from "node:os";
|
|
74
|
+
import { join } from "node:path";
|
|
45
75
|
import { isRunnerGroup } from "./ci-jobs.js";
|
|
46
76
|
import { CHANT_EXIT } from "./exit-codes.js";
|
|
77
|
+
import { BEFORE_MERGE_DIGEST_ENV, BEFORE_MERGE_HEAD_ENV, BEFORE_MERGE_PR_ENV, beforeMergePath, beforeMergeProblems, beforeMergeRunFromEnv, isBeforeMergeRun, parseBeforeMerge } from "./op/before-merge.js";
|
|
78
|
+
import { followOnPath, followOnProblems, followOnRecordProblems, followOnRunFromEnv, OP_WAVES_COMMIT_ENV, OP_WAVES_WAVE_ENV, parseFollowOn } from "./op/follow-on-run.js";
|
|
47
79
|
/** The variable the generated step carries its expectation in. */
|
|
48
80
|
export const JOB_GUARD_ENV = "CHANT_JOB_GUARD";
|
|
49
81
|
/** The audience of the token the guard requests on GitHub, which no cloud role should trust. */
|
|
@@ -63,6 +95,8 @@ export function jobGuardSpec(input) {
|
|
|
63
95
|
branches: [...input.branches],
|
|
64
96
|
...(input.forge === "gitlab" && labels.length > 0 ? { runnerTags: labels } : {}),
|
|
65
97
|
...(input.forge !== "gitlab" && labels.includes("self-hosted") ? { selfHosted: true } : {}),
|
|
98
|
+
...(input.beforeMerge ? { beforeMerge: { op: input.beforeMerge.op } } : {}),
|
|
99
|
+
...(input.rest !== undefined ? { rest: input.rest } : {}),
|
|
66
100
|
};
|
|
67
101
|
}
|
|
68
102
|
/** Read {@link JOB_GUARD_ENV}'s JSON, refusing one that is not a guard spec. */
|
|
@@ -89,6 +123,10 @@ export function parseJobGuardSpec(raw) {
|
|
|
89
123
|
throw new Error(`${JOB_GUARD_ENV}.forgeEnvironment is not a name`);
|
|
90
124
|
if (o.runnerTags !== undefined && (!Array.isArray(o.runnerTags) || o.runnerTags.some((t) => typeof t !== "string")))
|
|
91
125
|
throw new Error(`${JOB_GUARD_ENV}.runnerTags is not a list of tags`);
|
|
126
|
+
if (o.beforeMerge !== undefined && (typeof o.beforeMerge !== "object" || o.beforeMerge === null || typeof o.beforeMerge.op !== "string"))
|
|
127
|
+
throw new Error(`${JOB_GUARD_ENV}.beforeMerge is { op }`);
|
|
128
|
+
if (o.rest !== undefined && (!Number.isInteger(o.rest) || o.rest < 1))
|
|
129
|
+
throw new Error(`${JOB_GUARD_ENV}.rest is the rest wave's number`);
|
|
92
130
|
return o;
|
|
93
131
|
}
|
|
94
132
|
const shown = (v) => (v === undefined || v === null || v === "" ? "none" : v);
|
|
@@ -154,6 +192,38 @@ export function checkJob(expect, seen) {
|
|
|
154
192
|
else
|
|
155
193
|
out.checked.push(`ref ${seen.ref}`);
|
|
156
194
|
}
|
|
195
|
+
// #4984: a run started for an open pull request's head runs only as the decision recorded for it.
|
|
196
|
+
const run = seen.beforeMerge;
|
|
197
|
+
if (run && isBeforeMergeRun(run)) {
|
|
198
|
+
if (!expect.beforeMerge)
|
|
199
|
+
out.problems.push(`before merge: the run names pull request ${run.pr ?? "none"}'s head ${run.head ?? "none"}, and this job applies only the pushes to its branches`);
|
|
200
|
+
else if (seen.beforeMergeError !== undefined)
|
|
201
|
+
out.problems.push(`before merge: the decisions on chant/lifecycle could not be read: ${seen.beforeMergeError}`);
|
|
202
|
+
else {
|
|
203
|
+
const problems = beforeMergeProblems(expect.beforeMerge.op, run, seen.beforeMergeRecord ?? undefined);
|
|
204
|
+
if (problems.length > 0)
|
|
205
|
+
out.problems.push(...problems);
|
|
206
|
+
else
|
|
207
|
+
out.checked.push(`before merge: pull request ${run.pr}'s decided head ${run.head.slice(0, 12)}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
// #4992: a follow-on run of the rest wave, admitted in the rest wave's jobs alone and for a later wave.
|
|
211
|
+
const bmRun = run !== undefined && isBeforeMergeRun(run);
|
|
212
|
+
const follow = followOnProblems(expect.rest, seen.followOn ?? {}, bmRun);
|
|
213
|
+
out.problems.push(...follow.problems);
|
|
214
|
+
if (follow.checked) {
|
|
215
|
+
// #4998: and only for the wave the newest record job of its chain started.
|
|
216
|
+
const key = (bmRun ? run.head : seen.followOn?.commit) ?? "";
|
|
217
|
+
const rec = !expect.beforeMerge
|
|
218
|
+
? ["follow-on: this job names no op whose follow-on records it reads, so it admits no follow-on"]
|
|
219
|
+
: seen.followOnError !== undefined
|
|
220
|
+
? [`follow-on: the follow-on records on chant/lifecycle could not be read: ${seen.followOnError}`]
|
|
221
|
+
: followOnRecordProblems(expect.beforeMerge.op, seen.followOn.wave, key, bmRun ? (run.digest ?? "") : undefined, seen.followOnRecord);
|
|
222
|
+
if (rec.length > 0)
|
|
223
|
+
out.problems.push(...rec);
|
|
224
|
+
else
|
|
225
|
+
out.checked.push(follow.checked);
|
|
226
|
+
}
|
|
157
227
|
if (expect.forge === "gitlab") {
|
|
158
228
|
const want = expect.runnerTags ?? [];
|
|
159
229
|
if (want.length > 0) {
|
|
@@ -192,7 +262,72 @@ async function githubClaims(env, fetchFn) {
|
|
|
192
262
|
return tokenClaims(value);
|
|
193
263
|
}
|
|
194
264
|
/** What the job sees, from the forge's variables, and on GitHub from its token's claims when the forge environment is to be checked. */
|
|
195
|
-
export async function jobSeen(expect, env = process.env, fetchFn = fetch) {
|
|
265
|
+
export async function jobSeen(expect, env = process.env, fetchFn = fetch, readLifecycle = lifecycleFileByGit) {
|
|
266
|
+
const seen = await forgeSeen(expect, env, fetchFn);
|
|
267
|
+
// #4992: the follow-on variables, whatever else the run names.
|
|
268
|
+
const follow = followOnRunFromEnv(env);
|
|
269
|
+
if (follow.wave !== undefined || follow.commit !== undefined)
|
|
270
|
+
seen.followOn = follow;
|
|
271
|
+
// #4984: the decision a run names, read only when the spec has a before-merge mode.
|
|
272
|
+
const run = beforeMergeRunFromEnv(env);
|
|
273
|
+
const bm = isBeforeMergeRun(run);
|
|
274
|
+
if (bm) {
|
|
275
|
+
seen.beforeMerge = run;
|
|
276
|
+
if (expect.beforeMerge && run.head) {
|
|
277
|
+
try {
|
|
278
|
+
const text = readLifecycle(expect.forge, env, beforeMergePath(expect.beforeMerge.op));
|
|
279
|
+
seen.beforeMergeRecord = parseBeforeMerge(text).heads[run.head] ?? null;
|
|
280
|
+
}
|
|
281
|
+
catch (e) {
|
|
282
|
+
seen.beforeMergeError = e.message;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
// #4998: the record of the run's chain, read only for a follow-on the rest wave's job would admit.
|
|
287
|
+
const key = bm ? run.head : follow.commit;
|
|
288
|
+
if (expect.beforeMerge && key && followOnProblems(expect.rest, follow, bm).checked !== undefined) {
|
|
289
|
+
try {
|
|
290
|
+
seen.followOnRecord = parseFollowOn(readLifecycle(expect.forge, env, followOnPath(expect.beforeMerge.op))).chains[key] ?? null;
|
|
291
|
+
}
|
|
292
|
+
catch (e) {
|
|
293
|
+
seen.followOnError = e.message;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return seen;
|
|
297
|
+
}
|
|
298
|
+
/** The repository's git URL and the job token's basic credentials, as the guard fetches with them (#4984). */
|
|
299
|
+
export function guardRemote(forge, env) {
|
|
300
|
+
if (forge === "gitlab") {
|
|
301
|
+
if (!env.CI_SERVER_URL || !env.CI_PROJECT_PATH)
|
|
302
|
+
throw new Error("the job names no repository (no CI_SERVER_URL or CI_PROJECT_PATH)");
|
|
303
|
+
return { url: `${env.CI_SERVER_URL.replace(/\/+$/, "")}/${env.CI_PROJECT_PATH}.git`, user: "gitlab-ci-token", token: env.CI_JOB_TOKEN ?? "" };
|
|
304
|
+
}
|
|
305
|
+
if (!env.GITHUB_SERVER_URL || !env.GITHUB_REPOSITORY)
|
|
306
|
+
throw new Error("the job names no repository (no GITHUB_SERVER_URL or GITHUB_REPOSITORY)");
|
|
307
|
+
return { url: `${env.GITHUB_SERVER_URL.replace(/\/+$/, "")}/${env.GITHUB_REPOSITORY}.git`, user: "x-access-token", token: env.GITHUB_TOKEN ?? "" };
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* {@link LifecycleFileReader} through git: `chant/lifecycle` fetched at depth
|
|
311
|
+
* one into a directory of the guard's own, outside the checkout, with the
|
|
312
|
+
* token as a basic credential header, and the file shown from it. The
|
|
313
|
+
* `node -e` program does the same.
|
|
314
|
+
*/
|
|
315
|
+
export const lifecycleFileByGit = (forge, env, path) => {
|
|
316
|
+
const remote = guardRemote(forge, env);
|
|
317
|
+
const dir = mkdtempSync(join(tmpdir(), "chant-guard-"));
|
|
318
|
+
const git = (args) => spawnSync("git", args, { cwd: dir, encoding: "utf-8", env: { ...env, GIT_TERMINAL_PROMPT: "0" } });
|
|
319
|
+
const init = git(["init", "-q"]);
|
|
320
|
+
if (init.status !== 0)
|
|
321
|
+
throw new Error(`git init failed: ${(init.stderr || "").trim()}`);
|
|
322
|
+
const auth = `Authorization: Basic ${Buffer.from(`${remote.user}:${remote.token}`).toString("base64")}`;
|
|
323
|
+
const fetched = git(["-c", `http.extraHeader=${auth}`, "fetch", "-q", "--depth=1", remote.url, "refs/heads/chant/lifecycle"]);
|
|
324
|
+
if (fetched.status !== 0)
|
|
325
|
+
throw new Error(`could not fetch chant/lifecycle: ${(fetched.stderr || "").trim().split("\n").pop()}`);
|
|
326
|
+
const shown = git(["show", `FETCH_HEAD:${path}`]);
|
|
327
|
+
return shown.status === 0 ? shown.stdout : null;
|
|
328
|
+
};
|
|
329
|
+
/** What the forge's own variables and token say, before the decision is read. */
|
|
330
|
+
async function forgeSeen(expect, env, fetchFn) {
|
|
196
331
|
if (expect.forge === "gitlab") {
|
|
197
332
|
return {
|
|
198
333
|
forgeEnvironment: env.CI_ENVIRONMENT_NAME || null,
|
|
@@ -230,6 +365,66 @@ export function describeJobGuard(expect, result) {
|
|
|
230
365
|
const skipped = result.skipped.length ? `; not checked: ${result.skipped.join(", ")}` : "";
|
|
231
366
|
return { ok: true, out: [`${at}: ${result.checked.length ? result.checked.join(", ") : "nothing to check"}${skipped}`], err: [] };
|
|
232
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* The before-merge part of the `node -e` program (#4984): the run's three
|
|
370
|
+
* variables, the read of `chant/lifecycle` as {@link lifecycleFileByGit}
|
|
371
|
+
* does it, the decision entry as {@link parseBeforeMerge} keeps it, and the
|
|
372
|
+
* lines of {@link beforeMergeProblems}, digest included. No single quote,
|
|
373
|
+
* since the program is one shell word in single quotes.
|
|
374
|
+
*/
|
|
375
|
+
const BM_PATH = beforeMergePath("\u0000").split("\u0000");
|
|
376
|
+
/** Each apostrophe in the program's strings as `'`, since the whole program is one single-quoted shell word. */
|
|
377
|
+
const noQuote = (s) => s.replace(/'/g, "\\u0027");
|
|
378
|
+
const BEFORE_MERGE_JS = [
|
|
379
|
+
`const bmV=[${JSON.stringify(BEFORE_MERGE_PR_ENV)},${JSON.stringify(BEFORE_MERGE_HEAD_ENV)},${JSON.stringify(BEFORE_MERGE_DIGEST_ENV)}].map((k)=>String(E[k]||"").trim());`,
|
|
380
|
+
'const bmRun={};if(bmV[0])bmRun.pr=bmV[0];if(bmV[1])bmRun.head=bmV[1];if(bmV[2])bmRun.digest=bmV[2];const bmOn=Boolean(bmV[0]||bmV[1]||bmV[2]);',
|
|
381
|
+
"const SHA=/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;",
|
|
382
|
+
String.raw `const bmRead=(file)=>{const cp=require("child_process"),fs=require("fs"),os=require("os"),pa=require("path");let url,user,tok;`,
|
|
383
|
+
String.raw `if(x.forge==="gitlab"){if(!E.CI_SERVER_URL||!E.CI_PROJECT_PATH)throw new Error("the job names no repository (no CI_SERVER_URL or CI_PROJECT_PATH)");url=E.CI_SERVER_URL.replace(/\/+$/,"")+"/"+E.CI_PROJECT_PATH+".git";user="gitlab-ci-token";tok=E.CI_JOB_TOKEN||""}`,
|
|
384
|
+
String.raw `else{if(!E.GITHUB_SERVER_URL||!E.GITHUB_REPOSITORY)throw new Error("the job names no repository (no GITHUB_SERVER_URL or GITHUB_REPOSITORY)");url=E.GITHUB_SERVER_URL.replace(/\/+$/,"")+"/"+E.GITHUB_REPOSITORY+".git";user="x-access-token";tok=E.GITHUB_TOKEN||""}`,
|
|
385
|
+
String.raw `const d=fs.mkdtempSync(pa.join(os.tmpdir(),"chant-guard-"));const g=(a)=>cp.spawnSync("git",a,{cwd:d,encoding:"utf-8",env:Object.assign({},E,{GIT_TERMINAL_PROMPT:"0"})});`,
|
|
386
|
+
String.raw `const i=g(["init","-q"]);if(i.status!==0)throw new Error("git init failed: "+String(i.stderr||"").trim());`,
|
|
387
|
+
String.raw `const f=g(["-c","http.extraHeader=Authorization: Basic "+Buffer.from(user+":"+tok).toString("base64"),"fetch","-q","--depth=1",url,"refs/heads/chant/lifecycle"]);`,
|
|
388
|
+
String.raw `if(f.status!==0)throw new Error("could not fetch chant/lifecycle: "+String(f.stderr||"").trim().split("\n").pop());`,
|
|
389
|
+
String.raw `const o=g(["show","FETCH_HEAD:"+file]);return o.status===0?o.stdout:null};`,
|
|
390
|
+
String.raw `const bmEntry=(t,h)=>{let v;try{v=JSON.parse(t===null?"null":t)}catch(e){return null}const hs=v&&typeof v==="object"&&v.version===1?v.heads:undefined;if(!hs||typeof hs!=="object"||!SHA.test(h))return null;const e=hs[h];`,
|
|
391
|
+
String.raw `if(!e||typeof e!=="object"||e.head!==h||!Number.isInteger(e.pr)||e.pr<1||typeof e.base!=="string"||!SHA.test(e.base)||typeof e.at!=="string"||typeof e.by!=="string"||typeof e.digest!=="string")return null;`,
|
|
392
|
+
String.raw `if(e.through!==undefined&&(!Number.isInteger(e.through)||e.through<1))return null;const r={pr:e.pr,head:h,base:e.base,at:e.at,by:e.by,digest:e.digest};if(e.through!==undefined)r.through=e.through;return r};`,
|
|
393
|
+
`const bmSeen=(s)=>{if(!bmOn)return s;s.beforeMerge=bmRun;if(!x.beforeMerge||!bmRun.head)return s;try{s.rec=bmEntry(bmRead(${JSON.stringify(BM_PATH[0])}+x.beforeMerge.op+${JSON.stringify(BM_PATH[1])}),bmRun.head)}catch(e){s.bmErr=e&&e.message?e.message:String(e)}return s};`,
|
|
394
|
+
'const shownJ=(v)=>v===undefined||v===""?"none":JSON.stringify(v);',
|
|
395
|
+
String.raw `const bmProblems=(op,r,rec)=>{const p=[];if(!r.pr||!/^[1-9][0-9]{0,9}$/.test(r.pr))p.push("before merge: the run's pull request "+shownJ(r.pr)+" is not a number");`,
|
|
396
|
+
String.raw `if(!r.head||!SHA.test(r.head))p.push("before merge: the run's head "+shownJ(r.head)+" is not a commit sha");`,
|
|
397
|
+
String.raw `if(!r.digest||!/^sha256:[0-9a-f]{64}$/.test(r.digest))p.push("before merge: the run's digest "+shownJ(r.digest)+" is not a sha256 digest");`,
|
|
398
|
+
String.raw `if(p.length)return p;const h=r.head.slice(0,12);if(!rec)return["before merge: no decision on chant/lifecycle names head "+h+" of "+op+", so this run applies nothing"];`,
|
|
399
|
+
String.raw `if(rec.pr!==Number(r.pr))p.push("before merge: the decision for head "+h+" is pull request "+rec.pr+"'s, not "+r.pr+"'s");`,
|
|
400
|
+
String.raw `if(rec.digest!==r.digest)p.push("before merge: the run carries digest "+r.digest+", and the decision for head "+h+" has "+rec.digest);`,
|
|
401
|
+
String.raw `const dg="sha256:"+require("crypto").createHash("sha256").update(JSON.stringify(["chant-before-merge/1",op,rec.pr,rec.head,rec.base,rec.through===undefined?0:rec.through,rec.at,rec.by])).digest("hex");`,
|
|
402
|
+
String.raw `if(dg!==rec.digest)p.push("before merge: the decision for head "+h+" was changed after it was made: its fields give another digest");return p};`,
|
|
403
|
+
].map(noQuote);
|
|
404
|
+
const FO_PATH = followOnPath("\u0000").split("\u0000");
|
|
405
|
+
/**
|
|
406
|
+
* The follow-on part of the program (#4992): the run's two variables and the lines of {@link followOnProblems}, and
|
|
407
|
+
* (#4998) the read of the chain's record and the lines of {@link followOnRecordProblems}. After {@link BEFORE_MERGE_JS},
|
|
408
|
+
* whose `SHA`, `bmRead` and decision variables it reads.
|
|
409
|
+
*/
|
|
410
|
+
const FOLLOW_ON_JS = [
|
|
411
|
+
`const foV=[${JSON.stringify(OP_WAVES_WAVE_ENV)},${JSON.stringify(OP_WAVES_COMMIT_ENV)}].map((k)=>String(E[k]||"").trim());const foRun={};if(foV[0])foRun.wave=foV[0];if(foV[1])foRun.commit=foV[1];`,
|
|
412
|
+
String.raw `const foProblems=(rest,r,bm)=>{const w=r.wave,c=r.commit;`,
|
|
413
|
+
String.raw `if(rest===undefined){if(w===undefined&&c===undefined)return{p:[]};return{p:["follow-on: the run names wave "+(w===undefined?"none":w)+" and commit "+(c===undefined?"none":c)+", and this job is none of the rest wave's, which alone runs in a follow-on"]}}`,
|
|
414
|
+
String.raw `if(w===undefined||w===String(rest)){if(c===undefined)return{p:[]};return{p:["follow-on: the run names the commit "+c+" and no wave after wave "+rest+", so it is no follow-on"]}}`,
|
|
415
|
+
String.raw `if(!/^[1-9][0-9]{0,5}$/.test(w)||Number(w)<=rest)return{p:["follow-on: the run's wave "+JSON.stringify(w)+" is no wave after wave "+rest]};`,
|
|
416
|
+
String.raw `if(bm){if(c!==undefined)return{p:["follow-on: a follow-on of a decided head checks out that head, and the run names the commit "+c+" too"]};return{p:[],c:"follow-on wave "+w}}`,
|
|
417
|
+
String.raw `if(c===undefined||!SHA.test(c))return{p:["follow-on: a push's follow-on names the commit it goes on with, and the run's "+(c===undefined?"none":JSON.stringify(c))+" is not a commit sha"]};`,
|
|
418
|
+
String.raw `return{p:[],c:"follow-on wave "+w+" at "+c.slice(0,12)}};`,
|
|
419
|
+
// #4998: the record of the run's chain, as parseFollowOn keeps an entry, and the lines of followOnRecordProblems.
|
|
420
|
+
String.raw `const foEntry=(t,k)=>{let v;try{v=JSON.parse(t===null?"null":t)}catch(e){return null}const cs=v&&typeof v==="object"&&v.version===1?v.chains:undefined;if(!cs||typeof cs!=="object"||!SHA.test(k))return null;const e=cs[k];const W=(n,m)=>Number.isInteger(n)&&n>=m;`,
|
|
421
|
+
String.raw `if(!e||typeof e!=="object"||e.key!==k||!W(e.wave,2)||!W(e.from,1)||typeof e.run!=="string"||typeof e.at!=="string")return null;`,
|
|
422
|
+
String.raw `if((e.digest!==undefined&&typeof e.digest!=="string")||(e.pr!==undefined&&!W(e.pr,1))||(e.commit!==undefined&&(typeof e.commit!=="string"||!SHA.test(e.commit)))||!e.outcomes||typeof e.outcomes!=="object")return null;return e};`,
|
|
423
|
+
`const foSeen=(s)=>{const k=bmOn?bmRun.head:foRun.commit;if(!x.beforeMerge||!k||foProblems(x.rest,foRun,bmOn).c===undefined)return s;try{s.foRec=foEntry(bmRead(${JSON.stringify(FO_PATH[0])}+x.beforeMerge.op+${JSON.stringify(FO_PATH[1])}),k)}catch(e){s.foErr=e&&e.message?e.message:String(e)}return s};`,
|
|
424
|
+
String.raw `const foRecProblems=(op,w,k,dg,rec)=>{const what=dg!==undefined?"head":"commit";const sh=k.slice(0,12);if(!rec)return["follow-on: no record job of "+op+" started a follow-on for "+what+" "+sh+", so this run applies nothing"];const p=[];`,
|
|
425
|
+
String.raw `if(String(rec.wave)!==w)p.push("follow-on: the newest record job of "+op+" for "+what+" "+sh+" started wave "+rec.wave+", and this run names wave "+w);`,
|
|
426
|
+
String.raw `if(dg!==undefined&&rec.digest!==dg)p.push("follow-on: wave "+rec.wave+" of "+what+" "+sh+" was started for the decision with digest "+(rec.digest===undefined?"none":rec.digest)+", and the run carries "+dg);return p};`,
|
|
427
|
+
].map(noQuote);
|
|
233
428
|
/**
|
|
234
429
|
* The guard as one `node -e` program: the same checks as {@link checkJob},
|
|
235
430
|
* {@link jobSeen} and {@link describeJobGuard}, reading {@link JOB_GUARD_ENV}.
|
|
@@ -246,15 +441,17 @@ export const JOB_GUARD_JS = [
|
|
|
246
441
|
"if(!x||![\"github\",\"gitlab\",\"forgejo\"].includes(x.forge)||!Array.isArray(x.branches))fail(\"" + JOB_GUARD_ENV + " is not a guard spec\");",
|
|
247
442
|
'const tags=(r)=>{if(r===undefined)return undefined;const t=r.trim();if(t.startsWith("[")){try{const v=JSON.parse(t);if(Array.isArray(v))return v.map(String)}catch(e){}}return t===""?[]:t.split(",").map((s)=>s.trim()).filter((s)=>s!=="")};',
|
|
248
443
|
'const claimsOf=(tok)=>{const p=tok.split(".")[1];if(!p)throw new Error("the forge\\u0027s OIDC token is not a JWT");const c=JSON.parse(Buffer.from(p.replace(/-/g,"+").replace(/_/g,"/"),"base64").toString("utf-8"));if(!c||typeof c!=="object")throw new Error("the forge\\u0027s OIDC token has no claims");return c};',
|
|
444
|
+
...BEFORE_MERGE_JS,
|
|
445
|
+
...FOLLOW_ON_JS,
|
|
249
446
|
"async function seenOf(){",
|
|
250
|
-
'if(x.forge==="gitlab")return{forgeEnvironment:E.CI_ENVIRONMENT_NAME||null,ref:E.CI_COMMIT_REF_NAME,refProtected:E.CI_COMMIT_REF_PROTECTED,runnerTags:tags(E.CI_RUNNER_TAGS)};',
|
|
447
|
+
'if(x.forge==="gitlab")return foSeen(bmSeen({forgeEnvironment:E.CI_ENVIRONMENT_NAME||null,ref:E.CI_COMMIT_REF_NAME,refProtected:E.CI_COMMIT_REF_PROTECTED,runnerTags:tags(E.CI_RUNNER_TAGS)}));',
|
|
251
448
|
"const s={ref:E.GITHUB_REF};let c;",
|
|
252
449
|
'if(x.forge==="github"&&x.forgeEnvironment!==undefined){try{',
|
|
253
450
|
'if(!E.ACTIONS_ID_TOKEN_REQUEST_URL||!E.ACTIONS_ID_TOKEN_REQUEST_TOKEN)throw new Error("the job may request no OIDC token (no ACTIONS_ID_TOKEN_REQUEST_URL); it needs the id-token: write permission");',
|
|
254
451
|
'const r=await fetch(E.ACTIONS_ID_TOKEN_REQUEST_URL+"&audience="+encodeURIComponent(A),{headers:{authorization:"bearer "+E.ACTIONS_ID_TOKEN_REQUEST_TOKEN}});',
|
|
255
452
|
'if(!r.ok)throw new Error("the OIDC token request answered "+r.status);const v=(await r.json()).value;if(typeof v!=="string")throw new Error("the OIDC token request answered no token");',
|
|
256
453
|
'c=claimsOf(v);s.forgeEnvironment=typeof c.environment==="string"&&c.environment!==""?c.environment:null}catch(e){s.forgeEnvironmentError=e&&e.message?e.message:String(e)}}',
|
|
257
|
-
'const run=c&&typeof c.runner_environment==="string"?c.runner_environment:E.RUNNER_ENVIRONMENT;if(run)s.runnerEnvironment=run;return s}',
|
|
454
|
+
'const run=c&&typeof c.runner_environment==="string"?c.runner_environment:E.RUNNER_ENVIRONMENT;if(run)s.runnerEnvironment=run;return foSeen(bmSeen(s))}',
|
|
258
455
|
"seenOf().then((s)=>{const P=[],C=[],S=[];const fe=x.forgeEnvironment;",
|
|
259
456
|
'if(x.forge==="forgejo")S.push("forge environment (Forgejo has none)");',
|
|
260
457
|
'else if(fe!==undefined){if(s.forgeEnvironmentError!==undefined)P.push("forge environment: expected "+fe+", and it could not be read: "+s.forgeEnvironmentError);else if(s.forgeEnvironment!==fe)P.push("forge environment: expected "+fe+", found "+shown(s.forgeEnvironment));else C.push("forge environment "+fe)}',
|
|
@@ -263,6 +460,12 @@ export const JOB_GUARD_JS = [
|
|
|
263
460
|
'else if(x.forge==="gitlab"){if(!s.ref||!b.includes(s.ref))P.push("ref: expected "+b.join(" or ")+", found "+shown(s.ref));else C.push("ref "+s.ref);',
|
|
264
461
|
'if(s.refProtected!=="true")P.push("ref: expected a protected ref (CI_COMMIT_REF_PROTECTED true), found "+shown(s.refProtected));else C.push("protected ref")}',
|
|
265
462
|
'else{const refs=b.map((v)=>"refs/heads/"+v);if(!s.ref||!refs.includes(s.ref))P.push("ref: expected "+refs.join(" or ")+", found "+shown(s.ref));else C.push("ref "+s.ref)}',
|
|
463
|
+
...[
|
|
464
|
+
String.raw `if(s.beforeMerge){const r=s.beforeMerge;if(!x.beforeMerge)P.push("before merge: the run names pull request "+(r.pr||"none")+"'s head "+(r.head||"none")+", and this job applies only the pushes to its branches");`,
|
|
465
|
+
String.raw `else if(s.bmErr!==undefined)P.push("before merge: the decisions on chant/lifecycle could not be read: "+s.bmErr);`,
|
|
466
|
+
String.raw `else{const Q=bmProblems(x.beforeMerge.op,r,s.rec||undefined);if(Q.length)P.push(...Q);else C.push("before merge: pull request "+r.pr+"'s decided head "+r.head.slice(0,12))}}`,
|
|
467
|
+
].map(noQuote),
|
|
468
|
+
"{const F=foProblems(x.rest,foRun,bmOn);P.push(...F.p);if(F.c){const G=!x.beforeMerge?[\"follow-on: this job names no op whose follow-on records it reads, so it admits no follow-on\"]:s.foErr!==undefined?[\"follow-on: the follow-on records on chant/lifecycle could not be read: \"+s.foErr]:foRecProblems(x.beforeMerge.op,foRun.wave,(bmOn?bmRun.head:foRun.commit)||\"\",bmOn?(bmRun.digest||\"\"):undefined,s.foRec);if(G.length)P.push(...G);else C.push(F.c)}}",
|
|
266
469
|
'if(x.forge==="gitlab"){const w=x.runnerTags||[];if(w.length>0){const h=s.runnerTags;const miss=w.filter((t)=>!(h||[]).includes(t));',
|
|
267
470
|
'if(h===undefined)P.push("runner: expected tags "+w.join(", ")+", and the job has no CI_RUNNER_TAGS");else if(miss.length>0)P.push("runner: expected tags "+w.join(", ")+", found "+(h.length?h.join(", "):"none"));else C.push("runner tags "+w.join(", "))}}',
|
|
268
471
|
'else if(x.selfHosted){if(s.runnerEnvironment===undefined)S.push("runner (the runner says nothing about itself: no RUNNER_ENVIRONMENT)");else if(s.runnerEnvironment!=="self-hosted")P.push("runner: expected self-hosted, found "+s.runnerEnvironment);else C.push("self-hosted runner")}',
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
import { type CiProductWords, type ParsedProductComment } from "./ci-product-words.js";
|
|
30
30
|
import { type ForgeKind, type GitlabForgeOptions, type PrForge } from "./pr-forge.js";
|
|
31
31
|
import type { ForgeReads, PullRequestDetail, PullRequestNote, RunJob, WorkflowRun } from "./pr-forge-reads.js";
|
|
32
|
+
import type { DecideBeforeMergeInput, WavesBeforeMergeJobs } from "./op/before-merge-decide.js";
|
|
32
33
|
export { GITLAB_NOTE_COMMANDS_VAR } from "./components/pr-pipeline.js";
|
|
33
34
|
/** How far back the poll reads: merge requests updated, and notes written, in this many minutes. */
|
|
34
35
|
export declare const NOTE_COMMANDS_WINDOW_MINUTES: number;
|
|
@@ -93,6 +94,15 @@ export type NoteRun =
|
|
|
93
94
|
kind: "retry";
|
|
94
95
|
sha: string;
|
|
95
96
|
jobs?: RegExp;
|
|
97
|
+
/**
|
|
98
|
+
* With the waves' op (#4984, the GitLab half of #4979's stop): the
|
|
99
|
+
* stop written for `sha` on `chant/lifecycle` just before the retry,
|
|
100
|
+
* the last wave that runs, or null to clear an earlier one.
|
|
101
|
+
*/
|
|
102
|
+
stop?: {
|
|
103
|
+
op: string;
|
|
104
|
+
through: number | null;
|
|
105
|
+
};
|
|
96
106
|
}
|
|
97
107
|
/** A reply, and nothing runs. */
|
|
98
108
|
| {
|
|
@@ -155,6 +165,13 @@ export interface NoteCommandsOptions {
|
|
|
155
165
|
env?: Record<string, string | undefined>;
|
|
156
166
|
/** The commit words that take an argument, as `parseProductComment` takes them. */
|
|
157
167
|
commitArgs?: Readonly<Record<string, RegExp>>;
|
|
168
|
+
/** Writes a retry's wave stop for op `op` at `sha`, or clears it (#4984). Absent: a retry that carries a stop is refused. */
|
|
169
|
+
stops?: (op: string, sha: string, stop: {
|
|
170
|
+
through: number;
|
|
171
|
+
at: string;
|
|
172
|
+
by?: string;
|
|
173
|
+
pr?: number;
|
|
174
|
+
} | null) => Promise<void>;
|
|
158
175
|
}
|
|
159
176
|
export interface NotePoll {
|
|
160
177
|
outcomes: NoteOutcome[];
|
|
@@ -235,13 +252,36 @@ export interface ChantNoteJobs {
|
|
|
235
252
|
* reply, and nothing starts. Absent: any member a comment may name.
|
|
236
253
|
*/
|
|
237
254
|
members?: readonly string[];
|
|
255
|
+
/**
|
|
256
|
+
* The waves on merge (#4984, as the comment job's #4979): their op and
|
|
257
|
+
* count. With them a merged merge request's `wave-<n>` writes a stop for
|
|
258
|
+
* the merge commit before the retry, and an apply without a wave clears
|
|
259
|
+
* it; without them a `wave-<n>` is refused, as before.
|
|
260
|
+
*/
|
|
261
|
+
waves?: {
|
|
262
|
+
op: string;
|
|
263
|
+
count: number;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* The waves before merge (#4984), with `waves`: an open merge request's
|
|
267
|
+
* apply is decided here (./op/before-merge-decide.ts), recorded on
|
|
268
|
+
* `chant/lifecycle`, and runs in a pipeline of the default branch started
|
|
269
|
+
* with `CHANT_BEFORE_MERGE_PR`, `CHANT_BEFORE_MERGE_HEAD` and
|
|
270
|
+
* `CHANT_BEFORE_MERGE_DIGEST`.
|
|
271
|
+
*/
|
|
272
|
+
wavesBeforeMerge?: WavesBeforeMergeJobs;
|
|
273
|
+
}
|
|
274
|
+
/** What {@link chantNoteRuns} reads and writes with besides the jobs (#4984). */
|
|
275
|
+
export interface ChantNoteRunsOptions {
|
|
276
|
+
/** With `jobs.wavesBeforeMerge`: what the decision before merge reads and writes with. */
|
|
277
|
+
beforeMerge?: Pick<DecideBeforeMergeInput, "requires" | "statuses" | "git" | "cwd" | "lock" | "record" | "stop" | "now">;
|
|
238
278
|
}
|
|
239
279
|
/**
|
|
240
280
|
* What a command runs in chant's own GitLab pipeline, for the jobs it has.
|
|
241
281
|
* A command no job runs gets the words' reply for it (`words.replies`,
|
|
242
282
|
* #4946), else chant's.
|
|
243
283
|
*/
|
|
244
|
-
export declare function chantNoteRuns(jobs: ChantNoteJobs): NoteCommandRuns;
|
|
284
|
+
export declare function chantNoteRuns(jobs: ChantNoteJobs, opts?: ChantNoteRunsOptions): NoteCommandRuns;
|
|
245
285
|
/** The directory on `chant/lifecycle` that keeps the notes the poll answered. */
|
|
246
286
|
export declare const NOTES_DIR = "_notes";
|
|
247
287
|
/** A note's file in {@link NOTES_DIR}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-note-commands.d.ts","sourceRoot":"","sources":["../src/ci-note-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,EAAoE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGtJ,OAAO,EAAkC,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AACnH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ci-note-commands.d.ts","sourceRoot":"","sources":["../src/ci-note-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,EAAoE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGtJ,OAAO,EAAkC,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AACnH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC5G,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAE7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,oGAAoG;AACpG,eAAO,MAAM,4BAA4B,QAAU,CAAC;AAEpD,oGAAoG;A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AM,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC;CAC1H;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,GAAE,oBAAyB,GAAG,eAAe,CAsDnG;AAmCD,iFAAiF;AACjF,eAAO,MAAM,SAAS,WAAW,CAAC;AAElC,0CAA0C;AAC1C,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAiBlF"}
|
package/dist/ci-note-commands.js
CHANGED
|
@@ -206,7 +206,27 @@ async function answer(o, mr, note, least, at, me) {
|
|
|
206
206
|
return reply(`started pipeline${link(started)} to ${run.doing} for ${note.author}`, true, started.url);
|
|
207
207
|
}
|
|
208
208
|
case "retry": {
|
|
209
|
-
|
|
209
|
+
// #4984: the stop goes on chant/lifecycle just before the retry, so every wave job after it reads it.
|
|
210
|
+
const stop = run.stop;
|
|
211
|
+
if (stop && !o.stops)
|
|
212
|
+
return broke("the retry carries a wave stop, and this poll cannot write one");
|
|
213
|
+
const retry = gitlabRetry(o.pipelines);
|
|
214
|
+
const author = note.author;
|
|
215
|
+
const rerun = stop
|
|
216
|
+
? async (pipeline, jobs, ctx) => {
|
|
217
|
+
try {
|
|
218
|
+
await o.stops(stop.op, run.sha, stop.through === null ? null : { through: stop.through, at, by: author, pr: mr.number });
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
221
|
+
return { kind: "fail", reason: `could not write the wave stop for ${short(run.sha)}, so nothing was retried (${message(e)})` };
|
|
222
|
+
}
|
|
223
|
+
return retry(pipeline, jobs, ctx);
|
|
224
|
+
}
|
|
225
|
+
: retry;
|
|
226
|
+
const done = await retryApply(o, "gitlab", mr, note.author, run, rerun);
|
|
227
|
+
if (done.kind === "ran" && stop?.through !== null && stop?.through !== undefined) {
|
|
228
|
+
return reply(`${done.text}; it stops after \`wave-${stop.through}\`, and the waves after it wait until ${commandLine(o.words, "apply")} runs it again`, true, done.url);
|
|
229
|
+
}
|
|
210
230
|
if (done.kind === "fail")
|
|
211
231
|
return broke(done.reason);
|
|
212
232
|
return reply(done.text, done.kind === "ran", done.kind === "ran" ? done.url : undefined);
|
|
@@ -302,7 +322,7 @@ export function gitlabRetry(pipelines) {
|
|
|
302
322
|
* A command no job runs gets the words' reply for it (`words.replies`,
|
|
303
323
|
* #4946), else chant's.
|
|
304
324
|
*/
|
|
305
|
-
export function chantNoteRuns(jobs) {
|
|
325
|
+
export function chantNoteRuns(jobs, opts = {}) {
|
|
306
326
|
return ({ mr, note, parsed, base, words }) => {
|
|
307
327
|
const iid = String(mr.number);
|
|
308
328
|
const at = `!${mr.number}`;
|
|
@@ -316,7 +336,7 @@ export function chantNoteRuns(jobs) {
|
|
|
316
336
|
const open = mr.state === "open";
|
|
317
337
|
const intoBase = mr.base === undefined || mr.base === base;
|
|
318
338
|
// #4946: the product's sentence for an apply no job answers, in place of chant's, which say what the merge does.
|
|
319
|
-
if (parsed.kind === "apply" && !jobs.applyBeforeMerge && !jobs.applyOnMerge && words.replies?.apply !== undefined)
|
|
339
|
+
if (parsed.kind === "apply" && !jobs.applyBeforeMerge && !jobs.applyOnMerge && !jobs.wavesBeforeMerge && words.replies?.apply !== undefined)
|
|
320
340
|
return { kind: "reply", text: words.replies.apply };
|
|
321
341
|
switch (parsed.kind) {
|
|
322
342
|
case "plan":
|
|
@@ -327,6 +347,9 @@ export function chantNoteRuns(jobs) {
|
|
|
327
347
|
return { kind: "merge-request-pipeline", doing: `${words.verbs.plan[0]} ${at} again` };
|
|
328
348
|
case "apply":
|
|
329
349
|
if (open) {
|
|
350
|
+
// #4984: the waves before merge decide here, and the pipeline they start runs the decided head.
|
|
351
|
+
if (jobs.wavesBeforeMerge && jobs.waves && opts.beforeMerge && !jobs.applyBeforeMerge)
|
|
352
|
+
return wavesBeforeMergeRun(jobs, opts.beforeMerge, { mr, note, parsed, base, words });
|
|
330
353
|
if (!jobs.applyBeforeMerge)
|
|
331
354
|
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` };
|
|
332
355
|
if (!intoBase)
|
|
@@ -338,13 +361,16 @@ export function chantNoteRuns(jobs) {
|
|
|
338
361
|
if (!jobs.applyOnMerge) {
|
|
339
362
|
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` };
|
|
340
363
|
}
|
|
341
|
-
|
|
364
|
+
// #4984: with the waves' op, a wave-<n> writes a stop for the merge commit before the retry, as on GitHub and Forgejo.
|
|
365
|
+
if (parsed.wave !== undefined && !jobs.waves)
|
|
342
366
|
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` };
|
|
367
|
+
if (parsed.wave !== undefined && jobs.waves && parsed.wave > jobs.waves.count)
|
|
368
|
+
return { kind: "reply", text: `the ${words.verbs.apply[0]} of this project runs in ${jobs.waves.count} wave${jobs.waves.count === 1 ? "" : "s"}, so there is no \`wave-${parsed.wave}\`` };
|
|
343
369
|
if (!intoBase)
|
|
344
370
|
return { kind: "reply", text: `${at} was merged into ${mr.base}, not the default branch ${base}, so nothing applies from it` };
|
|
345
371
|
if (!mr.mergeCommit)
|
|
346
372
|
return { kind: "fail", reason: `${at} has no merge commit` };
|
|
347
|
-
return { kind: "retry", sha: mr.mergeCommit };
|
|
373
|
+
return { kind: "retry", sha: mr.mergeCommit, ...(jobs.waves ? { stop: { op: jobs.waves.op, through: parsed.wave !== undefined && parsed.wave < jobs.waves.count ? parsed.wave : null } } : {}) };
|
|
348
374
|
case "lock":
|
|
349
375
|
case "unlock":
|
|
350
376
|
if (!jobs.locks)
|
|
@@ -371,6 +397,39 @@ export function chantNoteRuns(jobs) {
|
|
|
371
397
|
}
|
|
372
398
|
};
|
|
373
399
|
}
|
|
400
|
+
/**
|
|
401
|
+
* An open merge request's apply under the waves before merge (#4984): the
|
|
402
|
+
* decision records the head, and the run is a pipeline of the default branch
|
|
403
|
+
* started with the decision's three variables, which the wave jobs' guard
|
|
404
|
+
* checks against the record.
|
|
405
|
+
*/
|
|
406
|
+
async function wavesBeforeMergeRun(jobs, deps, c) {
|
|
407
|
+
const parsed = c.parsed;
|
|
408
|
+
const { decideWavesBeforeMerge } = await import("./op/before-merge-decide.js");
|
|
409
|
+
const { BEFORE_MERGE_DIGEST_ENV, BEFORE_MERGE_HEAD_ENV, BEFORE_MERGE_PR_ENV } = await import("./op/before-merge.js");
|
|
410
|
+
let variables;
|
|
411
|
+
const done = await decideWavesBeforeMerge({
|
|
412
|
+
...deps,
|
|
413
|
+
forge: "gitlab",
|
|
414
|
+
pr: c.mr,
|
|
415
|
+
user: c.note.author ?? "",
|
|
416
|
+
base: c.base,
|
|
417
|
+
...(parsed.wave !== undefined ? { wave: parsed.wave } : {}),
|
|
418
|
+
op: jobs.waves.op,
|
|
419
|
+
count: jobs.waves.count,
|
|
420
|
+
jobs: jobs.wavesBeforeMerge,
|
|
421
|
+
words: c.words,
|
|
422
|
+
// The poll starts the pipeline once the decision is recorded, and its reply links it.
|
|
423
|
+
start: async (r) => {
|
|
424
|
+
variables = { [BEFORE_MERGE_PR_ENV]: String(r.pr), [BEFORE_MERGE_HEAD_ENV]: r.head, [BEFORE_MERGE_DIGEST_ENV]: r.digest };
|
|
425
|
+
return {};
|
|
426
|
+
},
|
|
427
|
+
});
|
|
428
|
+
if (done.kind !== "ran")
|
|
429
|
+
return done.kind === "fail" ? { kind: "fail", reason: done.reason } : { kind: "reply", text: done.text };
|
|
430
|
+
const through = parsed.wave !== undefined && parsed.wave < jobs.waves.count ? ` through wave ${parsed.wave}` : "";
|
|
431
|
+
return { kind: "pipeline", ref: c.base, variables: variables, doing: `${c.words.verbs.apply[0]} !${c.mr.number}'s head ${short(c.mr.headSha ?? "")}${through} before it merges` };
|
|
432
|
+
}
|
|
374
433
|
/** The directory on `chant/lifecycle` that keeps the notes the poll answered. */
|
|
375
434
|
export const NOTES_DIR = "_notes";
|
|
376
435
|
/** A note's file in {@link NOTES_DIR}. */
|
package/dist/ci-product.d.ts
CHANGED
|
@@ -77,11 +77,51 @@ export { planFlagsReply } from "./ci-comment-commands.js";
|
|
|
77
77
|
*/
|
|
78
78
|
export declare const WAVE_STOP_FLOOR = "0.124.89";
|
|
79
79
|
export { setWaveStop, waveStopAt, waveStopLine, type WaveStop } from "./op/wave-stop.js";
|
|
80
|
+
/**
|
|
81
|
+
* The first chant whose Op waves run before merge (#4984): `wavesBeforeMerge` in the product pipeline, where the comment job (GitHub, Forgejo) or the note poll (GitLab) decides `/<product> apply [wave-<n>]` on an open pull request (`decideWavesBeforeMerge`, `@intentius/chant/op/before-merge-decide`), records the head and its digest on `chant/lifecycle` (`_waves/<op>.before-merge.json`) and starts the waves for it; the generators' `beforeMerge`, whose guard admits that head alone, whose jobs check it out and read the base from the default branch, and whose `before-merge-done` job merges and releases the locks (`chant run wave --merge`); `waveJobs.<wave>.prelude`; the GitLab note poll's wave stop (`chantNoteRuns`' `waves`); a re-plan word that never starts with `-`; and the terraform lexicon's reach helpers (`@intentius/chant-lexicon-terraform/reach`).
|
|
82
|
+
*/
|
|
83
|
+
export declare const WAVES_BEFORE_MERGE_FLOOR = "0.124.90";
|
|
84
|
+
export { BEFORE_MERGE_DIGEST_ENV, BEFORE_MERGE_DONE_JOB, BEFORE_MERGE_HEAD_ENV, BEFORE_MERGE_PR_ENV, beforeMergeDigest, beforeMergePath, beforeMergeProblems, WAVES_BASE_ENV, type BeforeMergeDecision, type BeforeMergeRecord, type OpWavesBeforeMerge } from "./op/before-merge.js";
|
|
85
|
+
export { decideWavesBeforeMerge, defaultPipelineFiles, type WavesBeforeMergeJobs } from "./op/before-merge-decide.js";
|
|
86
|
+
export type { ProductWavesBeforeMerge } from "./components/product-pipeline.js";
|
|
87
|
+
/**
|
|
88
|
+
* The first chant whose Op waves post the apply statuses (#4987): the generators' `applyStatus`, a job `apply-status-<n>` after each wave at the default branch's commit that posts `<product>/apply` on the commit the waves applied (a before-merge run's decided head) with `chant run wave --apply-status` (`@intentius/chant/op/apply-status`), and the product pipeline's `applyStatus`; whose product plan takes `staleNotes`, each target's note carrying the target branch's commit and a `stale-notes` job beside wave 1 on a push marking each target's note (`pr-post --stale` with one `--member` per target); whose `productPipelineJobs` returns `waves.pipeline` for the generators; and whose GitLab reach line reaches the lock and note-commands jobs unexpanded (`expand: false`).
|
|
89
|
+
*/
|
|
90
|
+
export declare const WAVES_APPLY_STATUS_FLOOR = "0.124.90";
|
|
91
|
+
export { applyStatusJobName, opWaveApplyStatus, postOpWaveApplyStatus, type OpWaveApplyStatus, type OpWavesApplyStatus } from "./op/apply-status.js";
|
|
92
|
+
/**
|
|
93
|
+
* The first chant whose before-merge waves never run the change's code beside a write token (#4987): with `beforeMerge` each wave is a plan job (the change's code, a checkout with no credentials kept, a read-only token; GitLab drops `CHANT_FORGE_TOKEN` and the job token), a gate job at the default branch with the token, an applying job on the saved plan with no write token, and a record job at the default branch that writes the run records (`chant run wave --phase plan|gate|apply|record`, `@intentius/chant/op/op-waves-split`). A `rest` wave is refused with `beforeMerge`.
|
|
94
|
+
*/
|
|
95
|
+
export declare const WAVES_BEFORE_MERGE_SPLIT_FLOOR = "0.124.90";
|
|
96
|
+
export { opWaveSplitJobs, type OpWavePhase, type OpWaveSplitJob } from "./op/op-waves-split.js";
|
|
97
|
+
/**
|
|
98
|
+
* The first chant whose split before-merge waves take a `step` spec, Forgejo's hand-off, holds on other gates and one approval per wave (#4992): the plan job saves each run's step plan, the gate job leases the rows they change (no heartbeat; the decision names the lease) before it spends the approval, the applying job plans its runs again through the step and applies each whose digest the decision holds, and the record job writes the release records and lets go of the rows; a hook in the plan or apply job that holds the wave on another gate reads it with no write token and leaves its pending fact to the gate or record job; on Forgejo the plan and applying jobs hand their files on as job outputs (`packJs`), never through the artifact upload, and the gate and record jobs keep them as the artifacts; the plan job names no environment on GitHub (a wave's `planEnvironment` when set; on GitLab it prepares it), so the environment's reviewers are asked once. A `rest` wave splits from {@link WAVES_BEFORE_MERGE_REST_FLOOR} on.
|
|
99
|
+
*/
|
|
100
|
+
export declare const WAVES_BEFORE_MERGE_STEP_FLOOR = "0.124.90";
|
|
101
|
+
export type { OpWaveSavedStep, OpWaveSplitHandoff, OpWaveSplitLease } from "./op/op-waves-run.js";
|
|
102
|
+
/**
|
|
103
|
+
* The first chant whose split waves run a product's own process in every job (#4994): the product wave hook's `hooks` (`runChantInProcess(["run", "wave", ..., "--phase", <phase>], words, { wave: { afterPlan, capabilities, hookExec, runHooks, hooks } })`, `RunOpWaveOptions.inProcessHooks`) serves a spec hook by its name in the process of whichever job runs it, plan, gate or applying job or the one-job shape, in place of a command that called back over a socket; `opWaveProductStateDir` is where the plan job's code keeps what the later jobs read; a `record: true` hold in the plan job is spent by the gate job for a re-run of the hook at the wave's commit (an applied line with `rerun.head`), which the next run's plan job runs and its gate job finishes (`holdsFinished`); and `waveJobs.<wave>.artifact.path` takes a list and `waveJobs.<wave>.gate` gives the gate job a report and an artifact, so a product's own upload steps go through chant's Forgejo hand-off.
|
|
104
|
+
*/
|
|
105
|
+
export declare const WAVES_PRODUCT_HOOKS_FLOOR = "0.124.90";
|
|
106
|
+
export type { OpWaveHandedFinished, OpWaveInProcessHook, OpWaveInProcessHookCall } from "./op/op-waves-run.js";
|
|
107
|
+
export { opWaveProductStateDir } from "./op/op-waves-split.js";
|
|
108
|
+
/**
|
|
109
|
+
* The first chant whose split before-merge waves take a `rest` wave (#4992): its four jobs run one wave per run, the wave `CHANT_WAVES_WAVE` names (their own by default), and its record job, once the run applied and the plan found another wave, starts the waves workflow again for it (GitHub and Forgejo: a dispatch with the inputs `wave` and the decision's `pr`, `head` and `digest`, or a push's `commit`; GitLab: a pipeline with the same variables, with `CHANT_FORGE_TOKEN`), whose guard admits it as the same decided head; the jobs of the waves before it do not run in that follow-on; the record job's note (`rest-wave.json` beside the outcomes, `@intentius/chant/op/op-waves-follow-on`) tells `before-merge-done`, the control dispatch and the apply status that a run which started a follow-on is not the last.
|
|
110
|
+
*/
|
|
111
|
+
export declare const WAVES_BEFORE_MERGE_REST_FLOOR = "0.124.90";
|
|
112
|
+
/**
|
|
113
|
+
* The first chant whose rest wave's record job records each follow-on it starts on `chant/lifecycle` before it starts it (#4998): `_waves/<op>.follow-on.json` keeps, per decided head or pushed commit, the wave started, the run that started it, the decision (`pr`, `digest`) or the `commit`, and the outcomes of every run of the chain so far; the guard admits a follow-on only for the wave that record names, so a wave started by hand past it is refused; and the last run's control dispatch, apply status and `before-merge-done` add up the outcomes of every run of the chain (the note's `chain`), so a chain whose last wave changed nothing reports `applied`.
|
|
114
|
+
*/
|
|
115
|
+
export declare const WAVES_FOLLOW_ON_RECORD_FLOOR = "0.124.90";
|
|
80
116
|
/**
|
|
81
117
|
* The first chant whose product plan takes `watches`, the product's own scheduled jobs the note job's `pr-post` checks for having stopped with the job's token (#4888), and whose `checkOverdueOps` and `overdueOpsAt` take a product's `logPrefix` and `label`.
|
|
82
118
|
*/
|
|
83
119
|
export declare const PRODUCT_PLAN_WATCHES_FLOOR = "0.124.88";
|
|
84
|
-
export { PLAN_WATCHES_ENV } from "./op/schedule-overdue.js";
|
|
120
|
+
export { PLAN_WATCHES_ENV, watchesForTarget } from "./op/schedule-overdue.js";
|
|
121
|
+
/**
|
|
122
|
+
* The first chant whose product plan's `watches` take `targets` (#4988): a watch scoped to those targets is checked by their notes alone, and the note of another target checks neither it nor the discovered Op of its name (`watchesForTarget`).
|
|
123
|
+
*/
|
|
124
|
+
export declare const PRODUCT_PLAN_WATCH_TARGETS_FLOOR = "0.124.90";
|
|
85
125
|
/**
|
|
86
126
|
* The first chant whose product plan takes `record` (#4899): the plan step writes the plan job's run record into the hand-off, and the note job keeps it as Op `pr-plan` on `chant/lifecycle` with `pr-post --record-run <plan job>` (`--open` on GitLab), as `chant ci run plan --in-place` records `pr-plan`'s.
|
|
87
127
|
*/
|
|
@@ -98,6 +138,15 @@ export { planBodyHandoff, PLAN_BODY_LIMIT, type PrPlanBodyHandoff } from "./pr-p
|
|
|
98
138
|
*/
|
|
99
139
|
export declare const PRODUCT_PLAN_SUBJECT_FLOOR = "0.124.89";
|
|
100
140
|
export { PLAN_SUBJECT_LIMIT, planSubjectProblem, sinceLastLine, subjectChanges, type PrPlanSubject, type PrPlanSubjectPartWords } from "./pr-plan-note.js";
|
|
141
|
+
/**
|
|
142
|
+
* The first chant whose product plan keeps a product's own names (#5003): `workflowFile` (the generators' `path`), `jobNames` (the plan, note, re-plan and re-plan note jobs, with `{target}`), `statusContext` (which `pr-post --context`, the pending step, the stale job and the apply before merge use) and `reportDir` (`{output}`, the hand-off, the artifact's path and `pr-post --output`), and whose `pr-post --open` finds a plan job of the product's name (`--plan-job`).
|
|
143
|
+
*/
|
|
144
|
+
export declare const PRODUCT_PLAN_NAMES_FLOOR = "0.124.91";
|
|
145
|
+
export { productPlanContext, productPlanReportDir, productPlanWorkflowFile } from "./components/product-plan.js";
|
|
146
|
+
/**
|
|
147
|
+
* The first chant whose GitLab product plan job keeps a product's own artifacts beside the report directory (#5004): `productPlan.artifacts: { paths, reports }`, as `artifacts:paths` and `artifacts:reports`, such as terragucci's `terraform` report for the merge request's widget, with `{target}` and `{output}` filled. GitHub and Forgejo refuse it.
|
|
148
|
+
*/
|
|
149
|
+
export declare const PRODUCT_PLAN_ARTIFACTS_FLOOR = "0.124.91";
|
|
101
150
|
/**
|
|
102
151
|
* Day-2 actions in the product pipeline (#4654): the `action` comment
|
|
103
152
|
* command counted as answered by the product's own workflow
|
package/dist/ci-product.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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