Skip to content

Commit 04ce999

Browse files
authored
update dependencies (#26)
1 parent 9bbec38 commit 04ce999

10 files changed

Lines changed: 144 additions & 504 deletions

File tree

go.mod

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,38 @@ module github.com/hirosassa/tfcmt-gitlab
33
go 1.25
44

55
require (
6-
github.com/Masterminds/sprig/v3 v3.2.2
6+
github.com/Masterminds/sprig/v3 v3.3.0
77
github.com/drone/envsubst v1.0.3
8-
github.com/google/go-cmp v0.5.7
9-
github.com/mattn/go-colorable v0.1.12
10-
github.com/sirupsen/logrus v1.8.1
11-
github.com/suzuki-shunsuke/go-findconfig v1.1.0
12-
github.com/urfave/cli/v2 v2.4.0
13-
github.com/xanzy/go-gitlab v0.64.0
14-
go.uber.org/mock v0.4.0
8+
github.com/google/go-cmp v0.7.0
9+
github.com/mattn/go-colorable v0.1.13
10+
github.com/sirupsen/logrus v1.9.4
11+
github.com/suzuki-shunsuke/go-findconfig v1.2.0
12+
github.com/urfave/cli/v2 v2.27.7
13+
gitlab.com/gitlab-org/api/client-go v1.41.0
14+
go.uber.org/mock v0.6.0
1515
gopkg.in/yaml.v2 v2.4.0
1616
)
1717

1818
require (
19+
dario.cat/mergo v1.0.1 // indirect
1920
github.com/Masterminds/goutils v1.1.1 // indirect
20-
github.com/Masterminds/semver/v3 v3.1.1 // indirect
21-
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
22-
github.com/golang/protobuf v1.4.2 // indirect
23-
github.com/google/go-querystring v1.1.0 // indirect
24-
github.com/google/uuid v1.1.3 // indirect
25-
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
26-
github.com/hashicorp/go-retryablehttp v0.6.8 // indirect
27-
github.com/huandu/xstrings v1.3.2 // indirect
28-
github.com/imdario/mergo v0.3.11 // indirect
29-
github.com/kr/pretty v0.2.0 // indirect
30-
github.com/mattn/go-isatty v0.0.14 // indirect
31-
github.com/mitchellh/copystructure v1.0.0 // indirect
32-
github.com/mitchellh/reflectwalk v1.0.0 // indirect
21+
github.com/Masterminds/semver/v3 v3.3.0 // indirect
22+
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
23+
github.com/google/go-querystring v1.2.0 // indirect
24+
github.com/google/uuid v1.6.0 // indirect
25+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
26+
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
27+
github.com/huandu/xstrings v1.5.0 // indirect
28+
github.com/mattn/go-isatty v0.0.20 // indirect
29+
github.com/mitchellh/copystructure v1.2.0 // indirect
30+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
3331
github.com/russross/blackfriday/v2 v2.1.0 // indirect
34-
github.com/shopspring/decimal v1.2.0 // indirect
35-
github.com/spf13/cast v1.3.1 // indirect
36-
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
37-
golang.org/x/net v0.1.0 // indirect
38-
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
39-
golang.org/x/sys v0.1.0 // indirect
40-
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
41-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
42-
google.golang.org/appengine v1.6.7 // indirect
43-
google.golang.org/protobuf v1.25.0 // indirect
32+
github.com/shopspring/decimal v1.4.0 // indirect
33+
github.com/spf13/cast v1.7.0 // indirect
34+
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
35+
golang.org/x/crypto v0.26.0 // indirect
36+
golang.org/x/oauth2 v0.34.0 // indirect
37+
golang.org/x/sys v0.39.0 // indirect
38+
golang.org/x/time v0.14.0 // indirect
4439
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
4540
)

go.sum

Lines changed: 74 additions & 429 deletions
Large diffs are not rendered by default.

pkg/notifier/gitlab/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"strings"
77

88
"github.com/hirosassa/tfcmt-gitlab/pkg/terraform"
9-
gitlab "github.com/xanzy/go-gitlab"
9+
gitlab "gitlab.com/gitlab-org/api/client-go"
1010
)
1111

1212
// EnvToken is GitLab API Token

pkg/notifier/gitlab/comment.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55

66
"github.com/sirupsen/logrus"
7-
gitlab "github.com/xanzy/go-gitlab"
7+
gitlab "gitlab.com/gitlab-org/api/client-go"
88
)
99

1010
const (
@@ -40,15 +40,15 @@ func (g *CommentService) Post(body string, opt PostOptions) error {
4040

4141
_, _, err := g.client.API.CreateMergeRequestNote(
4242
opt.Number,
43-
&gitlab.CreateMergeRequestNoteOptions{Body: gitlab.String(body)},
43+
&gitlab.CreateMergeRequestNoteOptions{Body: gitlab.Ptr(body)},
4444
)
4545
return err
4646
}
4747

4848
func (g *CommentService) postForRevision(body, revision string) error {
4949
_, _, err := g.client.API.PostCommitComment(
5050
revision,
51-
&gitlab.PostCommitCommentOptions{Note: gitlab.String(body)},
51+
&gitlab.PostCommitCommentOptions{Note: gitlab.Ptr(body)},
5252
)
5353
return err
5454
}
@@ -58,7 +58,7 @@ func (g *CommentService) Patch(note int, body string, opt PostOptions) error {
5858
_, _, err := g.client.API.UpdateMergeRequestNote(
5959
opt.Number,
6060
note,
61-
&gitlab.UpdateMergeRequestNoteOptions{Body: gitlab.String(body)},
61+
&gitlab.UpdateMergeRequestNoteOptions{Body: gitlab.Ptr(body)},
6262
)
6363
return err
6464
}

pkg/notifier/gitlab/comment_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"testing"
77

88
gitlabmock "github.com/hirosassa/tfcmt-gitlab/pkg/notifier/gitlab/gen"
9-
gitlab "github.com/xanzy/go-gitlab"
9+
gitlab "gitlab.com/gitlab-org/api/client-go"
1010
"go.uber.org/mock/gomock"
1111
)
1212

@@ -26,7 +26,7 @@ func TestCommentPost(t *testing.T) {
2626
config: newFakeConfig(),
2727
createMockGitLabAPI: func(ctrl *gomock.Controller) *gitlabmock.MockAPI {
2828
api := gitlabmock.NewMockAPI(ctrl)
29-
api.EXPECT().CreateMergeRequestNote(1, &gitlab.CreateMergeRequestNoteOptions{Body: gitlab.String(body)}).Return(&gitlab.Note{}, nil, nil)
29+
api.EXPECT().CreateMergeRequestNote(1, &gitlab.CreateMergeRequestNoteOptions{Body: gitlab.Ptr(body)}).Return(&gitlab.Note{}, nil, nil)
3030
return api
3131
},
3232
body: body,
@@ -42,8 +42,8 @@ func TestCommentPost(t *testing.T) {
4242
createMockGitLabAPI: func(ctrl *gomock.Controller) *gitlabmock.MockAPI {
4343
api := gitlabmock.NewMockAPI(ctrl)
4444
mriid := 1
45-
api.EXPECT().ListMergeRequestsByCommit("abcd").Return([]*gitlab.MergeRequest{{IID: mriid}}, nil, nil)
46-
api.EXPECT().CreateMergeRequestNote(mriid, &gitlab.CreateMergeRequestNoteOptions{Body: gitlab.String(body)}).Return(&gitlab.Note{}, nil, nil)
45+
api.EXPECT().ListMergeRequestsByCommit("abcd").Return([]*gitlab.BasicMergeRequest{{IID: int64(mriid)}}, nil, nil)
46+
api.EXPECT().CreateMergeRequestNote(mriid, &gitlab.CreateMergeRequestNoteOptions{Body: gitlab.Ptr(body)}).Return(&gitlab.Note{}, nil, nil)
4747
return api
4848
},
4949
body: body,
@@ -58,7 +58,7 @@ func TestCommentPost(t *testing.T) {
5858
config: newFakeConfig(),
5959
createMockGitLabAPI: func(ctrl *gomock.Controller) *gitlabmock.MockAPI {
6060
api := gitlabmock.NewMockAPI(ctrl)
61-
api.EXPECT().CreateMergeRequestNote(2, &gitlab.CreateMergeRequestNoteOptions{Body: gitlab.String(body)}).Return(&gitlab.Note{}, nil, nil)
61+
api.EXPECT().CreateMergeRequestNote(2, &gitlab.CreateMergeRequestNoteOptions{Body: gitlab.Ptr(body)}).Return(&gitlab.Note{}, nil, nil)
6262
return api
6363
},
6464
body: body,
@@ -89,7 +89,7 @@ func TestCommentPost(t *testing.T) {
8989
api := gitlabmock.NewMockAPI(ctrl)
9090
api.EXPECT().ListMergeRequestsByCommit("revision").Return(nil, nil, errors.New("error"))
9191
// PostCommitComment should be called
92-
api.EXPECT().PostCommitComment("revision", &gitlab.PostCommitCommentOptions{Note: gitlab.String(body)}).Return(&gitlab.CommitComment{}, nil, nil)
92+
api.EXPECT().PostCommitComment("revision", &gitlab.PostCommitCommentOptions{Note: gitlab.Ptr(body)}).Return(&gitlab.CommitComment{}, nil, nil)
9393
return api
9494
},
9595
body: body,

pkg/notifier/gitlab/commits.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func (g *CommitsService) ListMergeRequestIIDsByRevision(revision string) ([]int,
1919

2020
result := make([]int, len(mrs))
2121
for i, mr := range mrs {
22-
result[i] = mr.IID
22+
result[i] = int(mr.IID)
2323
}
2424
return result, nil
2525
}

pkg/notifier/gitlab/gen/gitlab.go

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

pkg/notifier/gitlab/gitlab.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package gitlab
33
import (
44
"fmt"
55

6-
gitlab "github.com/xanzy/go-gitlab"
6+
gitlab "gitlab.com/gitlab-org/api/client-go"
77
)
88

99
// API is GitLab API interface
@@ -20,7 +20,7 @@ type API interface {
2020
GetLabel(labelName string, options ...gitlab.RequestOptionFunc) (*gitlab.Label, *gitlab.Response, error)
2121
UpdateLabel(opt *gitlab.UpdateLabelOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Label, *gitlab.Response, error)
2222
GetCommit(sha string, options ...gitlab.RequestOptionFunc) (*gitlab.Commit, *gitlab.Response, error)
23-
ListMergeRequestsByCommit(sha string, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequest, *gitlab.Response, error)
23+
ListMergeRequestsByCommit(sha string, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error)
2424
}
2525

2626
// GitLab represents the attribute information necessary for requesting GitLab API
@@ -29,44 +29,44 @@ type GitLab struct {
2929
namespace, project string
3030
}
3131

32-
// CreateMergeRequestNote is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#NotesService.CreateMergeRequestNote
32+
// CreateMergeRequestNote is a wrapper of NotesService.CreateMergeRequestNote
3333
func (g *GitLab) CreateMergeRequestNote(mergeRequest int, opt *gitlab.CreateMergeRequestNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) {
34-
return g.Notes.CreateMergeRequestNote(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, opt, options...)
34+
return g.Notes.CreateMergeRequestNote(fmt.Sprintf("%s/%s", g.namespace, g.project), int64(mergeRequest), opt, options...)
3535
}
3636

37-
// UpdateMergeRequestNote is a wrapper of https://pkg.go.dev/github.com/xanzy/go-gitlab#NotesService.UpdateMergeRequestNote
37+
// UpdateMergeRequestNote is a wrapper of NotesService.UpdateMergeRequestNote
3838
func (g *GitLab) UpdateMergeRequestNote(mergeRequest, note int, opt *gitlab.UpdateMergeRequestNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) {
39-
return g.Notes.UpdateMergeRequestNote(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, note, opt, options...)
39+
return g.Notes.UpdateMergeRequestNote(fmt.Sprintf("%s/%s", g.namespace, g.project), int64(mergeRequest), int64(note), opt, options...)
4040
}
4141

42-
// ListMergeRequestNotes is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#NotesService.ListMergeRequestNotes
42+
// ListMergeRequestNotes is a wrapper of NotesService.ListMergeRequestNotes
4343
func (g *GitLab) ListMergeRequestNotes(mergeRequest int, opt *gitlab.ListMergeRequestNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error) {
44-
return g.Notes.ListMergeRequestNotes(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, opt, options...)
44+
return g.Notes.ListMergeRequestNotes(fmt.Sprintf("%s/%s", g.namespace, g.project), int64(mergeRequest), opt, options...)
4545
}
4646

47-
// GetMergerRequest is a wrapper of https://pkg.go.dev/github.com/xanzy/go-gitlab#MergeRequestsService.GetMergeRequest
47+
// GetMergeRequest is a wrapper of MergeRequestsService.GetMergeRequest
4848
func (g *GitLab) GetMergeRequest(mergeRequest int, opt *gitlab.GetMergeRequestsOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) {
49-
return g.MergeRequests.GetMergeRequest(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, opt, options...)
49+
return g.MergeRequests.GetMergeRequest(fmt.Sprintf("%s/%s", g.namespace, g.project), int64(mergeRequest), opt, options...)
5050
}
5151

52-
// UpdateMergerRequest is a wrapper of https://pkg.go.dev/github.com/xanzy/go-gitlab#MergeRequestsService.UpdateMergeRequest
52+
// UpdateMergeRequest is a wrapper of MergeRequestsService.UpdateMergeRequest
5353
func (g *GitLab) UpdateMergeRequest(mergeRequest int, opt *gitlab.UpdateMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) {
54-
return g.MergeRequests.UpdateMergeRequest(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, opt, options...)
54+
return g.MergeRequests.UpdateMergeRequest(fmt.Sprintf("%s/%s", g.namespace, g.project), int64(mergeRequest), opt, options...)
5555
}
5656

57-
// PostCommitComment is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#CommitsService.PostCommitComment
57+
// PostCommitComment is a wrapper of CommitsService.PostCommitComment
5858
func (g *GitLab) PostCommitComment(sha string, opt *gitlab.PostCommitCommentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.CommitComment, *gitlab.Response, error) {
5959
return g.Commits.PostCommitComment(fmt.Sprintf("%s/%s", g.namespace, g.project), sha, opt, options...)
6060
}
6161

6262
// AddMergeRequestLabels adds labels on the merge request.
6363
func (g *GitLab) AddMergeRequestLabels(labels *[]string, mergeRequest int) (gitlab.Labels, error) {
64-
var addLabels gitlab.Labels
64+
var addLabels gitlab.LabelOptions
6565
for _, label := range *labels {
6666
addLabels = append(addLabels, label)
6767
}
6868

69-
updatedMergeRequest, _, err := g.MergeRequests.UpdateMergeRequest(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, &gitlab.UpdateMergeRequestOptions{AddLabels: &addLabels})
69+
updatedMergeRequest, _, err := g.MergeRequests.UpdateMergeRequest(fmt.Sprintf("%s/%s", g.namespace, g.project), int64(mergeRequest), &gitlab.UpdateMergeRequestOptions{AddLabels: &addLabels})
7070
if err != nil {
7171
return nil, err
7272
}
@@ -75,12 +75,12 @@ func (g *GitLab) AddMergeRequestLabels(labels *[]string, mergeRequest int) (gitl
7575

7676
// RemoveMergeRequestLabels removes labels on the merge request.
7777
func (g *GitLab) RemoveMergeRequestLabels(labels *[]string, mergeRequest int) (gitlab.Labels, error) {
78-
var removeLabels gitlab.Labels
78+
var removeLabels gitlab.LabelOptions
7979
for _, label := range *labels {
8080
removeLabels = append(removeLabels, label)
8181
}
8282

83-
updatedMergeRequest, _, err := g.MergeRequests.UpdateMergeRequest(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, &gitlab.UpdateMergeRequestOptions{RemoveLabels: &removeLabels})
83+
updatedMergeRequest, _, err := g.MergeRequests.UpdateMergeRequest(fmt.Sprintf("%s/%s", g.namespace, g.project), int64(mergeRequest), &gitlab.UpdateMergeRequestOptions{RemoveLabels: &removeLabels})
8484
if err != nil {
8585
return nil, err
8686
}
@@ -89,28 +89,28 @@ func (g *GitLab) RemoveMergeRequestLabels(labels *[]string, mergeRequest int) (g
8989

9090
// ListMergeRequestLabels lists labels on the merger request
9191
func (g *GitLab) ListMergeRequestLabels(mergeRequest int, opt *gitlab.GetMergeRequestsOptions, options ...gitlab.RequestOptionFunc) (gitlab.Labels, error) {
92-
mr, _, err := g.MergeRequests.GetMergeRequest(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, opt, options...)
92+
mr, _, err := g.MergeRequests.GetMergeRequest(fmt.Sprintf("%s/%s", g.namespace, g.project), int64(mergeRequest), opt, options...)
9393
if err != nil {
9494
return nil, err
9595
}
9696
return mr.Labels, nil
9797
}
9898

99-
// GetLabel is a wrapper of https://pkg.go.dev/github.com/xanzy/go-gitlab#LabelsService.GetLabel
99+
// GetLabel is a wrapper of LabelsService.GetLabel
100100
func (g *GitLab) GetLabel(labelName string, options ...gitlab.RequestOptionFunc) (*gitlab.Label, *gitlab.Response, error) {
101101
return g.Labels.GetLabel(fmt.Sprintf("%s/%s", g.namespace, g.project), labelName, options...)
102102
}
103103

104-
// UpdateLabel is a wrapper of https://pkg.go.dev/github.com/xanzy/go-gitlab#LabelsService.UpdateLabel
104+
// UpdateLabel is a wrapper of LabelsService.UpdateLabel
105105
func (g *GitLab) UpdateLabel(opt *gitlab.UpdateLabelOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Label, *gitlab.Response, error) {
106-
return g.Labels.UpdateLabel(fmt.Sprintf("%s/%s", g.namespace, g.project), opt, options...)
106+
return g.Labels.UpdateLabel(fmt.Sprintf("%s/%s", g.namespace, g.project), *opt.Name, opt, options...)
107107
}
108108

109-
// GetCommit is a wrapper of https://pkg.go.dev/github.com/xanzy/go-gitlab#CommitsService.GetCommit
109+
// GetCommit is a wrapper of CommitsService.GetCommit
110110
func (g *GitLab) GetCommit(sha string, options ...gitlab.RequestOptionFunc) (*gitlab.Commit, *gitlab.Response, error) {
111-
return g.Commits.GetCommit(fmt.Sprintf("%s/%s", g.namespace, g.project), sha, options...)
111+
return g.Commits.GetCommit(fmt.Sprintf("%s/%s", g.namespace, g.project), sha, nil, options...)
112112
}
113113

114-
func (g *GitLab) ListMergeRequestsByCommit(sha string, options ...gitlab.RequestOptionFunc) ([]*gitlab.MergeRequest, *gitlab.Response, error) {
114+
func (g *GitLab) ListMergeRequestsByCommit(sha string, options ...gitlab.RequestOptionFunc) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error) {
115115
return g.Commits.ListMergeRequestsByCommit(fmt.Sprintf("%s/%s", g.namespace, g.project), sha, options...)
116116
}

pkg/notifier/gitlab/notify.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"github.com/hirosassa/tfcmt-gitlab/pkg/notifier"
55
"github.com/hirosassa/tfcmt-gitlab/pkg/terraform"
66
"github.com/sirupsen/logrus"
7-
gitlab "github.com/xanzy/go-gitlab"
7+
gitlab "gitlab.com/gitlab-org/api/client-go"
88
)
99

1010
// NotifyService handles communication with the notification related
@@ -77,7 +77,7 @@ func (g *NotifyService) Notify(param notifier.ParamExec) (int, error) { //nolint
7777

7878
if template.IsSamePlan(comment.Body) {
7979
logE.Debugf("Patch comment from `%s` to `%s`", comment.Body, body)
80-
if err := g.client.Comment.Patch(comment.ID, body, PostOptions{
80+
if err := g.client.Comment.Patch(int(comment.ID), body, PostOptions{
8181
Number: cfg.MR.Number,
8282
Revision: cfg.MR.Revision,
8383
}); err != nil {

pkg/notifier/gitlab/notify_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/hirosassa/tfcmt-gitlab/pkg/notifier"
77
gitlabmock "github.com/hirosassa/tfcmt-gitlab/pkg/notifier/gitlab/gen"
88
"github.com/hirosassa/tfcmt-gitlab/pkg/terraform"
9-
gitlab "github.com/xanzy/go-gitlab"
9+
gitlab "gitlab.com/gitlab-org/api/client-go"
1010
"go.uber.org/mock/gomock"
1111
)
1212

@@ -131,7 +131,7 @@ func TestNotifyNotify(t *testing.T) { //nolint:maintidx
131131
name: "valid, and isRevision",
132132
createMockGitLabAPI: func(ctrl *gomock.Controller) *gitlabmock.MockAPI {
133133
api := gitlabmock.NewMockAPI(ctrl)
134-
api.EXPECT().ListMergeRequestsByCommit("revision-revision").Return([]*gitlab.MergeRequest{{IID: 1}}, nil, nil)
134+
api.EXPECT().ListMergeRequestsByCommit("revision-revision").Return([]*gitlab.BasicMergeRequest{{IID: 1}}, nil, nil)
135135
api.EXPECT().CreateMergeRequestNote(1, gomock.Any()).Return(nil, nil, nil)
136136
return api
137137
},
@@ -264,7 +264,7 @@ func TestNotifyNotify(t *testing.T) { //nolint:maintidx
264264
name: "get MR IID when MR number is 0",
265265
createMockGitLabAPI: func(ctrl *gomock.Controller) *gitlabmock.MockAPI {
266266
api := gitlabmock.NewMockAPI(ctrl)
267-
api.EXPECT().ListMergeRequestsByCommit("revision").Return([]*gitlab.MergeRequest{{IID: 1}}, nil, nil)
267+
api.EXPECT().ListMergeRequestsByCommit("revision").Return([]*gitlab.BasicMergeRequest{{IID: 1}}, nil, nil)
268268
api.EXPECT().CreateMergeRequestNote(1, gomock.Any()).Return(nil, nil, nil)
269269
return api
270270
},

0 commit comments

Comments
 (0)