| title | About GitHub Copilot code review | ||||
|---|---|---|---|---|---|
| shortTitle | Code review | ||||
| allowTitleToDifferFromFilename | true | ||||
| intro | Find out how {% data variables.product.prodname_copilot_short %} can review pull requests for you. | ||||
| versions |
|
||||
| redirect_from |
|
||||
| contentType | concepts | ||||
| category |
|
{% data variables.copilot.copilot_code-review_short %} reviews code written in any language, and provides feedback. It reviews your code from multiple angles to identify issues and suggest fixes. You can apply suggested changes with a couple of clicks.
This article provides an overview of {% data variables.copilot.copilot_code-review_short %}. To learn how to request a code review from {% data variables.product.prodname_copilot_short %}, see AUTOTITLE.
{% data variables.copilot.copilot_code-review_short %} is supported in:
- {% data variables.product.prodname_dotcom_the_website %}
- {% data variables.product.prodname_mobile %}
- {% data variables.product.prodname_vscode_shortname %}
- {% data variables.product.prodname_vs %}
- Xcode
- JetBrains IDEs
{% data variables.copilot.copilot_code-review_short %} is a premium feature available with these plans:
- {% data variables.copilot.copilot_pro_short %}
- {% data variables.copilot.copilot_pro_plus_short %}
- {% data variables.copilot.copilot_business_short %}
- {% data variables.copilot.copilot_enterprise_short %}
See {% data variables.product.prodname_copilot_short %} plans.
If you receive {% data variables.product.prodname_copilot_short %} from an organization, your organization must enable the {% data variables.copilot.copilot_code-review_short %} option in the {% data variables.product.prodname_copilot_short %} policy settings. This applies to reviews on {% data variables.product.prodname_dotcom_the_website %} or in {% data variables.product.prodname_mobile %}. See AUTOTITLE.
{% data variables.copilot.copilot_code-review_short %} without a {% data variables.product.prodname_copilot_short %} license
Organization members without a {% data variables.product.prodname_copilot_short %} license can use {% data variables.copilot.copilot_code-review_short %} on {% data variables.product.prodname_dotcom_the_website %}. An enterprise administrator or organization owner must enable it. This capability is available to organizations on {% data variables.copilot.copilot_business_short %} and {% data variables.copilot.copilot_enterprise_short %} plans.
To allow organization members without a {% data variables.product.prodname_copilot_short %} license to use {% data variables.copilot.copilot_code-review_short %}, you must enable two policies:
- Premium request paid usage. Enable this policy first. It allows the enterprise or organization to incur charges for {% data variables.copilot.copilot_code-review_short %} premium request usage.
- Allow members without a {% data variables.product.prodname_copilot_short %} license to use {% data variables.copilot.copilot_code-review_short %} in {% data variables.product.prodname_dotcom_the_website %}. This sub-policy enables {% data variables.copilot.copilot_code-review_short %} for users without a license.
The second policy has these characteristics:
- It is disabled by default.
- Once this policy is set it at the enterprise level, it becomes visible, but not editable at the organization level.
- The policy is most restrictive. {% data variables.copilot.copilot_code-review_short %} is only available in repositories where you explicitly enable the policy.
When both policies are enabled, users without a {% data variables.product.prodname_copilot_short %} license can request a review from {% data variables.copilot.copilot_code-review_short %} on their pull requests in the organization's repositories.
In repositories where automatic code review is enabled, {% data variables.product.prodname_copilot_short %} automatically reviews all pull requests. This happens regardless of whether the author has a {% data variables.product.prodname_copilot_short %} license.
{% data variables.copilot.copilot_code-review_short %} for users without a license is not available in IDEs.
Some file types are excluded from {% data variables.copilot.copilot_code-review_short %}:
- Dependency management files, such as package.json and Gemfile.lock
- Log files
- SVG files
If you include these file types in a pull request, {% data variables.copilot.copilot_code-review_short %} will not review the file.
For more information, see AUTOTITLE.
Note
- {% data variables.copilot.copilot_code-review_short %} has capabilities that are in {% data variables.release-phases.public_preview %} and subject to change. The AUTOTITLE apply to your use of preview features.
{% data variables.copilot.copilot_code-review_short %} utilizes agentic capabilities to extend its functionality.
- Full project context gathering. This provides more specific, accurate, and contextually aware code reviews. This capability analyzes your entire repository to better understand the context of code changes. Full project context gathering is generally available.
- The ability to pass suggestions to {% data variables.copilot.copilot_coding_agent %}. This automates creating a new pull request against your branch with the suggested fixes applied. Passing suggestions to {% data variables.copilot.copilot_coding_agent %} is in public preview and subject to change.
These capabilities are enabled automatically for {% data variables.copilot.copilot_pro_short %} or {% data variables.copilot.copilot_pro_plus_short %} plans.
If {% data variables.product.prodname_actions %} is unavailable or if Actions workflows used by {% data variables.copilot.copilot_code-review_short %} fail, reviews will still be generated. However, they will not include the additional features provided by the agentic capabilities.
Usage of {% data variables.product.prodname_actions %} runners for agentic capabilities in code review
{% data variables.copilot.copilot_code-review_short %} uses free minutes for {% data variables.product.prodname_actions %} to run the agentic capabilities, including full project context gathering and any capabilities in {% data variables.release-phases.public_preview %}. By default, {% data variables.copilot.copilot_code-review_short %} uses {% data variables.product.prodname_dotcom %}-hosted runners. You can also upgrade to larger {% data variables.product.prodname_dotcom %}-hosted runners for better performance.
Note
Usage of larger {% data variables.product.prodname_dotcom %}-hosted runners is billed per-minute and may incur additional {% data variables.product.prodname_actions %} charges.
You do not need to have {% data variables.product.prodname_actions %} enabled in your organization or enterprise to use the agentic capabilities in code review.
If your organization has disabled {% data variables.product.prodname_dotcom %}-hosted runners, the agentic capabilities will not be available. In this case, code reviews will fall back to a more limited review. Organizations in this situation can use self-hosted runners.
For more information on configuring runners, see AUTOTITLE.
Each time {% data variables.product.prodname_copilot_short %} reviews a pull request or reviews code in your IDE, your monthly quota of {% data variables.product.prodname_copilot_short %} premium requests is reduced by one.
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 pull request author's quota. If a review is manually requested by another user, the usage is applied to that user's quota instead.
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 that user can be identified.
- 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. To continue to use code reviews before your quota resets, you will need to upgrade your {% data variables.product.prodname_copilot_short %} plan or enable additional premium requests.
Users without a {% data variables.product.prodname_copilot_short %} license or plan that includes {% data variables.copilot.copilot_code-review_short %}
Users without access to {% data variables.copilot.copilot_code-review_short %} do not have a monthly premium request quota. This includes users who have no {% data variables.product.prodname_copilot_short %} license and users on the {% data variables.copilot.copilot_free_short %} plan, which does not include {% data variables.copilot.copilot_code-review_short %}.
When {% data variables.copilot.copilot_code-review_short %} is enabled for these users, any premium requests they generate are billed directly to the organization or enterprise as paid overage usage. This applies to both manually requested reviews and automatic code reviews.
Premium requests generated by these users are not attributed to any {% data variables.product.prodname_copilot_short %} plan quota. They appear as overage usage in billing reports and premium request analytics. Users with a {% data variables.product.prodname_copilot_short %} license that includes code review continue to consume premium requests from their assigned plan quota.
{% data reusables.copilot.ccr-model-usage %}
{% data reusables.copilot.ccr-model-settings %}
{% data variables.product.prodname_copilot_short %} is not guaranteed to spot all problems or issues in a pull request. Sometimes it will make mistakes. Always validate {% data variables.product.prodname_copilot_short %}'s feedback carefully. Supplement {% data variables.product.prodname_copilot_short %}'s feedback with a human review.
For more information, see AUTOTITLE.
The more {% data variables.product.prodname_copilot_short %} knows about the code in your repository, the tools you use, and your coding standards and practices, the more accurate and useful its reviews will become. You can enhance {% data variables.product.prodname_copilot_short %}'s knowledge of your repositories in two ways.
These are short, natural-language statements that you write and store as one or more files in a repository. If you are the owner of an organization on {% data variables.product.github %}, you can also define custom instructions in the settings for your organization. For more information, see AUTOTITLE.
If you have a {% data variables.copilot.copilot_pro_short %} or {% data variables.copilot.copilot_pro_plus_short %} plan, you can enable {% data variables.copilot.copilot_memory %}. This allows {% data variables.product.prodname_copilot_short %} to store useful details it has learned about a repository. {% data variables.product.prodname_copilot_short %} can then use this information when it reviews pull requests in that repository. For more information, see AUTOTITLE.
By default, {% data variables.product.prodname_copilot_short %} only reviews a pull request if you assign it to the pull request. However, you can configure automatic reviews.
- Individual users on the {% data variables.copilot.copilot_pro_short %} or {% data variables.copilot.copilot_pro_plus_short %} plan can configure {% data variables.product.prodname_copilot_short %} to automatically review all pull requests they create.
- Repository owners can configure {% data variables.product.prodname_copilot_short %} to automatically review all pull requests in the repository that are created by people with access to {% data variables.product.prodname_copilot_short %}.
- Organization owners can configure {% data variables.product.prodname_copilot_short %} to automatically review all pull requests in some or all of the repositories in the organization where the pull request is created by a {% data variables.product.prodname_copilot_short %} user.
The triggers for automatic code review depend on the configuration settings.
- Basic setting:
- When you create a pull request as an "Open" pull request.
- The first time you switch a "Draft" pull request to "Open".
- Review new pushes:
- Every time you push a new commit to the pull request.
- Review draft pull requests:
- Pull requests are automatically reviewed while they are still drafts, before you switch them to "Open".
For full instructions, see AUTOTITLE.
Note
Unless {% data variables.product.prodname_copilot_short %} has been configured to review each push to a pull request, it will only review a pull request once. If you make changes to the pull request after it has been automatically reviewed and you want {% data variables.product.prodname_copilot_short %} to re-review it, you can request this manually. Click the {% octicon "sync" aria-label="Re-request review" %} button next to {% data variables.product.prodname_copilot_short %}'s name in the Reviewers menu.
{% data variables.copilot.copilot_code-review %} reviews your code in pull requests and provides feedback. If you want actionable feedback on the reliability and maintainability of your whole repository, enable {% data variables.product.prodname_code_quality %}. See AUTOTITLE.