mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
Refactor comment deletion method to 'remove_comment' in git providers and update references
This commit is contained in:
@ -130,18 +130,6 @@ class AzureDevopsProvider(GitProvider):
|
||||
def get_pr_description_full(self) -> str:
|
||||
return self.pr.description
|
||||
|
||||
def delete_comment(self, comment):
|
||||
try:
|
||||
self.azure_devops_client.delete_comment(
|
||||
repository_id=self.repo_slug,
|
||||
pull_request_id=self.pr_num,
|
||||
thread_id=comment.thread_id,
|
||||
comment_id=comment.id,
|
||||
project=self.workspace_slug,
|
||||
)
|
||||
except Exception as e:
|
||||
get_logger().exception(f"Failed to delete comment, error: {e}")
|
||||
|
||||
def edit_comment(self, comment, body: str):
|
||||
try:
|
||||
self.azure_devops_client.update_comment(
|
||||
|
@ -208,9 +208,6 @@ class GitProvider(ABC):
|
||||
def get_comment_url(self, comment) -> str:
|
||||
return ""
|
||||
|
||||
def delete_comment(self, comment):
|
||||
comment.delete()
|
||||
|
||||
#### labels operations ####
|
||||
@abstractmethod
|
||||
def publish_labels(self, labels):
|
||||
|
@ -264,7 +264,7 @@ class PRCodeSuggestions:
|
||||
get_logger().info(f"Persistent mode - updating comment {comment_url} to latest {name} message")
|
||||
if progress_response: # publish to 'progress_response' comment, because it refreshes immediately
|
||||
self.git_provider.edit_comment(progress_response, pr_comment_updated)
|
||||
self.git_provider.delete_comment(comment)
|
||||
self.git_provider.remove_comment(comment)
|
||||
else:
|
||||
self.git_provider.edit_comment(comment, pr_comment_updated)
|
||||
return
|
||||
|
Reference in New Issue
Block a user