Copilot Code Reviews
Overview
Microsoft Copilot code reviews have now been enabled for pull requests.
Copilot will automatically review changes submitted in a pull request and provide feedback on potential issues, code quality concerns, maintainability improvements, and best practice recommendations.
Copilot reviews are intended to support the existing peer review process and help identify issues earlier in the development lifecycle.
What Copilot Reviews
When a pull request is created or updated, Copilot may provide feedback on:
- Potential bugs and logic issues
- Code readability and maintainability
- Security concerns
- Performance considerations
- Unused or redundant code
- Error handling opportunities
- Consistency with common coding best practices
Copilot reviews the code changes contained within the pull request and generates comments where potential improvements are identified.
What Copilot Does Not Replace
Copilot reviews are designed to assist developers and reviewers.
Copilot is not a replacement for:
- Human code reviews
- Architectural review
- Security review
- Testing
- Responsibility for code quality
All pull requests must continue to follow existing review and approval processes.
How to Use Copilot Feedback
When Copilot leaves comments on a pull request:
- Review the recommendation.
- Determine whether the suggestion is applicable.
- Update the code if the recommendation adds value.
- Resolve the comment or respond with justification where appropriate.
Not every recommendation will be relevant.
Developers should apply engineering judgement when deciding whether to act on Copilot feedback.
Expected Benefits
By incorporating Copilot reviews into the pull request process we aim to:
- Catch issues earlier in development
- Improve code quality and consistency
- Reduce manual reviewer effort
- Help identify common coding mistakes
- Encourage adherence to engineering best practices
Frequently Asked Questions
Is Copilot approval required before merging?
No.
Copilot comments should be reviewed and considered, but they do not replace the existing approval process or merge requirements.
Do I need to implement every Copilot suggestion?
No.
Copilot feedback is advisory. Use your judgement to determine whether a recommendation is applicable to the change being made.
Can Copilot be wrong?
Yes.
Copilot generates recommendations based on patterns and analysis of the code changes. Suggestions should always be reviewed and validated by developers.
Will Copilot review every pull request?
Copilot will attempt to review eligible pull requests, however review coverage and feedback may vary depending on the size and content of the change.
Copilot will not review pull requests marked as a draft.