-
Couldn't load subscription status.
- Fork 7.3k
light interactive pr review #885
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
Conversation
79229b8 to
f94fc4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yayay I'm excited about this one, it's looking great! ✨ Left some specific comments below :)
command/pr_review.go
Outdated
| "Comment", | ||
| "Approve", | ||
| "Request Changes", | ||
| "Cancel", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we nix the Cancel option in the first prompt? I think this muddies up that question and you can cancel by saying no at the submit step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just played around with this and it works great. But there was one area that was a bit clunky. If I request changes or want to leave a comment it gives me two choices; edit in editor or skip. But only edit in editor is valid.
But maybe it is a better flow than automatically opening up an editor without explaining to the user why the editor opened?
command/pr_review.go
Outdated
| } | ||
| } | ||
|
|
||
| if input == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input confused me a bit here. reivewData, reviewContents might make it more clear.
Also, I realize input wasn't introduced in this PR, so it doesn't have to be changed in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well, but also ran into what @tierninho was describing: the -b flag was ignored unless -a, -r, or -c were passed. Perhaps any flag passed should trigger non-interactive mode and immediately error out on invalid combination of arguments (e.g. -b alone would be invalid).
| return nil, err | ||
| } | ||
|
|
||
| fmt.Fprintf(out, "Got:\n%s", renderedBody) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was printing the preview of the review body intended in the final product? We don't do that in issue/pr create, so doing it here looks odd. Also, the user has just seen this text because they've authored it in their text editor, so what would be the intended purpose of printing it out right after?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we've discussed doing it for pr/issue as a review step. I thought this was a good opportunity to try it out.
|
@probablycorey I updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
radical
Good idea, added a discarding message.
Fixed.
Can you paste what you ran? sounds like you were missing the
Fixed
Yes, but it's markdown-rendered. Two adjacent lines in markdown are joined into one paragraph. A blank line is needed between them.
Fixed
They are two separate concepts on github.com. |
|
I've taken care of all the feedback and none of the new code is very involved so I'm going to go ahead and merge~ |
|
Thanks for all the fixes!
Yes, I was not including the |
This PR adds "light" interactive reviewing; ie still a top-level review but with prompts for review type and adding a body via your editor.
Fixes #434