mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 21:00:40 +08:00
Check is tempolary before remove it
This commit is contained in:
@ -649,7 +649,7 @@ class GiteaProvider(GitProvider):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
comment_id = comment.get("comment_id")
|
comment_id = comment.get("comment_id") if isinstance(comment, dict) else comment.id
|
||||||
if not comment_id:
|
if not comment_id:
|
||||||
self.logger.error("Comment ID not found")
|
self.logger.error("Comment ID not found")
|
||||||
return None
|
return None
|
||||||
@ -659,7 +659,7 @@ class GiteaProvider(GitProvider):
|
|||||||
comment_id=comment_id
|
comment_id=comment_id
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.comments_list:
|
if self.comments_list and comment in self.comments_list:
|
||||||
self.comments_list.remove(comment)
|
self.comments_list.remove(comment)
|
||||||
|
|
||||||
self.logger.info(f"Comment removed successfully: {comment}")
|
self.logger.info(f"Comment removed successfully: {comment}")
|
||||||
@ -671,6 +671,8 @@ class GiteaProvider(GitProvider):
|
|||||||
"""Remove the initial comment"""
|
"""Remove the initial comment"""
|
||||||
for comment in self.comments_list:
|
for comment in self.comments_list:
|
||||||
try:
|
try:
|
||||||
|
if not comment.get("is_temporary"):
|
||||||
|
continue
|
||||||
self.remove_comment(comment)
|
self.remove_comment(comment)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.error(f"Error removing comment: {e}")
|
self.logger.error(f"Error removing comment: {e}")
|
||||||
|
Reference in New Issue
Block a user