mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 12:20:38 +08:00
Update pr_agent/git_providers/bitbucket_provider.py
Co-authored-by: Prateek <110811408+Prateikx@users.noreply.github.com>
This commit is contained in:
@ -625,14 +625,15 @@ class BitbucketProvider(GitProvider):
|
|||||||
get_logger().error(f"repo_url_to_clone: {repo_url_to_clone} is not a valid bitbucket URL.")
|
get_logger().error(f"repo_url_to_clone: {repo_url_to_clone} is not a valid bitbucket URL.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if hasattr(self, 'basic_token'):
|
if self.auth_type == "basic":
|
||||||
# Basic auth with token
|
# Basic auth with token
|
||||||
clone_url = f"{scheme}x-token-auth:{self.basic_token}@bitbucket.org{base_url}"
|
clone_url = f"{scheme}x-token-auth:{self.basic_token}@bitbucket.org{base_url}"
|
||||||
elif hasattr(self, 'bearer_token'):
|
elif self.auth_type == "bearer":
|
||||||
# Bearer token
|
# Bearer token
|
||||||
clone_url = f"{scheme}x-token-auth:{self.bearer_token}@bitbucket.org{base_url}"
|
clone_url = f"{scheme}x-token-auth:{self.bearer_token}@bitbucket.org{base_url}"
|
||||||
else:
|
else:
|
||||||
get_logger().error("No valid authentication method provided. Returning None")
|
# This case should ideally not be reached if __init__ validates auth_type
|
||||||
|
get_logger().error(f"Unsupported or uninitialized auth_type: {getattr(self, 'auth_type', 'N/A')}. Returning None")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return clone_url
|
return clone_url
|
||||||
|
Reference in New Issue
Block a user