Skip to content

Commit e67b004

Browse files
authored
upgrade github v61 -> v71 to fix migrating bug (#34389)
backport #34385
1 parent a4cc867 commit e67b004

File tree

6 files changed

+35
-24
lines changed

6 files changed

+35
-24
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
@@ -17,7 +17,7 @@ import (
1717
"strings"
1818
"syscall"
1919

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

go.mod

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

go.sum

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,11 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
410410
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
411411
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
412412
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
413-
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
414413
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
415-
github.com/google/go-github/v61 v61.0.0 h1:VwQCBwhyE9JclCI+22/7mLB1PuU9eowCXKY5pNlu1go=
416-
github.com/google/go-github/v61 v61.0.0/go.mod h1:0WR+KmsWX75G2EbpyGsGmradjo3IiciuI4BmdVCobQY=
414+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
415+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
416+
github.com/google/go-github/v71 v71.0.0 h1:Zi16OymGKZZMm8ZliffVVJ/Q9YZreDKONCr+WUd0Z30=
417+
github.com/google/go-github/v71 v71.0.0/go.mod h1:URZXObp2BLlMjwu0O8g4y6VBneUj2bCHgnI8FfgZ51M=
417418
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
418419
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
419420
github.com/google/go-tpm v0.9.1 h1:0pGc4X//bAlmZzMKf8iz6IsDo1nYTbYJ6FZN/rg4zdM=

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

@@ -448,9 +448,11 @@ func (g *GithubDownloaderV3) GetIssues(page, perPage int) ([]*base.Issue, bool,
448448
if !g.SkipReactions {
449449
for i := 1; ; i++ {
450450
g.waitAndPickClient()
451-
res, resp, err := g.getClient().Reactions.ListIssueReactions(g.ctx, g.repoOwner, g.repoName, issue.GetNumber(), &github.ListOptions{
452-
Page: i,
453-
PerPage: perPage,
451+
res, resp, err := g.getClient().Reactions.ListIssueReactions(g.ctx, g.repoOwner, g.repoName, issue.GetNumber(), &github.ListReactionOptions{
452+
ListOptions: github.ListOptions{
453+
Page: i,
454+
PerPage: perPage,
455+
},
454456
})
455457
if err != nil {
456458
return nil, false, err
@@ -534,9 +536,11 @@ func (g *GithubDownloaderV3) getComments(commentable base.Commentable) ([]*base.
534536
if !g.SkipReactions {
535537
for i := 1; ; i++ {
536538
g.waitAndPickClient()
537-
res, resp, err := g.getClient().Reactions.ListIssueCommentReactions(g.ctx, g.repoOwner, g.repoName, comment.GetID(), &github.ListOptions{
538-
Page: i,
539-
PerPage: g.maxPerPage,
539+
res, resp, err := g.getClient().Reactions.ListIssueCommentReactions(g.ctx, g.repoOwner, g.repoName, comment.GetID(), &github.ListReactionOptions{
540+
ListOptions: github.ListOptions{
541+
Page: i,
542+
PerPage: g.maxPerPage,
543+
},
540544
})
541545
if err != nil {
542546
return nil, err
@@ -609,9 +613,11 @@ func (g *GithubDownloaderV3) GetAllComments(page, perPage int) ([]*base.Comment,
609613
if !g.SkipReactions {
610614
for i := 1; ; i++ {
611615
g.waitAndPickClient()
612-
res, resp, err := g.getClient().Reactions.ListIssueCommentReactions(g.ctx, g.repoOwner, g.repoName, comment.GetID(), &github.ListOptions{
613-
Page: i,
614-
PerPage: g.maxPerPage,
616+
res, resp, err := g.getClient().Reactions.ListIssueCommentReactions(g.ctx, g.repoOwner, g.repoName, comment.GetID(), &github.ListReactionOptions{
617+
ListOptions: github.ListOptions{
618+
Page: i,
619+
PerPage: g.maxPerPage,
620+
},
615621
})
616622
if err != nil {
617623
return nil, false, err
@@ -680,9 +686,11 @@ func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullReq
680686
if !g.SkipReactions {
681687
for i := 1; ; i++ {
682688
g.waitAndPickClient()
683-
res, resp, err := g.getClient().Reactions.ListIssueReactions(g.ctx, g.repoOwner, g.repoName, pr.GetNumber(), &github.ListOptions{
684-
Page: i,
685-
PerPage: perPage,
689+
res, resp, err := g.getClient().Reactions.ListIssueReactions(g.ctx, g.repoOwner, g.repoName, pr.GetNumber(), &github.ListReactionOptions{
690+
ListOptions: github.ListOptions{
691+
Page: i,
692+
PerPage: perPage,
693+
},
686694
})
687695
if err != nil {
688696
return nil, false, err
@@ -767,9 +775,11 @@ func (g *GithubDownloaderV3) convertGithubReviewComments(cs []*github.PullReques
767775
if !g.SkipReactions {
768776
for i := 1; ; i++ {
769777
g.waitAndPickClient()
770-
res, resp, err := g.getClient().Reactions.ListPullRequestCommentReactions(g.ctx, g.repoOwner, g.repoName, c.GetID(), &github.ListOptions{
771-
Page: i,
772-
PerPage: g.maxPerPage,
778+
res, resp, err := g.getClient().Reactions.ListPullRequestCommentReactions(g.ctx, g.repoOwner, g.repoName, c.GetID(), &github.ListReactionOptions{
779+
ListOptions: github.ListOptions{
780+
Page: i,
781+
PerPage: g.maxPerPage,
782+
},
773783
})
774784
if err != nil {
775785
return nil, err

0 commit comments

Comments
 (0)