-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
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. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
@gmlewis Please review |
There was a problem hiding this 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!
3b0b32e
to
0801a40
Compare
@gmlewis Changes have been made. |
0801a40
to
d2e5883
Compare
There was a problem hiding this 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.
github/git_commits.go
Outdated
@@ -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, ", ")) |
There was a problem hiding this comment.
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)
github/git_commits_test.go
Outdated
@@ -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, ", ")) |
There was a problem hiding this comment.
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.
github/git_tags.go
Outdated
@@ -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, ", ")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
github/git_tags_test.go
Outdated
@@ -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, ", ")) |
There was a problem hiding this comment.
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, ", ")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
github/issues_labels_test.go
Outdated
@@ -83,7 +83,7 @@ func TestIssuesService_CreateLabel(t *testing.T) { | |||
|
|||
input := &Label{Name: String("n")} | |||
|
|||
acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} | |||
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview} |
There was a problem hiding this comment.
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.
github/issues_labels_test.go
Outdated
@@ -122,7 +122,7 @@ func TestIssuesService_EditLabel(t *testing.T) { | |||
|
|||
input := &Label{Name: String("z")} | |||
|
|||
acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} | |||
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview} |
There was a problem hiding this comment.
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.
github/issues_labels_test.go
Outdated
@@ -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, ", ")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
github/issues_labels_test.go
Outdated
@@ -218,7 +218,7 @@ func TestIssuesService_AddLabelsToIssue(t *testing.T) { | |||
|
|||
input := []string{"a", "b"} | |||
|
|||
acceptHeaders := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} | |||
acceptHeaders := []string{mediaTypeLabelDescriptionSearchPreview} |
There was a problem hiding this comment.
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.
github/issues_labels_test.go
Outdated
@@ -280,7 +280,7 @@ func TestIssuesService_ReplaceLabelsForIssue(t *testing.T) { | |||
|
|||
input := []string{"a", "b"} | |||
|
|||
acceptHeader := []string{mediaTypeGraphQLNodeIDPreview, mediaTypeLabelDescriptionSearchPreview} | |||
acceptHeader := []string{mediaTypeLabelDescriptionSearchPreview} |
There was a problem hiding this comment.
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.
d2e5883
to
67a036f
Compare
@gmlewis Requested changes have been made.Please review |
There was a problem hiding this 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.
@shurcooL Please review |
@gmlewis Till when can we wait for this PR to be merged? |
We have a policy for this repo to not merge non-trivial PRs until we get at least two LGTMs. |
Merging without second LGTM. Sorry for the delay, @S2606! |
No problem and thank you for merging. A start for lot more PR's |
Fixes #919