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

Is it possible to use with Bitbucket cloud? #191

Open
UrosCvijan opened this issue Nov 17, 2022 · 4 comments
Open

Is it possible to use with Bitbucket cloud? #191

UrosCvijan opened this issue Nov 17, 2022 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@UrosCvijan
Copy link

Is this posssible to work with bitbucket cloud? As I keep getting 403, like either my repository is not present or I don't have permissions, but I think I should be doing everything right.

So thinking as lot of thing are available for bitbucket server but not cloud, maybe this is the same?

Thanks

@joachimprinzbach
Copy link
Member

Hey @UrosCvijan
I think the API's are quite similar, you could try to set the URL to the cloud instance and try it out - we have not tested it yet.

@christiansiegel
Copy link
Member

I don't have any experience with Bitbucket cloud, but I found some hints:

  1. According to https://community.atlassian.com/t5/Bitbucket-questions/Using-python-API-to-get-branch-restrictions-pullrequests/qaq-p/2072969 you have to use your username (not your email) + an app password (not your regular password) with enough priviliges. There are also links in the answer on how to create those.
  2. If that does not work, we might have to create the internal Bitbucket client instance differently. Looks like there is a special Cloud class: https://atlassian-python-api.readthedocs.io/index.html
from atlassian.bitbucket import Cloud

bitbucket = Cloud(
    username=bitbucket_email,
    password=bitbucket_password,
    cloud=True)

We're currently using the Bitbucket class:

self.__bitbucket = Bitbucket(git_provider_url, username, password)

Please let us know if hint 1 worked 😉

@christiansiegel christiansiegel added the question Further information is requested label Dec 13, 2022
@UrosCvijan
Copy link
Author

Hi @christiansiegel ,

I will try. I think i even tried all the combinations but constantly was getting like permission denied error, if i have access or check if the repository exist. It was something like that.
I think there is some difference what is organization in bitbucket server, cloud etc..
I mean, you dont have to change it for this use case, it would be nice. I will also try to push that we move to github as noticed for a lot of things bitbucket cloud does not have support or those other things dont have support for bitbucket cloud.

Thank you for the great tool btw.. .

@christiansiegel
Copy link
Member

Hi @UrosCvijan ,

I played around with it: With the Bitbucket Cloud client of atlassian-python-api I could get it to work. So what needs to be done is

  1. Upgrade
    "atlassian-python-api==1.14.5",
    to a more recent version with cloud support
  2. Implement the GitRepoApi interface for Bitbucket cloud using the aforementioned Cloud client

I started on branch feat/bitbucket-cloud. I marked all the remaining TODOs. Unfortunately I don't have much time these days. Anyone, feel free to take it from here..

@christiansiegel christiansiegel added enhancement New feature or request good first issue Good for newcomers and removed question Further information is requested labels Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants