Skip to content

Remove custom media type for global node IDs #925

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 2 commits into from
Aug 10, 2018

Conversation

S2606
Copy link
Contributor

@S2606 S2606 commented Jun 6, 2018

Fixes #919

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). 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 (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@S2606
Copy link
Contributor Author

S2606 commented Jun 6, 2018

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes Indication that the PR author has signed a Google Contributor License Agreement. and removed cla: no labels Jun 6, 2018
@S2606
Copy link
Contributor Author

S2606 commented Jun 6, 2018

@gmlewis Please review

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @S2606!

Instead of commenting out the unwanted lines, please go ahead and delete them so that we don't have old comments left lying around... as they would just cause confusion when someone new to the repo started reading and contributing to the code.

Check out https://github.com/google/go-github/pull/844/files for an example of removal.

Thanks again!

@S2606 S2606 force-pushed the remove_custom_mediatype branch from 3b0b32e to 0801a40 Compare June 8, 2018 04:47
@S2606
Copy link
Contributor Author

S2606 commented Jun 8, 2018

@gmlewis Changes have been made.

@S2606 S2606 force-pushed the remove_custom_mediatype branch from 0801a40 to d2e5883 Compare June 8, 2018 04:53
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @S2606!

This is looking better. There are more opportunities to clean up the code if you don't mind.

@@ -70,7 +70,7 @@ func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, s
}

// TODO: remove custom Accept headers when APIs fully launch.
acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
acceptHeaders := []string{mediaTypeGitSigningPreview}
req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's please simplify this one:

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

@@ -19,7 +19,7 @@ func TestGitService_GetCommit(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
acceptHeaders := []string{mediaTypeGitSigningPreview}
mux.HandleFunc("/repos/o/r/git/commits/s", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", strings.Join(acceptHeaders, ", "))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here. No need for the acceptHeaders slice anymore.

@@ -45,7 +45,7 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha
}

// TODO: remove custom Accept headers when APIs fully launch.
acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
acceptHeaders := []string{mediaTypeGitSigningPreview}
req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here.

@@ -19,7 +19,7 @@ func TestGitService_GetTag(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
acceptHeaders := []string{mediaTypeGitSigningPreview}
mux.HandleFunc("/repos/o/r/git/tags/s", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", strings.Join(acceptHeaders, ", "))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here.

github/issues.go Outdated
@@ -270,7 +270,7 @@ func (s *IssuesService) Create(ctx context.Context, owner string, repo string, i
}

// TODO: remove custom Accept header when this API fully launches.
acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview}
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview}
req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here.

@@ -83,7 +83,7 @@ func TestIssuesService_CreateLabel(t *testing.T) {

input := &Label{Name: String("n")}

acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview}
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here for line 92 below.

@@ -122,7 +122,7 @@ func TestIssuesService_EditLabel(t *testing.T) {

input := &Label{Name: String("z")}

acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview}
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here for line 131 below.

@@ -181,7 +181,7 @@ func TestIssuesService_ListLabelsByIssue(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview}
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview}
mux.HandleFunc("/repos/o/r/issues/1/labels", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", strings.Join(acceptHeaders, ", "))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here.

@@ -218,7 +218,7 @@ func TestIssuesService_AddLabelsToIssue(t *testing.T) {

input := []string{"a", "b"}

acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview}
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here for line 227 below.

@@ -280,7 +280,7 @@ func TestIssuesService_ReplaceLabelsForIssue(t *testing.T) {

input := []string{"a", "b"}

acceptHeader := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview}
acceptHeader := []string{mediaTypeLabelDescriptionSearchPreview}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You get the idea, I'm going to stop commenting... but here and below as well.

@S2606 S2606 force-pushed the remove_custom_mediatype branch from d2e5883 to 67a036f Compare June 10, 2018 04:31
@S2606
Copy link
Contributor Author

S2606 commented Jun 10, 2018

@gmlewis Requested changes have been made.Please review

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you... this LGTM.
Awaiting second LGTM before merging.

@S2606
Copy link
Contributor Author

S2606 commented Jun 10, 2018

@shurcooL Please review

@S2606
Copy link
Contributor Author

S2606 commented Jun 14, 2018

@gmlewis Till when can we wait for this PR to be merged?

@gmlewis
Copy link
Collaborator

gmlewis commented Jun 14, 2018

We have a policy for this repo to not merge non-trivial PRs until we get at least two LGTMs.
Sometimes it takes a few days to a couple weeks depending upon how busy the other contributors are.
Thank you for your patience! It is greatly appreciated.

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 10, 2018

Merging without second LGTM. Sorry for the delay, @S2606!

@gmlewis gmlewis merged commit 29a3681 into google:master Aug 10, 2018
@S2606
Copy link
Contributor Author

S2606 commented Aug 10, 2018

No problem and thank you for merging. A start for lot more PR's

gmlewis pushed a commit to gmlewis/go-github that referenced this pull request Aug 10, 2018
n1lesh pushed a commit to n1lesh/go-github that referenced this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indication that the PR author has signed a Google Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants