Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitlab comments don't work #113

Open
eremeevfd opened this issue Mar 10, 2022 · 0 comments
Open

Gitlab comments don't work #113

eremeevfd opened this issue Mar 10, 2022 · 0 comments

Comments

@eremeevfd
Copy link

WHAT

Hello, excellent project! I'm very excited to use it in gitlab, but unfortunately I can't. Comments can't be posted to any gitlab mr.

WHY

I think that error is here:

return g.Client.Notes.CreateMergeRequestNote(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, opt, options...)

To be precise error-prone part is this:
fmt.Sprintf("%s/%s", g.namespace, g.project)

sprint here leads to incorrect api url:
https://gitlab.com/api/v4/projects/{namespace}/{project}/merge_requests/{mr}/notes

because gitlab doesn't have namespace and project, only project, so right url should look like this:

https://gitlab.com/api/v4/projects/{project}/merge_requests/{mr}/notes

also it should be mentioned that underlying gitlab client specifies this signature:
https://github.com/xanzy/go-gitlab/blob/41c6472d936a0ce5f919f7eb1afb8dc8ac46247a/notes.go#L477

func (s *NotesService) CreateMergeRequestNote(pid interface{}, mergeRequest int, opt *CreateMergeRequestNoteOptions, options ...RequestOptionFunc) (*Note, *Response, error) {

where pid is for project_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant