Using GitLab API it is possible to post a comment to a commit “on a particular line of a particular file” (see here).
On Merge Request in order to add comments it’s required to use the notes resource (see here and here) but the note object does not seem to contain any parameter to comment on a particular line.
From the GitLab UI I’m able to add inline comments to a Merge Request in the Changes tab but when I call the API and look at the corresponding note object createed from my inline comment there is nothing about the inline, it is only a regular note object without any line or line_type parameter…
Anyone knows how to use the API to add inline comments to a Merge Request ?
I’m attempting to add gitlab support to Lint Review (github.com/markstory/lint-review) which I use on github currently.
In order to do this I need a method of commenting on the merge request.
Somewhat works, but there is a bizarre quirk: the comment will be referencing specific line in specific file iff it references the line modified by the commit.
I.e. if you changed .gitlab-ci.yml lines 23-25, you can only comment on lines 23, 24 and 25, but not on any others.
The comments created through the UI creates the comments on other lines just fine, and they show up with line_type: null.
Do you know if this is something that can be worked around, or is this a limitation of the API at the moment?
Is there any solution to this yet? I want to post comments on lines that are not changed or modified, but keeps on getting the error: GitLab Create Error: 400 Bad request - Note {:line_code=>[“can’t be blank”, “must be a valid line code”]}
when I’m trying to do so.