Sub topic 3
Requesting a review on a pull request
This chapter assumes you can create branches, commits, and pull requests on GitHub, and that you have a Copilot plan that includes code review. You will request a Copilot review from the Reviewers menu and learn what happens next. Reading and acting on the comments is covered in later chapters.
What you are requesting
Copilot code review is a reviewer you add to a pull request, in the same way you add a teammate. Copilot reads the diff and the surrounding code. It then posts a review with comments on specific lines, and sometimes with suggested changes you can apply.
Copilot's review always has the "Comment" status. It never approves a pull request and never blocks one. A human approval is still a separate step.
Prerequisites to check first
Before you request a review, confirm three things:
- Your account has a Copilot plan that includes code review.
- The pull request is open and has at least one commit that differs from the base branch.
- Copilot code review is enabled for the repository or organization. If your organization restricts it, Copilot won't appear in the Reviewers menu.
If Copilot is missing from the menu, the cause is almost always access or enablement, not the pull request itself.
Request a review step by step
The basic flow is the same on every pull request.
1. Open the pull request on GitHub.
2. In the sidebar, open the Reviewers menu.
3. Select Copilot.
4. Wait for Copilot to post a review with the "Comment" status.
5. Read the comments and apply or dismiss each suggestion.
6. After pushing new commits, use the re-request review button next to Copilot's name.This chapter covers steps 1 to 4. Steps 5 and 6 have their own chapters.
When you select Copilot, it appears in the Reviewers list with a pending indicator. Reviews usually finish within a minute or so, depending on the size of the diff. You don't need to keep the page open. GitHub notifies you the same way it does for human reviews.
What the review contains
A completed review has two parts:
- A summary comment on the pull request that describes what Copilot looked at and lists the main findings.
- Inline comments attached to specific lines or ranges in the diff.
Some inline comments include a suggested change, shown as a diff you can commit directly from the browser. Many comments only describe a concern and leave the fix to you.
A review can contain no inline comments. That means Copilot found nothing it chose to flag. It does not mean the code is correct.
Common errors
| Symptom | Likely cause | What to do |
|---|---|---|
| Copilot is not in the Reviewers menu | No Copilot plan with code review, or the feature is disabled for the repository or organization | Check your plan, then ask an administrator to enable it |
| The review stays pending | Large diff, or a temporary service delay | Wait a few minutes, then remove and re-add Copilot |
| The review has no comments | Copilot flagged nothing | Treat this as one signal, and still request human review |
| Comments are about style you don't care about | No custom instructions are set | Add repository instructions (covered later in this tutorial) |
| Review runs on a draft pull request and seems incomplete | The code is still changing | Request the review again once the work is ready |
Practical tips
Request a review when the pull request is reasonably complete. Reviewing a half-finished change produces comments about code you were about to rewrite.
Keep pull requests small. A focused diff gives Copilot less to miss and gives you fewer comments to sort through.
Request Copilot at the same time as your human reviewers. Copilot responds quickly, so you can fix obvious issues before a teammate spends time on them.
Check your understanding
Exercise
You open the Reviewers menu on a pull request and Copilot isn't listed. Name two possible causes, and say what you would check first.
Show answer
Possible causes are that your account lacks a Copilot plan that includes code review, or that code review is disabled for the repository or organization. Check your plan and access first, because that is the most common cause. If your plan is fine, ask an administrator whether the feature is enabled for the repository or organization.
Exercise
Copilot posts a review with no inline comments. Can you merge without a human review? Explain.
Show answer
Not on that basis. Copilot's review has the "Comment" status, so it doesn't count as an approval. An empty review means Copilot flagged nothing, not that the code is correct. Your team's normal human review requirements still apply.