mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 20:30:41 +08:00
#1657 review fix
This commit is contained in:
@ -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()
|
||||||
|
Reference in New Issue
Block a user