Repository: reviewdog/reviewdog
Pull request #1599 (2023-10-22 10:02:49)

fix(deps): update module github.com/xanzy/go-gitlab to v0.93.2
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/xanzy/go-gitlab](https://togithub.com/xanzy/go-gitlab) | require | patch | `v0.93.1` -> `v0.93.2` |

---

### Release Notes

<details>
<summary>xanzy/go-gitlab (github.com/xanzy/go-gitlab)</summary>

### [`v0.93.2`](https://togithub.com/xanzy/go-gitlab/compare/v0.93.1...v0.93.2)

[Compare Source](https://togithub.com/xanzy/go-gitlab/compare/v0.93.1...v0.93.2)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/reviewdog/reviewdog).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOS4yIiwidXBkYXRlZEluVmVyIjoiMzcuMTkuMiIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->



Patch:
diff --git a/go.mod b/go.mod
index c7ad8f23..9eeb6132 100644
--- a/go.mod
+++ b/go.mod
@@ -26,7 +26,7 @@ require (
 	github.com/reviewdog/go-bitbucket v0.0.0-20201024094602-708c3f6a7de0
 	github.com/stretchr/testify v1.8.4
 	github.com/vvakame/sdlog v1.2.0
-	github.com/xanzy/go-gitlab v0.93.1
+	github.com/xanzy/go-gitlab v0.93.2
 	go.opencensus.io v0.24.0
 	golang.org/x/build v0.0.0-20230906094020-6ed658a430ec
 	golang.org/x/oauth2 v0.13.0
diff --git a/go.sum b/go.sum
index 8876324f..22d1de58 100644
--- a/go.sum
+++ b/go.sum
@@ -259,8 +259,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
 github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
 github.com/vvakame/sdlog v1.2.0 h1:gwZRXZ0EmhJQJN/Do/+PTQigcmFiSqZ07aDjxqGOLT8=
 github.com/vvakame/sdlog v1.2.0/go.mod h1:gFYv2g/iR3pJSxkJz0YnkNmhNbXT5R3PzWsfZKGQADY=
-github.com/xanzy/go-gitlab v0.93.1 h1:f7J33cw/P9b/8paIOoH0F3H+TFrswvWHs6yUgoTp9LY=
-github.com/xanzy/go-gitlab v0.93.1/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw=
+github.com/xanzy/go-gitlab v0.93.2 h1:kNNf3BYNYn/Zkig0B89fma12l36VLcYSGu7OnaRlRDg=
+github.com/xanzy/go-gitlab v0.93.2/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw=
 github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
diff --git a/service/gitlab/gitlab_mr_discussion.go b/service/gitlab/gitlab_mr_discussion.go
index 355413ea..2f3f7308 100644
--- a/service/gitlab/gitlab_mr_discussion.go
+++ b/service/gitlab/gitlab_mr_discussion.go
@@ -122,17 +122,17 @@ func (g *MergeRequestDiscussionCommenter) postCommentsForEach(ctx context.Contex
 			continue
 		}
 		eg.Go(func() error {
-			pos := &gitlab.NotePosition{
-				StartSHA:     targetBranch.Commit.ID,
-				HeadSHA:      g.sha,
-				BaseSHA:      targetBranch.Commit.ID,
-				PositionType: "text",
-				NewPath:      loc.GetPath(),
-				NewLine:      lnum,
+			pos := &gitlab.PositionOptions{
+				StartSHA:     gitlab.String(targetBranch.Commit.ID),
+				HeadSHA:      gitlab.String(g.sha),
+				BaseSHA:      gitlab.String(targetBranch.Commit.ID),
+				PositionType: gitlab.String("text"),
+				NewPath:      gitlab.String(loc.GetPath()),
+				NewLine:      gitlab.Int(lnum),
 			}
 			if c.Result.OldPath != "" && c.Result.OldLine != 0 {
-				pos.OldPath = c.Result.OldPath
-				pos.OldLine = c.Result.OldLine
+				pos.OldPath = gitlab.String(c.Result.OldPath)
+				pos.OldLine = gitlab.Int(c.Result.OldLine)
 			}
 			discussion := &gitlab.CreateMergeRequestDiscussionOptions{
 				Body:     gitlab.String(body),


Test patch:
diff --git a/service/gitlab/gitlab_mr_discussion_test.go b/service/gitlab/gitlab_mr_discussion_test.go
index f70ca5bc..3350eac6 100644
--- a/service/gitlab/gitlab_mr_discussion_test.go
+++ b/service/gitlab/gitlab_mr_discussion_test.go
@@ -217,12 +217,18 @@ func TestGitLabMergeRequestDiscussionCommenter_Post_Flush_review_api(t *testing.
 			if err := json.NewDecoder(r.Body).Decode(got); err != nil {
 				t.Error(err)
 			}
-			switch got.Position.NewPath {
+			switch *got.Position.NewPath {
 			case "file.go":
 				want := &gitlab.CreateMergeRequestDiscussionOptions{
 					Body: gitlab.String(commentutil.MarkdownComment(newComment1)),
-					Position: &gitlab.NotePosition{
-						BaseSHA: "xxx", StartSHA: "xxx", HeadSHA: "sha", PositionType: "text", NewPath: "file.go", NewLine: 14},
+					Position: &gitlab.PositionOptions{
+						BaseSHA:      gitlab.String("xxx"),
+						StartSHA:     gitlab.String("xxx"),
+						HeadSHA:      gitlab.String("sha"),
+						PositionType: gitlab.String("text"),
+						NewPath:      gitlab.String("file.go"),
+						NewLine:      gitlab.Int(14),
+					},
 				}
 				if diff := cmp.Diff(got, want); diff != "" {
 					t.Error(diff)
@@ -230,8 +236,14 @@ func TestGitLabMergeRequestDiscussionCommenter_Post_Flush_review_api(t *testing.
 			case "file2.go":
 				want := &gitlab.CreateMergeRequestDiscussionOptions{
 					Body: gitlab.String(commentutil.MarkdownComment(newComment2)),
-					Position: &gitlab.NotePosition{
-						BaseSHA: "xxx", StartSHA: "xxx", HeadSHA: "sha", PositionType: "text", NewPath: "file2.go", NewLine: 15},
+					Position: &gitlab.PositionOptions{
+						BaseSHA:      gitlab.String("xxx"),
+						StartSHA:     gitlab.String("xxx"),
+						HeadSHA:      gitlab.String("sha"),
+						PositionType: gitlab.String("text"),
+						NewPath:      gitlab.String("file2.go"),
+						NewLine:      gitlab.Int(15),
+					},
 				}
 				if diff := cmp.Diff(got, want); diff != "" {
 					t.Error(diff)
@@ -239,10 +251,15 @@ func TestGitLabMergeRequestDiscussionCommenter_Post_Flush_review_api(t *testing.
 			case "new_file.go":
 				want := &gitlab.CreateMergeRequestDiscussionOptions{
 					Body: gitlab.String(commentutil.MarkdownComment(newComment3)),
-					Position: &gitlab.NotePosition{
-						BaseSHA: "xxx", StartSHA: "xxx", HeadSHA: "sha", PositionType: "text",
-						NewPath: "new_file.go", NewLine: 14,
-						OldPath: "old_file.go", OldLine: 7,
+					Position: &gitlab.PositionOptions{
+						BaseSHA:      gitlab.String("xxx"),
+						StartSHA:     gitlab.String("xxx"),
+						HeadSHA:      gitlab.String("sha"),
+						PositionType: gitlab.String("text"),
+						NewPath:      gitlab.String("new_file.go"),
+						NewLine:      gitlab.Int(14),
+						OldPath:      gitlab.String("old_file.go"),
+						OldLine:      gitlab.Int(7),
 					},
 				}
 				if diff := cmp.Diff(got, want); diff != "" {
@@ -254,8 +271,14 @@ func TestGitLabMergeRequestDiscussionCommenter_Post_Flush_review_api(t *testing.
 
 				want := &gitlab.CreateMergeRequestDiscussionOptions{
 					Body: gitlab.String(bodyExpected),
-					Position: &gitlab.NotePosition{
-						BaseSHA: "xxx", StartSHA: "xxx", HeadSHA: "sha", PositionType: "text", NewPath: "file3.go", NewLine: 14},
+					Position: &gitlab.PositionOptions{
+						BaseSHA:      gitlab.String("xxx"),
+						StartSHA:     gitlab.String("xxx"),
+						HeadSHA:      gitlab.String("sha"),
+						PositionType: gitlab.String("text"),
+						NewPath:      gitlab.String("file3.go"),
+						NewLine:      gitlab.Int(14),
+					},
 				}
 				if diff := cmp.Diff(got, want); diff != "" {
 					t.Error(diff)