Skip to content

Add support for integration service - #436

Closed
cyberdelia wants to merge 3 commits into
google:masterfrom
cyberdelia:installation-service
Closed

cyberdelia wants to merge 3 commits into
google:masterfrom
cyberdelia:installation-service

Conversation

@cyberdelia

Copy link
Copy Markdown
Contributor

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

@willnorris

Copy link
Copy Markdown
Collaborator

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 IntegrationsService, rather than having a standalone InstallationsService.

@cyberdelia

Copy link
Copy Markdown
Contributor Author

Some documentation appeared, I will makes the changes to match it: https://developer.github.com/v3/integrations/

@cyberdelia

Copy link
Copy Markdown
Contributor Author

I've rebased, matched and added links to the new documentation.

@cyberdelia cyberdelia changed the title Add support for installation service Add support for integration service Oct 5, 2016

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR, @cyberdelia!

return nil, nil, err
}

req.Header.Set("Accept", mediaTypeIntegrationPreview)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this line, could you please add:
// TODO: remove custom Accept header when this API fully launches.

Comment thread github/integration.go
return nil, nil, err
}

req.Header.Set("Accept", mediaTypeIntegrationPreview)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this line, could you please add:
// TODO: remove custom Accept header when this API fully launches.

Comment thread github/integration.go
// 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) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a test function for this one?

@cyberdelia

Copy link
Copy Markdown
Contributor Author

@gmlewis I added the TODO comments and tests.

@gmlewis

gmlewis commented Oct 12, 2016

Copy link
Copy Markdown
Collaborator

Thank you, @cyberdelia!
LGTM. Awaiting secondary LGTM before merging.

@gmlewis gmlewis added the lgtm label Oct 12, 2016

@dmitshur dmitshur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, not spotting any issues.

Comment thread github/github.go
// https://developer.github.com/changes/2016-09-14-projects-api/
mediaTypeProjectsPreview = "application/vnd.github.inertia-preview+json"

// https://developer.github.com/v3/integrations/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @shurcooL - I can address this one in my merge.

@gmlewis gmlewis closed this in 93d3f73 Oct 12, 2016
@gmlewis

gmlewis commented Oct 12, 2016

Copy link
Copy Markdown
Collaborator

Integrated in 93d3f73

@cyberdelia
cyberdelia deleted the installation-service branch October 12, 2016 19:23
bubg-dev pushed a commit to bubg-dev/go-github that referenced this pull request Jun 16, 2017
Closes google#436.

Change-Id: I02f7503a362ffc5ec09e24d0e3da0f8adfcd4b0c
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Closes google#436.

Change-Id: I02f7503a362ffc5ec09e24d0e3da0f8adfcd4b0c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants