Compare commits
4 Commits
c4083db17e
...
5a899c05fb
Author | SHA1 | Date | |
---|---|---|---|
5a899c05fb | |||
d3d9a1b3fe | |||
d0a0bf0db3 | |||
fca65f73c5 |
|
@ -14,9 +14,10 @@ import tempfile
|
|||
import subprocess
|
||||
import os
|
||||
|
||||
import secret_loader
|
||||
import re
|
||||
|
||||
from . import secrets
|
||||
|
||||
def generate_branch_name(issue_title: str) -> str:
|
||||
"""
|
||||
Create a branch name by sanitizing the issue title.
|
||||
|
@ -33,11 +34,6 @@ AIDER_LINT="ruff format; ruff check --fix --ignore RUF022 --ignore PGH004; ruff
|
|||
|
||||
MODEL = 'o3-mini'
|
||||
|
||||
SECRETS = secret_loader.SecretLoader()
|
||||
LLM_API_KEY = SECRETS.load_or_fail('LLM_API_KEY')
|
||||
GITEA_TOKEN = SECRETS.load_or_fail('GITEA_TOKEN')
|
||||
|
||||
|
||||
def create_aider_command(issue: str) -> list[str]:
|
||||
return [
|
||||
'aider',
|
||||
|
@ -47,7 +43,7 @@ def create_aider_command(issue: str) -> list[str]:
|
|||
'--lint-cmd', AIDER_LINT,
|
||||
'--auto-test',
|
||||
'--no-auto-lint',
|
||||
'--api-key', LLM_API_KEY,
|
||||
'--api-key', secrets.llm_api_key(),
|
||||
'--read', 'CONVENTIONS.md',
|
||||
'--message', "First, write unit tests that validate your changes. Then, solve the issue. Issue details:\n" + issue,
|
||||
'--yes-always',
|
||||
|
@ -145,7 +141,7 @@ def main():
|
|||
logging.basicConfig(level='INFO')
|
||||
args = parse_args()
|
||||
|
||||
client = GiteaClient(args.gitea_url, GITEA_TOKEN )
|
||||
client = GiteaClient(args.gitea_url, secrets.gitea_token())
|
||||
|
||||
try:
|
||||
issues = client.get_issues(args.owner, args.repo)
|
||||
|
|
9
aider_gitea/secrets.py
Normal file
9
aider_gitea/secrets.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
SECRETS = secret_loader.SecretLoader()
|
||||
|
||||
import secret_loader
|
||||
|
||||
def llm_api_key():
|
||||
return SECRETS.load_or_fail('LLM_API_KEY')
|
||||
|
||||
def gitea_token():
|
||||
return SECRETS.load_or_fail('GITEA_TOKEN')
|
Loading…
Reference in New Issue
Block a user