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 AuthorAssociation field in struct PullRequest #802

Merged
merged 1 commit into from Dec 2, 2017

Conversation

Projects
None yet
3 participants
@allencloud
Contributor

allencloud commented Dec 1, 2017

I see that when a user contributes to a repo at his first time, the github will show this contributor is the-first-time-contributor. And I contact with developers in github about how to get this field in API.
And they said they design a new Field AuthorAssociation in pullrequest struct. Although this is not documented in github API docs.

I think it is important, so I try to add this field.

@googlebot googlebot added the cla: yes label Dec 1, 2017

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Dec 2, 2017

Member

You'll need to run go generate to update a generated part of this package too. See step 5 of https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch.

Member

dmitshur commented Dec 2, 2017

You'll need to run go generate to update a generated part of this package too. See step 5 of https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch.

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Dec 2, 2017

Member

It's unfortunate that the field isn't documented. But it's easy to confirm it's there, e.g., https://api.github.com/repos/google/go-github/pulls/802:

{
  ...
  "author_association": "CONTRIBUTOR",
  ...
}

LGTM, just need to update the generated file.

Member

dmitshur commented Dec 2, 2017

It's unfortunate that the field isn't documented. But it's easy to confirm it's there, e.g., https://api.github.com/repos/google/go-github/pulls/802:

{
  ...
  "author_association": "CONTRIBUTOR",
  ...
}

LGTM, just need to update the generated file.

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Dec 2, 2017

Member

It's unfortunate that the field isn't documented.

FWIW, this field is documented as part of GitHub's v4 API:
image

Member

dmitshur commented Dec 2, 2017

It's unfortunate that the field isn't documented.

FWIW, this field is documented as part of GitHub's v4 API:
image

Add AuthorAssociation field in struct PullRequest
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
@allencloud

This comment has been minimized.

Show comment
Hide comment
@allencloud

allencloud Dec 2, 2017

Contributor

Thanks for your detailed guide. I have updated the generating thing . PTAL @shurcooL
Thanks a lot.

Contributor

allencloud commented Dec 2, 2017

Thanks for your detailed guide. I have updated the generating thing . PTAL @shurcooL
Thanks a lot.

@dmitshur

LGTM. Thanks!

@dmitshur dmitshur merged commit d4f26c3 into google:master Dec 2, 2017

2 checks passed

cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Dec 2, 2017

Member

If you want, it'd be helpful to contact GitHub support and let them know this field is missing in the docs at https://developer.github.com/v3/pulls/, so it can be added there (and gain more confidence in being able to rely on it).

Caution should be taken using it given it is not documented (but I suspect it's likely because they haven't gotten around to updating the v3 docs yet).

Member

dmitshur commented Dec 2, 2017

If you want, it'd be helpful to contact GitHub support and let them know this field is missing in the docs at https://developer.github.com/v3/pulls/, so it can be added there (and gain more confidence in being able to rely on it).

Caution should be taken using it given it is not documented (but I suspect it's likely because they haven't gotten around to updating the v3 docs yet).

@allencloud allencloud deleted the allencloud:patch-1 branch Dec 2, 2017

nbareil pushed a commit to nbareil/go-github that referenced this pull request May 1, 2018

Add PullRequest.AuthorAssociation field. (google#802)
The field contains the author association with the repository,
e.g., "COLLABORATOR", "CONTRIBUTOR", "NONE", etc.

It's not currently documented at https://developer.github.com/v3/pulls/ but
is present in GitHub API v3 responses. It's documented in GitHub API v4 at
https://developer.github.com/v4/reference/object/pullrequest/#fields and
https://developer.github.com/v4/reference/enum/commentauthorassociation/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment