Skip to content

Commit ea35870

Browse files
committed
internal/gitlab/gitlab.go: Update for new version of gitlab library
Fix some compilation issues introduced by the new gitlab library version. Signed-off-by: Prarit Bhargava <prarit@redhat.com>
1 parent 6b759b6 commit ea35870

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

internal/gitlab/gitlab.go

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ func LabelCreate(projID interface{}, opts *gitlab.CreateLabelOptions) error {
855855

856856
// LabelDelete removes a project label
857857
func LabelDelete(projID, name string) error {
858-
_, err := lab.Labels.DeleteLabel(projID, &gitlab.DeleteLabelOptions{
858+
_, err := lab.Labels.DeleteLabel(projID, name, &gitlab.DeleteLabelOptions{
859859
Name: &name,
860860
})
861861
return err
@@ -1689,7 +1689,9 @@ func TodoIssueCreate(projID interface{}, id int) (int, error) {
16891689
func GetCommitDiff(projID interface{}, sha string) ([]*gitlab.Diff, error) {
16901690
var diffs []*gitlab.Diff
16911691
opt := &gitlab.GetCommitDiffOptions{
1692-
PerPage: maxItemsPerPage,
1692+
ListOptions: gitlab.ListOptions{
1693+
PerPage: maxItemsPerPage,
1694+
},
16931695
}
16941696

16951697
for {
@@ -1810,23 +1812,25 @@ func CreateMergeRequestCommitDiscussion(projID interface{}, id int, sha string,
18101812
return "", err
18111813
}
18121814

1813-
position := gitlab.NotePosition{
1814-
NewPath: newFile,
1815-
OldPath: oldFile,
1816-
BaseSHA: commitInfo.ParentIDs[0],
1817-
StartSHA: commitInfo.ParentIDs[0],
1818-
HeadSHA: sha,
1819-
PositionType: "text",
1815+
positionType := "text"
1816+
1817+
position := gitlab.PositionOptions{
1818+
NewPath: &newFile,
1819+
OldPath: &oldFile,
1820+
BaseSHA: &commitInfo.ParentIDs[0],
1821+
StartSHA: &commitInfo.ParentIDs[0],
1822+
HeadSHA: &sha,
1823+
PositionType: &positionType,
18201824
}
18211825

18221826
switch linetype {
18231827
case "new":
1824-
position.NewLine = line
1828+
position.NewLine = &line
18251829
case "old":
1826-
position.OldLine = line
1830+
position.OldLine = &line
18271831
case "context":
1828-
position.NewLine = line
1829-
position.OldLine = line
1832+
position.NewLine = &line
1833+
position.OldLine = &line
18301834
}
18311835

18321836
opt := &gitlab.CreateMergeRequestDiscussionOptions{

0 commit comments

Comments
 (0)