21 KiB
title, shortTitle, intro, allowTitleToDifferFromFilename, versions, topics, redirect_from
| title | shortTitle | intro | allowTitleToDifferFromFilename | versions | topics | redirect_from | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Using GitHub Copilot code review | Use code review | Learn how to request a code review from {% data variables.product.prodname_copilot %}. | true |
|
|
|
About {% data variables.copilot.copilot_code-review_short %}
{% data variables.product.prodname_copilot %} can review your code and provide feedback. Where possible, {% data variables.product.prodname_copilot_short %}'s feedback includes suggested changes which you can apply with a couple of clicks.
{% vscode %}
{% data variables.copilot.copilot_code-review_short %} in {% data variables.product.prodname_vscode %} supports two types of review:
- Review selection: Highlight code and ask for an initial review
- Review changes: Request a deeper review of all your changes
The current functionality and availability of the two types of review is summarized in the following table:
{% rowheaders %}
| Review selection | Review changes | |
|---|---|---|
| Available in | {% data variables.product.prodname_vscode %} | {% data variables.product.prodname_vscode %} and the {% data variables.product.github %} website |
| Premium/standard feature | Standard feature available to all {% data variables.product.prodname_copilot_short %} subscribers | Premium feature. Available with the {% data variables.copilot.copilot_pro_short %}, {% data variables.copilot.copilot_pro_plus_short %}, {% data variables.copilot.copilot_business_short %}, and {% data variables.copilot.copilot_enterprise_short %} plans. Per-person monthly quota applies. |
| Description | Initial review of a highlighted section of code with feedback and suggestions | Deeper review of all changes |
| Language support | All | All |
| Custom coding guidelines support | No | Yes, see Customizing {% data variables.product.prodname_copilot_short %}'s reviews with coding guidelines |
{% endrowheaders %}
Code review monthly quota
The review changes type of {% data variables.copilot.copilot_code-review_short %} is a premium feature with a per-person monthly quota.
When you assign {% data variables.product.prodname_copilot_short %} as a reviewer for a pull request, one premium request is deducted from your monthly quota each time {% data variables.product.prodname_copilot_short %} posts comments to the pull request. See AUTOTITLE.
If a repository is configured to automatically request a code review from {% data variables.product.prodname_copilot_short %} for all new pull requests, the premium request usage is applied to the quota of the pull request author. If a pull request is created by {% data variables.product.prodname_actions %} or by a bot, the usage will apply to the user who triggered the workflow (if identifiable), or to a designated billing owner.
When you reach your monthly quota you will not be able to get a code review from {% data variables.product.prodname_copilot_short %} until your quota resets—unless you upgrade your {% data variables.product.prodname_copilot_short %} plan or enable additional premium requests.
{% endvscode %}
{% webui %}
Two types of {% data variables.copilot.copilot_code-review_short %} are available:
- Review selection: Highlight code and ask for an initial review (only available in {% data variables.product.prodname_vscode_shortname %})
- Review changes: Request a deeper review of all your changes (available in {% data variables.product.prodname_vscode_shortname %} and the {% data variables.product.github %} website)
This version of the article relates to {% data variables.copilot.copilot_code-review_short %} on the {% data variables.product.github %} website. To see information about the review selection type of {% data variables.copilot.copilot_code-review_short %}, click the "{% data variables.product.prodname_vscode %}" tool switcher at the top of the page.
Availability
{% data variables.copilot.copilot_code-review_short %} on the {% data variables.product.github %} website is a premium feature, available with the {% data variables.copilot.copilot_pro_short %}, {% data variables.copilot.copilot_pro_plus_short %}, {% data variables.copilot.copilot_business_short %}, and {% data variables.copilot.copilot_enterprise_short %} plans.
Code review monthly quota
The review changes type of {% data variables.copilot.copilot_code-review_short %} is a premium feature with a per-person monthly quota.
When you assign {% data variables.product.prodname_copilot_short %} as a reviewer for a pull request, one premium request is deducted from your monthly quota each time {% data variables.product.prodname_copilot_short %} posts comments to the pull request. See AUTOTITLE.
If a repository is configured to automatically request a code review from {% data variables.product.prodname_copilot_short %} for all new pull requests, the premium request usage is applied to the quota of the pull request author. If a pull request is created by {% data variables.product.prodname_actions %} or by a bot, the usage will apply to the user who triggered the workflow (if identifiable), or to a designated billing owner.
When you reach your monthly quota you will not be able to get a code review from {% data variables.product.prodname_copilot_short %} until your quota resets—unless you upgrade your {% data variables.product.prodname_copilot_short %} plan or enable additional premium requests.
Language support
{% data variables.copilot.copilot_code-review_short %} on the {% data variables.product.github %} website supports all languages.
{% endwebui %}
Validating {% data variables.product.prodname_copilot_short %} code reviews
[!WARNING] {% data variables.product.prodname_copilot_short %} isn't guaranteed to spot all problems or issues in a pull request, and sometimes it will make mistakes. Always validate {% data variables.product.prodname_copilot_short %}'s feedback carefully, and supplement {% data variables.product.prodname_copilot_short %}'s feedback with a human review.
For more information, see AUTOTITLE.
Requesting a review from {% data variables.product.prodname_copilot_short %}
{% webui %}
These instructions explain how to use {% data variables.copilot.copilot_code-review_short %} in the {% data variables.product.github %} website. To see instructions for other popular coding environments, use the tool switcher at the top of the page.
Requesting a pull request review from {% data variables.product.prodname_copilot_short %}
-
On {% data variables.product.prodname_dotcom_the_website %}, create a pull request or navigate to an existing pull request.
-
Open the Reviewers menu, then select {% data variables.product.prodname_copilot_short %}.
-
Wait for {% data variables.product.prodname_copilot_short %} to review your pull request. This usually takes less than 30 seconds.
-
Scroll down and read through {% data variables.product.prodname_copilot_short %}'s comments.
{% data variables.product.prodname_copilot_short %} always leaves a "Comment" review, not an "Approve" review or a "Request changes" review. This means that {% data variables.product.prodname_copilot_short %}'s reviews do not count toward required approvals for the pull request, and {% data variables.product.prodname_copilot_short %}'s reviews will not block merging changes. For more details, see AUTOTITLE.
-
{% data variables.product.prodname_copilot_short %}'s review comments behave like review comments from humans. You can add reactions to them, comment on them, resolve them and hide them.
Any comments you add to {% data variables.product.prodname_copilot_short %}'s review comments will be visible to humans, but they won't be visible to {% data variables.product.prodname_copilot_short %}, and {% data variables.product.prodname_copilot_short %} won't reply.
Working with suggested changes provided by {% data variables.product.prodname_copilot_short %}
Where possible, {% data variables.product.prodname_copilot_short %}'s feedback includes suggested changes which you can apply with a couple of clicks.
If you're happy with the changes, you can accept a single suggestion from {% data variables.product.prodname_copilot_short %} and commit it, or accept a group of suggestions together in a single commit. For more information, see AUTOTITLE.
Providing feedback on {% data variables.product.prodname_copilot_short %}'s reviews
You can provide feedback on {% data variables.product.prodname_copilot_short %}'s comments directly within each comment. We use this information to improve the product and the quality of {% data variables.product.prodname_copilot_short %}'s suggestions.
-
On a pull request review comment from {% data variables.product.prodname_copilot_short %}, click the thumbs up (👍) or thumbs down (👎) button.
-
If you click the thumbs down button, you're asked to provide additional information. You can, optionally, pick the reason for your negative feedback and leave a comment before clicking Submit feedback.
Requesting a re-review from {% data variables.product.prodname_copilot_short %}
When you push changes to a pull request that {% data variables.product.prodname_copilot_short %} has reviewed, it won't automatically re-review your changes.
To request a re-review from {% data variables.product.prodname_copilot_short %}, click the {% octicon "sync" aria-label="Re-request review" %} button next to {% data variables.product.prodname_copilot_short %}'s name in the Reviewers menu. For more information, see AUTOTITLE.
[!NOTE] When re-reviewing a pull request, {% data variables.product.prodname_copilot_short %} may repeat the same comments again, even if they have been dismissed with the "Resolve conversation" button or downvoted with the thumbs down (👎) button.
Enabling automatic reviews
By default, you manually request a review from {% data variables.product.prodname_copilot_short %} on each pull request, in the same way you would request a review from a human. However, you can set up {% data variables.product.prodname_copilot_short %} to automatically review all pull requests. See AUTOTITLE.
Customizing {% data variables.product.prodname_copilot_short %}'s reviews with custom instructions
{% data reusables.copilot.code-review.custom-instructions-information %}
Customizing {% data variables.product.prodname_copilot_short %}'s reviews with coding guidelines
{% data reusables.copilot.code-review.custom-coding-guidelines %}
{% endwebui %}
{% vscode %}
These instructions explain how to use {% data variables.copilot.copilot_code-review_short %} in {% data variables.product.prodname_vscode %}. To see instructions for other popular coding environments, use the tool switcher at the top of the page.
[!NOTE] {% data variables.copilot.copilot_code-review_short %} is only available in {% data variables.product.prodname_vscode %} with version 0.22 or later of the {% data variables.copilot.copilot_chat %} extension.
Reviewing a selection of code
You can request an initial review of a highlighted selection of code in {% data variables.product.prodname_vscode %}.
-
In {% data variables.product.prodname_vscode %}, select the code you want to review.
-
Open the {% data variables.product.prodname_vscode_command_palette_shortname %}
- For Mac:
- Use: Shift+Command+P
- For Windows or Linux:
- Use Ctrl+Shift+P
- For Mac:
-
In the command palette, search for and select {% data variables.product.prodname_copilot %}: Review and Comment.
-
Wait for {% data variables.product.prodname_copilot_short %} to review your changes. This usually takes less than 30 seconds.
-
If {% data variables.product.prodname_copilot_short %} has any comments, they will be shown inline in your file, and in the Problems tab.
Reviewing changes
You can request a review for your staged or unstaged changes in {% data variables.product.prodname_vscode %}.
-
In {% data variables.product.prodname_vscode_shortname %}, switch to the Source Control tab.
-
To request a review on your unstaged changes, hover over Changes in the sidebar, and then click the {% data reusables.copilot.code-review.staging-icon-vscode %} {% data variables.copilot.copilot_code-review_short %} - Changes button.
-
To request a review on your staged changes, hover over Staged Changes in the sidebar, and then click the {% data reusables.copilot.code-review.staging-icon-vscode %} {% data variables.copilot.copilot_code-review_short %} - Staged Changes button.
-
Wait for {% data variables.product.prodname_copilot_short %} to review your changes. This usually takes less than 30 seconds.
-
If {% data variables.product.prodname_copilot_short %} has any comments, they will be shown inline in your file(s), and in the Problems tab.
Working with suggested changes provided by {% data variables.product.prodname_copilot_short %}
Where possible, {% data variables.product.prodname_copilot_short %}'s feedback includes suggested changes which you can apply with a single click.
If you're happy with the change, you can accept a suggestion from {% data variables.product.prodname_copilot_short %} by clicking the Apply and Go To Next button. Any changes you apply will not be automatically committed.
If you don't want to apply {% data variables.product.prodname_copilot_short %}'s suggested change, click the Discard and Go to Next button.
Providing feedback on {% data variables.product.prodname_copilot_short %}'s reviews
You can provide feedback on {% data variables.product.prodname_copilot_short %}'s comments directly within each comment. We use this information to improve the product and the quality of {% data variables.product.prodname_copilot_short %}'s suggestions.
To provide feedback, hover over the comment and click the thumbs up or thumbs down button.
Customizing {% data variables.product.prodname_copilot_short %}'s reviews with custom instructions
{% data reusables.copilot.code-review.custom-instructions-information %}
Customizing {% data variables.product.prodname_copilot_short %}'s reviews with coding guidelines
{% data reusables.copilot.code-review.custom-coding-guidelines %}
{% endvscode %}
{% visualstudio %}
These instructions explain how to use {% data variables.copilot.copilot_code-review_short %} in {% data variables.product.prodname_vs %}. To see instructions for other popular coding environments, use the tool switcher at the top of the page.
To use {% data variables.copilot.copilot_code-review_short %}, you must use {% data variables.product.prodname_vs %} version 17.14 or later. See the {% data variables.product.prodname_vs %} downloads page.
-
In the Git Changes window, click Review changes with {% data variables.product.prodname_copilot_short %}. This button appears as a comment icon with a sparkle.
-
{% data variables.product.prodname_copilot_short %} will begin reviewing your changes. After a few moments, a link showing the number of code review comments appears in the Git Changes window.
-
Click the link to view and navigate the comments. If no issues are found, you’ll see the message: {% data variables.product.prodname_copilot_short %} did not comment on any files.
-
{% data variables.product.prodname_copilot_short %} displays comments in your code with a summary of each potential issue. You can:
- Review and make changes based on the suggestions.
- Dismiss a comment using the downward arrow in the top-right corner of the comment box.
-
To remove all review comments, click {% octicon "x" aria-label="The X icon" %} next to the code review link in the Git Changes window.
For more information on enabling and configuring {% data variables.copilot.copilot_code-review_short %} in {% data variables.product.prodname_vs %}, see Review local changes with {% data variables.copilot.copilot_chat_short %} in the {% data variables.product.prodname_vs %} documentation.
{% endvisualstudio %}








