* Fetch and print the diff for a check, indented under the check output.
(check: CheckStatus)
| 124 | * Fetch and print the diff for a check, indented under the check output. |
| 125 | */ |
| 126 | async function printCheckDiff(check: CheckStatus): Promise<void> { |
| 127 | try { |
| 128 | const diffResponse = await get<{ diff: string }>( |
| 129 | `agents/${check.sessionId}/diff`, |
| 130 | ); |
| 131 | if (!diffResponse.data.diff) { |
| 132 | return; |
| 133 | } |
| 134 | console.log(`\n${chalk.bold(` Diff:`)}`); |
| 135 | for (const line of diffResponse.data.diff.split("\n")) { |
| 136 | console.log(` ${line}`); |
| 137 | } |
| 138 | } catch (err) { |
| 139 | logger.debug(`Failed to fetch diff for ${check.sessionId}: ${err}`); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * List check statuses for a PR, including diffs for checks with commits. |
no test coverage detected