Use Repositories v2 API#93
Conversation
…gives us the extra parameter of role, allowing us to filter the repository list by whether a user is an owner, contributor etc
|
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. |
|
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. |
|
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 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. |
Pulled in changes from #72 (rebased to remove some unnecessary commits that had since been merged into master).