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 projects api #130

Merged
merged 5 commits into from
Jul 15, 2017
Merged

✨ Add projects api #130

merged 5 commits into from
Jul 15, 2017

Conversation

hirakiuc
Copy link
Owner

@hirakiuc hirakiuc commented Jul 2, 2017

Add /2.0/teams/<owner>/projects API

Ref: #128

Detail

Add projects API on team.

New APIs

bucket = Tinybucket.new
team = bucket.team('my_team')

# Fetch projects
team.projects

# Fetch the project
team.project('project_key)

@hirakiuc hirakiuc added this to the v1.5.0 milestone Jul 2, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 94.893% when pulling 8952063 on add_projects_apis into 121074b on master.

@hirakiuc
Copy link
Owner Author

hirakiuc commented Jul 2, 2017

This code does not work yet.

D, [2017-07-02T22:04:31.221510 #99958] DEBUG -- : [api.bitbucket.org] GET /2.0/teams/altabjpworks/projects (0.792 s)
/Users/hirakiuc/repos/src/github.com/hirakiuc/tinybucket/lib/tinybucket/response/handler.rb:13:in `on_complete': GET https://api.bitbucket.org/2.0/teams/altabjpworks/projects 404 {"type": "error", "error": {"message": "Resource not found", "detail": "There is no API hosted at this URL.\n\nFor information about our API's, please refer to the documentation at: https://developer.atlassian.com/bitbucket/api/2/reference/"}} (Tinybucket::Error::NotFound)
        from /Users/hirakiuc/repos/src/github.com/hirakiuc/tinybucket/.bundle/ruby/2.3.0/gems/faraday-0.11.0/lib/faraday/response.rb:9:in `block in call'
        from /Users/hirakiuc/repos/src/github.com/hirakiuc/tinybucket/.bundle/ruby/2.3.0/gems/faraday-0.11.0/lib/faraday/response.rb:61:in `on_complete'
        from /Users/hirakiuc/repos/src/github.com/hirakiuc/tinybucket/.bundle/ruby/2.3.0/gems/faraday-0.11.0/lib/faraday/response.rb:8:in `call'
        from /Users/hirakiuc/repos/src/github.com/hirakiuc/tinybucket/.bundle/ruby/2.3.0/gems/faraday_middleware-0.11.0.1/lib/faraday_middleware/response_middleware.rb:30:in

@hirakiuc hirakiuc changed the title ✨ Add projects api [WIP] ✨ Add projects api Jul 2, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 94.893% when pulling d68e397 on add_projects_apis into 121074b on master.

@hirakiuc
Copy link
Owner Author

hirakiuc commented Jul 4, 2017

@npadgen
Copy link

npadgen commented Jul 4, 2017

Suggest raising an issue at https://bitbucket.org/site/master/issues rather than relying on the community forum.

Thanks for the work you've done so far.

@hirakiuc
Copy link
Owner Author

hirakiuc commented Jul 4, 2017

Thanks for your suggestion 👍

I'll create the issue at the https://bitbucket.org/site/master/issues if there is no answer from the community in few days.

@hirakiuc
Copy link
Owner Author

hirakiuc commented Jul 6, 2017

I created a new support request and waiting for the answer...

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 94.893% when pulling d830a78 on add_projects_apis into 121074b on master.

@hirakiuc
Copy link
Owner Author

hirakiuc commented Jul 9, 2017

I received a message from Bitbucket support team and fixed the issue! 👍

This code works for me with this branch.

bucket = Tinybucket.new
bucket.teams('admin').each do |team|
  p team
  team.projects.each do |project|
    p project
  end
end

@npadgen
Copy link

npadgen commented Jul 10, 2017

That code works for me as well!

Could you include support for finding the repos belonging to a team – /2.0/teams/{username}/repositories
https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/repositories

Thanks!

@hirakiuc
Copy link
Owner Author

Oh, Sorry. I found your comment, just now.

Could you include support for finding the repos belonging to a team – /2.0/teams/{username}/repositories

I'll try to do that after this pull request. 😄

@npadgen
Copy link

npadgen commented Jul 13, 2017

Perfect, thanks :)

@hirakiuc hirakiuc changed the title [WIP] ✨ Add projects api ✨ Add projects api Jul 15, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 95.162% when pulling 07bc985 on add_projects_apis into 121074b on master.

@hirakiuc
Copy link
Owner Author

This pull request just implements 'GET' methods only.

#131, #132 remains yet.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 95.162% when pulling ff12ec6 on add_projects_apis into 121074b on master.

@hirakiuc
Copy link
Owner Author

LGTM 👍

@hirakiuc hirakiuc merged commit e3118ee into master Jul 15, 2017
@hirakiuc hirakiuc deleted the add_projects_apis branch July 15, 2017 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants