mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 21:00:40 +08:00
Rename & Return comment object after published
This commit is contained in:
@ -232,26 +232,28 @@ class GiteaProvider(GitProvider):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
comment = self.limit_output_characters(comment, self.max_comment_chars)
|
comment = self.limit_output_characters(comment, self.max_comment_chars)
|
||||||
reponse = self.repo_api.create_comment(
|
response = self.repo_api.create_comment(
|
||||||
owner=self.owner,
|
owner=self.owner,
|
||||||
repo=self.repo,
|
repo=self.repo,
|
||||||
index=index,
|
index=index,
|
||||||
comment=comment
|
comment=comment
|
||||||
)
|
)
|
||||||
|
|
||||||
if not reponse:
|
if not response:
|
||||||
self.logger.error("Failed to publish comment")
|
self.logger.error("Failed to publish comment")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if is_temporary:
|
if is_temporary:
|
||||||
self.temp_comments.append(comment)
|
self.temp_comments.append(comment)
|
||||||
|
|
||||||
self.comments_list.append({
|
comment_obj = {
|
||||||
"is_temporary": is_temporary,
|
"is_temporary": is_temporary,
|
||||||
"comment": comment,
|
"comment": comment,
|
||||||
"comment_id": reponse.id if isinstance(reponse, tuple) else reponse.id
|
"comment_id": response.id if isinstance(response, tuple) else response.id
|
||||||
})
|
}
|
||||||
|
self.comments_list.append(comment_obj)
|
||||||
self.logger.info("Comment published")
|
self.logger.info("Comment published")
|
||||||
|
return comment_obj
|
||||||
|
|
||||||
def edit_comment(self, comment, body : str):
|
def edit_comment(self, comment, body : str):
|
||||||
body = self.limit_output_characters(body, self.max_comment_chars)
|
body = self.limit_output_characters(body, self.max_comment_chars)
|
||||||
|
Reference in New Issue
Block a user