Reviewing pull requests
When you click on a PR from a colleague in the review queue, you'll be able to view the proposed changes, add your comments, and submit your review from Graphite. Anything you can do on the GitHub UI, you are able to do in Graphite.
Adding comments
The first step in reviewing a PR is to scroll through changes, and leave comments in the code as you go - you can leave comments anywhere, not just on lines that have changed. As you leave in-line comments, the pending comments count in the header of the PR is incremented, and the add review button text changes to finish review.
After you've finished perusing the code, you can opt to finish the review, and leave a final comment.
Tip
If you want to respond in a thread without entering the review flow, you can leave the comment as a draft and use the shortcut CMD+J
to do so.
As a reviewer, you have three options: to request changes based on your comments, approve the PR since everything looks good, or just add comments without any explicit review status.
As soon as you provide a review, the reviewers section of the PR will be updated to reflect the latest review status of the PR, and it will also move to the appropriate section on the PR inbox page.
Timeline and filetree
By default, Graphite shows you a timeline of changes, comments, and reviews for a PR in a tray on the right side of the screen:
Clicking a comment which references a specific line of code will scroll that change into view
Clicking a commit currently takes you to GitHub, but will soon show the diff for that commit only in Graphite
To show the file tree, click the 🗂 icon in the top right corner of the right-side tray or use the keyboard shortcut F
. The file tree shows you the subdirectories of all files changed in a PR:
Clicking on a changed file will scroll it into view
New and deleted filenames highlighted green & red respectively
To enter Focus Mode and hide the right side tray altogether, click on the selected tab in the right panel to dismiss the panel altogether. You can resurface the panel by clicking on any of the tabs in the right panel, or using one of their shortcuts.
Best of all, Graphite enables you to comment anywhere on a PR - not just lines that changed:
Adding GIFs & memes to review comments
One of the features we missed the most from Phabricator was the ability to quickly add GIFs & memes to our code reviews to keep them lighthearted and fun. That's why we brought back first-class support for GIFs & memes in Graphite!
Adding a GIF is easy with our Giphy integration:
Click the
GIF
icon in the comment boxType in your search text and hit
Enter
Click on the GIF you want to add to your comment, and hit
Save
to see it rendered!Alternatively, you can select a GIF/meme from your team's meme library:
Click the #
icon in the comment box
Click "Browse org macros"
Type in your search text, or just click the GIF/meme you want to add to your comment
Hit
Save
to see it rendered!
Tip
Note that every GIF/meme in your team's meme library has a shortcode next to it which you can use to quickly add it to a review comment with /
. Try typing /cathack
into a comment to see this in action!
Lastly, you can upload your own GIFs & memes to your team's meme library:
Click the # icon in the comment box
Click "Upload new macro"
Choose an image/GIF, give it a shortcode, and add it to your comment
Hit
Save
to see it rendered!
Navigating a stack of PRs to review
Graphite makes it easy to review large stacks of PRs at once. From your PR inbox, just click into a pull request to see the PR details, code changes, and comments. You can always see where the current PR sits and navigate to any of the other PRs in a stack with the "Show stack" button, or by using the keyboard shortcut S
. Starting from the bottom of the stack, just add your comments, choose your review outcome, and move on to the next PR in the stack!