mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-16 02:30:37 +08:00
Remove 'bitbucket' explicit dependency anywhere that's not in bitbucket_provider.py
This commit is contained in:
@ -38,7 +38,8 @@ class AzureDevopsProvider:
|
||||
self.set_pr(pr_url)
|
||||
|
||||
def is_supported(self, capability: str) -> bool:
|
||||
if capability in ['get_issue_comments', 'create_inline_comment', 'publish_inline_comments', 'get_labels', 'remove_initial_comment']:
|
||||
if capability in ['get_issue_comments', 'create_inline_comment', 'publish_inline_comments', 'get_labels',
|
||||
'remove_initial_comment', 'gfm_markdown']:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
@ -101,8 +101,7 @@ class BitbucketProvider(GitProvider):
|
||||
return False
|
||||
|
||||
def is_supported(self, capability: str) -> bool:
|
||||
if capability in ['get_issue_comments', 'publish_inline_comments', 'get_labels']:
|
||||
|
||||
if capability in ['get_issue_comments', 'publish_inline_comments', 'get_labels', 'gfm_markdown']:
|
||||
return False
|
||||
return True
|
||||
|
||||
@ -180,11 +179,6 @@ class BitbucketProvider(GitProvider):
|
||||
for comment in comments:
|
||||
self.publish_inline_comment(comment['body'], comment['start_line'], comment['path'])
|
||||
|
||||
def publish_bitbucket_inline_comments(self, comments: list[dict]):
|
||||
for comment in comments:
|
||||
self.publish_inline_comment(comment['body'],comment['position'], comment['path'])
|
||||
|
||||
|
||||
def get_title(self):
|
||||
return self.pr.title
|
||||
|
||||
|
@ -54,11 +54,16 @@ class CodeCommitClient:
|
||||
def __init__(self):
|
||||
self.boto_client = None
|
||||
|
||||
def is_supported(self, capability: str) -> bool:
|
||||
if capability in ["gfm_markdown"]:
|
||||
return False
|
||||
return True
|
||||
|
||||
def _connect_boto_client(self):
|
||||
try:
|
||||
self.boto_client = boto3.client("codecommit")
|
||||
except Exception as e:
|
||||
raise ValueError(f"Failed to connect to AWS CodeCommit: {e}")
|
||||
raise ValueError(f"Failed to connect to AWS CodeCommit: {e}") from e
|
||||
|
||||
def get_differences(self, repo_name: int, destination_commit: str, source_commit: str):
|
||||
"""
|
||||
|
@ -74,6 +74,7 @@ class CodeCommitProvider(GitProvider):
|
||||
"create_inline_comment",
|
||||
"publish_inline_comments",
|
||||
"get_labels",
|
||||
"gfm_markdown"
|
||||
]:
|
||||
return False
|
||||
return True
|
||||
|
@ -304,7 +304,8 @@ class GerritProvider(GitProvider):
|
||||
# 'get_issue_comments',
|
||||
'create_inline_comment',
|
||||
'publish_inline_comments',
|
||||
'get_labels'
|
||||
'get_labels',
|
||||
'gfm_markdown'
|
||||
]:
|
||||
return False
|
||||
return True
|
||||
|
@ -43,7 +43,7 @@ class GitLabProvider(GitProvider):
|
||||
self.incremental = incremental
|
||||
|
||||
def is_supported(self, capability: str) -> bool:
|
||||
if capability in ['get_issue_comments', 'create_inline_comment', 'publish_inline_comments']:
|
||||
if capability in ['get_issue_comments', 'create_inline_comment', 'publish_inline_comments', 'gfm_markdown']:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
@ -56,7 +56,8 @@ class LocalGitProvider(GitProvider):
|
||||
raise KeyError(f'Branch: {self.target_branch_name} does not exist')
|
||||
|
||||
def is_supported(self, capability: str) -> bool:
|
||||
if capability in ['get_issue_comments', 'create_inline_comment', 'publish_inline_comments', 'get_labels']:
|
||||
if capability in ['get_issue_comments', 'create_inline_comment', 'publish_inline_comments', 'get_labels',
|
||||
'gfm_markdown']:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
Reference in New Issue
Block a user