Review UI
Review UI
Version V3.4.4
Table of Contents
Change Screen
Top info
Star Change
Change metadata
File List
Patch Sets
Download
Included In
Related Changes
Reply
History
Update Notification
Plugin Extensions
Side-by-Side Diff Screen
Inline Comments
File Level Comments
Diff Preferences
Keyboard Shortcuts
Reviewing changes is an important task and the Gerrit Web UI provides many functionalities to make the review process comfortable and efficient.
The UI has three different main views,
Change Screen
The change screen shows the details of a single change and provides various actions on it.
Here are the main areas of the screen
Top info
Top left, you find the status of the change, and a permalink.
The change status shows the state of the change:
Star Change
Clicking the star icon marks the change as a favorite: it turns on email notifications for this change, and the change is added to the list under Your > Starred Changes. They can be queried by the is:starred search operator.
Change metadata
The change metadata block contains detailed information about the change and offers actions on the change.
File List
The file list shows the files that are modified in the currently viewed patch set.
In addition to the modified files the file list contains magic files that are generated by Gerrit and which don’t exist in the repository. The magic files contain additional commit data that should be reviewable and allow users to comment on this data. The magic files are always listed first. The following magic files exist:
Patch Sets
The change screen only presents one patch set at a time. Which patch set is currently viewed can be seen from the Patch Sets drop-down panel in the change header.
Download
The Download drop-down panel in the change header offers commands and links for downloading the currently viewed patch set.
The available download commands depend on the installed Gerrit plugins. The most popular plugin for download commands, the download-commands plugin, provides commands to checkout, pull and cherry-pick a patch set.
Each command has a copy-to-clipboard icon that allows the command to be copied into the clipboard. This makes it easy to paste and execute the command on a Git command line.
If several download schemes are configured on the server (e.g. SSH and HTTP) there is a drop-down list to switch between the download schemes. Gerrit automatically remembers the download scheme that was last chosen and selects this download scheme the next time the download commands drop-down panel is opened.
The Patch-File links provide the Git patch file for the currently viewed patch set for download. The patch file can be base64 encoded or zipped.
The Archive links allow one to download an archive with the contents of the currently viewed patch set. The archive is offered in several formats (e.g. tar and tbz2); which formats are available depends on the configuration of the server.
Included In
For merged changes the Included In drop-down panel is available through the overflow menu at the top. It shows the branches and tags in which the change is included. E.g. if a change fixes a bug, this shows which released versions contain the bug-fix (assuming that every release is tagged).
Related Changes
If there are changes that are related to the currently viewed change they are displayed in the third column of the change screen.
There are several lists of related changes and a tab control is used to display each list of related changes in its own tab.
The following tabs may be displayed:
Reply
The Reply…​ button in the change header allows to reply to the currently viewed patch set; one can add a summary comment, publish inline draft comments, and vote on the labels.
Clicking on the Reply…​ button opens a popup panel.
A text box allows to type a summary comment for the currently viewed patch set. Some basic markdown-like syntax is supported which renders indented lines preformatted, lines starting with "- " or "* " as list items, and lines starting with "> " as block quotes (also see replying to messages and inline comments).
Note that you can set the text and tooltip of the button in gerrit.config.
If the current patch set is viewed, radio buttons are displayed for each label on which the user is allowed to vote. Voting on non-current patch sets is not possible.
The inline draft comments that will be published are displayed in a separate section so that they can be reviewed before publishing. There are links to navigate to the inline comments which can be used if a comment needs to be edited.
The Post button publishes the comments and the votes.
If a user can approve a label that is still required, a quick approve button appears in the change header that allows to add this missing approval by a single click. The quick approve button only appears if there is a single label that is still required and can be approved by the user.
E.g. if a change requires approvals on the 'Code-Review' and the 'Verified' labels, and there is already a '+1 Verified' vote, then if the user is allowed to vote the max score on 'Code-Review', a Code-Review+2 quick approve button appears that approves the 'Code-Review' label if clicked.
Using the quick approve button also publishes all inline draft comments; a summary comment is only added if the reply popup panel is open when the quick approve button is clicked.
History
The history of the change can be seen in the lower part of the screen.
The history contains messages for all kinds of change updates, e.g. a message is added when a new patch set is uploaded or when a review was done.
Messages with new comments from other users, that were published after the current user last reviewed this change, are automatically expanded.
It is possible to directly reply to a change message by clicking on the reply icon in the right upper corner of a change message. This opens the reply popup panel and prefills the text box with the quoted comment. Then the reply can be written below the quoted comment or inserted inline. Lines starting with "> " will be rendered as a block quote. Please note that for a correct rendering it is important to leave a blank line between a quoted block and the reply to it.
Inline comments are directly displayed in the change history and there are links to navigate to the inline comments.
The Expand All button expands all messages; the Collapse All button collapses all messages.
Update Notification
The change screen automatically polls for updates to the currently viewed change. If there is an update the user is informed by a popup panel in the bottom right corner.
The polling frequency depends on the server configuration; by default it is 30 seconds. Polling may also be completely disabled by the administrator.
Plugin Extensions
Gerrit plugins may extend the change screen; they can add buttons for additional actions to the change info block and display arbitrary UI controls below the change info block.
Side-by-Side Diff Screen
The side-by-side diff screen shows a single patch; the old file version is displayed on the left side of the screen; the new file version is displayed on the right side of the screen.
This screen allows to review a patch and to comment on it.
In the screen header the project name and the name of the viewed patch file are shown.
If a Git web browser is configured on the server, the project name and the file path are displayed as links to the project and the folder in the Git web browser.
The checkbox in front of the file name allows the patch to be marked as reviewed. The Mark Reviewed diff preference allows to control whether the files should be automatically marked as reviewed when they are viewed.
In the header, on each side, the list of patch sets is shown. Clicking on a patch set changes the selection for the patch set comparison and the screen is refreshed to show the diff between the selected patch sets. The currently selected patch set is highlighted by a light blue background.
On the left side Base can be selected to compare a patch set against its base. For merge commits Auto Merge is available instead which allows to compare the patch against the result of the auto merge. The auto merge version may contain Git conflict markers and is useful for reviewing how conflicts are resolved by a patch.
Reviewers that are reviewing a patch for the first time look at its diff against its base; reviewers that have reviewed an old patch version before, may see what has changed since that version by comparing the old patch against the current patch.
The download icon next to the patch set list allows to download the patch. Unless the mime type of the file is configured as safe, the download file is a zip archive that contains the patch file.
If the compared patches are identical, this is highlighted by a red No Differences label in the screen header.
If a file was renamed, the old and new file paths are shown in the header together with a similarity index that shows how much of the file content is unmodified.
For navigating between the patches in a patch set there are navigation buttons on the right side of the screen header. The left arrow button navigates to the previous patch; the right arrow button navigates to the next patch. The arrow up button leads back to the change screen. In all cases the selection for the patch set comparison is kept.
Inline Comments
Inline comments are displayed directly in the patch file under the code that is commented. Inline comments can be placed on lines or on code blocks.
If an inline comment relates to a code block, this code block is highlighted by a yellow background.
Code blocks with comments may overlap. This means it is possible to attach several comments to the same code.
The lines of the patch file are linkable. To link to a certain line in the patch file, '@<line-number>' must be appended to the patch link, e.g. http://host:8080/#/c/56857/2/Documentation/user-review-ui.txt@665​. To link to a line in the old file version, '@a<line-number>' must be appended to the patch link. These links can be used to directly link to certain inline comments.
If the diff preference Expand All Comments is set to Expand, all inline comments will be automatically expanded.
In the header of the comment box, the name of the comment author and the timestamp of the comment are shown. If avatars are configured on the server, the avatar image of the comment author is displayed in the top left corner. Below the actual comment there are buttons to reply to the comment.
Clicking on the Reply button opens an editor to type the reply.
Quoting is supported, but only by manually copying & pasting the old comment that should be quoted and prefixing every line by "> ". Please note that for a correct rendering it is important to leave a blank line between a quoted block and the reply to it.
Clicking on the Save button saves the comment as a draft. To make it visible to other users it must be published from the change screen by replying to the change.
The Cancel button cancels the editing and discards any changes to the draft comment.
Clicking on the Discard button deletes the inline draft comment.
Draft comments are marked by the text "Draft" in the header in the place of the comment author.
A draft comment can be edited by clicking on the Edit button, or deleted by clicking on the Discard button.
Clicking on the Done button is a quick way to reply with "Done" to a comment. This is used to mark a comment as addressed by a follow-up patch set.
To add a new inline comment there are several possibilities:
There are many ways to select code for commenting on it. The most frequently used methods are:
For typing the new comment, a new comment box is shown under the code that is commented.
Clicking on the Save button saves the new comment as a draft. To make it visible to other users it must be published from the change screen by replying to the change.
Clicking on the Discard button deletes the new comment.
File Level Comments
File level comments are added by clicking the 'File' header at the top of the file.
Diff Preferences
There are several options to control how patch diffs should be rendered. Users can configure their preferences in the diff preferences. The diff preferences can be accessed by clicking on the settings icon in the screen header.
The following diff preferences can be configured:
Keyboard Shortcuts
Navigation within the review UI can be completely done by keys, and most actions can be controlled by keyboard shortcuts. Typing ? opens a popup that shows a list of available keyboard shortcuts.
In addition, Vim-like commands can be used to navigate and search within a patch file.
Part of Gerrit Code Review
Version v3.4.4