Skip to content

Commit faf0b59

Browse files
dmitshurgopherbot
authored andcommitted
all: upgrade go-github v17.0.0+incompatible to v48.1.0
Upgrade a few remaining uses of the very old v17.0.0+incompatible major version of go-github to the newer v48.1.0 that's already used elsewhere. Change-Id: I79316b1b32574b11e87828ae9ac1a8ab952154f2 Reviewed-on: https://go-review.googlesource.com/c/build/+/591735 Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]>
1 parent ab83534 commit faf0b59

File tree

11 files changed

+17
-19
lines changed

11 files changed

+17
-19
lines changed

cmd/coordinator/status.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"sync/atomic"
2929
"time"
3030

31-
"github.com/google/go-github/github"
31+
"github.com/google/go-github/v48/github"
3232
"go.opencensus.io/stats"
3333
"golang.org/x/build/dashboard"
3434
"golang.org/x/build/internal/coordinator/pool"

cmd/gerritbot/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ WORKDIR /go/src/golang.org/x/build
2121
# Optimization for iterative docker build speed, not necessary for correctness:
2222
# TODO: write a tool to make writing Go module-friendly Dockerfiles easier.
2323
RUN go install cloud.google.com/go/compute/metadata
24-
RUN go install github.com/google/go-github/github
24+
RUN go install github.com/google/go-github/v48/github
2525
RUN go install golang.org/x/oauth2
2626
COPY autocertcache /go/src/golang.org/x/build/autocertcache
2727
COPY gerrit /go/src/golang.org/x/build/gerrit

cmd/relui/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
cloudbuild "cloud.google.com/go/cloudbuild/apiv1/v2"
2626
"cloud.google.com/go/compute/metadata"
2727
"cloud.google.com/go/storage"
28-
"github.com/google/go-github/github"
28+
"github.com/google/go-github/v48/github"
2929
"github.com/jackc/pgx/v4/pgxpool"
3030
"github.com/shurcooL/githubv4"
3131
"go.chromium.org/luci/auth"

go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ require (
3030
github.com/golang-migrate/migrate/v4 v4.15.0-beta.3
3131
github.com/golang/protobuf v1.5.3
3232
github.com/google/go-cmp v0.6.0
33-
github.com/google/go-github v17.0.0+incompatible
3433
github.com/google/go-github/v48 v48.1.0
3534
github.com/google/safehtml v0.0.3-0.20220430015336-00016cfeca15
3635
github.com/google/uuid v1.3.1

go.sum

-2
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,6 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
411411
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
412412
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
413413
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
414-
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
415-
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
416414
github.com/google/go-github/v35 v35.2.0/go.mod h1:s0515YVTI+IMrDoy9Y4pHt9ShGpzHvHO8rZ7L7acgvs=
417415
github.com/google/go-github/v48 v48.1.0 h1:nqPqq+0oRY2AMR/SRskGrrP4nnewPB7e/m2+kbT/UvM=
418416
github.com/google/go-github/v48 v48.1.0/go.mod h1:dDlehKBDo850ZPvCTK0sEqTCVWcrGl2LcDiajkYi89Y=

internal/relui/buildrelease_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727

2828
"github.com/google/go-cmp/cmp"
2929
"github.com/google/go-cmp/cmp/cmpopts"
30-
"github.com/google/go-github/github"
30+
"github.com/google/go-github/v48/github"
3131
"github.com/google/uuid"
3232
"github.com/shurcooL/githubv4"
3333
"golang.org/x/build/gerrit"

internal/task/milestones.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"strings"
1212
"time"
1313

14-
"github.com/google/go-github/github"
14+
"github.com/google/go-github/v48/github"
1515
"github.com/shurcooL/githubv4"
1616
wf "golang.org/x/build/internal/workflow"
1717
goversion "golang.org/x/build/maintner/maintnerd/maintapi/version"

internal/task/milestones_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"strings"
1313
"testing"
1414

15-
"github.com/google/go-github/github"
15+
"github.com/google/go-github/v48/github"
1616
"github.com/shurcooL/githubv4"
1717
"golang.org/x/build/internal/workflow"
1818
"golang.org/x/oauth2"

maintner/github.go

+9-7
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ import (
2323

2424
"github.com/golang/protobuf/ptypes"
2525
"github.com/golang/protobuf/ptypes/timestamp"
26-
"github.com/google/go-github/github"
26+
"github.com/google/go-github/v48/github"
2727
"github.com/gregjones/httpcache"
28-
2928
"golang.org/x/build/maintner/maintpb"
3029
"golang.org/x/oauth2"
3130
"golang.org/x/sync/errgroup"
@@ -1923,12 +1922,15 @@ func (p *githubRepoPoller) syncCommentsOnIssue(ctx context.Context, issueNum int
19231922
owner, repo := p.gr.id.Owner, p.gr.id.Repo
19241923
morePages := true // at least try the first. might be empty.
19251924
for morePages {
1926-
ics, res, err := p.githubDirect.Issues.ListComments(ctx, owner, repo, int(issueNum), &github.IssueListCommentsOptions{
1927-
Since: since,
1928-
Direction: "asc",
1929-
Sort: "updated",
1925+
opt := &github.IssueListCommentsOptions{
1926+
Direction: github.String("asc"),
1927+
Sort: github.String("updated"),
19301928
ListOptions: github.ListOptions{PerPage: 100},
1931-
})
1929+
}
1930+
if !since.IsZero() {
1931+
opt.Since = &since
1932+
}
1933+
ics, res, err := p.githubDirect.Issues.ListComments(ctx, owner, repo, int(issueNum), opt)
19321934
if canRetry(ctx, err) {
19331935
continue
19341936
} else if ge, ok := err.(*github.ErrorResponse); ok && (ge.Response.StatusCode == http.StatusNotFound || ge.Response.StatusCode == http.StatusGone) {

maintner/github_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import (
2121

2222
"github.com/golang/protobuf/ptypes"
2323
"github.com/golang/protobuf/ptypes/timestamp"
24-
"github.com/google/go-github/github"
25-
24+
"github.com/google/go-github/v48/github"
2625
"golang.org/x/build/maintner/maintpb"
2726
)
2827

maintner/maintner_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/davecgh/go-spew/spew"
1717
"github.com/golang/protobuf/ptypes"
1818
google_protobuf "github.com/golang/protobuf/ptypes/timestamp"
19-
"github.com/google/go-github/github"
19+
"github.com/google/go-github/v48/github"
2020
"golang.org/x/build/maintner/maintpb"
2121
)
2222

0 commit comments

Comments
 (0)