Include commit messages in the pull request body #66

Merged
Jmaa merged 2 commits from jmaa/issue-38-include-commit-messages-in-the-pull-request-body into main 2025-04-14 21:57:19 +00:00
2 changed files with 8 additions and 8 deletions
Showing only changes of commit 3bdbf2e621 - Show all commits

View File

@ -138,6 +138,7 @@ For code tasks:
MODEL = None MODEL = None
def create_aider_command(issue: str) -> list[str]: def create_aider_command(issue: str) -> list[str]:
l = [ l = [
'aider', 'aider',
@ -195,7 +196,7 @@ def get_commit_messages(cwd: Path, base_branch: str, current_branch: str) -> str
return result.stdout.strip() return result.stdout.strip()
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
logger.exception(f'Failed to get commit messages on branch {current_branch}') logger.exception(f'Failed to get commit messages on branch {current_branch}')
return "" return ''
def push_changes( def push_changes(
@ -209,16 +210,16 @@ def push_changes(
if not has_commits_on_branch(cwd, base_branch, branch_name): if not has_commits_on_branch(cwd, base_branch, branch_name):
logger.info('No commits made on branch %s, skipping push', branch_name) logger.info('No commits made on branch %s, skipping push', branch_name)
return False return False
# Get commit messages for PR description # Get commit messages for PR description
commit_messages = get_commit_messages(cwd, base_branch, branch_name) commit_messages = get_commit_messages(cwd, base_branch, branch_name)
description = f"This pull request resolves #{issue_number}\n\n" description = f'This pull request resolves #{issue_number}\n\n'
if commit_messages: if commit_messages:
description += "## Commit Messages\n\n" description += '## Commit Messages\n\n'
for message in commit_messages.split('\n'): for message in commit_messages.split('\n'):
description += f"- {message}\n" description += f'- {message}\n'
cmd = [ cmd = [
'git', 'git',
'push', 'push',

View File

@ -1,4 +1,3 @@
from aider_gitea.seen_issues_db import SeenIssuesDB from aider_gitea.seen_issues_db import SeenIssuesDB