@intentius/chant 0.124.5 → 0.124.7
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/cli/handlers/gate-resume.d.ts +32 -1
- package/dist/cli/handlers/gate-resume.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +7 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/rollback.d.ts.map +1 -1
- package/dist/op/activities/forge-pull-request.d.ts +49 -0
- package/dist/op/activities/forge-pull-request.d.ts.map +1 -0
- package/dist/op/activities/lexicon-upgrade.d.ts +7 -0
- package/dist/op/activities/lexicon-upgrade.d.ts.map +1 -1
- package/dist/op/activities/propose-upgrade.d.ts +6 -0
- package/dist/op/activities/propose-upgrade.d.ts.map +1 -1
- package/dist/op/activities/reconcile.d.ts.map +1 -1
- package/dist/op/gate-point-run.d.ts +1 -1
- package/dist/op/gate-point-run.d.ts.map +1 -1
- package/dist/op/gate-point.d.ts +6 -0
- package/dist/op/gate-point.d.ts.map +1 -1
- package/dist/op/gate-resume.d.ts +2 -31
- package/dist/op/gate-resume.d.ts.map +1 -1
- package/dist/op/gate-run-locator.d.ts +40 -0
- package/dist/op/gate-run-locator.d.ts.map +1 -0
- package/dist/point-decision.d.ts +63 -1
- package/dist/point-decision.d.ts.map +1 -1
- package/dist/pr-forge.d.ts +72 -7
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/workspace/points-cli.d.ts.map +1 -1
- package/dist/workspace/records-cli.d.ts +15 -0
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/handlers/gate-resume.ts +84 -11
- package/src/cli/main.ts +4 -2
- package/src/lifecycle/gate-ledger.ts +7 -0
- package/src/lifecycle/rollback.ts +10 -2
- package/src/op/activities/forge-pull-request.test.ts +91 -0
- package/src/op/activities/forge-pull-request.ts +98 -0
- package/src/op/activities/lexicon-upgrade.test.ts +58 -0
- package/src/op/activities/lexicon-upgrade.ts +34 -8
- package/src/op/activities/propose-upgrade.ts +13 -0
- package/src/op/activities/reconcile.ts +10 -2
- package/src/op/gate-point-ci.e2e.test.ts +39 -2
- package/src/op/gate-point-resume.e2e.test.ts +203 -0
- package/src/op/gate-point-run.ts +3 -0
- package/src/op/gate-point.ts +11 -0
- package/src/op/gate-resume.ts +5 -95
- package/src/op/gate-run-locator.ts +105 -0
- package/src/point-decision-bundle.test.ts +1 -0
- package/src/point-decision.ts +97 -1
- package/src/pr-forge-bundle.test.ts +1 -1
- package/src/pr-forge.test.ts +154 -0
- package/src/pr-forge.ts +179 -12
- package/src/workspace/points-cli.ts +7 -2
- package/src/workspace/records-cli.ts +38 -7
- package/src/workspace/records.schema.json +4 -0
package/dist/pr-forge.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* What chant and the products built on it ask of a forge: keep one comment
|
|
3
3
|
* (a merge request note on GitLab) on a pull request up to date, set a commit
|
|
4
4
|
* status, keep one tracking issue in the repository, list who approved a pull
|
|
5
|
-
* request,
|
|
5
|
+
* request, find the pull request that merged a commit, and open or edit a
|
|
6
|
+
* pull request (a merge request on GitLab) for a branch.
|
|
6
7
|
*
|
|
7
8
|
* The pull-request loop (#3183) uses the note, the status and the review
|
|
8
9
|
* calls. `reconcilePr`'s `comment` and `issue` finding modes post through the
|
|
@@ -21,6 +22,10 @@
|
|
|
21
22
|
* `gitlab:<login>`, or `<forge>@<host>:<login>` off the forge's default host.
|
|
22
23
|
* The apply compares that string with the approval's `resolvedBy`.
|
|
23
24
|
*
|
|
25
|
+
* Opening a pull request goes over REST too (#3798): `gh pr` speaks GitHub's
|
|
26
|
+
* GraphQL, which Forgejo does not serve, so chant's own pull-request paths
|
|
27
|
+
* open theirs through {@link PrForge.openPullRequest} on Forgejo and GitLab.
|
|
28
|
+
*
|
|
24
29
|
* Like `./pr-loop.ts`, this bundles without the TypeScript toolchain (#3421):
|
|
25
30
|
* it imports nothing but `node:fs`, to read a CI job's event payload.
|
|
26
31
|
* `./pr-forge-bundle.test.ts` holds it to that.
|
|
@@ -40,7 +45,13 @@ export type ForgeFetch = (url: string, init: {
|
|
|
40
45
|
export interface ForgeStatus {
|
|
41
46
|
/** The status's name, such as `chant/plan` or `terragucci/plan`. */
|
|
42
47
|
context: string;
|
|
43
|
-
|
|
48
|
+
/**
|
|
49
|
+
* GitLab's own states, plus GitHub's `failure` and `error`. Each forge gets
|
|
50
|
+
* the nearest state it has ({@link statusStateFor}): `running` is `pending`
|
|
51
|
+
* on GitHub and Forgejo, `canceled` is `error` there, and `failure` and
|
|
52
|
+
* `error` are `failed` on GitLab.
|
|
53
|
+
*/
|
|
54
|
+
state: ForgeStatusState;
|
|
44
55
|
/** Cut to what the forge keeps: 140 characters on GitHub and Forgejo, 255 on GitLab. */
|
|
45
56
|
description: string;
|
|
46
57
|
/** The pipeline run, linked from the status. */
|
|
@@ -48,6 +59,12 @@ export interface ForgeStatus {
|
|
|
48
59
|
/** GitLab only: the pipeline the status belongs to. */
|
|
49
60
|
pipelineId?: number;
|
|
50
61
|
}
|
|
62
|
+
/** A commit status's state, as a caller names it. */
|
|
63
|
+
export type ForgeStatusState = "pending" | "running" | "success" | "failed" | "failure" | "canceled" | "error";
|
|
64
|
+
/** Every {@link ForgeStatusState}, for a caller that reads one from its own input. */
|
|
65
|
+
export declare const FORGE_STATUS_STATES: readonly ForgeStatusState[];
|
|
66
|
+
/** The state `kind` is sent for `state`. Forgejo takes GitHub's. */
|
|
67
|
+
export declare function statusStateFor(kind: ForgeKind, state: ForgeStatusState): string;
|
|
51
68
|
/**
|
|
52
69
|
* How a comment or an issue is told to be the caller's own. By default the
|
|
53
70
|
* body starts with the marker, chant's recipe since #2291, and anyone may
|
|
@@ -57,12 +74,15 @@ export interface MarkerMatch {
|
|
|
57
74
|
/** `prefix` (the default): the body starts with the marker. `anywhere`: the body carries it. */
|
|
58
75
|
match?: "prefix" | "anywhere";
|
|
59
76
|
/**
|
|
60
|
-
* Only a comment or issue written by this login
|
|
61
|
-
* GitHub and Forgejo, `author.username` on
|
|
62
|
-
* A merge request's author can write a note
|
|
63
|
-
* product that reads its own notes back names
|
|
77
|
+
* Only a comment or issue written by this login, or by any of these
|
|
78
|
+
* logins, counts: `user.login` on GitHub and Forgejo, `author.username` on
|
|
79
|
+
* GitLab, compared without case. A merge request's author can write a note
|
|
80
|
+
* carrying any marker, so a product that reads its own notes back names
|
|
81
|
+
* its bot here. A list is for a bot whose login the job cannot know in
|
|
82
|
+
* advance, such as `gitea-actions` or `forgejo-actions` on Forgejo (#3834).
|
|
83
|
+
* An empty list matches nobody.
|
|
64
84
|
*/
|
|
65
|
-
author?: string;
|
|
85
|
+
author?: string | readonly string[];
|
|
66
86
|
}
|
|
67
87
|
/** What {@link PrForge.upsertComment} did. */
|
|
68
88
|
export interface CommentResult {
|
|
@@ -136,6 +156,32 @@ export interface IssueResult {
|
|
|
136
156
|
/** When the issue was opened (the forge's `created_at`, ISO 8601), for an issue that exists after the call or was just closed. */
|
|
137
157
|
created?: string;
|
|
138
158
|
}
|
|
159
|
+
/** A pull request (merge request) for {@link PrForge.openPullRequest} to open. */
|
|
160
|
+
export interface PullRequestSpec {
|
|
161
|
+
/** The branch with the change, in the same repository. */
|
|
162
|
+
head: string;
|
|
163
|
+
/** The branch it merges into. Default: the repository's default branch, read from the forge. */
|
|
164
|
+
base?: string;
|
|
165
|
+
title: string;
|
|
166
|
+
body: string;
|
|
167
|
+
/**
|
|
168
|
+
* Open it as a draft: GitHub's `draft`, GitLab's `Draft: ` title prefix,
|
|
169
|
+
* Forgejo's `WIP: ` title prefix (it has no draft field).
|
|
170
|
+
*/
|
|
171
|
+
draft?: boolean;
|
|
172
|
+
}
|
|
173
|
+
/** A pull request (merge request) as the forge answered it. */
|
|
174
|
+
export interface PullRequest {
|
|
175
|
+
/** The pull request's number, or the merge request's iid. */
|
|
176
|
+
number: number;
|
|
177
|
+
url?: string;
|
|
178
|
+
title: string;
|
|
179
|
+
body: string;
|
|
180
|
+
/** Its head (source) branch. */
|
|
181
|
+
head: string;
|
|
182
|
+
/** Its base (target) branch. */
|
|
183
|
+
base?: string;
|
|
184
|
+
}
|
|
139
185
|
export interface PrForge {
|
|
140
186
|
kind: ForgeKind;
|
|
141
187
|
/** Lower-cased, such as `github.com`. */
|
|
@@ -198,6 +244,25 @@ export interface PrForge {
|
|
|
198
244
|
approvers(pr: number): Promise<string[]>;
|
|
199
245
|
/** The merged pull request that produced `sha`, or null. */
|
|
200
246
|
pullRequestFor(sha: string): Promise<number | null>;
|
|
247
|
+
/**
|
|
248
|
+
* Open a pull request (a merge request on GitLab) from `head` into `base`,
|
|
249
|
+
* or into the default branch when `base` is not given. Over REST on every
|
|
250
|
+
* forge, so it works on Forgejo, where `gh pr create` cannot (#3798).
|
|
251
|
+
*/
|
|
252
|
+
openPullRequest(spec: PullRequestSpec): Promise<PullRequest>;
|
|
253
|
+
/**
|
|
254
|
+
* The OPEN pull request whose head is branch `head` in this repository (a
|
|
255
|
+
* fork's branch of the same name is not it), or undefined. The oldest when
|
|
256
|
+
* there are several.
|
|
257
|
+
*/
|
|
258
|
+
findPullRequest(head: string): Promise<PullRequest | undefined>;
|
|
259
|
+
/** Change an open pull request's title or body. */
|
|
260
|
+
editPullRequest(pr: number, change: {
|
|
261
|
+
title?: string;
|
|
262
|
+
body?: string;
|
|
263
|
+
}): Promise<PullRequest | undefined>;
|
|
264
|
+
/** Add labels to a pull request by name. Forgejo needs them to exist; GitHub and GitLab make them. */
|
|
265
|
+
addLabels(pr: number, labels: readonly string[]): Promise<void>;
|
|
201
266
|
}
|
|
202
267
|
/** A GitHub or Forgejo client. */
|
|
203
268
|
export type GithubShapedForge = PrForge & {
|
package/dist/pr-forge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-forge.d.ts","sourceRoot":"","sources":["../src/pr-forge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3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CASxG;AAED,0CAA0C;AAC1C,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,cAAc,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,MAAM,CAatF;AAED,8GAA8G;AAC9G,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,CASvD;AA+BD,6EAA6E;AAC7E,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwD7E"}
|
|
@@ -55,6 +55,13 @@ export interface RecordsQuery {
|
|
|
55
55
|
workGaps?: boolean;
|
|
56
56
|
/** List only the records that are modified or new against `HEAD` (#3160). Needs git and a working-tree read. */
|
|
57
57
|
uncommitted?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* For an answer kind read in the working tree (#3833): fetch `chant/lifecycle`
|
|
60
|
+
* first, best effort, as `points answer` does, so an answer held there by
|
|
61
|
+
* another clone or a CI job is listed. The command sets it; other readers
|
|
62
|
+
* read the local ledger as it is.
|
|
63
|
+
*/
|
|
64
|
+
fetchLedger?: boolean;
|
|
58
65
|
}
|
|
59
66
|
/**
|
|
60
67
|
* A record as the output carries it: the entry plus its provenance (#2547),
|
|
@@ -106,6 +113,14 @@ export type RecordView = RecordEntry & {
|
|
|
106
113
|
* steward keeps on the lifecycle ledger (#2786) laid over it.
|
|
107
114
|
*/
|
|
108
115
|
answers?: WorkAnswer[];
|
|
116
|
+
/**
|
|
117
|
+
* For a record of an answer kind (one with an `answers` block) read in the
|
|
118
|
+
* working tree (#3833): where the record is held on the lifecycle ledger,
|
|
119
|
+
* `chant/lifecycle:<path>`, as `points` names it for a question, or null
|
|
120
|
+
* when it is the working tree's file. A record held on the ledger has no
|
|
121
|
+
* `worktree` or `lastWrite`, since the checkout doesn't hold it.
|
|
122
|
+
*/
|
|
123
|
+
ledger?: string | null;
|
|
109
124
|
};
|
|
110
125
|
/** The role in the trust policy whose holders' verdicts the quorum does not count (#2671). */
|
|
111
126
|
export declare const AGENT_ROLE = "agent";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/records-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAkE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpH,OAAO,EAA4D,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAGrH,OAAO,EASL,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,YAAY,EAGjB,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAoC,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAS/D,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAwC,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAA+C,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACzH,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,gFAAgF,CAAC;AAKtH,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,M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,MAAM,CAM9C;AAED,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,eAAe,GAAG,UAAU,EAAE,CAE5F;AA0DD,yCAAyC;AACzC,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAS9E"}
|
package/package.json
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
* the CI job that waits at a gate again once its approval has arrived. See
|
|
4
4
|
* `../../op/gate-resume.ts` for what each forge is asked and the token it
|
|
5
5
|
* needs. Neither approves anything.
|
|
6
|
+
*
|
|
7
|
+
* A gate that asks a decision point (#3170) waits on a question, not on an
|
|
8
|
+
* approval: its pending fact cites the question, and the gate's resolution is
|
|
9
|
+
* only written when the run asks again. So such a fact is resumable once the
|
|
10
|
+
* question has an answer that passes the gate (`pointGateResumable`, #3835),
|
|
11
|
+
* and `chant workspace points answer --resume` resumes the job right after
|
|
12
|
+
* the answer.
|
|
6
13
|
*/
|
|
7
14
|
|
|
8
15
|
import {
|
|
@@ -12,7 +19,8 @@ import {
|
|
|
12
19
|
type GateResolutionRecord,
|
|
13
20
|
type PendingGateRecord,
|
|
14
21
|
} from "../../lifecycle/gate-ledger";
|
|
15
|
-
import { listFilesInDir, requireLifecycleLedger } from "../../lifecycle/git";
|
|
22
|
+
import { listFilesInDir, pushLifecycleStatus, requireLifecycleLedger } from "../../lifecycle/git";
|
|
23
|
+
import { parseGateSubject } from "../../op/gate-point";
|
|
16
24
|
import {
|
|
17
25
|
isGateRunLocator,
|
|
18
26
|
resolutionAnswering,
|
|
@@ -20,6 +28,7 @@ import {
|
|
|
20
28
|
resumeTokenFromEnv,
|
|
21
29
|
type GateResumeOutcome,
|
|
22
30
|
} from "../../op/gate-resume";
|
|
31
|
+
import { pointGateResumable, type PointQuestionState } from "../../point-decision";
|
|
23
32
|
import type { ForgeFetch } from "../../pr-forge";
|
|
24
33
|
import { formatError, formatInfo, formatSuccess, formatWarning } from "../format";
|
|
25
34
|
import type { CommandContext } from "../registry";
|
|
@@ -53,6 +62,20 @@ export interface ResumeGateOptions {
|
|
|
53
62
|
fetch?: ForgeFetch;
|
|
54
63
|
now?: string;
|
|
55
64
|
dryRun?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The workspace's questions by id, for a fact a gate that asks a decision
|
|
67
|
+
* point recorded (#3835). Read from the workspace at the working directory
|
|
68
|
+
* when a fact needs them and none are given.
|
|
69
|
+
*/
|
|
70
|
+
questions?: ReadonlyMap<string, PointQuestionState>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Every question the workspace at `cwd` lists, by id, the lifecycle ledger's included. Empty when the workspace can't be read. */
|
|
74
|
+
export async function workspaceQuestions(cwd: string): Promise<Map<string, PointQuestionState>> {
|
|
75
|
+
const { workspacePoints } = await import("../../workspace/points-cli");
|
|
76
|
+
const doc = await workspacePoints({ cwd }).catch(() => undefined);
|
|
77
|
+
if (!doc || !("questions" in doc)) return new Map();
|
|
78
|
+
return new Map(doc.questions.map((q) => [q.id, { id: q.id, state: q.state, answer: q.answer, answeredBy: q.answeredBy, answeredOn: q.answeredOn }]));
|
|
56
79
|
}
|
|
57
80
|
|
|
58
81
|
/** Resume the job behind one standing pending fact, when an approval answers it. */
|
|
@@ -68,9 +91,20 @@ export async function resumeStanding(
|
|
|
68
91
|
...(standing.environment !== undefined ? { environment: standing.environment } : {}),
|
|
69
92
|
...(standing.resume?.url ? { url: standing.resume.url } : {}),
|
|
70
93
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
94
|
+
let approvedBy: { approvedBy: string };
|
|
95
|
+
let since: string | undefined;
|
|
96
|
+
if (standing.answer) {
|
|
97
|
+
// A gate that asks a decision point waits on its question (#3835).
|
|
98
|
+
const check = pointGateResumable(standing, opts.questions?.get(standing.answer.id));
|
|
99
|
+
if (!check.resumable) return { ...base, status: "not-approved", message: check.message };
|
|
100
|
+
approvedBy = { approvedBy: check.answeredBy };
|
|
101
|
+
since = check.answeredOn ?? undefined;
|
|
102
|
+
} else {
|
|
103
|
+
const answer = resolutionAnswering(resolutions, standing, pending);
|
|
104
|
+
if (!answer) return { ...base, status: "not-approved", message: "no approval answers it yet" };
|
|
105
|
+
approvedBy = { approvedBy: answer.resolvedBy };
|
|
106
|
+
since = answer.timestamp;
|
|
107
|
+
}
|
|
74
108
|
if (!isGateRunLocator(standing.resume)) {
|
|
75
109
|
return { ...base, ...approvedBy, status: "no-job", message: "its pending fact names no CI job (it was recorded outside CI); run it again by hand" };
|
|
76
110
|
}
|
|
@@ -86,7 +120,7 @@ export async function resumeStanding(
|
|
|
86
120
|
};
|
|
87
121
|
}
|
|
88
122
|
try {
|
|
89
|
-
const outcome = await resumeGateRun(loc, { token, since:
|
|
123
|
+
const outcome = await resumeGateRun(loc, { token, ...(since ? { since } : {}), ...(opts.fetch ? { fetch: opts.fetch } : {}) });
|
|
90
124
|
return { ...base, ...approvedBy, status: outcome.status, message: outcome.status === "resumed" ? outcome.how : outcome.reason };
|
|
91
125
|
} catch (err) {
|
|
92
126
|
return { ...base, ...approvedBy, status: "failed", message: err instanceof Error ? err.message : String(err) };
|
|
@@ -98,10 +132,10 @@ export async function resumeOpGates(op: string, gate: string | undefined, opts:
|
|
|
98
132
|
const ledger = await readGateLedger(op);
|
|
99
133
|
const now = opts.now ?? new Date().toISOString();
|
|
100
134
|
const reports: GateResumeReport[] = [];
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
135
|
+
const standing = standingFacts(ledger.pending, gate).filter((p) => !isPendingGateExpired(p, now));
|
|
136
|
+
// Read the workspace's questions once, and only when a fact waits on one (#3835).
|
|
137
|
+
const questions = opts.questions ?? (standing.some((p) => p.answer) ? await workspaceQuestions(process.cwd()) : undefined);
|
|
138
|
+
for (const p of standing) reports.push(await resumeStanding(p, ledger.resolutions, { ...opts, ...(questions ? { questions } : {}) }, ledger.pending));
|
|
105
139
|
return reports;
|
|
106
140
|
}
|
|
107
141
|
|
|
@@ -140,10 +174,49 @@ export async function resumeAfterApproval(op: string, gate: string, environment:
|
|
|
140
174
|
return reports.some((r) => r.status === "failed" || r.status === "no-token") ? 1 : 0;
|
|
141
175
|
}
|
|
142
176
|
|
|
177
|
+
/**
|
|
178
|
+
* What `chant workspace points answer --resume` runs once the answer is
|
|
179
|
+
* written (#3835): resume the job waiting at the gate the question names in
|
|
180
|
+
* its subject (`gate:<op>/<gate>`), when the answer passes it. The answer has
|
|
181
|
+
* to be on the remote for the resumed job to see it: one held on
|
|
182
|
+
* `chant/lifecycle` is pushed again here, and one in the working tree is
|
|
183
|
+
* not resumed on, since the job reads it only once it is committed and pushed.
|
|
184
|
+
* Returns the exit code, as {@link resumeAfterApproval} does.
|
|
185
|
+
*/
|
|
186
|
+
export async function resumeAfterAnswer(question: { id: string; subject: string | null; ledger: string | null }, cwd: string = process.cwd()): Promise<number> {
|
|
187
|
+
const named = parseGateSubject(question.subject);
|
|
188
|
+
if (!named) {
|
|
189
|
+
console.error(formatInfo(`Question ${question.id} names no gate in its subject, so there is nothing to resume.`));
|
|
190
|
+
return 0;
|
|
191
|
+
}
|
|
192
|
+
if (question.ledger === null) {
|
|
193
|
+
console.error(formatWarning({
|
|
194
|
+
message: `Not resuming: the answer to ${question.id} is in the working tree, and the resumed job would not see it.`,
|
|
195
|
+
hint: `Commit and push it, then run \`chant run resume --op ${named.op}\`.`,
|
|
196
|
+
}));
|
|
197
|
+
return 1;
|
|
198
|
+
}
|
|
199
|
+
if ((await pushLifecycleStatus({ cwd })).status !== "pushed") {
|
|
200
|
+
console.error(formatWarning({
|
|
201
|
+
message: "Not resuming: the answer did not reach the remote, so the resumed job would not see it.",
|
|
202
|
+
hint: `Push chant/lifecycle, then run \`chant run resume --op ${named.op}\`.`,
|
|
203
|
+
}));
|
|
204
|
+
return 1;
|
|
205
|
+
}
|
|
206
|
+
const reports = (await resumeOpGates(named.op, named.gate)).filter((r) => r.environment === undefined);
|
|
207
|
+
if (reports.length === 0) {
|
|
208
|
+
console.error(formatInfo(`No pending fact for ${named.op} / ${named.gate} is waiting, so there is nothing to resume.`));
|
|
209
|
+
return 0;
|
|
210
|
+
}
|
|
211
|
+
for (const r of reports) printReport(r);
|
|
212
|
+
return reports.some((r) => r.status === "failed" || r.status === "no-token") ? 1 : 0;
|
|
213
|
+
}
|
|
214
|
+
|
|
143
215
|
/**
|
|
144
216
|
* `chant run resume [--op <op>] [--dry-run] [--json]`: the scheduled job.
|
|
145
217
|
* Reads every gate ledger on `chant/lifecycle` (or `--op`'s), and starts
|
|
146
|
-
* again each CI job that waits at a gate an approval now answers
|
|
218
|
+
* again each CI job that waits at a gate an approval now answers, or at a
|
|
219
|
+
* gate whose decision point now has an answer that passes it (#3835).
|
|
147
220
|
*/
|
|
148
221
|
export async function runResumeCommand(ctx: CommandContext): Promise<number> {
|
|
149
222
|
try {
|
|
@@ -161,7 +234,7 @@ export async function runResumeCommand(ctx: CommandContext): Promise<number> {
|
|
|
161
234
|
else {
|
|
162
235
|
for (const r of reports.filter((r) => r.status !== "not-approved")) printReport(r);
|
|
163
236
|
const waiting = reports.filter((r) => r.status === "not-approved").length;
|
|
164
|
-
console.error(formatInfo(`${reports.filter((r) => r.status === "resumed").length} resumed, ${waiting} still waiting for an approval.`));
|
|
237
|
+
console.error(formatInfo(`${reports.filter((r) => r.status === "resumed").length} resumed, ${waiting} still waiting for an approval or a passing answer.`));
|
|
165
238
|
}
|
|
166
239
|
return reports.some((r) => r.status === "failed" || r.status === "no-token") ? 1 : 0;
|
|
167
240
|
}
|
package/src/cli/main.ts
CHANGED
|
@@ -1226,10 +1226,12 @@ Workspace (level 1, #2524):
|
|
|
1226
1226
|
candidates, { question, criteria }. --store ledger
|
|
1227
1227
|
holds the question on chant/lifecycle and pushes it,
|
|
1228
1228
|
for a checkout that does not outlive the run (CI)
|
|
1229
|
-
workspace points answer <id> --answer <value> --by <name>... [--note <text>] [--relayed-by <principal>] [--kind <kind file>] [--dry-run]
|
|
1229
|
+
workspace points answer <id> --answer <value> --by <name>... [--note <text>] [--relayed-by <principal>] [--kind <kind file>] [--resume] [--dry-run]
|
|
1230
1230
|
Record people's answer to an open question, or confirm
|
|
1231
1231
|
a model's proposal, once the point's quorum is met,
|
|
1232
|
-
with their note and who relayed it
|
|
1232
|
+
with their note and who relayed it. --resume then
|
|
1233
|
+
starts again the CI job waiting at the gate the
|
|
1234
|
+
question names, when the answer passes it
|
|
1233
1235
|
workspace points retract <id> --by <name>... [--note <text>] [--kind <kind file>] [--dry-run]
|
|
1234
1236
|
Take an answer back: the question is open for people
|
|
1235
1237
|
again, and the answer stays in its retractions
|
|
@@ -82,6 +82,13 @@ export interface GateAnswerRef {
|
|
|
82
82
|
/** `table`, `model` or `quorum`. */
|
|
83
83
|
decider?: string;
|
|
84
84
|
answeredBy?: string[];
|
|
85
|
+
/**
|
|
86
|
+
* On a pending fact: the answers the gate passes on, when the gate names
|
|
87
|
+
* them (`point.pass`); absent means a noul point's yes. `chant run resume`
|
|
88
|
+
* reads it to tell an answer that passes the gate from one that does not,
|
|
89
|
+
* without the Op's config (#3835).
|
|
90
|
+
*/
|
|
91
|
+
pass?: Array<string | boolean>;
|
|
85
92
|
}
|
|
86
93
|
|
|
87
94
|
/** One immutable gate-resolution record. */
|
|
@@ -13,6 +13,7 @@ import { promisify } from "node:util";
|
|
|
13
13
|
import { tmpdir } from "node:os";
|
|
14
14
|
import { join } from "node:path";
|
|
15
15
|
import { ghHostEnv } from "../op/activities/gh-host";
|
|
16
|
+
import { restPullRequestForge } from "../op/activities/forge-pull-request";
|
|
16
17
|
|
|
17
18
|
const execFileAsync = promisify(execFile);
|
|
18
19
|
|
|
@@ -107,9 +108,16 @@ export async function rollbackToRevision(opts: {
|
|
|
107
108
|
|
|
108
109
|
await git(["commit", "-m", rollbackTitle(env, ref)], wt);
|
|
109
110
|
await git(["push", "-u", "origin", branch], wt);
|
|
111
|
+
// `gh pr` speaks GraphQL, which Forgejo does not serve: a Forgejo or
|
|
112
|
+
// GitLab job opens the pull request over REST (#3798).
|
|
113
|
+
const forge = await restPullRequestForge(process.env, { cwd: wt });
|
|
114
|
+
if (forge) {
|
|
115
|
+
const pr = await forge.openPullRequest({ head: branch, title: rollbackTitle(env, ref), body: rollbackBody(env, ref, sourceDir) });
|
|
116
|
+
return { noop: false, branch, prUrl: pr.url ?? "" };
|
|
117
|
+
}
|
|
110
118
|
// `gh pr create` names no host: tell it the one `origin` is on, or the
|
|
111
|
-
// CI job's forge, so a GitHub Enterprise Server
|
|
112
|
-
//
|
|
119
|
+
// CI job's forge, so a GitHub Enterprise Server checkout is not sent to
|
|
120
|
+
// github.com (#3780).
|
|
113
121
|
const { stdout } = await execFileAsync(
|
|
114
122
|
"gh",
|
|
115
123
|
["pr", "create", "--title", rollbackTitle(env, ref), "--body", rollbackBody(env, ref, sourceDir), "--head", branch],
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which pull-request paths go over REST (#3798): a Forgejo or GitLab job
|
|
3
|
+
* does, GitHub and a local run keep `gh`. Driven with an injected fetch.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, test } from "vitest";
|
|
7
|
+
import { ForgeEnvironmentError, type ForgeFetch } from "../../pr-forge";
|
|
8
|
+
import { remoteRepoPath, restPullRequestForge, upsertPullRequest } from "./forge-pull-request";
|
|
9
|
+
|
|
10
|
+
interface Call {
|
|
11
|
+
method: string;
|
|
12
|
+
url: string;
|
|
13
|
+
body?: unknown;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function fakeFetch(routes: Record<string, unknown>): { fetch: ForgeFetch; calls: Call[] } {
|
|
17
|
+
const calls: Call[] = [];
|
|
18
|
+
const fetch: ForgeFetch = async (url, init) => {
|
|
19
|
+
calls.push({ method: init.method, url, ...(init.body ? { body: JSON.parse(init.body) } : {}) });
|
|
20
|
+
const found = routes[`${init.method} ${new URL(url).pathname}`];
|
|
21
|
+
if (found === undefined) return { ok: false, status: 404, text: async () => "" };
|
|
22
|
+
return { ok: true, status: 200, text: async () => JSON.stringify(found) };
|
|
23
|
+
};
|
|
24
|
+
return { fetch, calls };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const FORGEJO_JOB = {
|
|
28
|
+
FORGEJO_ACTIONS: "true",
|
|
29
|
+
GITHUB_SERVER_URL: "https://forge.example",
|
|
30
|
+
GITHUB_API_URL: "https://forge.example/api/v1",
|
|
31
|
+
GITHUB_REPOSITORY: "acme/infra",
|
|
32
|
+
GITHUB_TOKEN: "tok",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
describe("remoteRepoPath", () => {
|
|
36
|
+
test("reads owner/name off https, ssh and scp-style remotes", () => {
|
|
37
|
+
expect(remoteRepoPath("https://forge.example/acme/infra.git")).toBe("acme/infra");
|
|
38
|
+
expect(remoteRepoPath("ssh://git@forge.example:2222/acme/infra.git")).toBe("acme/infra");
|
|
39
|
+
expect(remoteRepoPath("git@gitlab.com:group/sub/infra.git")).toBe("group/sub/infra");
|
|
40
|
+
expect(remoteRepoPath("https://forge.example/")).toBeUndefined();
|
|
41
|
+
expect(remoteRepoPath(undefined)).toBeUndefined();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe("restPullRequestForge", () => {
|
|
46
|
+
test("GitHub and a run outside CI keep gh", async () => {
|
|
47
|
+
expect(await restPullRequestForge({ GITHUB_ACTIONS: "true", GITHUB_REPOSITORY: "acme/infra", GITHUB_TOKEN: "t" })).toBeUndefined();
|
|
48
|
+
expect(await restPullRequestForge({})).toBeUndefined();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("a Forgejo job opens over REST, on the repository the checkout's remote names", async () => {
|
|
52
|
+
const { fetch, calls } = fakeFetch({ "POST /api/v1/repos/acme/other/pulls": { number: 3, html_url: "https://forge.example/acme/other/pulls/3" } });
|
|
53
|
+
const forge = await restPullRequestForge(FORGEJO_JOB, { cwd: "/wt", fetch, remoteUrl: async () => "https://forge.example/acme/other.git" });
|
|
54
|
+
expect(forge?.kind).toBe("forgejo");
|
|
55
|
+
expect((await forge!.openPullRequest({ head: "h", base: "main", title: "t", body: "b" })).url).toBe("https://forge.example/acme/other/pulls/3");
|
|
56
|
+
expect(calls[0].url).toBe("https://forge.example/api/v1/repos/acme/other/pulls");
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test("a remote on another host leaves the job's repository", async () => {
|
|
60
|
+
const { fetch, calls } = fakeFetch({ "POST /api/v1/repos/acme/infra/pulls": { number: 1 } });
|
|
61
|
+
const forge = await restPullRequestForge(FORGEJO_JOB, { cwd: "/wt", fetch, remoteUrl: async () => "https://github.com/acme/mirror.git" });
|
|
62
|
+
await forge!.openPullRequest({ head: "h", base: "main", title: "t", body: "b" });
|
|
63
|
+
expect(calls[0].url).toBe("https://forge.example/api/v1/repos/acme/infra/pulls");
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test("a GitLab job opens a merge request; a Forgejo job with no token is refused by name", async () => {
|
|
67
|
+
const forge = await restPullRequestForge({ GITLAB_CI: "true", CI_API_V4_URL: "https://gl/api/v4", CI_PROJECT_ID: "42", GITLAB_TOKEN: "t" });
|
|
68
|
+
expect(forge?.kind).toBe("gitlab");
|
|
69
|
+
const { GITHUB_TOKEN: _, ...noToken } = FORGEJO_JOB;
|
|
70
|
+
await expect(restPullRequestForge(noToken)).rejects.toBeInstanceOf(ForgeEnvironmentError);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe("upsertPullRequest", () => {
|
|
75
|
+
const open = { number: 10, title: "t", body: "b", head: { ref: "h", repo: { full_name: "acme/infra" } }, html_url: "https://forge.example/acme/infra/pulls/10" };
|
|
76
|
+
|
|
77
|
+
test("opens one when none is open, edits the open one, leaves a current one alone", async () => {
|
|
78
|
+
const env = FORGEJO_JOB;
|
|
79
|
+
const none = fakeFetch({ "GET /api/v1/repos/acme/infra/pulls": [], "POST /api/v1/repos/acme/infra/pulls": { number: 11 } });
|
|
80
|
+
expect((await upsertPullRequest((await restPullRequestForge(env, { fetch: none.fetch }))!, { head: "h", base: "main", title: "t", body: "b" })).action).toBe("opened");
|
|
81
|
+
|
|
82
|
+
const stale = fakeFetch({ "GET /api/v1/repos/acme/infra/pulls": [open], "PATCH /api/v1/repos/acme/infra/pulls/10": { ...open, title: "t2" } });
|
|
83
|
+
const r = await upsertPullRequest((await restPullRequestForge(env, { fetch: stale.fetch }))!, { head: "h", base: "main", title: "t2", body: "b" });
|
|
84
|
+
expect(r).toMatchObject({ action: "updated", pr: { number: 10, title: "t2", url: open.html_url } });
|
|
85
|
+
expect(stale.calls.at(-1)).toMatchObject({ method: "PATCH", body: { title: "t2", body: "b" } });
|
|
86
|
+
|
|
87
|
+
const current = fakeFetch({ "GET /api/v1/repos/acme/infra/pulls": [open] });
|
|
88
|
+
expect((await upsertPullRequest((await restPullRequestForge(env, { fetch: current.fetch }))!, { head: "h", title: "t", body: "b\n" })).action).toBe("unchanged");
|
|
89
|
+
expect(current.calls.every((c) => c.method === "GET")).toBe(true);
|
|
90
|
+
});
|
|
91
|
+
});
|