@intentius/chant 0.124.70 → 0.124.71
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/ci-agent.d.ts +12 -1
- package/dist/ci-agent.d.ts.map +1 -1
- package/dist/ci-agent.js +13 -8
- package/dist/ci-commit.d.ts +297 -0
- package/dist/ci-commit.d.ts.map +1 -0
- package/dist/ci-commit.js +696 -0
- package/dist/ci-product-words.d.ts +6 -1
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +3 -1
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +7 -2
- package/dist/cli/handlers/commit.d.ts +26 -0
- package/dist/cli/handlers/commit.d.ts.map +1 -0
- package/dist/cli/handlers/commit.js +142 -0
- package/dist/cli/handlers/pr.d.ts +6 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +16 -7
- package/dist/cli/handlers/release.d.ts +9 -0
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +114 -5
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +17 -0
- package/dist/components/product-pipeline.d.ts +33 -0
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +34 -1
- package/dist/components/release-compile.d.ts +2 -0
- package/dist/components/release-compile.d.ts.map +1 -1
- package/dist/components/release-compile.js +8 -4
- package/dist/config.d.ts +46 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +9 -0
- package/dist/lexicon.d.ts +37 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lexicon.js +28 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +4 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts.map +1 -1
- package/dist/lifecycle/__fixtures__/publish-fakes.js +6 -2
- package/dist/lifecycle/gated-request.d.ts +3 -1
- package/dist/lifecycle/gated-request.d.ts.map +1 -1
- package/dist/lifecycle/gated-request.js +5 -2
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +57 -0
- package/dist/lifecycle/publish-declaration.d.ts +16 -0
- package/dist/lifecycle/publish-declaration.d.ts.map +1 -1
- package/dist/lifecycle/publish-declaration.js +35 -3
- package/dist/lifecycle/publish-forge.d.ts +12 -0
- package/dist/lifecycle/publish-forge.d.ts.map +1 -1
- package/dist/lifecycle/publish-forge.js +103 -19
- package/dist/lifecycle/publish-npm.d.ts +15 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +28 -1
- package/dist/lifecycle/publish-oci.d.ts +2 -0
- package/dist/lifecycle/publish-oci.d.ts.map +1 -1
- package/dist/lifecycle/publish-oci.js +10 -0
- 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 +8 -1
- package/dist/lifecycle/release-images.d.ts +87 -0
- package/dist/lifecycle/release-images.d.ts.map +1 -0
- package/dist/lifecycle/release-images.js +139 -0
- package/dist/lifecycle/release-publish.d.ts +2 -0
- package/dist/lifecycle/release-publish.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.d.ts +4 -4
- package/dist/op/activities/review-agent.d.ts.map +1 -1
- package/dist/op/activities/review-agent.js +4 -2
- package/dist/op/gate.d.ts +5 -1
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +7 -2
- package/dist/op/op-waves-notify.d.ts +1 -1
- package/dist/op/op-waves-notify.d.ts.map +1 -1
- package/dist/op/op-waves-notify.js +2 -1
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +12 -8
- package/dist/op/op-waves.d.ts +9 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +11 -0
- package/dist/pr-forge-base.d.ts +18 -0
- package/dist/pr-forge-base.d.ts.map +1 -0
- package/dist/pr-forge-base.js +29 -0
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/wave-runtime.mjs +315 -315
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +1 -2
- package/dist/workspace/release-workflow.d.ts +23 -0
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +203 -12
- package/package.json +1 -1
- package/src/ci-agent.ts +13 -8
- package/src/ci-commit.test.ts +415 -0
- package/src/ci-commit.ts +857 -0
- package/src/ci-product-words.ts +6 -2
- package/src/cli/handlers/approve.ts +6 -2
- package/src/cli/handlers/commit.ts +152 -0
- package/src/cli/handlers/operator.test.ts +2 -0
- package/src/cli/handlers/pr-wave-approve-lines.test.ts +32 -0
- package/src/cli/handlers/pr.ts +17 -7
- package/src/cli/handlers/release.ts +110 -5
- package/src/cli/main.ts +17 -0
- package/src/components/product-pipeline.test.ts +28 -1
- package/src/components/product-pipeline.ts +54 -1
- package/src/components/release-compile.ts +9 -3
- package/src/config.ts +24 -0
- package/src/lexicon.ts +56 -0
- package/src/lifecycle/__fixtures__/publish-fakes.ts +11 -5
- package/src/lifecycle/gated-request-spend.test.ts +115 -0
- package/src/lifecycle/gated-request.ts +5 -2
- package/src/lifecycle/git.ts +53 -0
- package/src/lifecycle/ledger-two-clones.test.ts +132 -0
- package/src/lifecycle/publish-declaration.ts +35 -3
- package/src/lifecycle/publish-forge-notes.test.ts +193 -0
- package/src/lifecycle/publish-forge.ts +101 -22
- package/src/lifecycle/publish-npm.ts +31 -2
- package/src/lifecycle/publish-oci.ts +10 -0
- package/src/lifecycle/publish-targets.test.ts +2 -1
- package/src/lifecycle/release-cut.ts +17 -1
- package/src/lifecycle/release-images.test.ts +242 -0
- package/src/lifecycle/release-images.ts +175 -0
- package/src/lifecycle/release-publish.ts +2 -0
- package/src/op/activities/review-agent.test.ts +20 -1
- package/src/op/activities/review-agent.ts +5 -2
- package/src/op/gate.ts +7 -2
- package/src/op/op-waves-approve-target.test.ts +108 -0
- package/src/op/op-waves-notify.ts +2 -2
- package/src/op/op-waves-run.ts +12 -7
- package/src/op/op-waves.ts +12 -0
- package/src/pr-forge-base.test.ts +37 -0
- package/src/pr-forge-base.ts +36 -0
- package/src/release-floors.ts +1 -1
- package/src/workspace/__fixtures__/release-workflow/forgejo-plain-member.yml +26 -0
- package/src/workspace/__fixtures__/release-workflow/forgejo-plain.yml +23 -0
- package/src/workspace/__fixtures__/release-workflow/forgejo-secure-member.yml +27 -0
- package/src/workspace/__fixtures__/release-workflow/forgejo-secure.yml +24 -0
- package/src/workspace/__fixtures__/release-workflow/github-plain-member.yml +26 -0
- package/src/workspace/__fixtures__/release-workflow/github-plain.yml +23 -0
- package/src/workspace/__fixtures__/release-workflow/github-secure-member.yml +27 -0
- package/src/workspace/__fixtures__/release-workflow/github-secure.yml +24 -0
- package/src/workspace/__fixtures__/release-workflow/gitlab-plain-member.yml +13 -0
- package/src/workspace/__fixtures__/release-workflow/gitlab-plain.yml +12 -0
- package/src/workspace/__fixtures__/release-workflow/gitlab-secure-member.yml +14 -0
- package/src/workspace/__fixtures__/release-workflow/gitlab-secure.yml +13 -0
- package/src/workspace/ci-green.ts +1 -2
- package/src/workspace/release-workflow.test.ts +151 -0
- package/src/workspace/release-workflow.ts +270 -12
package/dist/ci-agent.d.ts
CHANGED
|
@@ -152,6 +152,12 @@ export declare const AGENT_DRIFT_MAX = 60000;
|
|
|
152
152
|
export declare class AgentError extends Error {
|
|
153
153
|
name: string;
|
|
154
154
|
}
|
|
155
|
+
/** A full commit sha, SHA-1 or SHA-256. */
|
|
156
|
+
export declare const SHA: RegExp;
|
|
157
|
+
/** A forge login as the agent and commit jobs accept it. */
|
|
158
|
+
export declare const LOGIN: RegExp;
|
|
159
|
+
/** Whether `b` is a branch name the agent and commit jobs push to. */
|
|
160
|
+
export declare function branchOk(b: string): boolean;
|
|
155
161
|
/**
|
|
156
162
|
* The settings of agent `name` from a spec's `agent`, checked. `product` is
|
|
157
163
|
* the product the agent's branch is named for.
|
|
@@ -214,6 +220,8 @@ export interface AgentDecision {
|
|
|
214
220
|
started: string;
|
|
215
221
|
}
|
|
216
222
|
export declare function readDecision(dir: string): AgentDecision | undefined;
|
|
223
|
+
/** A file of at most `max` bytes, or undefined. */
|
|
224
|
+
export declare function readSmall(file: string, max?: number): string | undefined;
|
|
217
225
|
/** What a run cost, as the agent command reported it. */
|
|
218
226
|
export interface AgentUsage {
|
|
219
227
|
model?: string;
|
|
@@ -258,6 +266,9 @@ export interface AgentAsk {
|
|
|
258
266
|
export declare function askFromRun(words: CiProductWords, settings: Pick<AgentSettings, "comment">, env: Record<string, string | undefined>, event: unknown): AgentAsk | {
|
|
259
267
|
refused: string;
|
|
260
268
|
};
|
|
269
|
+
export declare function firstLine(s: string): string;
|
|
270
|
+
/** An error's first line: git's stderr when it has one. */
|
|
271
|
+
export declare function errText(e: unknown): string;
|
|
261
272
|
export interface PrepareInput {
|
|
262
273
|
settings: AgentSettings;
|
|
263
274
|
words: CiProductWords;
|
|
@@ -377,5 +388,5 @@ export declare function agentCommandLines(forge: "github" | "gitlab" | "forgejo"
|
|
|
377
388
|
*/
|
|
378
389
|
export declare function agentGitAuthLines(tokenVar: string, user: "x-access-token" | "oauth2"): string[];
|
|
379
390
|
/** The line that fetches the pull request's head into {@link AGENT_HEAD_REF}, after the checkout. `prVar` holds the number. */
|
|
380
|
-
export declare function agentHeadFetchLine(forge: "github" | "gitlab" | "forgejo", prVar: string): string;
|
|
391
|
+
export declare function agentHeadFetchLine(forge: "github" | "gitlab" | "forgejo", prVar: string, into?: string): string;
|
|
381
392
|
//# sourceMappingURL=ci-agent.d.ts.map
|
package/dist/ci-agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-agent.d.ts","sourceRoot":"","sources":["../src/ci-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAOH,OAAO,EAAuB,KAAK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gB,CAgCnB;AAID;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAwKxE;AAID;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,MAAkB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAO/J;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,QAAQ,GAAG,MAAM,EAAE,CAO/F;AAED,+HAA+H;AAC/H,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAuB,GAAG,MAAM,CAI/H"}
|
package/dist/ci-agent.js
CHANGED
|
@@ -116,9 +116,11 @@ export class AgentError extends Error {
|
|
|
116
116
|
}
|
|
117
117
|
const NAME = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,99}$/;
|
|
118
118
|
const VAR = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
119
|
-
|
|
119
|
+
/** A full commit sha, SHA-1 or SHA-256. */
|
|
120
|
+
export const SHA = /^[0-9a-f]{40}([0-9a-f]{24})?$/;
|
|
120
121
|
const BRANCH = /^[A-Za-z0-9_][A-Za-z0-9_.\/-]{0,199}$/;
|
|
121
|
-
|
|
122
|
+
/** A forge login as the agent and commit jobs accept it. */
|
|
123
|
+
export const LOGIN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/;
|
|
122
124
|
function intIn(where, v, lo, hi) {
|
|
123
125
|
if (typeof v !== "number" || !Number.isInteger(v) || v < lo || v > hi)
|
|
124
126
|
throw new AgentError(`${where} is a whole number from ${lo} to ${hi}`);
|
|
@@ -129,7 +131,8 @@ function usdIn(where, v) {
|
|
|
129
131
|
throw new AgentError(`${where} is a number of US dollars above 0 and at most ${AGENT_MAX_COST_USD_CEILING}`);
|
|
130
132
|
return v;
|
|
131
133
|
}
|
|
132
|
-
|
|
134
|
+
/** Whether `b` is a branch name the agent and commit jobs push to. */
|
|
135
|
+
export function branchOk(b) {
|
|
133
136
|
return BRANCH.test(b) && !b.split("/").some((s) => s === "" || s === "." || s === "..") && !b.endsWith(".lock");
|
|
134
137
|
}
|
|
135
138
|
/**
|
|
@@ -364,7 +367,8 @@ export function readDecision(dir) {
|
|
|
364
367
|
return undefined;
|
|
365
368
|
}
|
|
366
369
|
}
|
|
367
|
-
|
|
370
|
+
/** A file of at most `max` bytes, or undefined. */
|
|
371
|
+
export function readSmall(file, max = 8 << 20) {
|
|
368
372
|
try {
|
|
369
373
|
if (!existsSync(file) || statSync(file).size > max)
|
|
370
374
|
return undefined;
|
|
@@ -467,10 +471,11 @@ export function askFromRun(words, settings, env, event) {
|
|
|
467
471
|
return { refused: parsed?.kind === "refused" ? parsed.reason : "the comment is not an agent ask" };
|
|
468
472
|
return { pr, user, ask: parsed.ask };
|
|
469
473
|
}
|
|
470
|
-
function firstLine(s) {
|
|
474
|
+
export function firstLine(s) {
|
|
471
475
|
return s.trim().split("\n")[0].slice(0, 300);
|
|
472
476
|
}
|
|
473
|
-
|
|
477
|
+
/** An error's first line: git's stderr when it has one. */
|
|
478
|
+
export function errText(e) {
|
|
474
479
|
const err = e;
|
|
475
480
|
return firstLine(typeof err.stderr === "string" && err.stderr ? err.stderr : err?.message ?? String(e));
|
|
476
481
|
}
|
|
@@ -824,9 +829,9 @@ export function agentGitAuthLines(tokenVar, user) {
|
|
|
824
829
|
];
|
|
825
830
|
}
|
|
826
831
|
/** The line that fetches the pull request's head into {@link AGENT_HEAD_REF}, after the checkout. `prVar` holds the number. */
|
|
827
|
-
export function agentHeadFetchLine(forge, prVar) {
|
|
832
|
+
export function agentHeadFetchLine(forge, prVar, into = AGENT_HEAD_REF) {
|
|
828
833
|
if (!VAR.test(prVar))
|
|
829
834
|
throw new AgentError(`${prVar} is not a variable name`);
|
|
830
835
|
const ref = forge === "gitlab" ? `refs/merge-requests/$${prVar}/head` : `refs/pull/$${prVar}/head`;
|
|
831
|
-
return `case "$${prVar}" in ''|*[!0-9]*) echo "no pull request number" >&2; exit 1 ;; esac\ngit -c protocol.version=2 fetch -q --no-tags origin "+${ref}:${
|
|
836
|
+
return `case "$${prVar}" in ''|*[!0-9]*) echo "no pull request number" >&2; exit 1 ;; esac\ngit -c protocol.version=2 fetch -q --no-tags origin "+${ref}:${into}"`;
|
|
832
837
|
}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The commit job (#4722): run a product's fixed command on a pull request's
|
|
3
|
+
* head and push what it changed to the pull request's branch. terragucci's
|
|
4
|
+
* `respond.fmt` (a formatter after a failed format check) and sql-yodeler's
|
|
5
|
+
* `yodel rebase` (a forked migrations directory) are the motivating uses.
|
|
6
|
+
*
|
|
7
|
+
* It has the agent job's shape (./ci-agent.ts) without the model:
|
|
8
|
+
*
|
|
9
|
+
* - the commit job holds a read token. `chant commit prepare` reads the
|
|
10
|
+
* request from the run (a `/<product> <word>` comment, or the check job
|
|
11
|
+
* that failed before it), refuses a fork, a commenter who cannot write, a
|
|
12
|
+
* head the job pushed itself (the loop guard) and a pull request over
|
|
13
|
+
* `maxRuns`, and on the `check` trigger a head whose plan is approved on
|
|
14
|
+
* the ledger. `chant commit run` then runs the command's argv, with no
|
|
15
|
+
* shell and no forge token, in a worktree of the head, and leaves what it
|
|
16
|
+
* changed as a patch.
|
|
17
|
+
* - the push job holds the push token. `chant commit land` reads the
|
|
18
|
+
* request from the event again, checks the head, the limit and the
|
|
19
|
+
* approval again, refuses a patch outside `allowed` or on a path no job
|
|
20
|
+
* may change ({@link agentForbiddenPaths}), commits with a `Commit-run:`
|
|
21
|
+
* trailer, pushes without force, replies on a comment, and records the
|
|
22
|
+
* run on the ledger under op `<name>`.
|
|
23
|
+
*
|
|
24
|
+
* An empty patch lands nothing, and on the `check` trigger says nothing.
|
|
25
|
+
* Nothing here applies, approves or merges.
|
|
26
|
+
*/
|
|
27
|
+
import { type AgentGit } from "./ci-agent.js";
|
|
28
|
+
import { type CiProductWords } from "./ci-product-words.js";
|
|
29
|
+
import type { OpRunRecord, OpRunRecordInput } from "./op/runtime.js";
|
|
30
|
+
import type { RunOrigin } from "./lifecycle/release-ledger.js";
|
|
31
|
+
import type { PrForge } from "./pr-forge.js";
|
|
32
|
+
/** The first chant with the commit job and the scheduled Op spec's `commit` (#4722). Products feature-detect on it. */
|
|
33
|
+
export declare const CI_COMMIT_FLOOR = "0.124.71";
|
|
34
|
+
/** What starts a commit run: a person's comment, or a check job's finding. */
|
|
35
|
+
export type CommitTrigger = "comment" | "check";
|
|
36
|
+
export declare const COMMIT_TRIGGERS: readonly CommitTrigger[];
|
|
37
|
+
/**
|
|
38
|
+
* A scheduled Op spec's `commit` (#4722). With `on: "comment"` the spec is
|
|
39
|
+
* the commit job's own workflow, answering `comment` on a pull request, and
|
|
40
|
+
* its trigger is not read. With `on: "check"` the jobs follow the Op's own
|
|
41
|
+
* job (the check) on a pull request and run when its run exits with one of
|
|
42
|
+
* `findings`.
|
|
43
|
+
*/
|
|
44
|
+
export interface OpCommitSpec {
|
|
45
|
+
on: CommitTrigger;
|
|
46
|
+
/** The comment the job answers, `/<product> <word>`, for `on: "comment"`. The word maps onto `commit` in the product's words. */
|
|
47
|
+
comment?: string;
|
|
48
|
+
/** The command, an argv run with no shell: the product's own, such as `["terraform", "fmt", "-recursive"]`. */
|
|
49
|
+
command: string[];
|
|
50
|
+
/** The only paths the change may touch, from the repository root; a trailing `/` names a directory. */
|
|
51
|
+
allowed: string[];
|
|
52
|
+
/** For `on: "check"`: the exit codes of the Op's run that name a finding. Default `[2]`, chant's `drift` code. */
|
|
53
|
+
findings?: number[];
|
|
54
|
+
/** The secret (GitHub, Forgejo) or protected variable (GitLab) holding the push token. Required on GitHub and Forgejo; `CHANT_FORGE_TOKEN` by default on GitLab. */
|
|
55
|
+
tokenEnv?: string;
|
|
56
|
+
/** The most commits the job pushes to one pull request, counted on the ledger. Default 3. */
|
|
57
|
+
maxRuns?: number;
|
|
58
|
+
/** Paths beyond chant's own that the change may not touch. */
|
|
59
|
+
guarded?: string[];
|
|
60
|
+
/** Minutes the command may run. Default 10. */
|
|
61
|
+
timeout?: number;
|
|
62
|
+
/** The ledger environment the runs are recorded under. Default `local`. */
|
|
63
|
+
env?: string;
|
|
64
|
+
/** GitLab only: run the `check` trigger, which is off there by default. */
|
|
65
|
+
gitlabCheck?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Merge the base branch's tip into the head (`--no-ff`) before the command
|
|
68
|
+
* runs (#4723), as a migrations fork shows only on that merge. A conflict
|
|
69
|
+
* is refused. The pushed commit is that merge, with the command's change:
|
|
70
|
+
* its parents are the head and the base tip.
|
|
71
|
+
*/
|
|
72
|
+
mergeBase?: boolean;
|
|
73
|
+
}
|
|
74
|
+
/** A commit job's settings, every default filled and checked. */
|
|
75
|
+
export interface CommitSettings {
|
|
76
|
+
name: string;
|
|
77
|
+
on: CommitTrigger;
|
|
78
|
+
comment?: string;
|
|
79
|
+
command: string[];
|
|
80
|
+
allowed: string[];
|
|
81
|
+
findings: number[];
|
|
82
|
+
maxRuns: number;
|
|
83
|
+
guarded: string[];
|
|
84
|
+
timeout: number;
|
|
85
|
+
env: string;
|
|
86
|
+
mergeBase: boolean;
|
|
87
|
+
}
|
|
88
|
+
export declare const COMMIT_MAX_RUNS = 3;
|
|
89
|
+
export declare const COMMIT_TIMEOUT_MINUTES = 10;
|
|
90
|
+
/** The GitLab variable the push job reads its token from unless `tokenEnv` names another. */
|
|
91
|
+
export declare const COMMIT_GITLAB_TOKEN_ENV = "CHANT_FORGE_TOKEN";
|
|
92
|
+
/** The trailer each of the job's commits carries, naming the job. The loop guard reads it. */
|
|
93
|
+
export declare const COMMIT_TRAILER = "Commit-run";
|
|
94
|
+
/** The variables the generated jobs carry the settings in. The workflow file is the base branch's, so they are not the change's. */
|
|
95
|
+
export declare const COMMIT_ENV: {
|
|
96
|
+
readonly name: "CHANT_COMMIT_NAME";
|
|
97
|
+
readonly on: "CHANT_COMMIT_ON";
|
|
98
|
+
readonly comment: "CHANT_COMMIT_COMMENT";
|
|
99
|
+
readonly command: "CHANT_COMMIT_COMMAND";
|
|
100
|
+
readonly allowed: "CHANT_COMMIT_ALLOWED";
|
|
101
|
+
readonly findings: "CHANT_COMMIT_FINDINGS";
|
|
102
|
+
readonly maxRuns: "CHANT_COMMIT_MAX_RUNS";
|
|
103
|
+
readonly guarded: "CHANT_COMMIT_GUARDED";
|
|
104
|
+
readonly timeout: "CHANT_COMMIT_TIMEOUT";
|
|
105
|
+
readonly env: "CHANT_COMMIT_ENV";
|
|
106
|
+
readonly mergeBase: "CHANT_COMMIT_MERGE_BASE";
|
|
107
|
+
};
|
|
108
|
+
/** GitLab starts no pipeline on a note: a pipeline of the default branch started with these runs a comment commit job. */
|
|
109
|
+
export declare const GITLAB_COMMIT_PR_VAR = "CHANT_COMMIT_PR";
|
|
110
|
+
export declare const GITLAB_COMMIT_WORD_VAR = "CHANT_COMMIT";
|
|
111
|
+
/** Where the jobs keep the decision, the exit code and the patch, from the job's directory. */
|
|
112
|
+
export declare const COMMIT_DIR = ".chant/commit";
|
|
113
|
+
/** The local ref the checkout fetches a pull request's head into. */
|
|
114
|
+
export declare const COMMIT_HEAD_REF = "refs/chant/commit-head";
|
|
115
|
+
/** The local ref the jobs fetch the base branch's tip into, with `mergeBase`. */
|
|
116
|
+
export declare const COMMIT_BASE_REF = "refs/chant/commit-base";
|
|
117
|
+
export declare const COMMIT_DECISION_FILE = "decision.json";
|
|
118
|
+
export declare const COMMIT_PATCH_FILE = "change.patch";
|
|
119
|
+
export declare const COMMIT_RC_FILE = "rc";
|
|
120
|
+
/** The commit identity the job's commits carry. */
|
|
121
|
+
export declare const COMMIT_GIT_NAME = "chant commit";
|
|
122
|
+
export declare const COMMIT_GIT_EMAIL = "chant-commit@localhost";
|
|
123
|
+
/** The settings of commit job `name` from a spec's `commit`, checked. */
|
|
124
|
+
export declare function resolveCommitSpec(name: string, spec: OpCommitSpec, product?: string): CommitSettings;
|
|
125
|
+
/** The settings as the generated jobs' variables. */
|
|
126
|
+
export declare function commitSettingsEnv(s: CommitSettings): Record<string, string>;
|
|
127
|
+
/** The settings back from the job's variables, checked as {@link resolveCommitSpec} checks a spec. */
|
|
128
|
+
export declare function commitSettingsFromEnv(env: Record<string, string | undefined>, product?: string): CommitSettings;
|
|
129
|
+
/** The paths of a change the job may not push: outside `allowed`, or on a path no job changes ({@link agentForbiddenPaths}). */
|
|
130
|
+
export declare function commitRefusedPaths(paths: readonly string[], s: Pick<CommitSettings, "allowed" | "guarded">): {
|
|
131
|
+
forbidden: string[];
|
|
132
|
+
outside: string[];
|
|
133
|
+
};
|
|
134
|
+
/** What a run was asked for: the pull request, and who asked on the `comment` trigger. */
|
|
135
|
+
export interface CommitRequest {
|
|
136
|
+
pr: number;
|
|
137
|
+
/** The commenter, or the person who started the GitLab pipeline. Absent on the `check` trigger. */
|
|
138
|
+
user?: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The request from the run. `comment`: the event's comment on GitHub and
|
|
142
|
+
* Forgejo, read against the product's grammar, which must name this job's
|
|
143
|
+
* word; on GitLab the pipeline's {@link GITLAB_COMMIT_PR_VAR} and
|
|
144
|
+
* {@link GITLAB_COMMIT_WORD_VAR}, and the user who started it. `check`: the
|
|
145
|
+
* pull request the check ran for, from the `pull_request` event or the
|
|
146
|
+
* merge request pipeline.
|
|
147
|
+
*/
|
|
148
|
+
export declare function commitRequestFromRun(words: CiProductWords, s: Pick<CommitSettings, "on" | "comment">, env: Record<string, string | undefined>, event: unknown): CommitRequest | {
|
|
149
|
+
refused: string;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* {@link commitRequestFromRun}, and for the `check` trigger of a check that
|
|
153
|
+
* runs on push (as terragucci's does), the open pull request whose head is
|
|
154
|
+
* the pushed branch, asked of the forge on GitHub and Forgejo. A branch with
|
|
155
|
+
* no open pull request is refused as before, which the check trigger skips.
|
|
156
|
+
*/
|
|
157
|
+
export declare function resolveCommitRequest(words: CiProductWords, s: Pick<CommitSettings, "on" | "comment">, env: Record<string, string | undefined>, event: unknown, forge?: Partial<Pick<PrForge, "findPullRequest">>): Promise<CommitRequest | {
|
|
158
|
+
refused: string;
|
|
159
|
+
}>;
|
|
160
|
+
/** How a run ended, as its record says. `skipped` is a run with nothing to do, which says nothing and is not recorded. */
|
|
161
|
+
export type CommitResult = "pushed" | "refused" | "stopped" | "skipped" | "failed";
|
|
162
|
+
/** What `commit prepare` decided. The push job reads it as data and checks every field it uses. */
|
|
163
|
+
export interface CommitDecision {
|
|
164
|
+
version: 1;
|
|
165
|
+
name: string;
|
|
166
|
+
on: CommitTrigger;
|
|
167
|
+
go: boolean;
|
|
168
|
+
reason?: string;
|
|
169
|
+
/** Why not, as the record says it: `skipped` says nothing on the pull request. */
|
|
170
|
+
stop?: Exclude<CommitResult, "pushed" | "failed">;
|
|
171
|
+
sha?: string;
|
|
172
|
+
pr?: number;
|
|
173
|
+
branch?: string;
|
|
174
|
+
user?: string;
|
|
175
|
+
/** With `mergeBase`: the base branch and the tip the command ran on. */
|
|
176
|
+
base?: string;
|
|
177
|
+
baseSha?: string;
|
|
178
|
+
started: string;
|
|
179
|
+
}
|
|
180
|
+
export declare function readCommitDecision(dir: string): CommitDecision | undefined;
|
|
181
|
+
/** The commits the job pushed to pull request `pr`, from its run records. */
|
|
182
|
+
export declare function pushedTo(records: readonly Pick<OpRunRecord, "outcomes">[], pr: number): number;
|
|
183
|
+
/** The run record of one commit run: op `<name>`, one phase with one step, the outcome in `outcomes.commit`. */
|
|
184
|
+
export declare function commitRunRecordInput(o: {
|
|
185
|
+
settings: Pick<CommitSettings, "name" | "on" | "env">;
|
|
186
|
+
started: string;
|
|
187
|
+
ended: string;
|
|
188
|
+
result: CommitResult;
|
|
189
|
+
reason: string;
|
|
190
|
+
requestedBy?: string;
|
|
191
|
+
pr?: number;
|
|
192
|
+
commit?: string;
|
|
193
|
+
approvalVoided?: string;
|
|
194
|
+
gitSha?: string;
|
|
195
|
+
runOrigin?: RunOrigin;
|
|
196
|
+
}): OpRunRecordInput;
|
|
197
|
+
/** Who approved the plan of a pull request's head on the ledger, or undefined. The job's own records never answer it. */
|
|
198
|
+
export type HeadApproval = (pr: number, sha: string) => Promise<string | undefined>;
|
|
199
|
+
export interface CommitPrepareInput {
|
|
200
|
+
settings: CommitSettings;
|
|
201
|
+
words: CiProductWords;
|
|
202
|
+
dir: string;
|
|
203
|
+
env: Record<string, string | undefined>;
|
|
204
|
+
event?: unknown;
|
|
205
|
+
/** A read client: who may write, and the pull request's head. Absent on GitLab, where this job holds no token. */
|
|
206
|
+
forge?: Pick<PrForge, "pullRequestHead" | "userCanWrite"> & Partial<Pick<PrForge, "findPullRequest">>;
|
|
207
|
+
/** The branch pull request `pr` merges into, asked of the forge (./pr-forge-base.ts), for `mergeBase` (#4723). */
|
|
208
|
+
pullRequestBase?: (pr: number) => Promise<string | undefined>;
|
|
209
|
+
readRuns: () => Promise<OpRunRecord[]>;
|
|
210
|
+
approval: HeadApproval;
|
|
211
|
+
git: AgentGit;
|
|
212
|
+
now: Date;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* `chant commit prepare`: decide whether the command runs, and on what. Every
|
|
216
|
+
* outcome is a decision file; the push job answers a refusal. The return is
|
|
217
|
+
* the decision.
|
|
218
|
+
*/
|
|
219
|
+
export declare function prepareCommitRun(i: CommitPrepareInput): Promise<CommitDecision>;
|
|
220
|
+
/** Run an argv in `cwd`, with no shell. A failure or a timeout is an outcome. */
|
|
221
|
+
export type CommitRunCommand = (argv: readonly string[], o: {
|
|
222
|
+
cwd: string;
|
|
223
|
+
env: Record<string, string>;
|
|
224
|
+
timeoutMs: number;
|
|
225
|
+
}) => Promise<{
|
|
226
|
+
exitCode: number | null;
|
|
227
|
+
timedOut: boolean;
|
|
228
|
+
}>;
|
|
229
|
+
export declare const runCommitArgv: CommitRunCommand;
|
|
230
|
+
/**
|
|
231
|
+
* The variables the command sees: process basics, with the checkout's
|
|
232
|
+
* `node_modules/.bin` first on `PATH` so a product's bin installed on the
|
|
233
|
+
* target branch runs on the head's files. Never a forge or cloud token.
|
|
234
|
+
*/
|
|
235
|
+
export declare function commitCommandEnv(env: Record<string, string | undefined>, checkout: string): Record<string, string>;
|
|
236
|
+
export interface CommitRunInput {
|
|
237
|
+
settings: CommitSettings;
|
|
238
|
+
dir: string;
|
|
239
|
+
/** The checkout the job runs in: the target branch, with the product installed. */
|
|
240
|
+
checkout: string;
|
|
241
|
+
/** Where the worktree of the head goes: outside the checkout. */
|
|
242
|
+
workDir: string;
|
|
243
|
+
env: Record<string, string | undefined>;
|
|
244
|
+
git: AgentGit;
|
|
245
|
+
runCommand: CommitRunCommand;
|
|
246
|
+
}
|
|
247
|
+
/** `chant commit run`: the command in a worktree of the head; what it changed leaves as a patch. This step holds no forge token. */
|
|
248
|
+
export declare function runCommit(i: CommitRunInput): Promise<{
|
|
249
|
+
rc: string;
|
|
250
|
+
changed: boolean;
|
|
251
|
+
}>;
|
|
252
|
+
export interface CommitLandOutcome {
|
|
253
|
+
result: CommitResult;
|
|
254
|
+
reason: string;
|
|
255
|
+
commit?: string;
|
|
256
|
+
paths?: string[];
|
|
257
|
+
requestedBy?: string;
|
|
258
|
+
code: number;
|
|
259
|
+
}
|
|
260
|
+
export interface CommitLandInput {
|
|
261
|
+
settings: CommitSettings;
|
|
262
|
+
words: CiProductWords;
|
|
263
|
+
dir: string;
|
|
264
|
+
workDir: string;
|
|
265
|
+
env: Record<string, string | undefined>;
|
|
266
|
+
event?: unknown;
|
|
267
|
+
/** A write client. */
|
|
268
|
+
forge: Pick<PrForge, "pullRequestHead" | "addComment"> & Partial<Pick<PrForge, "findPullRequest">>;
|
|
269
|
+
/** As {@link CommitPrepareInput.pullRequestBase}: the land checks the base is still the one the command ran on. */
|
|
270
|
+
pullRequestBase?: (pr: number) => Promise<string | undefined>;
|
|
271
|
+
git: AgentGit;
|
|
272
|
+
/** Push `HEAD` of `cwd` to `ref`, never with force. */
|
|
273
|
+
push: (o: {
|
|
274
|
+
cwd: string;
|
|
275
|
+
ref: string;
|
|
276
|
+
}) => void;
|
|
277
|
+
readRuns: () => Promise<OpRunRecord[]>;
|
|
278
|
+
approval: HeadApproval;
|
|
279
|
+
/** Append the run's record to the ledger and push it. */
|
|
280
|
+
record: (input: OpRunRecordInput) => Promise<void>;
|
|
281
|
+
now: () => Date;
|
|
282
|
+
runOrigin?: RunOrigin;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* `chant commit land`: from the commit job's patch to a pushed commit, or a
|
|
286
|
+
* reply saying why not. The request comes from the event again; the
|
|
287
|
+
* decision file is the commit job's and is checked against what this job
|
|
288
|
+
* reads itself. Every outcome but `skipped` is recorded on the ledger.
|
|
289
|
+
*/
|
|
290
|
+
export declare function landCommitChange(i: CommitLandInput): Promise<CommitLandOutcome>;
|
|
291
|
+
/** The three commands of the commit jobs, through the product's bin. */
|
|
292
|
+
export declare function commitCommandLines(forge: "github" | "gitlab" | "forgejo", bin?: string, dir?: string): {
|
|
293
|
+
prepare: string;
|
|
294
|
+
run: string;
|
|
295
|
+
land: string;
|
|
296
|
+
};
|
|
297
|
+
//# sourceMappingURL=ci-commit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-commit.d.ts","sourceRoot":"","sources":["../src/ci-commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,OAAO,EAA6E,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtH,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,oBAAoB,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