Code reviews in the desktop application
Create or interact with code reviews in your Unity Version Control desktop application so that you and your team can collaborate and review each other's work to approve changes before you check them in.
Code review window
The code review window opens automatically when you create a code review. To start a new code review, right-click on either a branch or a changeset, and select the corresponding option:
- New code review for this changeset
- New code review for this branch
To open an existing code review from the UVCS desktop application, select the Code reviews tab, and double-click on a code review.
The code review window has two tabs:
Tab | Description |
---|---|
Conversation | Allows you to edit the title, description, reviewers, and status of a code review. This tab also displays activity for your code review, and any comments. |
Review changes | Allows you to review changes and add comments. This tab also displays the diffs of the changes, and any comments. |
Conversation tab
Use the Conversation tab of the code review window to set up, edit, monitor, and manage your code review.
Request reviewers
- Select Add description to give an overview or summary to your reviewers.
- In the Reviewers panel, select Add.
- Select any users or groups you want to add as reviewers.
- Select OK.
Note: You can edit the title, description, and reviewers of your code review at any time from the Conversation tab of the code review window.
Change the status of a code review
A reviewer can change the status of a code review on the Conversation tab:
- Select Mark review.
- Select one of the review statuses:
Status Description Under review The review is ongoing. Rework required The reviewer is requesting changes. Reviewed The code review is approved. - Add a comment and select the Mark as button for the status you selected.
Review changes tab
Use the review changes tab to view the diffs of files and add or reply to any comments.
Branch review options
For a code review of a branch, there are two modes that you can change between when you review:
Review mode | Description |
---|---|
Review changeset by changeset | View each individual changeset and the associated checkin comments, and add comments to the individual changesets. This helps the reviewer understand how and why changes were made. |
Review entire branch | Review the most recent version of the branch, with all changesets applied. |
Any comments only display in the mode that they were added.
Diff options
In the Review changes tab, you have the following diff options:
Diff option | Description |
---|---|
Text diff | Provides a side-by-side text comparison of the changes in a file. |
Semantic diff | Provides a semantic outline which shows if items in the file were added, deleted, or changed. |
Visual diff | With the semantic diff, the visual diff provides a representation of the changed objects. You have the following options: Hide unchanged, Show unchanged, and Group unchanged. |
View existing comments
The Review comments summary panel at the bottom of the Review changes tab displays all the comments part of the code review. The panel is divided into three sections for each type of comment, and shows the comment, the status, and the owner of each comment.
Comment types
There are the following types of comment:
Comment type | Description |
---|---|
Request a change (default) | Select to indicate that a change in the code is necessary. |
Ask a question | Select to indicate that the comment needs an answer, but no initial change is necessary. |
Regular comment | Deselect both options to add a regular comment. |
Note: The Comments section doesn’t show replies to regular comments. The other two sections do display replies.
To navigate to the related comment, double-click on the comment.
Add new comments
- Add a new comment to a line:
- Hover over the line in the diff window.
- Select the + icon.
- In the comments panel, select the type of comment.
- Enter the comment and select Comment.
You can’t add a comment to the following types of file:
- A file that belongs to a different repository.
- An Xlink file.
- An unsupported file type, such as an image or directory diff.
Apply requested changes
When someone requests a change in a code review, the request comment has an associated GUID.
When you complete the requested change, you can automatically resolve the requested change comment:
- Copy the GUID from the change request comment.
- Make your changes to the file.
- In the Pending changes tab, enter a comment in the following format:
[apply-change:{commentID}]
- Enter the rest of the comment as normal and select Check in.
You can also edit the comment of an existing changeset and add the [apply-change:{commentID}]
text to resolve a code review change request.
Note: To apply the requested change in the command line, run the checkin
command with the comment GUID:
cm checkin FileName.cs -c="[apply-change:b3ab21d4] Apply requested changes"
When a comment is resolved, the Review comments summary panel changes the status of the comment to Done and displays a link to the linked changeset: