Requesting a code review
As someone who requests code review from your teammates, you typically perform the following sequence of tasks:
- Commit changes to your VCS repository.
- Create a code review.
- Invite participants (reviewers and optionally watchers).
- Discuss issues, if any, by way of exchanging comments with the reviewer(s).
- Work on resolving the issues, commit the fixes, and add the new revision(s) to the existing review.
- As soon as reviewers approve your changes, you close the review.
While committing changes is self-explanatory, we'll describe the other steps below.
Create a code review
- Log into Upsource and locate your project in the list:
- Click on the project name to open it. The project home view displays the revisions listed in chronological order:
- Scroll down the list or use the Search field to find the revision you're interested in.
- Move your cursor to the revision entry — a Review changes link will appear:
Click Review changes, then select Create review from the pop-up menu.
A new review is created, opened, and its ID is displayed at the top left (JD-CR-41 in our case):
The default review title is the same as your revision which becomes a part of this review.
To change the review title, click the Edit icon next to it.
In the next step you need to assign at least one reviewer to the review.
Invite participants
Add participants to the reviewers or watchers list depending on the action you want them to take.
To add a reviewer or a watcher
You can add as many participants as you wish and whenever you wish: when starting a review, or at any time after that.
The people you add are notified via e-mail and Upsource news feed.
To remove a participant, click their userpic in the Reviewers area and confirm the deletion:
![Remove participant Remove participant](https://resources.jetbrains.com/help/img/upsource/2017.3/CR_removeParticipant.png)
Set a deadline
![CR_set_deadline CR_set_deadline](https://resources.jetbrains.com/help/img/upsource/2017.3/CR_set_deadline.png)
You can optionally set (or adjust) the review deadline to remind the reviewers when you'd like the review completed. The default value can be preset by a project administrator for all reviews.
Participate in discussion
You can post comments, addressing them to other participants, and reply to the comments left by others. See Discussion comments for details.
Review progress
A progress bar underneath a reviewer's avatar will give you a hint on each reviewer's progress. Hover over it to see how many files out of those included with the review the reviewer has already opened.
![review_progress.png review_progress.png](https://resources.jetbrains.com/help/img/upsource/2017.3/review_progress.png)
Review resolution
When reviewers accept or
raise concern about your changes, their resolution is indicated with a corresponding flag:
![CR_accept_reject CR_accept_reject](https://resources.jetbrains.com/help/img/upsource/2017.3/CR_accept_reject.png)
Add new revisions
If the revision you had originally submitted for review was not approved by the reviewers, you can work on the issues, commit fixes, and attach one or several new revisions to the original review for approval.
This way the whole discussion and revision history is contained within one review, and as long as the review is open it will always be visible throughout the different revisions.
You can attach a new revision to an existing review on the project page. Move your cursor to the revision you'd like to attach, click Review changes, then select Attach to review..:
You can also attach a revision from the review page, by pressing the Add revision.. button under the Overview tab.
When new revisions are added to the review, you only see the diff of those revisions. If you want to show or hide any additional revisions within a review, use a revision selector that quickly toggles revisions on and off:
![CR revision selector CR revision selector](https://resources.jetbrains.com/help/img/upsource/2017.3/CR_revision_selector.png)
To detach a revision from a review, in the review home view, click the icon next to the revision name:
![Detach from review Detach from review](https://resources.jetbrains.com/help/img/upsource/2017.3/CR_detach.png)
Open a review in IDE
When you click this link, the review and the revisions it includes will be displayed in a separate tab of the Review tool window of your currently opened IDEA-based IDE. For this option to work, the IDE should have the Upsource plug-in installed and configured and the project should be open in the IDE.
![CR_open_in_IDE CR_open_in_IDE](https://resources.jetbrains.com/help/img/upsource/2017.3/CR_open_in_IDE.png)
Close review
As soon as all reviewers have approved your changes, and you expect no further input, you can close the review by clicking a corresponding button in the right pane:
![Close review Close review](https://resources.jetbrains.com/help/img/upsource/2017.3/CR_closeRev.png)
Review status
A review can go through three different stages:
- Pending — review is created and reviewers assigned.
- Completed — all reviewers completed the review by raising concern about or accepting your changes.
- Closed — review is closed by its author, as no further action is required or expected from all participants.
Remove review
Whether you've created a review by mistake, or want to clean up and get rid of outdated reviews, you can always delete a review no matter what its current status is.
Click the Edit icon next to the review title:
![CR_click_edit_title CR_click_edit_title](https://resources.jetbrains.com/help/img/upsource/2017.3/CR_click_edit_title.png)
Then push the Remove review button.
![CR_remove_review.png CR_remove_review.png](https://resources.jetbrains.com/help/img/upsource/2017.3/CR_remove_review.png)