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

Fine Grained Code Review Support #359

Open
chadfurman opened this issue Feb 12, 2020 · 6 comments
Open

Fine Grained Code Review Support #359

chadfurman opened this issue Feb 12, 2020 · 6 comments

Comments

@chadfurman
Copy link

@chadfurman chadfurman commented Feb 12, 2020

Describe the feature or problem you’d like to solve

PRs have a really nice way of leaving approvals, change requests, comments, and marking comments as resolved. gh cli does not appear to support comments on PRs

Proposed solution

CLI could allow commenting on a commit, filename, and line number, and it could allow retrieving all comments on all changes in a commit.

Additional context

This likely will need support from GH API -- There's comments on PR issues in general (https://developer.github.com/v4/object/pullrequest/) and comments for reviews: https://developer.github.com/v4/object/pullrequestreviewcomment/

@vilmibm
Copy link
Member

@vilmibm vilmibm commented Feb 12, 2020

this is on our roadmap! but we hadn't opened an issue for it yet, so thank you~

we wanted to do some designs up front and see what made the most sense; we only have some hand-drawn prototypes so far.

personally i was interested in something kind of like git add -p where you could page through comments/suggestions and take an action on each one. i'm curious what people think about that level of interactivity.

@mullr
Copy link

@mullr mullr commented Feb 12, 2020

We've experimented with various flavors of this. For awhile we used git appraise, which has a CLI along the lines described by OP. We found it basically unusable, to the point where it was having a chilling effect on code review.

I prototyped a frontend which allowed you mark up a diff to leave comments, and that seemed fairly promising. The workflow ends up being similar to a the format-patch + email review workflow, except you do it all locally. The syntax I arrived on was using '>' as a prefix character for new comments, and something else (don't remember) for putting existing comments inside the patch, in context.

The only real issue I had was that emacs tries to be helpful with edited patch files to the point of breaking them when you try to add comment metadata. A derived mode to disable this feature fixed it.

Ultimately we chose to go back to github PR's rather than try to tool our way around it. The reason we were using it in the first place is because it gave us a way to digitally sign review comments; this would be a very attractive feature of any CLI-driven review workflow.

(also: Hi Nate! Thanks for making something great!)

@chadfurman
Copy link
Author

@chadfurman chadfurman commented Feb 12, 2020

Interactivity is nice but not needed for MVP. JetBrains etc can provide the interactivity using the cli hooks I'd suspect. Interactivity is a good v2 feature though I think

@joshtriplett
Copy link

@joshtriplett joshtriplett commented Feb 12, 2020

I prototyped a frontend which allowed you mark up a diff to leave comments, and that seemed fairly promising. The workflow ends up being similar to a the format-patch + email review workflow, except you do it all locally. The syntax I arrived on was using '>' as a prefix character for new comments, and something else (don't remember) for putting existing comments inside the patch, in context.

What about the reverse? Quote the entire patch file, and have people insert their comments without the quote marks. That will be familiar for anyone used to reviewing patches by email, and the > prefix on every line should prevent editors from attempting to fiddle with the patch.

@vilmibm vilmibm changed the title Code Review Support Fine Grained Code Review Support May 14, 2020
@vilmibm
Copy link
Member

@vilmibm vilmibm commented May 14, 2020

I've renamed this as we have since added gh pr review (pending release) for adding a top level approve, request changes, or comment review on a given pr.

However, we did not include an affordance for line comments.

@jordanlewis
Copy link

@jordanlewis jordanlewis commented Jun 6, 2020

Hey @vilmibm, stumbled across this issue after realizing that gh is getting improvements - awesome!

I just wanted to point out a project I made a while back called re that has a workflow for line by line review comments:

https://github.com/jordanlewis/re

I find it at least medium usable. It has a workflow that's half add -p inspired, but mostly uses a modified diff format that allows you to leave inline comments, right from an ordinary git diff that's available in a buffer.

Please feel free to take ideas from that project if you find it appealing!

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

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.