jenkins-x/go-scm

Bitbucket Server Repo IsCollaborator not working

Timoses opened this issue · 4 comments

Attempting to create Lighthouse Triggers with bitbucketserver as SCMProvider.

However, it never identifies anybody as Collaborator.

I assume the error lies here:

path := fmt.Sprintf("/2.0/workspaces/%s/permissions/repositories/%s?q=user.account_id=\"%s\"", wsname, reponame, user)

This fits the Bitbucket Cloud API: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-user-permissions-workspaces-get

However the Bitbucket Server API seems to work differently:
https://docs.atlassian.com/bitbucket-server/rest/7.18.1/bitbucket-rest.html#idp297

I can take a look at it next week (unless u contribute first, then I am happy to review), I think our support for bitbucket cloud is a bit rough, we are improving gitlab integration atm, but bitbucket is right there after that!

Well, the problem seems to be that Bitbucket Server and Bitbucket Cloud have incompatible APIs, don't they?

I don't know if go-scm is able to determine the difference and adjust API calls based on that.

I intended to find a JX community channel somewhere to ask this, but perhaps this is also a good spot:

Do you intend to build out support for Bitbucket Server? Since Atlassian is moving to Cloud and ends support for Server product in 2024.

I intended to find a JX community channel somewhere to ask this

https://jenkins-x.io/community/#slack

Do you intend to build out support for Bitbucket Server? Since Atlassian is moving to Cloud and ends support for Server product in 2024.

Honestly, it would be good to see how much effort needs to be put in to support both server and cloud, like if it's only a change in go-scm, and that will make it work with the rest of Jenkins X, we are fine with supporting bit bucket server till 2024 (still 2 years away!).