From 8ef08eef925a6c9b8773e9cb2f621a8659f27688 Mon Sep 17 00:00:00 2001 From: Jason Martens Date: Fri, 2 Oct 2020 09:23:47 -0700 Subject: [PATCH 1/3] Update go-github to avoid deprecated github endpoint --- go.mod | 3 +++ go.sum | 10 ++++++++++ internal/bot/bot.go | 2 +- internal/config/config.go | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 31a5db6..68e3919 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,12 @@ module github.com/zendesk/term-check +go 1.14 + require ( github.com/DataDog/ghinstallation v0.1.2 github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/google/go-github/v18 v18.2.0 + github.com/google/go-github/v32 v32.1.0 github.com/gorilla/context v1.1.1 // indirect github.com/gorilla/mux v1.6.2 github.com/juju/clock v0.0.0-20180808021310-bab88fc67299 // indirect diff --git a/go.sum b/go.sum index 5e5b90d..2eb1926 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github/v18 v18.2.0 h1:s7Y4I8ZlIL1Ofxpj4AQRJcSGAr0Jl2AHThHgXpsUCfU= github.com/google/go-github/v18 v18.2.0/go.mod h1:Bf4Ut1RTeH0WuX7Z4Zf7N+qp/YqgcFOxvTLuSO+aY/k= +github.com/google/go-github/v32 v32.1.0 h1:GWkQOdXqviCPx7Q7Fj+KyPoGm4SwHRh8rheoPhd27II= +github.com/google/go-github/v32 v32.1.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= @@ -45,10 +49,16 @@ github.com/waigani/diffparser v0.0.0-20180518143736-8ef6bf958d9e h1:R6qM6h3b187X github.com/waigani/diffparser v0.0.0-20180518143736-8ef6bf958d9e/go.mod h1:Utd1McdLHltgYo8tcyoZVzjYzp+VG1QNZ/mHZ5xR+V4= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac h1:7d7lG9fHOLdL6jZPtnV4LpI41SbohIJ1Atq7U991dMg= golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= diff --git a/internal/bot/bot.go b/internal/bot/bot.go index 3112ac4..f36f3a4 100644 --- a/internal/bot/bot.go +++ b/internal/bot/bot.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v32/github" "github.com/rs/zerolog" "github.com/rs/zerolog/log" ignore "github.com/sabhiram/go-gitignore" diff --git a/internal/config/config.go b/internal/config/config.go index ff03358..9bcc22a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -10,7 +10,7 @@ import ( "gopkg.in/yaml.v2" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v32/github" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/zendesk/term-check/pkg/config" From 333bdd691a47896bd4bad12fcc41718293c8d02f Mon Sep 17 00:00:00 2001 From: Jason Martens Date: Fri, 2 Oct 2020 09:33:40 -0700 Subject: [PATCH 2/3] Missed some imports, update code for new version --- internal/bot/bot.go | 1 - pkg/github/client.go | 2 +- pkg/github/server.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/bot/bot.go b/internal/bot/bot.go index f36f3a4..8d15f04 100644 --- a/internal/bot/bot.go +++ b/internal/bot/bot.go @@ -190,7 +190,6 @@ func (b *Bot) createCheckRun(ctx context.Context, pr *github.PullRequest, r *git cro := github.CreateCheckRunOptions{ Name: b.checkName, - HeadBranch: pr.GetHead().GetRef(), HeadSHA: headSHA, Status: github.String("completed"), CompletedAt: &github.Timestamp{Time: time.Now()}, diff --git a/pkg/github/client.go b/pkg/github/client.go index be207af..70d132c 100644 --- a/pkg/github/client.go +++ b/pkg/github/client.go @@ -3,7 +3,7 @@ package github import ( "github.com/DataDog/ghinstallation" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v32/github" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "net/http" diff --git a/pkg/github/server.go b/pkg/github/server.go index 67a8106..d881489 100644 --- a/pkg/github/server.go +++ b/pkg/github/server.go @@ -4,7 +4,7 @@ import ( "net/http" "time" - "github.com/google/go-github/v18/github" + "github.com/google/go-github/v32/github" "github.com/gorilla/mux" "github.com/rs/zerolog" "github.com/rs/zerolog/log" From 5bceef986dc810d2568e1e2b06f36f1f8f952dc4 Mon Sep 17 00:00:00 2001 From: Jason Martens Date: Fri, 2 Oct 2020 09:38:49 -0700 Subject: [PATCH 3/3] Bump go version for Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dff9ada..881e19b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: go go: - - "1.11.x" + - "1.14.x" env: - GO111MODULE=on