Repository navigation
Add support for integration service - #436
cyberdelia wants to merge 3 commits into
Conversation
|
haven't looked closely, just a cursory comment on naming. Services in go-github typically map to how the API documentation is structured. That's a little hard right now, if this is an undocumented API, and given that the integrations stuff is in preview. However, I think that installations are always done in the context of integrations. So working with installations will almost certainly need to be a set of functions on an |
|
Some documentation appeared, I will makes the changes to match it: https://developer.github.com/v3/integrations/ |
|
I've rebased, matched and added links to the new documentation. |
gmlewis
left a comment
There was a problem hiding this comment.
Thank you for your PR, @cyberdelia!
| return nil, nil, err | ||
| } | ||
|
|
||
| req.Header.Set("Accept", mediaTypeIntegrationPreview) |
There was a problem hiding this comment.
Before this line, could you please add:
// TODO: remove custom Accept header when this API fully launches.
| return nil, nil, err | ||
| } | ||
|
|
||
| req.Header.Set("Accept", mediaTypeIntegrationPreview) |
There was a problem hiding this comment.
Before this line, could you please add:
// TODO: remove custom Accept header when this API fully launches.
| // ListInstallations lists the installations that the current integration has. | ||
| // | ||
| // GitHub API docs: https://developer.github.com/v3/integrations/#find-installations | ||
| func (s *IntegrationsService) ListInstallations(opt *ListOptions) ([]*Installation, *Response, error) { |
There was a problem hiding this comment.
Can you please add a test function for this one?
| // ListRepos lists the repositories that the current installation has access to. | ||
| // | ||
| // GitHub API docs: https://developer.github.com/v3/integrations/installations/#list-repositories | ||
| func (s *IntegrationsService) ListRepos(opt *ListOptions) ([]*Repository, *Response, error) { |
There was a problem hiding this comment.
Can you please add a test function for this one?
|
@gmlewis I added the TODO comments and tests. |
|
Thank you, @cyberdelia! |
dmitshur
left a comment
There was a problem hiding this comment.
LGTM, not spotting any issues.
| // https://developer.github.com/changes/2016-09-14-projects-api/ | ||
| mediaTypeProjectsPreview = "application/vnd.github.inertia-preview+json" | ||
|
|
||
| // https://developer.github.com/v3/integrations/ |
There was a problem hiding this comment.
Extremely minor, but most other comments above link to the changes page corresponding to the accept header value. So this could be https://developer.github.com/changes/2016-09-14-Integrations-Early-Access/.
There was a problem hiding this comment.
Thanks, @shurcooL - I can address this one in my merge.
|
Integrated in 93d3f73 |
Closes google#436. Change-Id: I02f7503a362ffc5ec09e24d0e3da0f8adfcd4b0c
Closes google#436. Change-Id: I02f7503a362ffc5ec09e24d0e3da0f8adfcd4b0c
Installations do have an one endpoint that list the repository they have access to.
Sadly, it's fairly undocumented for now, the only mention of it can be found the webhooks documentation, see: https://developer.github.com/early-access/integrations/webhooks/#integrationinstallationevent