chore: Add missing error handling to open pr func, update logging (#526)

* Apply patch

* Apply patch

* Apply patch

* Apply patch

* Apply patch

* Apply patch

* Apply patch

* format

* cr

* chore: Add missing error handling to open pr func, update logging

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
This commit is contained in:
Brace Sproul 2025-07-24 16:03:16 -07:00 • committed by GitHub
parent 4490393494
commit 2fd4b94a2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -203,9 +203,6 @@ export async function createPullRequest({
logger.info(`🐙 Pull request created: ${pullRequest.html_url}`);
} catch (error) {
if (nullOnError) {
logger.info("Pull request creation failed, returning null", {
nullOnError,
});
return null;
}
@ -267,21 +264,29 @@ export async function markPullRequestReadyForReview({
title: string;
body: string;
githubInstallationToken: string;
}): Promise<GitHubPullRequestUpdate> {
const octokit = new Octokit({
auth: githubInstallationToken,
});
}): Promise<GitHubPullRequestUpdate | null> {
return withGitHubRetry(
async (token: string) => {
const octokit = new Octokit({
auth: token,
});
const { data: updatedPR } = await octokit.pulls.update({
owner,
repo,
pull_number: pullNumber,
title,
body,
draft: false,
});
logger.info(`Pull request #${pullNumber} marked as ready for review.`);
return updatedPR;
const { data: updatedPR } = await octokit.pulls.update({
owner,
repo,
pull_number: pullNumber,
title,
body,
draft: false,
});
logger.info(`Pull request #${pullNumber} marked as ready for review.`);
return updatedPR;
},
githubInstallationToken,
"Failed to mark pull request as ready for review",
{ pullNumber, owner, repo },
1,
);
}
export async function getIssue({