From 07754f92aa6b13301197d16031714176093a5e27 Mon Sep 17 00:00:00 2001 From: He Liu Date: Fri, 10 Aug 2018 14:00:17 -0700 Subject: [PATCH] Update the use of github api --- cmd/gopherbot/Dockerfile | 39 +++++++++++++++++----------------- cmd/gopherbot/gopherbot.go | 2 +- cmd/gopherstats/gopherstats.go | 2 +- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/cmd/gopherbot/Dockerfile b/cmd/gopherbot/Dockerfile index e002b65a8d..159882bf16 100644 --- a/cmd/gopherbot/Dockerfile +++ b/cmd/gopherbot/Dockerfile @@ -8,18 +8,18 @@ ENV CGO_ENABLED=0 # BEGIN deps (run `make update-deps` to update) -# Repo cloud.google.com/go at ba25346 (2017-10-13) -ENV REV=ba2534604a6c2b8854d680e50f9132cade92d02f +# Repo cloud.google.com/go at d0195c2 (2018-08-16) +ENV REV=d0195c2919dd698efd742e4a4c92cfcab64252a0 RUN go get -d cloud.google.com/go/compute/metadata &&\ (cd /go/src/cloud.google.com/go && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV) -# Repo github.com/golang/protobuf at 130e6b0 (2017-09-20) -ENV REV=130e6b02ab059e7b717a096f397c5b60111cae74 +# Repo github.com/golang/protobuf at 89a0c16 (2018-08-04) +ENV REV=89a0c16f4dc2a70c0ed864d8ef64878f24fdaa51 RUN go get -d github.com/golang/protobuf/proto `#and 5 other pkgs` &&\ (cd /go/src/github.com/golang/protobuf && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV) -# Repo github.com/google/go-github at 471e67c (2017-11-16) -ENV REV=471e67c93cdd36a5f7c9bba5d6d11665ba12147d +# Repo github.com/google/go-github at dae5b87 (2018-08-10) +ENV REV=dae5b8767170392dd51fafc89da6605faa51a1c2 RUN go get -d github.com/google/go-github/github &&\ (cd /go/src/github.com/google/go-github && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV) @@ -28,33 +28,33 @@ ENV REV=53e6ce116135b80d037921a7fdd5138cf32d7a8a RUN go get -d github.com/google/go-querystring/query &&\ (cd /go/src/github.com/google/go-querystring && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV) -# Repo github.com/gregjones/httpcache at 316c5e0 (2017-09-20) -ENV REV=316c5e0ff04e0ce21cfae9fbbb2ab39c7fc74e71 +# Repo github.com/gregjones/httpcache at 9cad4c3 (2018-03-06) +ENV REV=9cad4c3443a7200dd6400aef47183728de563a38 RUN go get -d github.com/gregjones/httpcache &&\ (cd /go/src/github.com/gregjones/httpcache && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV) -# Repo go4.org at 034d17a (2017-05-25) -ENV REV=034d17a462f7b2dcd1a4a73553ec5357ff6e6c6e -RUN go get -d go4.org/types &&\ +# Repo go4.org at 417644f (2018-08-09) +ENV REV=417644f6feb5ed3a356ca5d6d8e3a3fac7dfd33f +RUN go get -d go4.org/strutil `#and 2 other pkgs` &&\ (cd /go/src/go4.org && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV) -# Repo golang.org/x/net at 01c1902 (2017-11-02) -ENV REV=01c190206fbdffa42f334f4b2bf2220f50e64920 +# Repo golang.org/x/net at aaf6012 (2018-08-16) +ENV REV=aaf60122140d3fcf75376d319f0554393160eb50 RUN go get -d golang.org/x/net/context `#and 2 other pkgs` &&\ (cd /go/src/golang.org/x/net && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV) -# Repo golang.org/x/oauth2 at bb50c06 (2017-09-28) -ENV REV=bb50c06baba3d0c76f9d125c0719093e315b5b44 +# Repo golang.org/x/oauth2 at 3d292e4 (2018-07-24) +ENV REV=3d292e4d0cdc3a0113e6d207bb137145ef1de42f RUN go get -d golang.org/x/oauth2 `#and 2 other pkgs` &&\ (cd /go/src/golang.org/x/oauth2 && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV) -# Repo golang.org/x/sync at f52d181 (2017-05-17) -ENV REV=f52d1811a62927559de87708c8913c1650ce4f26 +# Repo golang.org/x/sync at 1d60e46 (2018-03-14) +ENV REV=1d60e4601c6fd243af51cc01ddf169918a5407ca RUN go get -d golang.org/x/sync/errgroup &&\ (cd /go/src/golang.org/x/sync && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV) -# Repo golang.org/x/time at 26559e0 (2018-03-14) -ENV REV=26559e0f760e39c24d730d3224364aef164ee23f +# Repo golang.org/x/time at fbb02b2 (2018-04-12) +ENV REV=fbb02b2291d28baffd63558aa44b4b56f178d650 RUN go get -d golang.org/x/time/rate &&\ (cd /go/src/golang.org/x/time && (git cat-file -t $REV 2>/dev/null || git fetch -q origin $REV) && git reset --hard $REV) @@ -68,6 +68,7 @@ RUN go install cloud.google.com/go/compute/metadata \ github.com/google/go-github/github \ github.com/google/go-querystring/query \ github.com/gregjones/httpcache \ + go4.org/strutil \ go4.org/types \ golang.org/x/net/context \ golang.org/x/net/context/ctxhttp \ diff --git a/cmd/gopherbot/gopherbot.go b/cmd/gopherbot/gopherbot.go index ae56698143..5b1100a1e3 100644 --- a/cmd/gopherbot/gopherbot.go +++ b/cmd/gopherbot/gopherbot.go @@ -635,7 +635,7 @@ func (b *gopherbot) freezeOldIssues(ctx context.Context) error { if *dryRun { return nil } - _, err := b.ghc.Issues.Lock(ctx, "golang", "go", int(gi.Number)) + _, err := b.ghc.Issues.Lock(ctx, "golang", "go", int(gi.Number), nil) if err != nil { return err } diff --git a/cmd/gopherstats/gopherstats.go b/cmd/gopherstats/gopherstats.go index c55ccb04a7..7c72b13c1b 100644 --- a/cmd/gopherstats/gopherstats.go +++ b/cmd/gopherstats/gopherstats.go @@ -257,7 +257,7 @@ func (sc *statsClient) githubGroups() { ps := new(personSet) teams[teamName] = ps - users, _, err := sc.ghc.Organizations.ListTeamMembers(ctx, t.GetID(), &github.OrganizationListTeamMembersOptions{ + users, _, err := sc.ghc.Teams.ListTeamMembers(ctx, t.GetID(), &github.TeamListTeamMembersOptions{ ListOptions: github.ListOptions{PerPage: 1000}, }) if err != nil {