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

Support preview GraphQL API v4 Node IDs #817

Merged
merged 15 commits into from Jan 9, 2018

Conversation

Projects
None yet
6 participants
@anubhakushwaha
Contributor

anubhakushwaha commented Dec 23, 2017

Helps #814 .
The current pull request includes the GraphQL node ID in the response for the following REST API v3 resources:

  • Deployments
  • Gists
  • Git Blobs
  • Git Commits
  • Git References
  • Git Tags
  • Issues
  • Labels
  • Milestones
  • Organizations
@googlebot

This comment has been minimized.

Show comment
Hide comment
@googlebot

googlebot Dec 23, 2017

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. The email used to register you as an authorized contributor must be the email used for the Git commit.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

googlebot commented Dec 23, 2017

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. The email used to register you as an authorized contributor must be the email used for the Git commit.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@googlebot googlebot added the cla: no label Dec 23, 2017

@anubhakushwaha

This comment has been minimized.

Show comment
Hide comment
@anubhakushwaha

anubhakushwaha Dec 23, 2017

Contributor

I signed it!

Contributor

anubhakushwaha commented Dec 23, 2017

I signed it!

@googlebot

This comment has been minimized.

Show comment
Hide comment
@googlebot

googlebot Dec 23, 2017

CLAs look good, thanks!

googlebot commented Dec 23, 2017

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Dec 23, 2017

@anubhakushwaha

This comment has been minimized.

Show comment
Hide comment
@anubhakushwaha

anubhakushwaha Dec 23, 2017

Contributor

@gmlewis @shurcooL I have added GraphQL node ID in the response, let me know if I am doing it correctly and would love to correct and work upon my mistakes.Thanks!

Contributor

anubhakushwaha commented Dec 23, 2017

@gmlewis @shurcooL I have added GraphQL node ID in the response, let me know if I am doing it correctly and would love to correct and work upon my mistakes.Thanks!

@dmitshur

This is a large change, thank you for taking it on @anubhakushwaha!

It's looking great at a high level so far. I've spotted a few minor issues and change suggestions for you to consider, see inline comments.

@@ -193,6 +209,9 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist,
if err != nil {
return nil, nil, err
}

This comment has been minimized.

@dmitshur

dmitshur Dec 24, 2017

Member

Add a blank line here for consistency.

@dmitshur

dmitshur Dec 24, 2017

Member

Add a blank line here for consistency.

This comment has been minimized.

@anubhakushwaha

anubhakushwaha Dec 24, 2017

Contributor

Done

@anubhakushwaha

anubhakushwaha Dec 24, 2017

Contributor

Done

Show outdated Hide outdated github/git_blobs_test.go
Show outdated Hide outdated github/gists.go
Show outdated Hide outdated github/git_blobs_test.go
mux.HandleFunc("/repos/o/r/git/commits/s", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", mediaTypeGitSigningPreview)
testHeader(t, r, "Accept", strings.Join(acceptHeaders, ", "))

This comment has been minimized.

@dmitshur

dmitshur Dec 24, 2017

Member

This is minor and either way is fine, but I'll make the suggestion for you to consider.

Since acceptHeaders is only used here, you can declare it right here. No need to declare it that much earlier:

acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
testHeader(t, r, "Accept", strings.Join(acceptHeaders, ", "))
@dmitshur

dmitshur Dec 24, 2017

Member

This is minor and either way is fine, but I'll make the suggestion for you to consider.

Since acceptHeaders is only used here, you can declare it right here. No need to declare it that much earlier:

acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
testHeader(t, r, "Accept", strings.Join(acceptHeaders, ", "))

This comment has been minimized.

@anubhakushwaha

anubhakushwaha Dec 24, 2017

Contributor

@shurcooL It was done to maintain consistency with the rest of the files when we had multiple mediaType values. Let me know if I should change it 😄

@anubhakushwaha

anubhakushwaha Dec 24, 2017

Contributor

@shurcooL It was done to maintain consistency with the rest of the files when we had multiple mediaType values. Let me know if I should change it 😄

This comment has been minimized.

@dmitshur

dmitshur Jan 5, 2018

Member

Okay, keeping it as is is completely acceptable.

@dmitshur

dmitshur Jan 5, 2018

Member

Okay, keeping it as is is completely acceptable.

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Dec 24, 2017

Member

Also, you should edit the PR description and replace "Partially fixes #814." with something like "Helps #814." because GitHub syntax doesn't recognize the word "partially". It only sees "fixes #814", so it'll close that issue when this is merged, which isn't what you want.

Member

dmitshur commented Dec 24, 2017

Also, you should edit the PR description and replace "Partially fixes #814." with something like "Helps #814." because GitHub syntax doesn't recognize the word "partially". It only sees "fixes #814", so it'll close that issue when this is merged, which isn't what you want.

@anubhakushwaha anubhakushwaha referenced this pull request Dec 24, 2017

Merged

Migrate IDs to int64 type #816

3 of 4 tasks complete
@kshitij10496

This comment has been minimized.

Show comment
Hide comment
@kshitij10496

kshitij10496 Dec 24, 2017

Collaborator

The build is failing due to formatting issues with the code.

Run $ gofmt -d -s .in a terminal from the base directory of the repo.
This will show the diff of all formatting issues with the code.
I think fixing them should resolve the build failure.

Collaborator

kshitij10496 commented Dec 24, 2017

The build is failing due to formatting issues with the code.

Run $ gofmt -d -s .in a terminal from the base directory of the repo.
This will show the diff of all formatting issues with the code.
I think fixing them should resolve the build failure.

@anubhakushwaha

This comment has been minimized.

Show comment
Hide comment
@anubhakushwaha

anubhakushwaha Dec 24, 2017

Contributor

@kshitij10496 Thanks, I will keep it in mind from future 😄

Contributor

anubhakushwaha commented Dec 24, 2017

@kshitij10496 Thanks, I will keep it in mind from future 😄

@@ -82,6 +82,9 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo stri
return nil, nil, err
}
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)

This comment has been minimized.

@anubhakushwaha

anubhakushwaha Dec 24, 2017

Contributor

One of the reasons of failing Travis, forgot to add it previously.

@anubhakushwaha

anubhakushwaha Dec 24, 2017

Contributor

One of the reasons of failing Travis, forgot to add it previously.

@dmitshur dmitshur requested a review from gmlewis Jan 5, 2018

@dmitshur

dmitshur requested changes Jan 5, 2018 edited

A few minor comments. Otherwise this is looking good, not seeing other issues or opportunities for improvement.

It's hard to verify definitively which exact objects get the new NodeID field. I tried to confirm, and it looks good, but I can't give definitive guarantees. For example, I'm not quite sure if DeploymentStatus should get NodeID (it probably should, but I'm not 100% confident). GitHub documentation doesn't make it very easy to know for sure, so I think this is as good as it can be for the first version.

Show outdated Hide outdated github/git_commits.go
Show outdated Hide outdated github/git_blobs_test.go
Show outdated Hide outdated github/issues.go
@gmlewis

gmlewis approved these changes Jan 5, 2018

Very nice, @anubhakushwaha... thank you!
Thanks to @shurcooL and @sahildua2305 for the code reviews, too!

After you address @shurcooL's review requests, this LGTM.

@anubhakushwaha

This comment has been minimized.

Show comment
Hide comment
@anubhakushwaha

anubhakushwaha Jan 6, 2018

Contributor

@shurcooL @sahildua2305 Apologies for the delay 😄 Updated the PR. Please review.

Contributor

anubhakushwaha commented Jan 6, 2018

@shurcooL @sahildua2305 Apologies for the delay 😄 Updated the PR. Please review.

@sahildua2305

LGTM

@dmitshur

LGTM; just see one minor thing that needs to be done before we merge this.

Show outdated Hide outdated github/github-accessors.go
@googlebot

This comment has been minimized.

Show comment
Hide comment
@googlebot

googlebot Jan 9, 2018

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

googlebot commented Jan 9, 2018

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot googlebot added cla: no and removed cla: yes labels Jan 9, 2018

@dmitshur dmitshur merged commit cbeb72e into google:master Jan 9, 2018

0 of 2 checks passed

cla/google CLAs are signed, but unable to verify author consent
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Jan 9, 2018

Member

Merged. Thanks a lot for working on this @anubhakushwaha!

Member

dmitshur commented Jan 9, 2018

Merged. Thanks a lot for working on this @anubhakushwaha!

@anubhakushwaha

This comment has been minimized.

Show comment
Hide comment
@anubhakushwaha

anubhakushwaha Jan 10, 2018

Contributor

@shurcooL I would love to finish the whole issue and will soon send the PR for the rest of the API's as well

Contributor

anubhakushwaha commented Jan 10, 2018

@shurcooL I would love to finish the whole issue and will soon send the PR for the rest of the API's as well

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment