Skip to content

Commit

Permalink
Remove preview media type for Team Review Requests (google#844)
Browse files Browse the repository at this point in the history
As the Team Review Requests API is fully supported by GitHub API v3, we
have removed the preview(custom) media type: thor-preview.

Fixes google#840.
  • Loading branch information
Kshitij Saraogi authored and gmlewis committed Feb 23, 2018
1 parent 13d223e commit 93b6192
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
3 changes: 0 additions & 3 deletions github/github.go
Expand Up @@ -99,9 +99,6 @@ const (
// https://developer.github.com/changes/2017-07-17-update-topics-on-repositories/
mediaTypeTopicsPreview = "application/vnd.github.mercy-preview+json"

// https://developer.github.com/changes/2017-07-26-team-review-request-thor-preview/
mediaTypeTeamReviewPreview = "application/vnd.github.thor-preview+json"

// https://developer.github.com/v3/apps/marketplace/
mediaTypeMarketplacePreview = "application/vnd.github.valkyrie-preview+json"

Expand Down
9 changes: 0 additions & 9 deletions github/pulls_reviewers.go
Expand Up @@ -32,9 +32,6 @@ func (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo
return nil, nil, err
}

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

r := new(PullRequest)
resp, err := s.client.Do(ctx, req, r)
if err != nil {
Expand All @@ -59,9 +56,6 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str
return nil, nil, err
}

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

reviewers := new(Reviewers)
resp, err := s.client.Do(ctx, req, reviewers)
if err != nil {
Expand All @@ -81,8 +75,5 @@ func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo s
return nil, err
}

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

return s.client.Do(ctx, req, nil)
}
3 changes: 0 additions & 3 deletions github/pulls_reviewers_test.go
Expand Up @@ -20,7 +20,6 @@ func TestRequestReviewers(t *testing.T) {
mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "POST")
testBody(t, r, `{"reviewers":["octocat","googlebot"],"team_reviewers":["justice-league","injustice-league"]}`+"\n")
testHeader(t, r, "Accept", mediaTypeTeamReviewPreview)
fmt.Fprint(w, `{"number":1}`)
})

Expand All @@ -41,7 +40,6 @@ func TestRemoveReviewers(t *testing.T) {

mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "DELETE")
testHeader(t, r, "Accept", mediaTypeTeamReviewPreview)
testBody(t, r, `{"reviewers":["octocat","googlebot"],"team_reviewers":["justice-league"]}`+"\n")
})

Expand All @@ -57,7 +55,6 @@ func TestListReviewers(t *testing.T) {

mux.HandleFunc("/repos/o/r/pulls/1/requested_reviewers", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", mediaTypeTeamReviewPreview)
fmt.Fprint(w, `{"users":[{"login":"octocat","id":1}],"teams":[{"id":1,"name":"Justice League"}]}`)
})

Expand Down

0 comments on commit 93b6192

Please sign in to comment.