Skip to content

Commit

Permalink
Merge pull request #116 from eremeevfd/ISSUE-113-fix-gitlab-comments
Browse files Browse the repository at this point in the history
[ISSUE-113] fixed gitlab urls
  • Loading branch information
drlau authored Dec 9, 2022
2 parents f0d952d + f1b5921 commit 6f83005
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions notifier/gitlab/gitlab.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package gitlab

import (
"fmt"

gitlab "github.com/xanzy/go-gitlab"
)

Expand All @@ -23,25 +21,25 @@ type GitLab struct {

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

// DeleteMergeRequestNote is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#NotesService.DeleteMergeRequestNote
func (g *GitLab) DeleteMergeRequestNote(mergeRequest, note int, options ...gitlab.OptionFunc) (*gitlab.Response, error) {
return g.Client.Notes.DeleteMergeRequestNote(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, note, options...)
return g.Client.Notes.DeleteMergeRequestNote(g.project, mergeRequest, note, options...)
}

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

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

// ListCommits is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#CommitsService.ListCommits
func (g *GitLab) ListCommits(opt *gitlab.ListCommitsOptions, options ...gitlab.OptionFunc) ([]*gitlab.Commit, *gitlab.Response, error) {
return g.Client.Commits.ListCommits(fmt.Sprintf("%s/%s", g.namespace, g.project), opt, options...)
return g.Client.Commits.ListCommits(g.project, opt, options...)
}

0 comments on commit 6f83005

Please sign in to comment.