mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-03 11:33:27 +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}`);
|
logger.info(`🐙 Pull request created: ${pullRequest.html_url}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (nullOnError) {
|
if (nullOnError) {
|
||||||
logger.info("Pull request creation failed, returning null", {
|
|
||||||
nullOnError,
|
|
||||||
});
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -267,21 +264,29 @@ export async function markPullRequestReadyForReview({
|
||||||
title: string;
|
title: string;
|
||||||
body: string;
|
body: string;
|
||||||
githubInstallationToken: string;
|
githubInstallationToken: string;
|
||||||
}): Promise<GitHubPullRequestUpdate> {
|
}): Promise<GitHubPullRequestUpdate | null> {
|
||||||
const octokit = new Octokit({
|
return withGitHubRetry(
|
||||||
auth: githubInstallationToken,
|
async (token: string) => {
|
||||||
});
|
const octokit = new Octokit({
|
||||||
|
auth: token,
|
||||||
|
});
|
||||||
|
|
||||||
const { data: updatedPR } = await octokit.pulls.update({
|
const { data: updatedPR } = await octokit.pulls.update({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
pull_number: pullNumber,
|
pull_number: pullNumber,
|
||||||
title,
|
title,
|
||||||
body,
|
body,
|
||||||
draft: false,
|
draft: false,
|
||||||
});
|
});
|
||||||
logger.info(`Pull request #${pullNumber} marked as ready for review.`);
|
logger.info(`Pull request #${pullNumber} marked as ready for review.`);
|
||||||
return updatedPR;
|
return updatedPR;
|
||||||
|
},
|
||||||
|
githubInstallationToken,
|
||||||
|
"Failed to mark pull request as ready for review",
|
||||||
|
{ pullNumber, owner, repo },
|
||||||
|
1,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getIssue({
|
export async function getIssue({
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue