Compare commits
No commits in common. "00678b46e250b8fb94610b2a2e566257f15b6539" and "0497fd3e2613172a75ee7b85c1a13b77765a2c13" have entirely different histories.
00678b46e2
...
0497fd3e26
|
@ -757,8 +757,8 @@ def solve_issues_in_repository(
|
||||||
issue_number,
|
issue_number,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Handle unresolved pull request comments
|
# TODO: PR comment handling disabled for now due to missing functionality
|
||||||
if True:
|
if False:
|
||||||
# Handle unresolved pull request comments
|
# Handle unresolved pull request comments
|
||||||
handle_pr_comments(
|
handle_pr_comments(
|
||||||
repository_config,
|
repository_config,
|
||||||
|
|
|
@ -219,90 +219,3 @@ class GiteaClient:
|
||||||
response = self.session.get(url)
|
response = self.session.get(url)
|
||||||
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: int,
|
|
||||||
) -> list[dict]:
|
|
||||||
"""Fetch all review comments for a pull request.
|
|
||||||
|
|
||||||
This method implements the flow:
|
|
||||||
1. Download all reviews of the pull request
|
|
||||||
2. Download all comments for each review
|
|
||||||
3. Return all comments in a unified format
|
|
||||||
|
|
||||||
Args:
|
|
||||||
owner (str): Owner of the repository.
|
|
||||||
repo (str): Name of the repository.
|
|
||||||
pr_number (int): Pull request number.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
list[dict]: List of comment dictionaries with keys:
|
|
||||||
- id: Comment ID
|
|
||||||
- body: Comment body text
|
|
||||||
- path: File path the comment refers to
|
|
||||||
- line: Line number (or position)
|
|
||||||
- user: User who made the comment
|
|
||||||
"""
|
|
||||||
all_comments = []
|
|
||||||
|
|
||||||
# First, get all reviews for the pull request
|
|
||||||
reviews_url = f'{self.gitea_url}/repos/{owner}/{repo}/pulls/{pr_number}/reviews'
|
|
||||||
reviews_response = self.session.get(reviews_url)
|
|
||||||
reviews_response.raise_for_status()
|
|
||||||
reviews = reviews_response.json()
|
|
||||||
|
|
||||||
# For each review, get all comments
|
|
||||||
for review in reviews:
|
|
||||||
review_id = review.get('id')
|
|
||||||
if not review_id:
|
|
||||||
continue
|
|
||||||
|
|
||||||
# Get comments for this specific review
|
|
||||||
comments_url = f'{self.gitea_url}/repos/{owner}/{repo}/pulls/{pr_number}/reviews/{review_id}/comments'
|
|
||||||
comments_response = self.session.get(comments_url)
|
|
||||||
comments_response.raise_for_status()
|
|
||||||
comments = comments_response.json()
|
|
||||||
|
|
||||||
# Add each comment to our collection
|
|
||||||
all_comments.extend(
|
|
||||||
[
|
|
||||||
{
|
|
||||||
'id': comment.get('id'),
|
|
||||||
'body': comment.get('body', ''),
|
|
||||||
'path': comment.get('path', ''),
|
|
||||||
'line': comment.get('line') or comment.get('position') or 0,
|
|
||||||
'user': comment.get('user', {}).get('login', ''),
|
|
||||||
'review_id': review_id,
|
|
||||||
}
|
|
||||||
for comment in comments
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
# Also get general PR comments (not tied to specific reviews)
|
|
||||||
general_comments_url = (
|
|
||||||
f'{self.gitea_url}/repos/{owner}/{repo}/pulls/{pr_number}/comments'
|
|
||||||
)
|
|
||||||
general_response = self.session.get(general_comments_url)
|
|
||||||
general_response.raise_for_status()
|
|
||||||
general_comments = general_response.json()
|
|
||||||
|
|
||||||
# Add general comments that have file/line info
|
|
||||||
all_comments.extend(
|
|
||||||
[
|
|
||||||
{
|
|
||||||
'id': comment.get('id'),
|
|
||||||
'body': comment.get('body', ''),
|
|
||||||
'path': comment.get('path', ''),
|
|
||||||
'line': comment.get('line') or comment.get('position') or 0,
|
|
||||||
'user': comment.get('user', {}).get('login', ''),
|
|
||||||
'review_id': None, # General comments don't belong to a specific review
|
|
||||||
}
|
|
||||||
for comment in general_comments
|
|
||||||
if comment.get('path') # Only include comments with file references
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
return all_comments
|
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -174,7 +174,6 @@ def find_python_packages() -> list[str]:
|
||||||
print(f'Found following packages: {packages}')
|
print(f'Found following packages: {packages}')
|
||||||
return sorted(packages)
|
return sorted(packages)
|
||||||
|
|
||||||
|
|
||||||
with open(PACKAGE_NAME + '/_version.py') as f:
|
with open(PACKAGE_NAME + '/_version.py') as f:
|
||||||
version = parse_version_file(f.read())
|
version = parse_version_file(f.read())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user