Handle pull request comments #89

Merged
Jmaa merged 4 commits from issue-70-handle-pull-request-comments into main 2025-04-23 06:55:08 +00:00
2 changed files with 8 additions and 4 deletions
Showing only changes of commit e56463d207 - Show all commits

View File

@ -539,6 +539,7 @@ def solve_issues_in_repository(
issue_number,
)
def handle_pr_comments(
repository_config,
pr_number,
@ -567,15 +568,15 @@ def handle_pr_comments(
context = ''
body = comment.get('body', '')
issue = (
f"Resolve the following reviewer comment:\n{body}\n\n"
f"File: {path}\n\nContext:\n{context}"
f'Resolve the following reviewer comment:\n{body}\n\n'
f'File: {path}\n\nContext:\n{context}'
)
# invoke aider on the comment context
issue_solution_round(repository_path, issue)
# commit and push changes for this comment
run_cmd(['git', 'add', path], repository_path, check=False)
run_cmd(
['git', 'commit', '-m', f"Resolve comment {comment.get('id')}"],
['git', 'commit', '-m', f'Resolve comment {comment.get("id")}'],
repository_path,
check=False,
)

View File

@ -170,7 +170,10 @@ class GiteaClient:
return response.json()
def get_pull_request_comments(
self, owner: str, repo: str, pr_number: str,
self,
owner: str,
repo: str,
pr_number: str,
) -> list[dict]:
"""
Fetch comments for a pull request.