> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/issues/pull-request-review.md).

# Pull Request Review

*This feature is only supported for GitHub pull requests and is currently in alpha, subject to the terms* [*here*](https://www.sonarsource.com/legal/early-access/)*.*

The pull request review feature offers:

* Direct navigation from your GitHub pull request to your issues in SonarQube Cloud.
* Analysis summary with quality gate status and statistics about issues, and coverage and duplication metrics.
* AI-based organization of the changed files within your pull request into groups based on the nature of the code changes and other relevant criteria.
* In-context visualization of the code changes, the issues, the code coverage, and the code duplication.
* Review guidance and review follow-up.

## Retrieving your pull request in the Review page

You can open the Pull Request Review page either from your GitHub pull request or in SonarQube Cloud.

### From your GitHub pull request

1. In your GitHub pull request, go to the **Checks** or **Conversation** tab.
2. In the pull request analysis summary, select the **Review in SonarQube** button. The SonarQube Cloud’s [Pull Request Review page](#pull-request-review-page-overview) opens with your pull request.

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/QlXujz4PUc3b82A5Znnp" alt="Select the Review in SonarQube button."><figcaption></figcaption></figure>

### From your SonarQube Cloud project

1. Retrieve your SonarQube Cloud project. For more information, see [Retrieving projects](/sonarqube-cloud/managing-your-projects/retrieving-projects.md).
2. In the project navigation bar, select **Pull Requests**.
3. In the list of pull requests, select your pull request.
4. In the pull request navigation bar, select **Review**. The [Pull Request Review](#pull-request-review-page-overview) page opens.
5. To navigate to another pull request, use the drop-down menu in the page header.

### Pull Request Review page overview

The **Pull Request Review** page of a SonarQube Cloud project consists of:

1. **Pull request review header** at the top. The header contains a selection menu to navigate to another pull request or branch analysis within your project. It also displays various details about the currently selected pull request and allows you to navigate to the pull request in GitHub.
2. **Group navigation bar** on the left side. In this bar, you can navigate through the changed files organized by groups. The file selected in the bar is shown in the Code review section.
3. **Code review section** on the right side. This section contains at the top a summary of the pull request’s analysis. It also lists all the changed files organized by groups and shows for each file the GitHub's code diff, and the issues and other metrics returned by SonarQube Cloud.

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/ZvseIe4ieZ8oEy9PRVwm" alt="The Pull Request Review page consists of the review header at the top, the group navigation bar on the left, and the review section on the right."><figcaption></figcaption></figure>

## Viewing pull request analysis results

1. Retrieve the pull request in the Pull Request Review page of your SonarQube Cloud project: see [#retrieving-your-pull-request-in-the-review-page](#retrieving-your-pull-request-in-the-review-page "mention").
2. At the top of the Code review section on the right side, you can see the summary of the pull request analysis with:
   * The quality gate status. If it failed, the number of failed quality gate conditions is indicated.
   * Statistics about various metrics. Select a metric to get more information about it.

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/r3yiS271lXaHbhvg2GD2" alt="A summary of the pull request analysis results is shown at the top of the Review section."><figcaption></figcaption></figure>

3. To view the analysis metrics for a given file, select the file in the Group navigation bar on the left side. The file is displayed in the Code review section on the right side. You can view the metrics in the file header.

## Reviewing the file changes within a group

To review the code changes of a group of files within your pull request:

1. Retrieve the pull request in the Pull Request Review page of your SonarQube Cloud project: see [Retrieving your pull request in the Review page](https://docs.google.com/document/d/1JA7bzghqZz5WwDBq2Wc5c-pB38KaYZvxsmRhUxJP8eQ/edit?tab=t.0#heading=h.gvp3hfax6j9p).
2. In the Group navigation bar on the left side, select the first file of the group you want to review. The file is displayed in the Code review section on the right side.\
   At the top of the group, above the first file, the group summary shows:
   1. Group name.
   2. Group status. The status can be either Needs review or Reviewed.
   3. Statistics about the pull request:
      * Number of files within the group.
      * Code diff: number of added and of removed lines of code.
   4. Summary of the code changes purpose for the group.
   5. Review focus: guidelines for conducting your review.

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/LQSLBNz6Lp7LDCyV1WYT" alt="The group header shows the group name (a), the group status (b), group statistics (c), the group&#x27;s changes purpose (d), and the review focus (e).."><figcaption></figcaption></figure>

5. Read the review focus.
6. Navigate to a file to review the code changes:
   1. The file review header shows:
      * File path.
      * Code diff statistics.
      * Code coverage percentage.
      * Duplications percentage.
      * Number of issues. You can navigate to the list of issues by selecting the number.
      * File’s review status.
   2. Hover your mouse over a mark in the left side bar of the section to get information about it.
   3. Issues are displayed as cards (see [Retrieving issues](/sonarqube-cloud/managing-your-projects/issues/retrieving.md#issue-cards) for more information). If you have the corresponding permission, you can change the issue status or re-assign the issue. You can also select the issue to manage it in SonarQube Cloud’s Issues page and benefit from all issue management features. See [Managing code issues](/sonarqube-cloud/managing-your-projects/issues.md).

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/SKECYW0CMmUqPCWPMU9S" alt="When reviewing a file, you have analysis metrics in the file header (1), you can hoover your mouse over marks in the left side bar (b), you can see the raised issues (c)."><figcaption></figcaption></figure>

5. Once you’ve completed the file review, mark the file as reviewed by selecting the corresponding button in the far right of the file review header. The file collapses and the button switches to reviewed as illustrated below.

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/LMLN1wVCrdE5M0hXaCEH" alt="The Mark as reviewed button in the file header has switched to Reviewed."><figcaption></figcaption></figure>

To expand the file, select the expand button in the far left of the file review header.

## Marking a group as reviewed

Once you have reviewed all changed files in a group, you can mark the group as reviewed:

1. In the Code review section, navigate to the bottom of the group and select the **Mark as reviewed** button as illustrated below.

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/Jw9udxPdjWLsWJv0ADRE" alt="Select the Mark as reviewed button at the bottom of the group."><figcaption></figcaption></figure>

2. The group collapses and:
   1. Its status changes to Reviewed in the group header.
   2. In the Group navigation bar, the group switches to green with a check mark.
   3. The pull request’s review status is updated in the top right corner of the Group navigation bar.

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/KNVjbbx2i3MSWXwmHe8s" alt="The Reviewed status (a) is assigned to the group. The gourp&#x27;s Reviewed status is also visible in the Group navigation bar (b). The pull request review status (c) is udpated. in the"><figcaption></figcaption></figure>

## Setting a group status back to needs review

1. Retrieve the pull request in the Pull Request Review page of your SonarQube Cloud project: see [#retrieving-your-pull-request-in-the-review-page](#retrieving-your-pull-request-in-the-review-page "mention").
2. In the Code review section of your pull request, navigate to the group.
3. If the group is collapsed, select the expand button at the far right of the group header.
4. At the bottom of the group, select the **Mark as needs** **review** button.

## Viewing the pull request review status

Retrieve the pull request in the Pull Request Review page of your SonarQube Cloud project: see [#retrieving-your-pull-request-in-the-review-page](#retrieving-your-pull-request-in-the-review-page "mention"). The pull request review status is shown in the top right corner of the Group navigation bar. The first number indicates the number of reviewed groups and the second number indicates the total number of groups in the pull request. In the Group navigation bar, the reviewed groups are in green with a check mark.

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/NAQ0zb1qhl2QTYgNh2Je" alt="The pull request review status is shown on the top right corner of the Group navigation bar."><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/issues/pull-request-review.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
