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 committed 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 filters to find the revision you're interested in.

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

    createReview.png

    A new review is created and opened:

    reviewCreated.png

The default code review title is the same as your commit (or the last commit in a multi-commit review) included in the review.

To edit the code review title and add description to the review:

  1. In the top right corner of the code review page, click edit-blue.png

  2. Edit the title and add description:

    editCodeReview.png
  3. Click Save.

    Description will be displayed in the Timeline tab, on top of review comments.

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:

  • Place your cursor over the reviewer then click x:

    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. The status indicator under your name in the right-hand panel will tell you whether you should wait or take action.

authorStatusWaiting.png

Gray 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 in the top right corner to change your status and pass the turn to the reviewer.

authorStatusEnd.png

A blank status under your name indicates that the review is complete and can be closed. Click the Close review button in the top right corner. If the review is a merge request, click the Merge button 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 Comments and Suggested Changes 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 the arrow next to the New code review button 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.

  2. Click plus-add-grey.png next to Changes from commits:

    addCommits.png

    A list of commits will pop up.

  3. Choose one or more commits from the list and click Add commits:

    selectAddCommits.png

Detach a commit from the review:

  1. On the review page, go to the Changes tab and expand the Changes from commits view.

  2. Select the commits you want to detach.

  3. Click Detach selected:

    detachCommitFromReview.png

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 corresponding button:

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.

Technically, you can close a code review at any stage. For example, if you have created it by mistake. Just click menu-horizontal.png and choose Close review:

closeReviewFromMenu.png

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: 15 December 2023