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

Use Repositories v2 API #93

Merged
merged 2 commits into from
Jul 30, 2019

Conversation

ibrahima
Copy link

Pulled in changes from #72 (rebased to remove some unnecessary commits that had since been merged into master).

…gives us the extra

parameter of role, allowing us to filter the repository list by whether a user is an owner, contributor etc
@vongrippen vongrippen merged commit 2fc8fa5 into bitbucket-rest-api:master Jul 30, 2019
@ibrahima
Copy link
Author

ibrahima commented Jul 30, 2019

Oh hey, thanks for merging! I actually thought this gem was unmaintained and meant to make the pull request to my fork, but great to have this merged upstream. I haven't actually tested this yet myself but I assume it should work.

@vongrippen
Copy link
Member

Sure! One day I hope to get back to actually working on this again. I've merged it here, but won't make a new rubygems release until I can find the time to test it myself. If you're interested in helping me to clean things up and get them all merged in here I'd be more than happy to make it happen.

@ibrahima
Copy link
Author

ibrahima commented Jul 30, 2019

Mmk cool, thanks! I am testing it out right now and I think we might have to pass different arguments to actually get the user's repositories, it seems like right now it's just giving me a list of all public repositories. This might have needed a little tweaking (looks like it's not using the URL for the user's repos). Anyway, I will probably make another PR to fix that stuff once I figure out the situation.

Thanks again!


Ah yeah, the new API returns all public repositories by default: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories

You can add /#{username} to the endpoint to get those for the user but then you need to make an API call to get the username I think? You can also call the list method like

client.repos.list(role: 'owner')

(as the original author mentioned in the updated doc string)

although this might exclude repositories where the user is part of a team but not directly an owner, if Bitbucket's role thing works similar to how GitHub does it.


We should probably update the documentation to reflect the above change. I'm not sure whether it makes sense to make the default still filter by the user's owned repos or if it should make you pass that parameter in explicitly.

@ibrahima ibrahima changed the title User Repositories v2 API Use Repositories v2 API Jul 30, 2019
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

Successfully merging this pull request may close these issues.

3 participants