@blogic-cz/agent-tools 1.14.6 → 1.15.0
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/README.md +1 -1
- package/dist/gh-tool/pr/commands.d.ts +1 -0
- package/dist/gh-tool/pr/commands.d.ts.map +1 -1
- package/dist/gh-tool/read/pulls.d.ts +44 -0
- package/dist/gh-tool/read/pulls.d.ts.map +1 -1
- package/dist/gh-tool/read/reads.d.ts +22 -0
- package/dist/gh-tool/read/reads.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/gh-tool/pr/commands.ts +35 -2
- package/src/gh-tool/read/pulls.ts +178 -0
- package/src/gh-tool/read/reads.ts +10 -1
package/README.md
CHANGED
|
@@ -370,7 +370,7 @@ that GitHub squash commits exclude changes from an already squashed parent.
|
|
|
370
370
|
|
|
371
371
|
Use `review-triage --prs 12,34` for compact per-PR entries. Each entry has `classification`, the `visibleOpenReviewThreadsCount`, `unrepliedReviewThreadsCount`, and `unresolvedReviewThreadsCount` counts, and `visibleOpenThreadIds`. A failed PR returns an `error` entry. The command keeps results for other PRs. Use `review-triage-batch --prs 12,34` for the full triage result for each PR.
|
|
372
372
|
|
|
373
|
-
`pr request-review --reviewers alice,bob` emits sorted `submittedReviewers` (normalized input), `newlyRequested` and `alreadyPending` (the submitted logins split by whether a pending request already existed, so a fresh re-request is distinguishable from a no-op), and `requestedReviewers` (GitHub-confirmed result). `pr last-human-reviewer` derives `currentRequestedReviewers` from live `reviewRequests` only; timeline events are not replayed because GitHub clears a pending request on review submit without emitting `ReviewRequestRemovedEvent`.
|
|
373
|
+
`review-triage-batch --prs 12,34 --summary` returns only the PR state fields, `summary.unresolvedReviewThreadsCount`, `summary.unrepliedReviewThreadsCount`, and check names and buckets. It avoids review bodies, comment bodies, diff hunks, and full thread data. Without `--summary`, the command keeps the full triage result. `pr request-review --reviewers alice,bob` emits sorted `submittedReviewers` (normalized input), `newlyRequested` and `alreadyPending` (the submitted logins split by whether a pending request already existed, so a fresh re-request is distinguishable from a no-op), and `requestedReviewers` (GitHub-confirmed result). `pr last-human-reviewer` derives `currentRequestedReviewers` from live `reviewRequests` only; timeline events are not replayed because GitHub clears a pending request on review submit without emitting `ReviewRequestRemovedEvent`.
|
|
374
374
|
|
|
375
375
|
`pr watch --prs 12,34 --until terminal --format jsonl` accepts at most 50 unique, digits-only PR numbers and emits only JSONL state transitions. Identity uses `repo/pr/headSha/runId/attempt/jobId`; `runId`, `attempt`, and `jobId` are omitted from an event rather than emitted as `null`, and `checkId` is no longer emitted. State/bucket revisions emit even when identity stays stable; `supersedes` appears only when identity changes. Open PRs with no checks become terminal only after three stable empty snapshots, allowing bounded GitHub eventual consistency, and carry `checksObserved: false` — a terminal snapshot with no observed check is never green evidence. `pr checks`, batch checks, triage, and batch triage keep stderr silent with `--format json`; JSONL watch is also informationally silent. Failures still return structured nonzero errors on stderr.
|
|
376
376
|
|
|
@@ -436,6 +436,7 @@ export declare const prReviewTriageBatchCommand: Command.Command<"review-triage-
|
|
|
436
436
|
readonly format: "json" | "toon";
|
|
437
437
|
readonly prs: string;
|
|
438
438
|
readonly repo: Option.Option<string>;
|
|
439
|
+
readonly summary: boolean;
|
|
439
440
|
}, {}, import("#gh/read/transport").GhError, GitHubService>;
|
|
440
441
|
export declare const prReplyAndResolveCommand: Command.Command<"reply-and-resolve", {
|
|
441
442
|
readonly body: Option.Option<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAClD,OAAO,EAAW,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,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AA2EF,eAAO,MAAM,cAAc,oIAG1B,CAAC"}
|
|
@@ -134,5 +134,49 @@ export declare const prList: (repo: RepoRef, filter: PrListFilter, consistency?:
|
|
|
134
134
|
} | undefined;
|
|
135
135
|
}[], import("#gh/read/transport").GhError, GitHubService>;
|
|
136
136
|
export declare const prChecks: (repo: RepoRef, pr: number | null, headSha: string | null) => Effect.Effect<CheckResult[], import("#gh/read/transport").GhError, GitHubService>;
|
|
137
|
+
export type PrReviewTriageSummary = {
|
|
138
|
+
readonly info: {
|
|
139
|
+
readonly number: number;
|
|
140
|
+
readonly title: string;
|
|
141
|
+
readonly state: string;
|
|
142
|
+
readonly isDraft: boolean;
|
|
143
|
+
readonly baseRefName: string;
|
|
144
|
+
readonly reviewDecision: string;
|
|
145
|
+
readonly mergeable: "MERGEABLE" | "CONFLICTING" | "UNKNOWN";
|
|
146
|
+
readonly reviewRequests: ReadonlyArray<{
|
|
147
|
+
readonly login: string;
|
|
148
|
+
}>;
|
|
149
|
+
};
|
|
150
|
+
readonly summary: {
|
|
151
|
+
readonly unresolvedReviewThreadsCount: number;
|
|
152
|
+
readonly unrepliedReviewThreadsCount: number;
|
|
153
|
+
};
|
|
154
|
+
readonly checks: ReadonlyArray<{
|
|
155
|
+
readonly name: string;
|
|
156
|
+
readonly bucket: string;
|
|
157
|
+
}>;
|
|
158
|
+
};
|
|
159
|
+
export declare const prReviewTriageSummary: (repo: RepoRef, pr: number) => Effect.Effect<{
|
|
160
|
+
info: {
|
|
161
|
+
number: number;
|
|
162
|
+
title: string;
|
|
163
|
+
state: string;
|
|
164
|
+
isDraft: boolean;
|
|
165
|
+
baseRefName: string;
|
|
166
|
+
reviewDecision: string;
|
|
167
|
+
mergeable: "CONFLICTING" | "MERGEABLE" | "UNKNOWN";
|
|
168
|
+
reviewRequests: {
|
|
169
|
+
login: string;
|
|
170
|
+
}[];
|
|
171
|
+
};
|
|
172
|
+
summary: {
|
|
173
|
+
unresolvedReviewThreadsCount: number;
|
|
174
|
+
unrepliedReviewThreadsCount: number;
|
|
175
|
+
};
|
|
176
|
+
checks: never[] | readonly {
|
|
177
|
+
readonly name: string;
|
|
178
|
+
readonly bucket: string;
|
|
179
|
+
}[];
|
|
180
|
+
}, import("#gh/read/transport").GhError, GitHubService>;
|
|
137
181
|
export {};
|
|
138
182
|
//# sourceMappingURL=pulls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pulls.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/read/pulls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAO7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,eAAO,MAAM,cAAc,oKACwI,CAAC;AACpK,eAAO,MAAM,cAAc,yHAC6F,CAAC;AACzH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,eAAe,CAAA;CAAE,CAAC;AACpF,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;EAeR,CAAC;AAEH,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBZ,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,QAAQ,CAAC,IA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AAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpF,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;uBAoCY,MAAM;yBAAmB,MAAM;;uDAoC3E,CAAC"}
|
|
@@ -128,6 +128,28 @@ export declare const reads: {
|
|
|
128
128
|
} | undefined;
|
|
129
129
|
}[], import("#gh/read/transport").GhError, GitHubService>;
|
|
130
130
|
prChecks: (repo: RepoRef, pr: number | null, headSha: string | null) => Effect.Effect<import("#gh/types").CheckResult[], import("#gh/read/transport").GhError, GitHubService>;
|
|
131
|
+
prReviewTriageSummary: (repo: RepoRef, pr: number) => Effect.Effect<{
|
|
132
|
+
info: {
|
|
133
|
+
number: number;
|
|
134
|
+
title: string;
|
|
135
|
+
state: string;
|
|
136
|
+
isDraft: boolean;
|
|
137
|
+
baseRefName: string;
|
|
138
|
+
reviewDecision: string;
|
|
139
|
+
mergeable: "CONFLICTING" | "MERGEABLE" | "UNKNOWN";
|
|
140
|
+
reviewRequests: {
|
|
141
|
+
login: string;
|
|
142
|
+
}[];
|
|
143
|
+
};
|
|
144
|
+
summary: {
|
|
145
|
+
unresolvedReviewThreadsCount: number;
|
|
146
|
+
unrepliedReviewThreadsCount: number;
|
|
147
|
+
};
|
|
148
|
+
checks: never[] | readonly {
|
|
149
|
+
readonly name: string;
|
|
150
|
+
readonly bucket: string;
|
|
151
|
+
}[];
|
|
152
|
+
}, import("#gh/read/transport").GhError, GitHubService>;
|
|
131
153
|
prHead: (repo: RepoRef, pr: number, consistency?: "cached" | "origin" | undefined) => Effect.Effect<{
|
|
132
154
|
headSha: string;
|
|
133
155
|
baseSha: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reads.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/read/reads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAkB,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,aAAa,E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AAC;AA+EH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reads, writes } from "#gh/read/index";
|
|
1
|
+
import { reads, resolveRepo, writes } from "#gh/read/index";
|
|
2
2
|
import { repoSlug } from "#gh/read/keys";
|
|
3
3
|
import { Command, Flag, Param } from "effect/cli";
|
|
4
4
|
import { Console, Effect, Option } from "effect";
|
|
@@ -511,6 +511,28 @@ const compactReviewTriage = (
|
|
|
511
511
|
visibleOpenThreadIds: result.visibleOpenThreads.map((thread) => thread.threadId),
|
|
512
512
|
});
|
|
513
513
|
|
|
514
|
+
const fetchReviewTriageSummary = Effect.fn("pr.fetchReviewTriageSummary")(function* (pr: number) {
|
|
515
|
+
const repo = yield* resolveRepo(null);
|
|
516
|
+
return yield* reads
|
|
517
|
+
.prReviewTriageSummary(repo, pr)
|
|
518
|
+
.pipe(Effect.map((result) => ({ pr, ...result })));
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
const fetchReviewTriageSummaryBatch = Effect.fn("pr.fetchReviewTriageSummaryBatch")(function* (
|
|
522
|
+
prs: readonly number[],
|
|
523
|
+
) {
|
|
524
|
+
return yield* Effect.forEach(
|
|
525
|
+
prs,
|
|
526
|
+
(pr) =>
|
|
527
|
+
fetchReviewTriageSummary(pr).pipe(
|
|
528
|
+
Effect.catch((error) =>
|
|
529
|
+
Effect.succeed({ pr, error: error instanceof Error ? error.message : String(error) }),
|
|
530
|
+
),
|
|
531
|
+
),
|
|
532
|
+
{ concurrency: 5 },
|
|
533
|
+
);
|
|
534
|
+
});
|
|
535
|
+
|
|
514
536
|
export const fetchReviewTriageBatch = Effect.fn("pr.fetchReviewTriageBatch")(function* (
|
|
515
537
|
prs: readonly number[],
|
|
516
538
|
) {
|
|
@@ -1835,12 +1857,23 @@ export const prReviewTriageBatchCommand = Command.make(
|
|
|
1835
1857
|
format: formatOption,
|
|
1836
1858
|
prs: Flag.String("prs").pipe(Flag.withDescription("Comma-separated PR numbers")),
|
|
1837
1859
|
repo: repoOption,
|
|
1860
|
+
summary: Flag.Boolean("summary").pipe(
|
|
1861
|
+
Flag.withDescription(
|
|
1862
|
+
"Fetch only PR state, review thread counts, and check names and buckets",
|
|
1863
|
+
),
|
|
1864
|
+
Flag.withDefault(false),
|
|
1865
|
+
),
|
|
1838
1866
|
},
|
|
1839
|
-
({ format, prs, repo }) =>
|
|
1867
|
+
({ format, prs, repo, summary }) =>
|
|
1840
1868
|
withRepo(
|
|
1841
1869
|
repo,
|
|
1842
1870
|
Effect.gen(function* () {
|
|
1843
1871
|
const numbers = yield* parsePrNumbers(prs);
|
|
1872
|
+
if (summary) {
|
|
1873
|
+
const results = yield* fetchReviewTriageSummaryBatch(numbers);
|
|
1874
|
+
yield* logFormatted(results, format);
|
|
1875
|
+
return;
|
|
1876
|
+
}
|
|
1844
1877
|
const results = yield* Effect.all(
|
|
1845
1878
|
numbers.map((prNumber) => fetchReviewTriage(prNumber)),
|
|
1846
1879
|
{ concurrency: "unbounded" },
|
|
@@ -278,6 +278,184 @@ export const prChecks = Effect.fn("reads.prChecks")(function* (
|
|
|
278
278
|
});
|
|
279
279
|
});
|
|
280
280
|
|
|
281
|
+
const PR_REVIEW_TRIAGE_SUMMARY_QUERY = `
|
|
282
|
+
query($owner: String!, $name: String!, $pr: Int!, $after: String) {
|
|
283
|
+
repository(owner: $owner, name: $name) {
|
|
284
|
+
pullRequest(number: $pr) {
|
|
285
|
+
number
|
|
286
|
+
title
|
|
287
|
+
state
|
|
288
|
+
isDraft
|
|
289
|
+
baseRefName
|
|
290
|
+
reviewDecision
|
|
291
|
+
mergeable
|
|
292
|
+
reviewRequests(first: 100) {
|
|
293
|
+
nodes {
|
|
294
|
+
requestedReviewer {
|
|
295
|
+
... on User { login }
|
|
296
|
+
... on Team { slug }
|
|
297
|
+
... on Bot { login }
|
|
298
|
+
... on EnterpriseTeam { name }
|
|
299
|
+
... on Mannequin { login }
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
reviewThreads(first: 100, after: $after) {
|
|
304
|
+
nodes {
|
|
305
|
+
isResolved
|
|
306
|
+
comments(first: 2) {
|
|
307
|
+
nodes { replyTo { id } }
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
pageInfo { hasNextPage endCursor }
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
`;
|
|
316
|
+
|
|
317
|
+
const PR_REVIEW_THREAD_COUNTS_QUERY = `
|
|
318
|
+
query($owner: String!, $name: String!, $pr: Int!, $after: String) {
|
|
319
|
+
repository(owner: $owner, name: $name) {
|
|
320
|
+
pullRequest(number: $pr) {
|
|
321
|
+
reviewThreads(first: 100, after: $after) {
|
|
322
|
+
nodes {
|
|
323
|
+
isResolved
|
|
324
|
+
comments(first: 2) {
|
|
325
|
+
nodes { replyTo { id } }
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
pageInfo { hasNextPage endCursor }
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
`;
|
|
334
|
+
|
|
335
|
+
type PrReviewTriageSummaryPage = {
|
|
336
|
+
readonly repository: {
|
|
337
|
+
readonly pullRequest: {
|
|
338
|
+
readonly number: number;
|
|
339
|
+
readonly title: string;
|
|
340
|
+
readonly state: string;
|
|
341
|
+
readonly isDraft: boolean;
|
|
342
|
+
readonly baseRefName: string;
|
|
343
|
+
readonly reviewDecision: string | null;
|
|
344
|
+
readonly mergeable: "MERGEABLE" | "CONFLICTING" | "UNKNOWN";
|
|
345
|
+
readonly reviewRequests: {
|
|
346
|
+
readonly nodes: ReadonlyArray<{
|
|
347
|
+
readonly requestedReviewer: {
|
|
348
|
+
readonly login?: string;
|
|
349
|
+
readonly slug?: string;
|
|
350
|
+
readonly name?: string;
|
|
351
|
+
} | null;
|
|
352
|
+
}>;
|
|
353
|
+
};
|
|
354
|
+
readonly reviewThreads: {
|
|
355
|
+
readonly nodes: ReadonlyArray<{
|
|
356
|
+
readonly isResolved: boolean;
|
|
357
|
+
readonly comments: {
|
|
358
|
+
readonly nodes: ReadonlyArray<{ readonly replyTo: { readonly id: string } | null }>;
|
|
359
|
+
};
|
|
360
|
+
}>;
|
|
361
|
+
readonly pageInfo: { readonly hasNextPage: boolean; readonly endCursor: string | null };
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
export type PrReviewTriageSummary = {
|
|
368
|
+
readonly info: {
|
|
369
|
+
readonly number: number;
|
|
370
|
+
readonly title: string;
|
|
371
|
+
readonly state: string;
|
|
372
|
+
readonly isDraft: boolean;
|
|
373
|
+
readonly baseRefName: string;
|
|
374
|
+
readonly reviewDecision: string;
|
|
375
|
+
readonly mergeable: "MERGEABLE" | "CONFLICTING" | "UNKNOWN";
|
|
376
|
+
readonly reviewRequests: ReadonlyArray<{ readonly login: string }>;
|
|
377
|
+
};
|
|
378
|
+
readonly summary: {
|
|
379
|
+
readonly unresolvedReviewThreadsCount: number;
|
|
380
|
+
readonly unrepliedReviewThreadsCount: number;
|
|
381
|
+
};
|
|
382
|
+
readonly checks: ReadonlyArray<{ readonly name: string; readonly bucket: string }>;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
export const prReviewTriageSummary = Effect.fn("reads.prReviewTriageSummary")(function* (
|
|
386
|
+
repo: RepoRef,
|
|
387
|
+
pr: number,
|
|
388
|
+
) {
|
|
389
|
+
const gh = yield* GitHubService;
|
|
390
|
+
const variables = { owner: repo.owner, name: repo.name, pr, after: null as string | null };
|
|
391
|
+
const first = (yield* gh.runGraphQL(
|
|
392
|
+
PR_REVIEW_TRIAGE_SUMMARY_QUERY,
|
|
393
|
+
variables,
|
|
394
|
+
)) as PrReviewTriageSummaryPage;
|
|
395
|
+
const firstPage = first.repository.pullRequest;
|
|
396
|
+
let unresolvedReviewThreadsCount = 0;
|
|
397
|
+
let unrepliedReviewThreadsCount = 0;
|
|
398
|
+
const countThreads = (
|
|
399
|
+
threads: PrReviewTriageSummaryPage["repository"]["pullRequest"]["reviewThreads"]["nodes"],
|
|
400
|
+
) => {
|
|
401
|
+
for (const thread of threads) {
|
|
402
|
+
if (!thread.isResolved) unresolvedReviewThreadsCount++;
|
|
403
|
+
if (!thread.comments.nodes.some((comment) => comment.replyTo !== null))
|
|
404
|
+
unrepliedReviewThreadsCount++;
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
countThreads(firstPage.reviewThreads.nodes);
|
|
408
|
+
|
|
409
|
+
let pageInfo = firstPage.reviewThreads.pageInfo;
|
|
410
|
+
while (pageInfo.hasNextPage && pageInfo.endCursor !== null) {
|
|
411
|
+
const response = (yield* gh.runGraphQL(PR_REVIEW_THREAD_COUNTS_QUERY, {
|
|
412
|
+
...variables,
|
|
413
|
+
after: pageInfo.endCursor,
|
|
414
|
+
})) as PrReviewTriageSummaryPage;
|
|
415
|
+
const pullRequest = response.repository.pullRequest;
|
|
416
|
+
countThreads(pullRequest.reviewThreads.nodes);
|
|
417
|
+
pageInfo = pullRequest.reviewThreads.pageInfo;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const checks = yield* gh
|
|
421
|
+
.runGhJson<ReadonlyArray<{ readonly name: string; readonly bucket: string }>>([
|
|
422
|
+
"pr",
|
|
423
|
+
"checks",
|
|
424
|
+
String(pr),
|
|
425
|
+
"--repo",
|
|
426
|
+
repoSlug(repo),
|
|
427
|
+
"--json",
|
|
428
|
+
"name,bucket",
|
|
429
|
+
])
|
|
430
|
+
.pipe(
|
|
431
|
+
Effect.catchTag("GitHubCommandError", (error) =>
|
|
432
|
+
/no checks reported/i.test(`${error.message}\n${error.stderr}`)
|
|
433
|
+
? Effect.succeed([])
|
|
434
|
+
: Effect.fail(error),
|
|
435
|
+
),
|
|
436
|
+
);
|
|
437
|
+
const reviewRequests = firstPage.reviewRequests.nodes.flatMap(({ requestedReviewer }) => {
|
|
438
|
+
if (requestedReviewer === null) return [];
|
|
439
|
+
const login = requestedReviewer.login ?? requestedReviewer.slug ?? requestedReviewer.name;
|
|
440
|
+
return login === undefined ? [] : [{ login }];
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
return {
|
|
444
|
+
info: {
|
|
445
|
+
number: firstPage.number,
|
|
446
|
+
title: firstPage.title,
|
|
447
|
+
state: firstPage.state,
|
|
448
|
+
isDraft: firstPage.isDraft,
|
|
449
|
+
baseRefName: firstPage.baseRefName,
|
|
450
|
+
reviewDecision: firstPage.reviewDecision ?? "",
|
|
451
|
+
mergeable: firstPage.mergeable,
|
|
452
|
+
reviewRequests,
|
|
453
|
+
},
|
|
454
|
+
summary: { unresolvedReviewThreadsCount, unrepliedReviewThreadsCount },
|
|
455
|
+
checks,
|
|
456
|
+
};
|
|
457
|
+
});
|
|
458
|
+
|
|
281
459
|
const movedHead = (pr: number) =>
|
|
282
460
|
new GitHubCommandError({
|
|
283
461
|
command: `gh-tool pr checks --pr ${pr}`,
|
|
@@ -6,7 +6,15 @@ import { cachedRead, ReadCache } from "./cache";
|
|
|
6
6
|
import { OPS } from "./classes";
|
|
7
7
|
import { repoSlug } from "./keys";
|
|
8
8
|
import { issueView, issueList, issueComments } from "./issues";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
prView,
|
|
11
|
+
prList,
|
|
12
|
+
prChecks,
|
|
13
|
+
prHead,
|
|
14
|
+
prBody,
|
|
15
|
+
checkSignal,
|
|
16
|
+
prReviewTriageSummary,
|
|
17
|
+
} from "./pulls";
|
|
10
18
|
import { prComments, prReviews, reviewThreads, lastHumanReviewer } from "./reviews";
|
|
11
19
|
import { reviewGuards } from "./review-guards";
|
|
12
20
|
import type { RepoRef, RunFilter } from "./keys";
|
|
@@ -375,6 +383,7 @@ export const reads = {
|
|
|
375
383
|
prView,
|
|
376
384
|
prList,
|
|
377
385
|
prChecks,
|
|
386
|
+
prReviewTriageSummary,
|
|
378
387
|
prHead,
|
|
379
388
|
prBody,
|
|
380
389
|
checkSignal,
|