lab icon indicating copy to clipboard operation
lab copied to clipboard

lab mr note

Open zaquestion opened this issue 8 years ago • 4 comments

Help for command

lab mr note [remote] <id> 

Add comment to an mr using provided message or in $EDITOR

Operates on the checked out or provided merge request. Notes can be added to a specific line or to the merge request itself. Notes on the same line are appended to the same thread.

Flags
--message, -m stringSlice  msg to use for note
--line, -l                 Line to add comment
--right                    Add comment on new code
--left                     Add comment on existing code

Ref: https://docs.gitlab.com/ce/api/notes.html#merge-requests

zaquestion avatar Dec 20 '17 06:12 zaquestion

@zaquestion based on the docs, I don't see how to implement the --line, --right or --left options. Do you have any insights that I might be missing?

claytonrcarter avatar Nov 07 '18 02:11 claytonrcarter

@claytonrcarter Haha, I love it! Those are some pretty dreamy options, to be honest I wasn't sure how to implement them when I wrote this issue. I'll check the docs too and see if theres something hiding. The GitLab API sometimes hides things (seemingly part of the same api) in completely different areas in the docs.

zaquestion avatar Nov 07 '18 07:11 zaquestion

I think I found it under "merge request discussions": https://docs.gitlab.com/ee/api/discussions.html#create-new-merge-request-discussion

claytonrcarter avatar Nov 08 '18 03:11 claytonrcarter

Ah yeah, its the whole notes != discussions thing. Whenever you comment on a line in a MR its create a discussion (threaded conversation) so makes sense that its in that part of the api.

zaquestion avatar Nov 08 '18 06:11 zaquestion