Logging lines must not use f-strings. #52
|
@ -64,7 +64,6 @@ solve_issue_in_repository(
|
||||||
The tool uses environment variables for sensitive information:
|
The tool uses environment variables for sensitive information:
|
||||||
- `GITEA_TOKEN`: Your Gitea API token
|
- `GITEA_TOKEN`: Your Gitea API token
|
||||||
- `LLM_API_KEY`: API key for the language model used by Aider
|
- `LLM_API_KEY`: API key for the language model used by Aider
|
||||||
```
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
@ -105,8 +104,6 @@ AIDER_TEST = bash_cmd(
|
||||||
RUFF_FORMAT_AND_AUTO_FIX = bash_cmd(
|
RUFF_FORMAT_AND_AUTO_FIX = bash_cmd(
|
||||||
'ruff format',
|
'ruff format',
|
||||||
'ruff check --fix --ignore RUF022 --ignore PGH004',
|
'ruff check --fix --ignore RUF022 --ignore PGH004',
|
||||||
'ruff format',
|
|
||||||
'ruff check --fix --ignore RUF022 --ignore PGH004',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
AIDER_LINT = bash_cmd(
|
AIDER_LINT = bash_cmd(
|
||||||
|
@ -115,7 +112,6 @@ AIDER_LINT = bash_cmd(
|
||||||
'ruff check --ignore RUF022 --ignore PGH004',
|
'ruff check --ignore RUF022 --ignore PGH004',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
LLM_MESSAGE_FORMAT = """
|
LLM_MESSAGE_FORMAT = """
|
||||||
{issue}
|
{issue}
|
||||||
|
|
||||||
|
@ -247,39 +243,3 @@ def solve_issue_in_repository(
|
||||||
issue_title,
|
issue_title,
|
||||||
args.base_branch,
|
args.base_branch,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def handle_issues(args, client, seen_issues_db):
|
|
||||||
"""Process all open issues with the 'aider' label."""
|
|
||||||
try:
|
|
||||||
issues = client.get_issues(args.owner, args.repo)
|
|
||||||
except Exception:
|
|
||||||
logger.exception('Failed to retrieve issues')
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if not issues:
|
|
||||||
logger.info('No issues found for %s', args.repo)
|
|
||||||
return
|
|
||||||
|
|
||||||
for issue in issues:
|
|
||||||
issue_number = issue.get('number')
|
|
||||||
issue_description = issue.get('body', '')
|
|
||||||
title = issue.get('title', f'Issue {issue_number}')
|
|
||||||
issue_text = f'{title}\n{issue_description}'
|
|
||||||
if seen_issues_db.has_seen(issue_text):
|
|
||||||
logger.info(f'Skipping already processed issue #{issue_number}: {title}')
|
|
||||||
continue
|
|
||||||
|
|
||||||
branch_name = generate_branch_name(issue_number, title)
|
|
||||||
with tempfile.TemporaryDirectory() as tmpdirname:
|
|
||||||
solved = solve_issue_in_repository(
|
|
||||||
args,
|
|
||||||
Path(tmpdirname),
|
|
||||||
branch_name,
|
|
||||||
title,
|
|
||||||
issue_description,
|
|
||||||
issue_number,
|
|
||||||
)
|
|
||||||
|
|
||||||
if solved:
|
|
||||||
seen_issues_db.mark_as_seen(issue_text)
|
|
||||||
|
|
|
@ -109,7 +109,9 @@ class GiteaClient:
|
||||||
return issues
|
return issues
|
||||||
|
|
||||||
def iter_user_repositories(
|
def iter_user_repositories(
|
||||||
self, owner: str, only_those_with_issues: bool = False,
|
self,
|
||||||
|
owner: str,
|
||||||
|
only_those_with_issues: bool = False,
|
||||||
) -> Iterator[str]:
|
) -> Iterator[str]:
|
||||||
"""
|
"""
|
||||||
Get a list of repositories for a given user.
|
Get a list of repositories for a given user.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user