mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 15:03:16 +00:00
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:
parent
4490393494
commit
2fd4b94a2b
1 changed files with 22 additions and 17 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue