Skip to content
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

Add support for Bitbucket Cloud #31

Closed
chris5287 opened this issue May 6, 2018 · 22 comments
Closed

Add support for Bitbucket Cloud #31

chris5287 opened this issue May 6, 2018 · 22 comments
Milestone

Comments

@chris5287
Copy link

See:

@tmat
Copy link
Member

tmat commented Jun 1, 2018

So it seems that BitBucket uses the same URL pattern as GitLab. Although we would want to have a Microsoft.SourceLink.BitBucket package for convenience, you should be able to use Microsoft.SourceLink.GitLab package to generate SourceLink for BitBucket as well. I have just published the package on myget:

https://dotnet.myget.org/feed/sourcelink/package/nuget/Microsoft.SourceLink.GitLab

Could you please try it and confirm it works with BitBucket?

Apart from the package reference you'll need to specify host like so:

<ItemGroup>
   <PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.0.0-beta-63001-01" PrivateAssets="all" />
 
   <SourceLinkGitLabHosts Include="{host-name}" />
</ItemGroup>

The {host-name} is a domain of your BitBucket instance, e.g. "bitbucket.org".

If it builds fine and produces *.sourcelink.json in obj/{config}/{tfm} directory of your project with the right content then it works.

@chris5287
Copy link
Author

@tmat thanks for the head up. Just be aware that Bitbucket server and Bitbucket cloud use different URL patterns, so a change is required to support both types.

@tmat
Copy link
Member

tmat commented Jun 1, 2018

@chris5287 I see. Yes, we will need a specialized one for Server.

@tmat
Copy link
Member

tmat commented Jun 1, 2018

@chris5287 Do you know if there is a public documentation on the format of the URL?

@chris5287
Copy link
Author

Example implementation fetching required details from git url: https://github.com/ctaggart/SourceLink/blob/master/SourceLink.Create.BitBucketServer/BitBucketServerUrlConverter.cs

Sorry couldn’t find public API documentation via a quick google search.

@ctaggart
Copy link
Contributor

The second b is not capitalized in Bitbucket. In this repo, it should be called Microsoft.SourceLink.Bitbucket.

@tmat
Copy link
Member

tmat commented Jul 18, 2018

Bitbucket supports both Git and Mercurial. So we'll need to include that in the name: Microsoft.SourceLink.Bitbucket.Git.

Implementing Microsoft.SourceLink.Bitbucket.Mercurial would be much more work.

@tmat
Copy link
Member

tmat commented Jul 18, 2018

Filed #124 to track Mercurial support. Contributions are welcome.

@tmat tmat added this to the 1.0.0 milestone Jul 18, 2018
@tmat
Copy link
Member

tmat commented Jul 18, 2018

I'm gonna create a new issue for Bitbucket Enterprise and rename this to Bitbucket cloud.

@tmat tmat changed the title Add support for Bitbucket (Server and Cloud) Add support for Bitbucket Cloud Jul 18, 2018
@tmat
Copy link
Member

tmat commented Jul 18, 2018

@ctaggart Bitbucket Enterprise has two options: Server and Data Center. Do you know if they use the same URL formats?

@ctaggart
Copy link
Contributor

@chris5287 contributed it, and he opened the request here. Hopefully, he knows.

@ctaggart
Copy link
Contributor

ctaggart commented Jul 18, 2018

Hahaha, and they are different. That was the first thing he mentioned in this thread.

thanks for the head up. Just be aware that Bitbucket server and Bitbucket cloud use different URL patterns, so a change is required to support both types.
#31 (comment)

@chris5287
Copy link
Author

Afraid I only have access to server at work and I have been unable to find any official documentation from atlassian.

@chris5287 chris5287 reopened this Jul 18, 2018
@tmat
Copy link
Member

tmat commented Jul 18, 2018

To clarify: let's use this issue to track support for git repos on bitbucket.org. Microsoft.SourceLink.Bitbucket.Git will be available on myget shortly to support this scenario, so I consider this issue resolved.
I filed a new issue: #128 to track support for bitbucket Enterprise (Server and Data Center versions).

@tmat tmat closed this as completed Jul 18, 2018
@tmat
Copy link
Member

tmat commented Jul 19, 2018

The package is available on MyGet now: Microsoft.SourceLink.Bitbucket.Git

@JonCubed
Copy link

quick question, are private BitBucket repos supported with this and VS 15.7+, package documentation says only private GitHub and VSTS repositories.

@tmat
Copy link
Member

tmat commented Jul 19, 2018

@chuckries Does Bitbucket implement auth that the debugger currently supports?

@chuckries
Copy link
Contributor

@tmat @JonCubed Yes, BitBucket support is provided via Git Credential Manager for Windows. Source Link Auth for BitBucket is on by default starting in 15.8 Preview. Making BitBucket work in 15.7 requires a hack.

@ctaggart
Copy link
Contributor

Source Link Auth for BitBucket is on by default starting in 15.8 Preview

@chuckries That isn't out yet though, right?

@chuckries
Copy link
Contributor

@ctaggart It is out in the latest preview: https://visualstudio.microsoft.com/vs/preview/. BitBucket is enabled by default and requires no configuration. There is a new checkbox under Tools -> Options -> Debugging that will allow GCM to be used for any Source Link request.

@JonCubed
Copy link

@chuckries that great to hear, looking forward to trying it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants