How to compare two non-sequential pull request updates in VSTS?

Viewed 344

In VSTS (now Azure DevOps), multiple updates can be pushed to a pull request (PR). You can compare any update with its previous update, and you can compare a rolled-up view of all updates with the original code before any changes were made. But how do I compare two arbitrary, non-sequential updates?

My scenario is that a PR has had quite a bit of back-and-forth with a total of 8 updates pushed. I last reviewed update 5, but now 3 more updates exist. I don't want to review 6-5, 7-6, 8-7 or all updates, I just want to review 8-5. How do I do that?

1 Answers

A workaround (in the absence of any user interface to configure two non-sequential updates to be compared) is to edit the iteration=xxxand base=xxx query string parameters in the url, e.g.:

https://xxx.visualstudio.com/xxx/_git/xxx/pullrequest/123?iteration=8&base=5&_a=files

This updates the UI as shown below:

VSTS diff of two non-sequential updates

I discovered this because I received an automated email from VSTS notifying me about the latest pushed updates. The email included a "View pull request" button. I clicked the button which took me to the PR in VSTS (I think to the Overview section). There was a notification banner towards the top of the page with a link about comparing update 5 with update 8 which I had never seen before. This sounded promising, so I clicked the link and it took me to the Files section and showed the differences between update 5 and 8 which is exactly what I wanted!

However, subsequent visits to the page (or clicking the "View pull request" button in the email again) don't show that link again, and I can't find anywhere in the UI that lets me define the two updates to compare. So this seems like a one-time opportunity. Miss it, and it's gone forever. I'd still like to know if there's a way to define two non-sequential updates to be compared in the UI, however, the poor man's url hack is a viable workaround for now.

Related