feat: add handling of unresolved PR comments with context and auto-resolve via Aider
This commit is contained in:
parent
232622309f
commit
7b500c3f2e
|
@ -78,6 +78,8 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from .seen_issues_db import SeenIssuesDB
|
||||||
|
|
||||||
from . import secrets
|
from . import secrets
|
||||||
from ._version import __version__ # noqa: F401
|
from ._version import __version__ # noqa: F401
|
||||||
|
|
||||||
|
@ -516,6 +518,15 @@ def solve_issues_in_repository(
|
||||||
)
|
)
|
||||||
|
|
||||||
if issue_resolution.success:
|
if issue_resolution.success:
|
||||||
|
# Handle unresolved pull request comments
|
||||||
|
handle_pr_comments(
|
||||||
|
repository_config,
|
||||||
|
issue_resolution.pull_request_id,
|
||||||
|
Path(repository_path),
|
||||||
|
client,
|
||||||
|
seen_issues_db,
|
||||||
|
issue_url,
|
||||||
|
)
|
||||||
seen_issues_db.mark_as_seen(issue_url, str(issue_number))
|
seen_issues_db.mark_as_seen(issue_url, str(issue_number))
|
||||||
seen_issues_db.update_pr_info(
|
seen_issues_db.update_pr_info(
|
||||||
issue_url,
|
issue_url,
|
||||||
|
|
|
@ -168,3 +168,12 @@ class GiteaClient:
|
||||||
response = self.session.post(url, json=json_data)
|
response = self.session.post(url, json=json_data)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
|
def get_pull_request_comments(self, owner: str, repo: str, pr_number: str) -> list[dict]:
|
||||||
|
"""
|
||||||
|
Fetch comments for a pull request.
|
||||||
|
"""
|
||||||
|
url = f"{self.gitea_url}/repos/{owner}/{repo}/pulls/{pr_number}/comments"
|
||||||
|
response = self.session.get(url)
|
||||||
|
response.raise_for_status()
|
||||||
|
return response.json()
|
||||||
|
|
|
@ -46,6 +46,13 @@ class SeenIssuesDB:
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
)
|
)
|
||||||
""")
|
""")
|
||||||
|
self.conn.execute("""
|
||||||
|
CREATE TABLE IF NOT EXISTS resolved_comments (
|
||||||
|
issue_url TEXT,
|
||||||
|
comment_id TEXT,
|
||||||
|
PRIMARY KEY(issue_url, comment_id)
|
||||||
|
)
|
||||||
|
""")
|
||||||
|
|
||||||
def mark_as_seen(
|
def mark_as_seen(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user