Compare commits

..

1 Commits

Author SHA1 Message Date
0327d22d7f Initial ruff pass
Some checks failed
Run Python tests (through Pytest) / Test (push) Failing after 25s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 23s
2025-06-09 18:48:57 +02:00
3 changed files with 0 additions and 57 deletions

View File

@ -156,8 +156,6 @@ class RepositoryConfig:
owner: str
repo: str
base_branch: str
assignee: str | None = None
reviewer: str | None = None
def repo_url(self) -> str:
return f'{self.gitea_url}:{self.owner}/{self.repo}.git'.replace(
@ -508,18 +506,8 @@ def push_changes(
head=branch_name,
base=repository_config.base_branch,
labels=['aider'],
assignee=repository_config.assignee,
)
# Add reviewer if specified (requires separate API call after PR creation)
if repository_config.reviewer and pr_response.get('number'):
gitea_client.add_pull_request_reviewer(
owner=repository_config.owner,
repo=repository_config.repo,
pr_number=int(pr_response.get('number')),
reviewer=repository_config.reviewer,
)
# Extract PR number and URL if available
return IssueResolution(
True,

View File

@ -55,14 +55,6 @@ def parse_args():
help='Model to use for evaluating code (overrides default)',
default=None,
)
parser.add_argument(
'--assignee',
help='Username to automatically assign as assignee for created pull requests',
)
parser.add_argument(
'--reviewer',
help='Username to automatically assign as reviewer for created pull requests',
)
return parser.parse_args()
@ -92,8 +84,6 @@ def main():
owner=args.owner,
repo=repo,
base_branch=args.base_branch,
assignee=args.assignee,
reviewer=args.reviewer,
)
solve_issues_in_repository(repository_config, client, seen_issues_db)
del repo

View File

@ -139,7 +139,6 @@ class GiteaClient:
head: str,
base: str,
labels: list[str] = None,
assignee: str = None,
) -> dict:
"""Create a pull request and optionally apply labels.
@ -151,7 +150,6 @@ class GiteaClient:
head (str): The name of the branch where changes are implemented.
base (str): The name of the branch you want the changes pulled into.
labels (list[str], optional): List of label names to apply to the pull request.
assignee (str, optional): Username to assign as assignee for the pull request.
Returns:
dict: The created pull request data.
@ -167,9 +165,6 @@ class GiteaClient:
'base': base,
}
if assignee:
json_data['assignee'] = assignee
response = self.session.post(url, json=json_data)
# If a pull request for this head/base already exists, return it instead of crashing
if response.status_code == 409:
@ -190,36 +185,6 @@ class GiteaClient:
response.raise_for_status()
return response.json()
def add_pull_request_reviewer(
self,
owner: str,
repo: str,
pr_number: int,
reviewer: str,
) -> bool:
"""Add a reviewer to an existing pull request.
Args:
owner (str): Owner of the repository.
repo (str): Name of the repository.
pr_number (int): Number of the pull request.
reviewer (str): Username to assign as reviewer.
Returns:
bool: True if the reviewer was added successfully, False otherwise.
Raises:
requests.HTTPError: If the API request fails.
"""
url = f'{self.gitea_url}/repos/{owner}/{repo}/pulls/{pr_number}/requested_reviewers'
json_data = {'reviewers': [reviewer]}
response = self.session.post(url, json=json_data)
if response.status_code == 422:
logger.warning('Failed to add reviewer %s to PR #%s', reviewer, pr_number)
return False
response.raise_for_status()
return True
def get_failed_pipelines(self, owner: str, repo: str, pr_number: str) -> list[int]:
"""Fetch pipeline runs for a PR and return IDs of failed runs."""
url = f'{self.gitea_url}/repos/{owner}/{repo}/actions/runs'