zaquestion / lab

Lab wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab
https://zaquestion.github.io/lab
Creative Commons Zero v1.0 Universal
1.11k stars 102 forks source link

lab mr note #83

Open zaquestion opened 6 years ago

zaquestion commented 6 years ago

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

claytonrcarter commented 5 years ago

@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?

zaquestion commented 5 years ago

@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.

claytonrcarter commented 5 years ago

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

zaquestion commented 5 years ago

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.