This commit is contained in:
Nikolay Gribanov
2025-05-16 20:12:40 +03:00
parent f857ea1f22
commit 12b1fe23da

View File

@ -105,11 +105,17 @@ class GiteaProvider(GitProvider):
def publish_inline_comment(self, body: str, relevant_file: str, relevant_line_in_file: str, def publish_inline_comment(self, body: str, relevant_file: str, relevant_line_in_file: str,
original_suggestion=None): original_suggestion=None):
url = f"{self.gitea_url}/api/v1/repos/{self.owner}/{self.repo}/pulls/{self.pr_num}/comments" url = f"{self.gitea_url}/api/v1/repos/{self.owner}/{self.repo}/pulls/{self.pr_num}/reviews"
data = { data = {
'body': body, 'event': 'COMMENT',
'path': relevant_file, 'body': original_suggestion or '',
'line': int(relevant_line_in_file) 'commit_id': self.pr.get('head', {}).get('sha', ''),
'comments': [{
'body': body,
'path': relevant_file,
'line': int(relevant_line_in_file)
}]
} }
response = requests.post(url, headers=self.headers, json=data) response = requests.post(url, headers=self.headers, json=data)
response.raise_for_status() response.raise_for_status()