Azure DevOps pull request votes: Approve with suggestions, Wait for author and Reject
A reviewer of an Azure DevOps pull request votes from the vote menu on the pull request page, and the reviewer's icon then shows the vote. A vote never completes the pull request; it decides whether it can be completed. Below is what each vote does, from Microsoft's Review pull requests, branch policies, the Pull Request Reviewers REST reference and the Sprint 167 release notes.
The five options
- Approve (
10in the REST API): approves the proposed changes. - Approve with suggestions (
5): approves them, with optional suggestions for improvement. - Wait for author (
-5): asks the author to look at the reviewers' comments; the author should tell the reviewers when to look again. From a required reviewer, it blocks the pull request's approval. - Reject (
-10): the changes are not acceptable; Microsoft asks you to add a comment saying why. From a required reviewer, it blocks the approval too. - Reset feedback (
0): clears your vote. Having no vote does not keep a pull request from completing.
When a vote blocks completion
- Required reviewers: all of them must approve before the changes merge, and their Wait for author or Reject blocks the pull request. A required reviewer added by a branch policy cannot be removed or made optional (required reviewers).
- Minimum number of reviewers: with this policy, any reviewer's Wait for author or Reject keeps the pull request from completing, unless Allow completion even if some reviewers vote to wait or reject is on; the minimum number of approvals is needed either way (why an approval does not count).
- After a push: Reset all approval votes (does not reset votes to reject or wait) removes the approvals and keeps Wait for author and Reject, so those stay until the reviewer changes them. Reset all code reviewer votes removes every vote.
- Teams and groups: a team or a group can be a reviewer but cannot vote; when one of its members votes, the vote is rolled up into the group's vote (the REST API lists them under
votedFor; see pull requests assigned to your team).
Declining and flagging
Since Sprint 167 (April 2020), you can decline to review a pull request you were added to, from the vote menu or from the context menu on the pull request list, and the list's custom sections show the pull requests you reviewed and the ones you declined on separate tabs. A pull request you flag shows at the top of your list. The REST API shows both on the reviewer, as hasDeclined and isFlagged.
Voting from a script
- Azure CLI (Azure DevOps Services; not supported for Azure DevOps Server):
az repos pr set-vote --id 21 --vote approve, withapprove,approve-with-suggestions,reject,resetorwait-for-author. - REST API:
PUT https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/reviewers/{reviewerId}?api-version=7.1with{"vote": 10, "id": "{reviewerId}"}. The same call with"vote": 0adds someone as a reviewer. The values are 10 approved, 5 approved with suggestions, 0 no vote, -5 waiting for author and -10 rejected; it needs the scopevso.code_write, which a personal access token gets with Code (Read & write).
Votes in IntelliJ IDEA and Rider
Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, lists the pull requests of Azure DevOps Services and Azure DevOps Server in an IDE tool window. Its Waiting for my vote filter leaves out a pull request once you voted on it or declined it, and one asked of your team once a teammate voted. Its Vote… menu offers Approve, Approve with suggestions, Wait for author, Reject and Reset vote, and each reviewer shows with their vote and whether they are required. An approval is refused when the source branch got new commits after you opened the pull request, so you approve what you saw. The branch policies show in words, including "a reject or wait-for-author vote blocks completion" when the branch says so. The review inbox and the branch policies are free; voting, commenting and completing are Pro (US$1 a month, with a 30-day free trial).
Get it on JetBrains Marketplace
Azure DevOps is a trademark of Microsoft Corporation; IntelliJ IDEA and Rider are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.
More: suggested changes in comments · why an approval does not count · required reviewers and path filters · pull requests assigned to your team · comment status and resolution · 日本語