Update go-github library

This commit is contained in:
Luke Kysow
2018-12-12 09:55:17 -06:00
parent e001353ae9
commit 139f05ab49
170 changed files with 14305 additions and 3086 deletions

View File

@@ -54,7 +54,7 @@ This test sends real network traffic to the GitHub API and will exhaust the
default unregistered rate limit (60 requests per hour) very quickly.
Additionally, some data is only returned for authenticated API calls. Unlike
the integration tests above, these tests only read data, so it's less
imperitive that these be run using a dedicated test account (though you still
imperative that these be run using a dedicated test account (though you still
really should).
Run the fields tool using:

View File

@@ -25,7 +25,7 @@ import (
"reflect"
"strings"
"github.com/google/go-github/github"
"github.com/google/go-github/v19/github"
"golang.org/x/oauth2"
)

View File

@@ -108,19 +108,12 @@ func TestRepositories_EditBranches(t *testing.T) {
t.Fatalf("Branch %v of repo %v is already protected", "master", *repo.Name)
}
// TODO: This test fails with 422 Validation Failed [{Resource: Field: Code: Message:}].
// Someone familiar with protection requests needs to come up with
// a valid protection request that doesn't give 422 error.
protectionRequest := &github.ProtectionRequest{
RequiredStatusChecks: &github.RequiredStatusChecks{
Strict: true,
Contexts: []string{"continuous-integration"},
},
RequiredPullRequestReviews: &github.PullRequestReviewsEnforcementRequest{
DismissalRestrictionsRequest: &github.DismissalRestrictionsRequest{
Users: []string{},
Teams: []string{},
},
DismissStaleReviews: true,
},
EnforceAdmins: true,
@@ -141,13 +134,11 @@ func TestRepositories_EditBranches(t *testing.T) {
Contexts: []string{"continuous-integration"},
},
RequiredPullRequestReviews: &github.PullRequestReviewsEnforcement{
DismissalRestrictions: github.DismissalRestrictions{
Users: []*github.User{},
Teams: []*github.Team{},
},
DismissStaleReviews: true,
DismissStaleReviews: true,
RequiredApprovingReviewCount: 0,
},
EnforceAdmins: &github.AdminEnforcement{
URL: github.String("https://api.github.com/repos/" + *repo.Owner.Login + "/" + *repo.Name + "/branches/master/protection/enforce_admins"),
Enabled: true,
},
Restrictions: nil,

View File

@@ -203,7 +203,7 @@ func TestUsers_Keys(t *testing.T) {
t.Fatalf("Users.ListKeys('') returned error: %v", err)
}
var id int
var id int64
for _, k := range keys {
if k.Key != nil && *k.Key == key {
id = *k.ID