From edd21da9bc1cd285f7bd342fff4f690d93c4d191 Mon Sep 17 00:00:00 2001 From: Michael Spiegel Date: Wed, 28 Mar 2018 13:32:48 -0400 Subject: [PATCH 1/3] Update go-github dependency to HEAD master Fixes https://github.com/google/go-github/issues/664 id type changed from int to int64 --- .travis.yml | 2 +- Gopkg.lock | 2 +- model/review.go | 2 +- remote/github/github.go | 16 +++++++++------- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 629b001..a782c1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,6 @@ install: - go get -u github.com/golang/dep - go install github.com/golang/dep/cmd/dep - export PATH=$GOPATH/bin:$PATH - - dep ensure + - dep ensure -v -vendor-only script: make test diff --git a/Gopkg.lock b/Gopkg.lock index 053d297..f1a0638 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -59,7 +59,7 @@ branch = "master" name = "github.com/google/go-github" packages = ["github"] - revision = "464f5a91396a85da262abcac0b0a0aaf5b8f3c02" + revision = "1ce85f4eb585f22e22dbd214dd4610aafa516c4c" [[projects]] branch = "master" diff --git a/model/review.go b/model/review.go index 3343b1a..fd6f7aa 100644 --- a/model/review.go +++ b/model/review.go @@ -25,7 +25,7 @@ import ( ) type Review struct { - ID int + ID int64 Author lowercase.String Body string SubmittedAt time.Time diff --git a/remote/github/github.go b/remote/github/github.go index 98223c0..2d2a1fd 100644 --- a/remote/github/github.go +++ b/remote/github/github.go @@ -279,7 +279,7 @@ func getTeamMembers(ctx context.Context, client *github.Client, org string, team if err != nil { return nil, err } - var id *int + var id *int64 for _, t := range teams { if strings.EqualFold(t.GetSlug(), team) { id = t.ID @@ -512,15 +512,17 @@ func createProtectionRequest(input *github.Protection) *github.ProtectionRequest } inDismissal := inReviews.DismissalRestrictions if len(inDismissal.Users) > 0 || len(inDismissal.Teams) > 0 { - outDismissal := &github.DismissalRestrictionsRequest{ - Users: []string{}, - Teams: []string{}, - } + users := []string{} + teams := []string{} for _, user := range inDismissal.Users { - outDismissal.Users = append(outDismissal.Users, user.GetLogin()) + users = append(users, user.GetLogin()) } for _, team := range inDismissal.Teams { - outDismissal.Teams = append(outDismissal.Teams, team.GetSlug()) + teams = append(teams, team.GetSlug()) + } + outDismissal := &github.DismissalRestrictionsRequest{ + Users: &users, + Teams: &teams, } outReviews.DismissalRestrictionsRequest = outDismissal } From 0b0ad4de593f54b22e6935ecdf3e1be188830f27 Mon Sep 17 00:00:00 2001 From: Michael Spiegel Date: Wed, 28 Mar 2018 13:36:27 -0400 Subject: [PATCH 2/3] Show dep status --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a782c1d..f7fed75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,6 @@ install: - go install github.com/golang/dep/cmd/dep - export PATH=$GOPATH/bin:$PATH - dep ensure -v -vendor-only + - dep status script: make test From 76f7a281587bccb29771e772c114e7d6d88ae57d Mon Sep 17 00:00:00 2001 From: Michael Spiegel Date: Wed, 28 Mar 2018 13:57:02 -0400 Subject: [PATCH 3/3] Add 'master' branch to go-github dependency --- Gopkg.lock | 56 +++++++++++++++++++++++++++++++++-------- Gopkg.toml | 1 + remote/github/github.go | 4 +-- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index f1a0638..38be06a 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -39,7 +39,11 @@ [[projects]] name = "github.com/gin-gonic/gin" - packages = [".","binding","render"] + packages = [ + ".", + "binding", + "render" + ] revision = "d459835d2b077e44f7c9b453505ee29881d5d12d" version = "v1.2" @@ -93,7 +97,10 @@ [[projects]] name = "github.com/joho/godotenv" - packages = [".","autoload"] + packages = [ + ".", + "autoload" + ] revision = "a79fa1e548e2c689c241d10173efd51e5d689d5b" version = "v1.2.0" @@ -106,7 +113,10 @@ [[projects]] branch = "master" name = "github.com/lib/pq" - packages = [".","oid"] + packages = [ + ".", + "oid" + ] revision = "456514e2defec52e0cd37f90ccf17ec8b28295e2" [[projects]] @@ -154,7 +164,10 @@ [[projects]] branch = "master" name = "github.com/rubenv/sql-migrate" - packages = [".","sqlparse"] + packages = [ + ".", + "sqlparse" + ] revision = "79fe99e24311fa42469fb2ca23eb3f8f065e6155" [[projects]] @@ -171,7 +184,10 @@ [[projects]] name = "github.com/stretchr/testify" - packages = ["assert","mock"] + packages = [ + "assert", + "mock" + ] revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" version = "v1.1.4" @@ -184,14 +200,20 @@ [[projects]] branch = "master" name = "golang.org/x/net" - packages = ["context","context/ctxhttp"] + packages = [ + "context", + "context/ctxhttp" + ] revision = "aabf50738bcdd9b207582cbe796b59ed65d56680" source = "github.com/golang/net" [[projects]] branch = "master" name = "golang.org/x/oauth2" - packages = [".","internal"] + packages = [ + ".", + "internal" + ] revision = "bb50c06baba3d0c76f9d125c0719093e315b5b44" source = "github.com/golang/oauth2" @@ -204,7 +226,15 @@ [[projects]] name = "google.golang.org/appengine" - packages = ["internal","internal/base","internal/datastore","internal/log","internal/remote_api","internal/urlfetch","urlfetch"] + packages = [ + "internal", + "internal/base", + "internal/datastore", + "internal/log", + "internal/remote_api", + "internal/urlfetch", + "urlfetch" + ] revision = "150dc57a1b433e64154302bdc40b6bb8aefa313a" source = "github.com/golang/appengine" version = "v1.0.0" @@ -224,7 +254,13 @@ [[projects]] branch = "v2" name = "gopkg.in/mgo.v2" - packages = [".","bson","internal/json","internal/sasl","internal/scram"] + packages = [ + ".", + "bson", + "internal/json", + "internal/sasl", + "internal/scram" + ] revision = "3f83fa5005286a7fe593b055f0d7771a7dce4655" [[projects]] @@ -236,6 +272,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "3fbdbca37fb5208da80d2ce2e1fb73b619ba3f4b52ad8c3cf380a06ed23ff8bf" + inputs-digest = "f5d9f2fe599b2af1713618843035d375a0054562383a1dcc26078cb1e4b6543f" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index f217802..f3d67aa 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -46,6 +46,7 @@ [[constraint]] name = "github.com/google/go-github" + branch = "master" [[constraint]] name = "github.com/hashicorp/go-version" diff --git a/remote/github/github.go b/remote/github/github.go index 2d2a1fd..a343119 100644 --- a/remote/github/github.go +++ b/remote/github/github.go @@ -669,7 +669,7 @@ func (g *Github) SetOrgHook(ctx context.Context, user *model.User, org *model.Or old, err := getOrgHook(ctx, client, org.Owner, link) if err == nil && old != nil { - client.Organizations.DeleteHook(ctx, org.Owner, old.GetID()) + client.Organizations.DeleteHook(ctx, org.Owner, int(old.GetID())) } _, err = createOrgHook(ctx, client, org.Owner, link) @@ -690,7 +690,7 @@ func (g *Github) DelOrgHook(ctx context.Context, user *model.User, org *model.Or } else if hook == nil { return nil } - resp, err := client.Organizations.DeleteHook(ctx, org.Owner, hook.GetID()) + resp, err := client.Organizations.DeleteHook(ctx, org.Owner, int(hook.GetID())) if err != nil { return createError(resp, err) }