JetBrains Space Help

Start (Request) a Code Review

As someone who requests code review from your teammates, you typically perform the following sequence of tasks:

  1. Commit and push changes to your Git repository.

  2. Create a code review. If you have commited your changes to a feature branch and now would like to merge it to a base branch (main, master), create a merge request.

  3. Invite reviewers and wait for their feedback.

  4. Discuss issues, if any, by way of exchanging comments with the reviewer(s).

  5. Work on resolving the issues, commit the fixes, and add the new revision(s) to the existing review.

  6. As soon as the reviewer(s) approve your changes, you close the review. If the review is a merge request, you merge your branch.

Create a code review

  1. Navigate to the project and open the repository.

  2. Go to the Commits tab. Recent commits are listed in chronological order.

  3. Scroll down the list or use the Search field to find the revision you're interested in.

  4. Select the revision entry, then click Review changes → New code review:

    createReview.png

    A new review is created, opened, and its ID is displayed:

    reviewCreated.png
  • The default review title is the same as your commit which becomes a part of this review.

  • To change the review title, just click edit.png and edit it.

In the next step you need to assign at least one reviewer to the review.

Assign reviewers

Assign reviewers by adding them to the reviewers list.

To add a reviewer:

  1. On the review page, click the plus icon and select one or more reviewers from the drop-down list:

    addReviewer.png

    The assigned reviewers will be shown on top of the review page.

  2. The people you add as reviewers will be notified in their Chats.

    Now you need to wait for the reviewer(s) to finish examining your changes. You'll be notified when they are done, and it's your turn to proceed.

To remove a reviewer:

  • Click the reviewer's user icon then Remove...:

    removeFromReview.png

Subscribe others as watchers

You can invite others to watch updates and discuss changes by subscribing them to the review. Just mention them in a comment: type @ and pick a person from the list.

Check your status

In a code review, participants take turns to keep the process clear and orderly. A status indicator at the top-right will tell you whether you should wait or take action.

authorStatusWaiting.png

Blue color indicates that no action is required, wait for the reviewer to finish their turn.

authorStatusRevising.png

Orange color indicates that it's your turn, and you are expected to take some action such as:

  • Reply to comments posted by the reviewer.

  • Commit some additional changes or fixes and attach the commit to the review.

Once you're finished, click the suggested action on the status indicator to change your status and pass the turn to the reviewer.

authorStatusEnd.png

Indicates that the review is complete and can be closed. Click the arrow on the status indicator to close the review. In the review is a merge request, click the arrow to merge your branch and close the review.

Post comments

You can post comments, addressing them to other participants, and reply to the comments left by others. See Discussion and Comments in Code Review for details.

Add more commits (revisions) to the review

A review can contain multiple commits when:

  • The changes you want to be reviewed are spread across several commits.

  • The commit you had originally submitted for review was not approved by the reviewers. You can then work on the issues, commit fixes, and attach one or several new commits to the original review for approval.

This way the entire commit and discussion history is contained within one review, and as long as the review is open it will always be visible throughout the different commits.

Attach another commit (revision) from the commit list:

  1. On the commit list, locate the commit you want to attach and select it.

  2. On the right pane, click Review changes and choose Add to existing review:

    attachToReview.png
  3. From the displayed list, choose the review to which you want to attach the commit.

Attach another commit (revision) from the review page:

  1. On the review page, go to the Changes tab and expand the Commits view:

    expandCommitsView.png
  2. Click plus-add-grey.png next to Commits.

    addCommits.png

    A list of commits will pop up.

  3. Choose one or more commits from the list.

  4. Click Add commits.

Detach a commit from the review:

  1. On the review page, go to the Changes tab and expand the Commits view:

  2. Select the commits you want to detach and click Detach selected.

Reviewer's approval

When reviewers accept your changes, you are notified in Chats. Their resolution will be also posted on the review page under the Timeline tab, and indicated on their user icons (they will be encircled in green):

reviewResolutionAvatar.png
reviewResolutionAll.png

Close a code review

If all the reviewers have accepted your changes, the review is complete and you are expected to close it. To close the review, click the status indicator and choose Close review:

closeReview.png

If all the discussions in the review have been marked Resolved, the review will close by itself when all the reviewers accept your changes.

Keep track of reviews

The Code Reviews page lets you keep track of the reviews you participate in or are expected to. Use filters to check which reviews need your attentions either as author or reviewer.

gotoReviewsPage.png

On this page, you can also see and search all reviews in the project.

Last modified: 21 January 2021