gitlab_mr_comment_on_line
Post a review comment on a specific line of a merge request diff; invalid stale SHAs or lines outside the diff are rejected, and the discussion_id lets you reply in the same thread.
Instructions
Comment on one line of the merge request diff, as a normal review comment. Give the path exactly as gitlab_mr_changes reports it and the line number in that side of the file. The required base/start/head SHAs and the old-side line number are resolved from the merge request's latest diff version, so a stale SHA or a line that is not in the diff is reported instead of being sent. The result carries discussion_id - pass it to gitlab_mr_reply to continue the thread.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| iid | Yes | project-scoped internal id - the number in !123 for a merge request or #123 for an issue, not the global id | |
| body | Yes | comment text (GitLab Flavored Markdown) | |
| line | Yes | 1-based line number in the file | |
| path | Yes | repository-relative file path, e.g. 'src/app.ts' (no leading slash) | |
| side | No | 'new' = the file after the change (added and unchanged lines), 'old' = the file before it (removed and unchanged lines) | new |
| project | Yes | project id ('42') or full path ('group/subgroup/app'); a path is URL-encoded for you |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note_id | No | ||
| web_url | No | ||
| position | No | diff position; a GitLab diff note is only valid with all of these | |
| resolved | No | ||
| discussion_id | No |