fix: sanitize PR number to handle full URL in get_pull_request_comments
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 25s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 22s

This commit is contained in:
Jon Michael Aanes (aider) 2025-04-23 20:21:20 +02:00
parent e56463d207
commit e23ffd830a

View File

@ -178,6 +178,8 @@ class GiteaClient:
"""
Fetch comments for a pull request.
"""
# sanitize pr_number to ensure it's just the numeric ID, not a full URL
pr_number = pr_number.rstrip('/').split('/')[-1]
url = f'{self.gitea_url}/repos/{owner}/{repo}/pulls/{pr_number}/comments'
response = self.session.get(url)
response.raise_for_status()