From eda9969e1d8de2d4f6fdf5e32419d181b159aa32 Mon Sep 17 00:00:00 2001 From: harryzcy Date: Thu, 6 Apr 2023 04:21:16 -0400 Subject: [PATCH 1/4] Update github.com/google/go-github to v51 --- assets/go-licenses.json | 4 ++-- contrib/backport/backport.go | 2 +- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- services/migrations/error.go | 2 +- services/migrations/github.go | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/assets/go-licenses.json b/assets/go-licenses.json index 593d6af5c1168..eed9070d0d54f 100644 --- a/assets/go-licenses.json +++ b/assets/go-licenses.json @@ -500,8 +500,8 @@ "licenseText": "Copyright (c) 2011 The Snappy-Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" }, { - "name": "github.com/google/go-github/v45/github", - "path": "github.com/google/go-github/v45/github/LICENSE", + "name": "github.com/google/go-github/v51/github", + "path": "github.com/google/go-github/v51/github/LICENSE", "licenseText": "Copyright (c) 2013 The go-github AUTHORS. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" }, { diff --git a/contrib/backport/backport.go b/contrib/backport/backport.go index b63698e62eac0..aa665ac2e15f5 100644 --- a/contrib/backport/backport.go +++ b/contrib/backport/backport.go @@ -16,7 +16,7 @@ import ( "strings" "syscall" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v51/github" "github.com/urfave/cli" "gopkg.in/yaml.v3" ) diff --git a/go.mod b/go.mod index 1ee95b9f59063..0bbf566dc6634 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,7 @@ require ( github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85 github.com/golang-jwt/jwt/v4 v4.5.0 - github.com/google/go-github/v45 v45.2.0 + github.com/google/go-github/v51 v51.0.0 github.com/google/pprof v0.0.0-20230222194610-99052d3372e7 github.com/google/uuid v1.3.0 github.com/gorilla/feeds v1.1.1 @@ -104,11 +104,11 @@ require ( github.com/yuin/goldmark v1.5.4 github.com/yuin/goldmark-highlighting/v2 v2.0.0-20220924101305-151362477c87 github.com/yuin/goldmark-meta v1.1.0 - golang.org/x/crypto v0.6.0 - golang.org/x/net v0.7.0 - golang.org/x/oauth2 v0.5.0 + golang.org/x/crypto v0.7.0 + golang.org/x/net v0.8.0 + golang.org/x/oauth2 v0.6.0 golang.org/x/sys v0.6.0 - golang.org/x/text v0.7.0 + golang.org/x/text v0.8.0 golang.org/x/tools v0.6.0 google.golang.org/grpc v1.53.0 google.golang.org/protobuf v1.28.1 diff --git a/go.sum b/go.sum index 6bbbbf6eea086..968e7b16025b1 100644 --- a/go.sum +++ b/go.sum @@ -558,8 +558,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v45 v45.2.0 h1:5oRLszbrkvxDDqBCNj2hjDZMKmvexaZ1xw/FCD+K3FI= -github.com/google/go-github/v45 v45.2.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28= +github.com/google/go-github/v51 v51.0.0 h1:KCjsbgPV28VoRftdP+K2mQL16jniUsLAJknsOVKwHyU= +github.com/google/go-github/v51 v51.0.0/go.mod h1:kZj/rn/c1lSUbr/PFWl2hhusPV7a5XNYKcwPrd5L3Us= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/go-tpm v0.1.2-0.20190725015402-ae6dd98980d4/go.mod h1:H9HbmUG2YgV/PHITkO7p6wxEEj/v5nlsVWIwumwH2NI= @@ -1309,8 +1309,8 @@ golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1406,8 +1406,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20220906165146-f3363e06e74c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1419,8 +1419,8 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s= -golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1541,8 +1541,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/services/migrations/error.go b/services/migrations/error.go index 46d303ac8ee8c..5f0388a497765 100644 --- a/services/migrations/error.go +++ b/services/migrations/error.go @@ -7,7 +7,7 @@ package migrations import ( "errors" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v51/github" ) // ErrRepoNotCreated returns the error that repository not created diff --git a/services/migrations/github.go b/services/migrations/github.go index d34ad13b95a71..ff1e0adf6b8e5 100644 --- a/services/migrations/github.go +++ b/services/migrations/github.go @@ -21,7 +21,7 @@ import ( "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/util" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v51/github" "golang.org/x/oauth2" ) From a87da7a25f3ac6313a2d1d4822cec946119ee92a Mon Sep 17 00:00:00 2001 From: harryzcy Date: Thu, 6 Apr 2023 05:13:04 -0400 Subject: [PATCH 2/4] Fix CI --- services/migrations/github.go | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/services/migrations/github.go b/services/migrations/github.go index ff1e0adf6b8e5..264938d15c88a 100644 --- a/services/migrations/github.go +++ b/services/migrations/github.go @@ -259,11 +259,11 @@ func (g *GithubDownloaderV3) GetMilestones() ([]*base.Milestone, error) { milestones = append(milestones, &base.Milestone{ Title: m.GetTitle(), Description: m.GetDescription(), - Deadline: m.DueOn, + Deadline: &m.DueOn.Time, State: state, - Created: m.GetCreatedAt(), - Updated: m.UpdatedAt, - Closed: m.ClosedAt, + Created: m.GetCreatedAt().Time, + Updated: &m.UpdatedAt.Time, + Closed: &m.ClosedAt.Time, }) } if len(ms) < perPage { @@ -486,11 +486,11 @@ func (g *GithubDownloaderV3) GetIssues(page, perPage int) ([]*base.Issue, bool, Content: issue.GetBody(), Milestone: issue.GetMilestone().GetTitle(), State: issue.GetState(), - Created: issue.GetCreatedAt(), - Updated: issue.GetUpdatedAt(), + Created: issue.GetCreatedAt().Time, + Updated: issue.GetUpdatedAt().Time, Labels: labels, Reactions: reactions, - Closed: issue.ClosedAt, + Closed: &issue.ClosedAt.Time, IsLocked: issue.GetLocked(), Assignees: assignees, ForeignIndex: int64(*issue.Number), @@ -565,8 +565,8 @@ func (g *GithubDownloaderV3) getComments(commentable base.Commentable) ([]*base. PosterName: comment.GetUser().GetLogin(), PosterEmail: comment.GetUser().GetEmail(), Content: comment.GetBody(), - Created: comment.GetCreatedAt(), - Updated: comment.GetUpdatedAt(), + Created: comment.GetCreatedAt().Time, + Updated: comment.GetUpdatedAt().Time, Reactions: reactions, }) } @@ -641,8 +641,8 @@ func (g *GithubDownloaderV3) GetAllComments(page, perPage int) ([]*base.Comment, PosterName: comment.GetUser().GetLogin(), PosterEmail: comment.GetUser().GetEmail(), Content: comment.GetBody(), - Created: comment.GetCreatedAt(), - Updated: comment.GetUpdatedAt(), + Created: comment.GetCreatedAt().Time, + Updated: comment.GetUpdatedAt().Time, Reactions: reactions, }) } @@ -716,13 +716,13 @@ func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullReq Content: pr.GetBody(), Milestone: pr.GetMilestone().GetTitle(), State: pr.GetState(), - Created: pr.GetCreatedAt(), - Updated: pr.GetUpdatedAt(), - Closed: pr.ClosedAt, + Created: pr.GetCreatedAt().Time, + Updated: pr.GetUpdatedAt().Time, + Closed: &pr.ClosedAt.Time, Labels: labels, Merged: pr.MergedAt != nil, MergeCommitSHA: pr.GetMergeCommitSHA(), - MergedTime: pr.MergedAt, + MergedTime: &pr.MergedAt.Time, IsLocked: pr.ActiveLockReason != nil, Head: base.PullRequestBranch{ Ref: pr.GetHead().GetRef(), @@ -756,7 +756,7 @@ func convertGithubReview(r *github.PullRequestReview) *base.Review { ReviewerName: r.GetUser().GetLogin(), CommitID: r.GetCommitID(), Content: r.GetBody(), - CreatedAt: r.GetSubmittedAt(), + CreatedAt: r.GetSubmittedAt().Time, State: r.GetState(), } } @@ -800,8 +800,8 @@ func (g *GithubDownloaderV3) convertGithubReviewComments(cs []*github.PullReques CommitID: c.GetCommitID(), PosterID: c.GetUser().GetID(), Reactions: reactions, - CreatedAt: c.GetCreatedAt(), - UpdatedAt: c.GetUpdatedAt(), + CreatedAt: c.GetCreatedAt().Time, + UpdatedAt: c.GetUpdatedAt().Time, }) } return rcs, nil From c8148d98e6d91f32e20c4f4032774d4546cd744a Mon Sep 17 00:00:00 2001 From: harryzcy Date: Sat, 8 Apr 2023 01:05:11 -0400 Subject: [PATCH 3/4] Fix nil pointer dereference panic --- services/migrations/github.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/services/migrations/github.go b/services/migrations/github.go index 264938d15c88a..2c59249b4fba7 100644 --- a/services/migrations/github.go +++ b/services/migrations/github.go @@ -259,11 +259,11 @@ func (g *GithubDownloaderV3) GetMilestones() ([]*base.Milestone, error) { milestones = append(milestones, &base.Milestone{ Title: m.GetTitle(), Description: m.GetDescription(), - Deadline: &m.DueOn.Time, + Deadline: convertGithubTimeToTime(m.DueOn), State: state, Created: m.GetCreatedAt().Time, - Updated: &m.UpdatedAt.Time, - Closed: &m.ClosedAt.Time, + Updated: convertGithubTimeToTime(m.UpdatedAt), + Closed: convertGithubTimeToTime(m.ClosedAt), }) } if len(ms) < perPage { @@ -718,11 +718,11 @@ func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullReq State: pr.GetState(), Created: pr.GetCreatedAt().Time, Updated: pr.GetUpdatedAt().Time, - Closed: &pr.ClosedAt.Time, + Closed: convertGithubTimeToTime(pr.ClosedAt), Labels: labels, Merged: pr.MergedAt != nil, MergeCommitSHA: pr.GetMergeCommitSHA(), - MergedTime: &pr.MergedAt.Time, + MergedTime: convertGithubTimeToTime(pr.MergedAt), IsLocked: pr.ActiveLockReason != nil, Head: base.PullRequestBranch{ Ref: pr.GetHead().GetRef(), @@ -881,3 +881,10 @@ func (g *GithubDownloaderV3) GetReviews(reviewable base.Reviewable) ([]*base.Rev } return allReviews, nil } + +func convertGithubTimeToTime(t *github.Timestamp) *time.Time { + if t == nil { + return nil + } + return &t.Time +} From 92130c1b8d334404710bff1aeccd36cecd1c2551 Mon Sep 17 00:00:00 2001 From: harryzcy Date: Sat, 8 Apr 2023 01:12:51 -0400 Subject: [PATCH 4/4] Update helper function name --- services/migrations/github.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/migrations/github.go b/services/migrations/github.go index 2c59249b4fba7..26e8813536cad 100644 --- a/services/migrations/github.go +++ b/services/migrations/github.go @@ -259,11 +259,11 @@ func (g *GithubDownloaderV3) GetMilestones() ([]*base.Milestone, error) { milestones = append(milestones, &base.Milestone{ Title: m.GetTitle(), Description: m.GetDescription(), - Deadline: convertGithubTimeToTime(m.DueOn), + Deadline: convertGithubTimestampToTime(m.DueOn), State: state, Created: m.GetCreatedAt().Time, - Updated: convertGithubTimeToTime(m.UpdatedAt), - Closed: convertGithubTimeToTime(m.ClosedAt), + Updated: convertGithubTimestampToTime(m.UpdatedAt), + Closed: convertGithubTimestampToTime(m.ClosedAt), }) } if len(ms) < perPage { @@ -718,11 +718,11 @@ func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullReq State: pr.GetState(), Created: pr.GetCreatedAt().Time, Updated: pr.GetUpdatedAt().Time, - Closed: convertGithubTimeToTime(pr.ClosedAt), + Closed: convertGithubTimestampToTime(pr.ClosedAt), Labels: labels, Merged: pr.MergedAt != nil, MergeCommitSHA: pr.GetMergeCommitSHA(), - MergedTime: convertGithubTimeToTime(pr.MergedAt), + MergedTime: convertGithubTimestampToTime(pr.MergedAt), IsLocked: pr.ActiveLockReason != nil, Head: base.PullRequestBranch{ Ref: pr.GetHead().GetRef(), @@ -882,7 +882,7 @@ func (g *GithubDownloaderV3) GetReviews(reviewable base.Reviewable) ([]*base.Rev return allReviews, nil } -func convertGithubTimeToTime(t *github.Timestamp) *time.Time { +func convertGithubTimestampToTime(t *github.Timestamp) *time.Time { if t == nil { return nil }