-
Notifications
You must be signed in to change notification settings - Fork 181
Fix: Bitbucket authentication related repo cloning issue #622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
To sanity check, will this break Bitbucket server? |
| const username = config.user ?? 'x-token-auth'; | ||
| // Extract username from email if present (e.g., user@example.com -> user) | ||
| // Bitbucket API auth uses the full email, but git clone needs just the username | ||
| const username = config.user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To my other comment, I'm not sure if this will break bitbucket server. Might be best to only do this if config.deploymentType is cloud
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I can’t confirm whether it breaks Bitbucket Server or not. I only have access to Cloud.
If no one can verify it, making it conditional might be better.
Problem
Bitbucket Cloud repository cloning was failing with authentication errors. The root cause was a mismatch between the credential formats required by different Bitbucket operations:
user@example.com)Previously, the code was passing the full email address to git clone URLs, causing authentication failures like:
fatal: Authentication failed for 'https://bitbucket.org/workspace/repo.git'Solution
Extract the username from the configured email address when building git clone URLs for Bitbucket repositories. The fix uses JavaScript's
split('@')[0]to extract the username portion while maintaining the full email for API authentication.The
getAuthCredentialsForRepofunction in utils.ts was updated to handle Bitbucket's specific authentication requirements:cloneUrlWithTokencreateGitCloneUrlWithTokenwhich builds the authenticated URL format:https://username:token@bitbucket.org/...Testing
Related Issues
Fixes #573 - Sourcebot not indexing branches for bitbucket