mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-06 13:50:44 +08:00
AZURE_DEVOPS_AVAILABLE
This commit is contained in:
@ -5,10 +5,13 @@ from urllib.parse import urlparse
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from msrest.authentication import BasicAuthentication
|
AZURE_DEVOPS_AVAILABLE = True
|
||||||
from azure.devops.connection import Connection
|
try:
|
||||||
|
from msrest.authentication import BasicAuthentication
|
||||||
from azure.devops.v7_1.git.models import Comment, CommentThread, GitVersionDescriptor, GitPullRequest
|
from azure.devops.connection import Connection
|
||||||
|
from azure.devops.v7_1.git.models import Comment, CommentThread, GitVersionDescriptor, GitPullRequest
|
||||||
|
except ImportError:
|
||||||
|
AZURE_DEVOPS_AVAILABLE = False
|
||||||
|
|
||||||
from ..algo.pr_processing import clip_tokens
|
from ..algo.pr_processing import clip_tokens
|
||||||
from ..config_loader import get_settings
|
from ..config_loader import get_settings
|
||||||
@ -19,6 +22,8 @@ from .git_provider import EDIT_TYPE, FilePatchInfo
|
|||||||
|
|
||||||
class AzureDevopsProvider:
|
class AzureDevopsProvider:
|
||||||
def __init__(self, pr_url: Optional[str] = None, incremental: Optional[bool] = False):
|
def __init__(self, pr_url: Optional[str] = None, incremental: Optional[bool] = False):
|
||||||
|
if not AZURE_DEVOPS_AVAILABLE:
|
||||||
|
raise ImportError("Azure DevOps provider is not available. Please install the required dependencies.")
|
||||||
|
|
||||||
self.azure_devops_client = self._get_azure_devops_client()
|
self.azure_devops_client = self._get_azure_devops_client()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user