Gytautas Buivydas
Gytautas Buivydas

Reputation: 81

Is it possible to review commits one by one in a pull request in Azure DevOps?

As far as I could find Azure DevOps only allows to review Pull Requests by Update on the PR. I can't find any way to review the commits in the PR such that I could review the commits one by one and have comments showing up in the PR. If I simply leave a comment on a commit, it's a global comment in the repository. Does anyone know of a way to review the commits one by one?

Upvotes: 8

Views: 1163

Answers (2)

Magnar Myrtveit
Magnar Myrtveit

Reputation: 2740

This is a well-known issue.

Pull requests are designed to create an Update every time something is pushed to the branch. With some extra steps when creating the PR, this feature can be utilized to allow reviewing the PR commit by commit.

Here are the steps:

  1. Push only your first commit.
  2. Create the pull request. It will only contain the first commit.
  3. Push the rest of your commits, but push only one at a time. This results in an Update in the PR for each commit.
  4. Assign the PR to reviewers. The reason for not doing this in step 2 is that then the reviewers would be spammed with emails for every commit you pushed.

When reviewing the PR, go to the Files tab and open the drop-down called All Changes. Every commit will be listed there, and you can click them one by one to review each commit individually. Any comments you make in that view are tied to the PR and not the commits.

enter image description here

I really hope Microsoft fixes this issue soon, but hopefully this workaround can help in the meantime. By creating a script for pushing the commits, the process can become quite lean.

Upvotes: 4

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31013

You could see the commits for a PR in link https://dev.azure.com/{org}/Git/_git/Git/pullrequest/{id}?_a=commits, but the comments you add in the commit won't show on the Overview of a PR, you have to click into the commit and check the comments.

Upvotes: 2

Related Questions