Skip to content

add support for new repository invitations #373

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

Merged
merged 1 commit into from
Jun 20, 2016

Conversation

gmlewis
Copy link
Collaborator

@gmlewis gmlewis commented Jun 16, 2016

Fixes #371.

Change-Id: I97f2fc28ce048442ee8af3bd11c48b5b2084e09b

@gmlewis gmlewis force-pushed the i-371-repo-invitations branch 4 times, most recently from 781b29e to f26e2d3 Compare June 17, 2016 18:44
func (s *RepositoriesService) AddCollaborator(owner, repo, user string, opt *RepositoryAddCollaboratorOptions) (*Response, error) {
u := fmt.Sprintf("repos/%v/%v/collaborators/%v", owner, repo, user)
req, err := s.client.NewRequest("PUT", u, opt)
if err != nil {
return nil, err
}

// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeRepositoryInvitationsPreview)
Copy link
Member

Choose a reason for hiding this comment

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

It's interesting that this takes an existing, previously stable endpoint, and changes it slightly to use the (potentially less stable) preview API. (Usually preview APIs are for new endpoints.)

I think it's fine per our discussion in #376 because people who have really really specific needs will be vendoring this library anyway.

@dmitshur
Copy link
Member

dmitshur commented Jun 19, 2016

I've left 4 inline comments, otherwise LGTM.

I did not test the functionality, just reviewed the code.

@gmlewis gmlewis force-pushed the i-371-repo-invitations branch from f26e2d3 to 6c958ff Compare June 20, 2016 02:35
// ListInvitations lists all currently-open repository invitations for the
// authenticated user.
//
// GitHub API docs: https://developer.github.com/v3/repos/invitations/#list-invitations-for-a-repository
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! Thanks, @shurcooL

@gmlewis gmlewis force-pushed the i-371-repo-invitations branch from 6c958ff to a4eeb22 Compare June 20, 2016 04:19
Fixes google#371.

Change-Id: I97f2fc28ce048442ee8af3bd11c48b5b2084e09b
@gmlewis gmlewis force-pushed the i-371-repo-invitations branch from a4eeb22 to 5c1b3a0 Compare June 20, 2016 04:25
@gmlewis gmlewis merged commit 5c1b3a0 into google:master Jun 20, 2016
@gmlewis gmlewis deleted the i-371-repo-invitations branch June 20, 2016 04:29
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.

2 participants