Skip to content

Commit 6737e5a

Browse files
committed
Address CCR feedback
1 parent 18e94f6 commit 6737e5a

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/lm/tools/pullRequestStatusChecksTool.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,17 @@ export class PullRequestStatusChecksTool extends RepoToolBase<StatusChecksToolPa
5151
const pullRequest = issueOrPullRequest;
5252
const status = await pullRequest.getStatusChecks();
5353
const statuses = status[0]?.statuses ?? [];
54-
const failures = statuses.filter(s => s.state === CheckState.Failure);
5554

56-
// Fetch logs for failed check runs in parallel
57-
const failedChecks = await Promise.all(failures.map(async (s) => {
55+
// Return all status checks, but only fetch logs for failures
56+
const statusChecks = await Promise.all(statuses.map(async (s) => {
5857
const entry: Record<string, any> = {
5958
context: s.context,
6059
description: s.description,
6160
state: s.state,
6261
name: s.workflowName,
6362
targetUrl: s.targetUrl,
6463
};
65-
if (s.isCheckRun && s.databaseId) {
64+
if (s.state === CheckState.Failure && s.isCheckRun && s.databaseId) {
6665
try {
6766
entry.logs = await pullRequest.githubRepository.getCheckRunLogs(s.databaseId);
6867
} catch (e) {
@@ -73,7 +72,7 @@ export class PullRequestStatusChecksTool extends RepoToolBase<StatusChecksToolPa
7372
}));
7473

7574
const statusChecksInfo = {
76-
failedChecks,
75+
statusChecks,
7776
reviewRequirements: {
7877
approvalsNeeded: status[1]?.count ?? 0,
7978
currentApprovals: status[1]?.approvals.length ?? 0,

0 commit comments

Comments
 (0)