@blogic-cz/agent-tools 1.13.1 → 1.14.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 +13 -0
- package/dist/gh-tool/pr/commands.d.ts +7 -0
- package/dist/gh-tool/pr/commands.d.ts.map +1 -1
- package/dist/gh-tool/pr/core.d.ts +5 -0
- package/dist/gh-tool/pr/core.d.ts.map +1 -1
- package/dist/gh-tool/pr/index.d.ts +1 -1
- package/dist/gh-tool/pr/index.d.ts.map +1 -1
- package/dist/gh-tool/workflow.d.ts +1 -0
- package/dist/gh-tool/workflow.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/gh-tool/main.ts +2 -0
- package/src/gh-tool/pr/commands.ts +36 -0
- package/src/gh-tool/pr/core.ts +29 -4
- package/src/gh-tool/pr/index.ts +1 -0
- package/src/gh-tool/workflow.ts +19 -1
package/README.md
CHANGED
|
@@ -407,6 +407,19 @@ Reruns preflight every target before mutation and fail closed with `evidence_una
|
|
|
407
407
|
|
|
408
408
|
Zero reported checks is a state, not an error. `gh pr checks` exits nonzero on an empty result. `stack merge`, `review-triage`, and `checks-failed` preserve `none_reported` so they do not report a green or ready PR. `pr checks` batch output includes `checksStatus: "none_reported"` and a reason. `fetchCheckResults` still maps this state to `[]` for rerun, trigger, and watch flows that handle empty results. `pr trigger-checks` covers the case where GitHub dropped the `pull_request` event and no run exists at all. It dispatches the named `workflow_dispatch` workflow **on the PR head branch**, then compares the created run's `headSha` back to the PR head and reports `matchesPrHead`. A run dispatched on the wrong ref goes green for another branch and must never be read as PR evidence, so `workflow run` also returns the discovered `runId`/`headSha` instead of a bare `dispatched: true`.
|
|
409
409
|
|
|
410
|
+
`pr checks --watch` waits up to 600 seconds by default. On timeout, the error names the pending checks and the `--timeout <seconds>` option.
|
|
411
|
+
|
|
412
|
+
Use `pr wait` when a PR must reach a specific state before the next action:
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
bun gh-tool pr wait --pr 123 --state merged --timeout 600000
|
|
416
|
+
bun gh-tool pr wait --pr 123 --state closed --timeout 600000
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
The timeout is in milliseconds and includes API reads. The command reads fresh state every five seconds and returns one result. A timeout exits with code 124. `closed` means closed without a merge. `merged` requires a merge.
|
|
420
|
+
|
|
421
|
+
`workflow job-logs --failed-steps-only` puts the last `CHECK FAIL` line first. If there is no such line, it puts the first error or failure line first. Other lines follow. `pr checks-failed --with-logs` keeps that line first in its bounded summary. Job logs come from the job endpoint. The tool reuses the metadata read that resolved the job name.
|
|
422
|
+
|
|
410
423
|
`pr checks-failed` returns `status: "none_reported"`, the reason, and a hint when GitHub reports no checks for the stable PR head. It does not return `no_failures` for that state.
|
|
411
424
|
|
|
412
425
|
`pr feedback` returns the whole inventory by default. Narrow it with `--only visible-open|needs-human-reply|current-head` (narrowed filters drop issue comments), drop bots with `--exclude-authors github-actions,dependabot`, and read `omitted` for what each filter removed. Base64 report payloads in bodies are replaced with `[base64 payload omitted]`; pass `--raw-bodies` to keep them. `review-triage --omit reviews,inlineComments` trims a repeated snapshot to the verdict and check state, and lists what it left out in `omittedSections`.
|
|
@@ -189,6 +189,13 @@ export declare const prListCommand: Command.Command<"list", {
|
|
|
189
189
|
readonly limit: number;
|
|
190
190
|
readonly repo: Option.Option<string>;
|
|
191
191
|
}, {}, import("#gh/read/transport").GhError, GitHubService>;
|
|
192
|
+
export declare const prWaitCommand: Command.Command<"wait", {
|
|
193
|
+
readonly pr: number;
|
|
194
|
+
readonly state: "closed" | "merged";
|
|
195
|
+
readonly timeout: number;
|
|
196
|
+
readonly format: "json" | "toon";
|
|
197
|
+
readonly repo: Option.Option<string>;
|
|
198
|
+
}, {}, GitHubTimeoutError | import("#gh/read/transport").GhError, GitHubService>;
|
|
192
199
|
export declare const prWaitMergeableCommand: Command.Command<"wait-mergeable", {
|
|
193
200
|
readonly format: "json" | "toon";
|
|
194
201
|
readonly pr: Option.Option<number>;
|
|
@@ -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,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
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,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAsGpE,eAAO,MAAM,cAAc,cAAe,MAAM,4FAM/C,CAAC;AAiCF,eAAO,MAAM,aAAa,OAAQ,MAAM,aAAa,MAAM;;;;;;uDA6BvD,CAAC;AAEL,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAC/C,QAAQ,CAAC,2BAA2B,EAAE,MAAM,CAAC;IAC7C,QAAQ,CAAC,4BAA4B,EAAE,MAAM,CAAC;CAC/C,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,qBAAqB,CAAC;IACjD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,oBAA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eAAe;;;;;;;;;2DAkD3B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;2DAsDjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,YACpC,SAAS,EACT,gBAAgB,EAChB,mBAAmB,CACX,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAC1D,CAAC,QACH,aAAa,CAAC,MAAM,CAAC;;EAW5B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;2DAgCjC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;2DAiBsD,CAAC;AAE1F,eAAO,MAAM,0BAA0B;;;;2DAuBtC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;2DAgDpC,CAAC;AA2EF,eAAO,MAAM,cAAc,oIAG1B,CAAC"}
|
|
@@ -151,6 +151,11 @@ export declare const waitForMergeable: (pr: number | null, timeoutSeconds: numbe
|
|
|
151
151
|
headSha: string | null;
|
|
152
152
|
baseSha: string | null;
|
|
153
153
|
}, import("#gh/read/transport").GhError, GitHubService>;
|
|
154
|
+
export declare const waitForPRState: (pr: number, state: "closed" | "merged", timeoutMs: number) => Effect.Effect<{
|
|
155
|
+
number: number;
|
|
156
|
+
state: string;
|
|
157
|
+
url: string;
|
|
158
|
+
}, GitHubTimeoutError | import("#gh/read/transport").GhError, GitHubService>;
|
|
154
159
|
export declare const createPR: (opts: {
|
|
155
160
|
base: string | null;
|
|
156
161
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAA6B,MAAM,QAAQ,CAAC;AAE3E,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,iBAAiB,EA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;uDAejF,CAAC;AAEH,eAAO,MAAM,MAAM;QACb,MAAM;WACH,MAAM,GAAG,IAAI;UACd,MAAM,GAAG,IAAI;UACb,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAwDnB,CAAC;AAEH,eAAO,MAAM,WAAW,uMAoGtB,CAAC;AAIH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;uDA2DxB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;iBAryCJ,MAAM,GAAG,IAAI;iBAAW,MAAM,GAAG,IAAI;;;;;QAgJzD,KAAK;QACL,MAAM;QACN,OAAO;QACP,MAAM;;;;;;;;QAoqCQ,OAAO;QAA0B,OAAO;;;;;;QAIzC,KAAK;QAAK,MAAM;QAAK,OAAO;QAAK,MAAM;;;;;;uDAsBxD,CAAC;AAEH,eAAO,MAAM,qBAAqB;;iBAn1CR,MAAM,GAAG,IAAI;iBAAW,MAAM,GAAG,IAAI;;;;;QAgJzD,KAAK;QACL,MAAM;QACN,OAAO;QACP,MAAM;;;;;;4EAguCV,CAAC;AAuBH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;0DA+B3B,CAAC;AAEH,eAAO,MAAM,QAAQ;qBAES,MAAM;oBAAkB,MAAM;YAAU,UAAU;iBAChE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,mHA6P7D,CAAC;AA6DH,eAAO,MAAM,WAAW;YAGH,OAAO;qBAAmB,MAAM;uGA0NnD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { prChecksCommand, prChecksFailedCommand, prCloseCommand, prCommentCommand, prEditCommentCommand, prCommentsCommand, prCreateCommand, prDiscussionSummaryCommand, prDraftCommand, prEditCommand, prCheckboxCommand, prFeedbackCommand, prIssueCommentsCommand, prIssueCommentsLatestCommand, prLastHumanReviewerCommand, prListCommand, prMergeCommand, prReadyCommand, prStackCommand, prRequestReviewCommand, prReplyCommand, prRerunChecksCommand, prReplyAndResolveCommand, prResolveCommand, prReviewCommand, prReviewsCommand, prStatusCommand, prSubmitReviewCommand, prThreadsCommand, prTriggerChecksCommand, prWaitMergeableCommand, prReviewTriageCommand, prReviewTriageBatchCommand, prViewCommand, prWatchCommand, } from "./commands";
|
|
1
|
+
export { prChecksCommand, prChecksFailedCommand, prCloseCommand, prCommentCommand, prEditCommentCommand, prCommentsCommand, prCreateCommand, prDiscussionSummaryCommand, prDraftCommand, prEditCommand, prCheckboxCommand, prFeedbackCommand, prIssueCommentsCommand, prIssueCommentsLatestCommand, prLastHumanReviewerCommand, prListCommand, prMergeCommand, prReadyCommand, prStackCommand, prRequestReviewCommand, prReplyCommand, prRerunChecksCommand, prReplyAndResolveCommand, prResolveCommand, prReviewCommand, prReviewsCommand, prStatusCommand, prSubmitReviewCommand, prThreadsCommand, prTriggerChecksCommand, prWaitMergeableCommand, prWaitCommand, prReviewTriageCommand, prReviewTriageBatchCommand, prViewCommand, prWatchCommand, } from "./commands";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,cAAc,GACf,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gh-tool/pr/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,cAAc,GACf,MAAM,YAAY,CAAC"}
|
|
@@ -84,6 +84,7 @@ type StepTiming = {
|
|
|
84
84
|
export declare const readJobLogApi: (path: string) => Effect.Effect<import("./read/transport").GhResult, import("./read/transport").GhError, GitHubService>;
|
|
85
85
|
export declare function parseRawJobLogs(raw: string, steps?: ReadonlyArray<StepTiming>): LogEntry[];
|
|
86
86
|
export declare function formatLogEntries(entries: LogEntry[]): string;
|
|
87
|
+
export declare function prioritizeFailureEntries(entries: LogEntry[]): LogEntry[];
|
|
87
88
|
export declare const diagnoseLogEntries: (entries: readonly LogEntry[]) => LogDiagnosis;
|
|
88
89
|
export declare const fetchJobLogs: (opts: {
|
|
89
90
|
runId: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/gh-tool/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAA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,CAAC;AAEnG,eAAO,MAAM,sBAAsB;;;;;;;yDAwClC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;yDAyBtC,CAAC"}
|
package/package.json
CHANGED
package/src/gh-tool/main.ts
CHANGED
|
@@ -55,6 +55,7 @@ import {
|
|
|
55
55
|
prReviewTriageBatchCommand,
|
|
56
56
|
prReviewTriageCommand,
|
|
57
57
|
prWaitMergeableCommand,
|
|
58
|
+
prWaitCommand,
|
|
58
59
|
prWatchCommand,
|
|
59
60
|
} from "./pr/index";
|
|
60
61
|
import { branchRenameCommand } from "./branch";
|
|
@@ -114,6 +115,7 @@ const prCommand = Command.make("pr", {}).pipe(
|
|
|
114
115
|
prStackCommand,
|
|
115
116
|
prRequestReviewCommand,
|
|
116
117
|
prWaitMergeableCommand,
|
|
118
|
+
prWaitCommand,
|
|
117
119
|
prThreadsCommand,
|
|
118
120
|
prCommentsCommand,
|
|
119
121
|
prReviewsCommand,
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
watchPRs,
|
|
55
55
|
viewPR,
|
|
56
56
|
waitForMergeable,
|
|
57
|
+
waitForPRState,
|
|
57
58
|
} from "./core";
|
|
58
59
|
import {
|
|
59
60
|
createReview,
|
|
@@ -585,6 +586,41 @@ export const prListCommand = Command.make(
|
|
|
585
586
|
),
|
|
586
587
|
);
|
|
587
588
|
|
|
589
|
+
export const prWaitCommand = Command.make(
|
|
590
|
+
"wait",
|
|
591
|
+
{
|
|
592
|
+
pr: Flag.Int("pr").pipe(
|
|
593
|
+
Flag.filter(
|
|
594
|
+
(n) => n > 0,
|
|
595
|
+
() => "--pr must be positive",
|
|
596
|
+
),
|
|
597
|
+
),
|
|
598
|
+
state: Flag.Literals("state", ["merged", "closed"]),
|
|
599
|
+
timeout: Flag.Int("timeout").pipe(
|
|
600
|
+
Flag.withDescription("Maximum wait in milliseconds, including API reads (default: 600000)"),
|
|
601
|
+
Flag.withDefault(600000),
|
|
602
|
+
Flag.filter(
|
|
603
|
+
(n) => n > 0,
|
|
604
|
+
() => "--timeout must be positive milliseconds",
|
|
605
|
+
),
|
|
606
|
+
),
|
|
607
|
+
format: formatOption,
|
|
608
|
+
repo: repoOption,
|
|
609
|
+
},
|
|
610
|
+
({ pr, state, timeout, format, repo }) =>
|
|
611
|
+
withRepo(
|
|
612
|
+
repo,
|
|
613
|
+
Effect.gen(function* () {
|
|
614
|
+
const result = yield* waitForPRState(pr, state, timeout);
|
|
615
|
+
yield* logFormatted(result, format);
|
|
616
|
+
}),
|
|
617
|
+
),
|
|
618
|
+
).pipe(
|
|
619
|
+
Command.withDescription(
|
|
620
|
+
"Wait for a PR to be merged or closed without merging; --timeout is in milliseconds",
|
|
621
|
+
),
|
|
622
|
+
);
|
|
623
|
+
|
|
588
624
|
export const prWaitMergeableCommand = Command.make(
|
|
589
625
|
"wait-mergeable",
|
|
590
626
|
{
|
package/src/gh-tool/pr/core.ts
CHANGED
|
@@ -267,7 +267,9 @@ export type CheckReport =
|
|
|
267
267
|
| { checksStatus: "none_reported"; reason: string; checks: null };
|
|
268
268
|
|
|
269
269
|
const summarizeFailedStepEntries = (entries: Array<{ step: string; message: string }>) => {
|
|
270
|
+
const first = entries[0];
|
|
270
271
|
const selected = entries
|
|
272
|
+
.slice(1)
|
|
271
273
|
.map((entry, index) => ({
|
|
272
274
|
entry,
|
|
273
275
|
index,
|
|
@@ -278,13 +280,15 @@ const summarizeFailedStepEntries = (entries: Array<{ step: string; message: stri
|
|
|
278
280
|
: 1,
|
|
279
281
|
}))
|
|
280
282
|
.toSorted((a, b) => a.rank - b.rank || b.index - a.index)
|
|
281
|
-
.slice(0,
|
|
283
|
+
.slice(0, 19)
|
|
282
284
|
.toSorted((a, b) => a.index - b.index);
|
|
283
285
|
const kept: Array<{ step: string; message: string }> = [];
|
|
284
286
|
for (const { entry } of selected.toReversed()) {
|
|
285
287
|
const clipped = { step: entry.step.slice(0, 80), message: entry.message.slice(0, 150) };
|
|
286
|
-
if (formatLogEntries([clipped, ...kept]).length <=
|
|
288
|
+
if (formatLogEntries([clipped, ...kept]).length <= 2_800) kept.unshift(clipped);
|
|
287
289
|
}
|
|
290
|
+
if (first !== undefined)
|
|
291
|
+
kept.unshift({ step: first.step.slice(0, 80), message: first.message.slice(0, 1000) });
|
|
288
292
|
let output = formatLogEntries(kept);
|
|
289
293
|
if (kept.length < entries.length)
|
|
290
294
|
output += `\n… ${entries.length - kept.length} log lines omitted`;
|
|
@@ -741,6 +745,26 @@ export const waitForMergeable = Effect.fn("pr.waitForMergeable")(function* (
|
|
|
741
745
|
return outcome.kind === "done" ? outcome.value : outcome.last;
|
|
742
746
|
});
|
|
743
747
|
|
|
748
|
+
export const waitForPRState = Effect.fn("pr.waitForPRState")(function* (
|
|
749
|
+
pr: number,
|
|
750
|
+
state: "merged" | "closed",
|
|
751
|
+
timeoutMs: number,
|
|
752
|
+
) {
|
|
753
|
+
const timeout = () =>
|
|
754
|
+
new GitHubTimeoutError({
|
|
755
|
+
message: `PR #${pr} did not reach ${state} within ${timeoutMs}ms. Increase --timeout to wait longer.`,
|
|
756
|
+
timeoutMs,
|
|
757
|
+
});
|
|
758
|
+
const outcome = yield* waits
|
|
759
|
+
.until(fetchPRView(pr, "origin"), (info) => info.state === state.toUpperCase(), {
|
|
760
|
+
intervalMs: 5000,
|
|
761
|
+
timeoutMs,
|
|
762
|
+
})
|
|
763
|
+
.pipe(Effect.timeoutOrElse({ duration: timeoutMs, orElse: () => Effect.fail(timeout()) }));
|
|
764
|
+
if (outcome.kind === "timedOut") return yield* timeout();
|
|
765
|
+
return { number: outcome.value.number, state: outcome.value.state, url: outcome.value.url };
|
|
766
|
+
});
|
|
767
|
+
|
|
744
768
|
export const createPR = Effect.fn("pr.createPR")(function* (opts: {
|
|
745
769
|
base: string | null;
|
|
746
770
|
title: string;
|
|
@@ -1541,10 +1565,11 @@ export const fetchChecks = Effect.fn("pr.fetchChecks")(function* (
|
|
|
1541
1565
|
(watchOutcome === null || watchOutcome.kind === "timedOut") &&
|
|
1542
1566
|
results.some((check) => check.bucket === "pending")
|
|
1543
1567
|
) {
|
|
1544
|
-
const
|
|
1568
|
+
const pendingChecks = results.filter((check) => check.bucket === "pending");
|
|
1569
|
+
const pending = pendingChecks.length;
|
|
1545
1570
|
yield* logFormatted(results, quiet ? "json" : "toon");
|
|
1546
1571
|
return yield* new GitHubTimeoutError({
|
|
1547
|
-
message: `Watch timed out, ${pending} pending after ${timeoutSeconds}s. This is not a CI verdict.`,
|
|
1572
|
+
message: `Watch timed out, ${pending} pending after ${timeoutSeconds}s: ${pendingChecks.map((check) => check.name).join(", ")}. Increase --timeout <seconds> to wait longer. This is not a CI verdict.`,
|
|
1548
1573
|
timeoutMs: timeoutSeconds * 1000,
|
|
1549
1574
|
});
|
|
1550
1575
|
}
|
package/src/gh-tool/pr/index.ts
CHANGED
package/src/gh-tool/workflow.ts
CHANGED
|
@@ -506,6 +506,20 @@ const normalizeFingerprint = (message: string) =>
|
|
|
506
506
|
.trim()
|
|
507
507
|
.slice(0, 240);
|
|
508
508
|
|
|
509
|
+
export function prioritizeFailureEntries(entries: LogEntry[]): LogEntry[] {
|
|
510
|
+
const checkFail = entries.findLastIndex(({ message }) => /\bCHECK FAIL\b/.test(message));
|
|
511
|
+
const index =
|
|
512
|
+
checkFail >= 0
|
|
513
|
+
? checkFail
|
|
514
|
+
: entries.findIndex(
|
|
515
|
+
({ message }) =>
|
|
516
|
+
/\berror\b|\(fail\)|\bfatal\b|\bexception\b|\bfailed\b|\bfailure\b/i.test(message) &&
|
|
517
|
+
!/Process completed with exit code/i.test(message),
|
|
518
|
+
);
|
|
519
|
+
if (index <= 0) return entries;
|
|
520
|
+
return [entries[index], ...entries.slice(0, index), ...entries.slice(index + 1)];
|
|
521
|
+
}
|
|
522
|
+
|
|
509
523
|
export const diagnoseLogEntries = (entries: readonly LogEntry[]): LogDiagnosis => {
|
|
510
524
|
const fetchProgress =
|
|
511
525
|
/^(?:\s*(?:\*\s+\[new branch\]|\[new branch\]|From\s+\S+|\*\s+\[new tag\]|\s*->\s+origin\/)|\s*\+?git fetch\b|.*refs\/(?:heads|remotes)\/)/i;
|
|
@@ -658,7 +672,9 @@ export const fetchJobLogs = Effect.fn("workflow.fetchJobLogs")(function* (
|
|
|
658
672
|
const steps = !opts.failedStepsOnly
|
|
659
673
|
? []
|
|
660
674
|
: (opts.steps ??
|
|
661
|
-
(yield* listJobs(opts.runId, opts.repo)).find(
|
|
675
|
+
(job === null ? yield* listJobs(opts.runId, opts.repo) : [job]).find(
|
|
676
|
+
(j) => j.databaseId === jobId,
|
|
677
|
+
)?.steps ??
|
|
662
678
|
[]);
|
|
663
679
|
const attributed = parseAttributedJobLogs(raw, steps);
|
|
664
680
|
let entries: LogEntry[] = attributed.map(({ step, message }) => ({ step, message }));
|
|
@@ -676,6 +692,8 @@ export const fetchJobLogs = Effect.fn("workflow.fetchJobLogs")(function* (
|
|
|
676
692
|
}
|
|
677
693
|
}
|
|
678
694
|
|
|
695
|
+
if (opts.failedStepsOnly) entries = prioritizeFailureEntries(entries);
|
|
696
|
+
|
|
679
697
|
if (opts.diagnose) {
|
|
680
698
|
return { runId: opts.runId, job: opts.job, jobId, diagnosis: diagnoseLogEntries(entries) };
|
|
681
699
|
}
|