Skip to content

Commit a3a95a0

Browse files
GiteaBotlunny
andauthored
Upgrade go-github v61 -> v71 (#34385) (#34387)
Backport #34385 by @lunny There will be a possible bug when migrating from Github google/go-github#3229 This PR upgrades go-github from v61 to v71 to resolve that problem. Co-authored-by: Lunny Xiao <[email protected]>
1 parent ed527b6 commit a3a95a0

File tree

6 files changed

+33
-23
lines changed

6 files changed

+33
-23
lines changed

assets/go-licenses.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/backport/backport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"strings"
1919
"syscall"
2020

21-
"github.com/google/go-github/v61/github"
21+
"github.com/google/go-github/v71/github"
2222
"github.com/urfave/cli/v2"
2323
"gopkg.in/yaml.v3"
2424
)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ require (
6666
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
6767
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
6868
github.com/golang-jwt/jwt/v5 v5.2.2
69-
github.com/google/go-github/v61 v61.0.0
69+
github.com/google/go-github/v71 v71.0.0
7070
github.com/google/licenseclassifier/v2 v2.0.0
7171
github.com/google/pprof v0.0.0-20250422154841-e1f9c1950416
7272
github.com/google/uuid v1.6.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
420420
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
421421
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
422422
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
423-
github.com/google/go-github/v61 v61.0.0 h1:VwQCBwhyE9JclCI+22/7mLB1PuU9eowCXKY5pNlu1go=
424-
github.com/google/go-github/v61 v61.0.0/go.mod h1:0WR+KmsWX75G2EbpyGsGmradjo3IiciuI4BmdVCobQY=
423+
github.com/google/go-github/v71 v71.0.0 h1:Zi16OymGKZZMm8ZliffVVJ/Q9YZreDKONCr+WUd0Z30=
424+
github.com/google/go-github/v71 v71.0.0/go.mod h1:URZXObp2BLlMjwu0O8g4y6VBneUj2bCHgnI8FfgZ51M=
425425
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
426426
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
427427
github.com/google/go-tpm v0.9.3 h1:+yx0/anQuGzi+ssRqeD6WpXjW2L/V0dItUayO0i9sRc=

services/migrations/error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package migrations
77
import (
88
"errors"
99

10-
"github.com/google/go-github/v61/github"
10+
"github.com/google/go-github/v71/github"
1111
)
1212

1313
// ErrRepoNotCreated returns the error that repository not created

services/migrations/github.go

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"code.gitea.io/gitea/modules/proxy"
2121
"code.gitea.io/gitea/modules/structs"
2222

23-
"github.com/google/go-github/v61/github"
23+
"github.com/google/go-github/v71/github"
2424
"golang.org/x/oauth2"
2525
)
2626

@@ -441,9 +441,11 @@ func (g *GithubDownloaderV3) GetIssues(ctx context.Context, page, perPage int) (
441441
if !g.SkipReactions {
442442
for i := 1; ; i++ {
443443
g.waitAndPickClient(ctx)
444-
res, resp, err := g.getClient().Reactions.ListIssueReactions(ctx, g.repoOwner, g.repoName, issue.GetNumber(), &github.ListOptions{
445-
Page: i,
446-
PerPage: perPage,
444+
res, resp, err := g.getClient().Reactions.ListIssueReactions(ctx, g.repoOwner, g.repoName, issue.GetNumber(), &github.ListReactionOptions{
445+
ListOptions: github.ListOptions{
446+
Page: i,
447+
PerPage: perPage,
448+
},
447449
})
448450
if err != nil {
449451
return nil, false, err
@@ -527,9 +529,11 @@ func (g *GithubDownloaderV3) getComments(ctx context.Context, commentable base.C
527529
if !g.SkipReactions {
528530
for i := 1; ; i++ {
529531
g.waitAndPickClient(ctx)
530-
res, resp, err := g.getClient().Reactions.ListIssueCommentReactions(ctx, g.repoOwner, g.repoName, comment.GetID(), &github.ListOptions{
531-
Page: i,
532-
PerPage: g.maxPerPage,
532+
res, resp, err := g.getClient().Reactions.ListIssueCommentReactions(ctx, g.repoOwner, g.repoName, comment.GetID(), &github.ListReactionOptions{
533+
ListOptions: github.ListOptions{
534+
Page: i,
535+
PerPage: g.maxPerPage,
536+
},
533537
})
534538
if err != nil {
535539
return nil, err
@@ -602,9 +606,11 @@ func (g *GithubDownloaderV3) GetAllComments(ctx context.Context, page, perPage i
602606
if !g.SkipReactions {
603607
for i := 1; ; i++ {
604608
g.waitAndPickClient(ctx)
605-
res, resp, err := g.getClient().Reactions.ListIssueCommentReactions(ctx, g.repoOwner, g.repoName, comment.GetID(), &github.ListOptions{
606-
Page: i,
607-
PerPage: g.maxPerPage,
609+
res, resp, err := g.getClient().Reactions.ListIssueCommentReactions(ctx, g.repoOwner, g.repoName, comment.GetID(), &github.ListReactionOptions{
610+
ListOptions: github.ListOptions{
611+
Page: i,
612+
PerPage: g.maxPerPage,
613+
},
608614
})
609615
if err != nil {
610616
return nil, false, err
@@ -673,9 +679,11 @@ func (g *GithubDownloaderV3) GetPullRequests(ctx context.Context, page, perPage
673679
if !g.SkipReactions {
674680
for i := 1; ; i++ {
675681
g.waitAndPickClient(ctx)
676-
res, resp, err := g.getClient().Reactions.ListIssueReactions(ctx, g.repoOwner, g.repoName, pr.GetNumber(), &github.ListOptions{
677-
Page: i,
678-
PerPage: perPage,
682+
res, resp, err := g.getClient().Reactions.ListIssueReactions(ctx, g.repoOwner, g.repoName, pr.GetNumber(), &github.ListReactionOptions{
683+
ListOptions: github.ListOptions{
684+
Page: i,
685+
PerPage: perPage,
686+
},
679687
})
680688
if err != nil {
681689
return nil, false, err
@@ -760,9 +768,11 @@ func (g *GithubDownloaderV3) convertGithubReviewComments(ctx context.Context, cs
760768
if !g.SkipReactions {
761769
for i := 1; ; i++ {
762770
g.waitAndPickClient(ctx)
763-
res, resp, err := g.getClient().Reactions.ListPullRequestCommentReactions(ctx, g.repoOwner, g.repoName, c.GetID(), &github.ListOptions{
764-
Page: i,
765-
PerPage: g.maxPerPage,
771+
res, resp, err := g.getClient().Reactions.ListPullRequestCommentReactions(ctx, g.repoOwner, g.repoName, c.GetID(), &github.ListReactionOptions{
772+
ListOptions: github.ListOptions{
773+
Page: i,
774+
PerPage: g.maxPerPage,
775+
},
766776
})
767777
if err != nil {
768778
return nil, err

0 commit comments

Comments
 (0)