What changed in an Azure DevOps pull request since your last review
Every push to the source branch of an Azure Repos pull request adds an update, numbered from 1; the REST API calls it an iteration. Below is where Azure DevOps shows the updates, how to see only what was pushed since you last looked, and what becomes of comments written on an earlier update, from Microsoft's Review pull requests and the REST reference for Pull Request Iterations and Pull Request Threads.
Where the web page shows the updates
- Updates tab: every push, numbered, the newest at the top, each with the commits it brought. A force push does not overwrite this history; it is listed as one more update. The Commits tab shows the source branch as it is now, so after a force push the two can differ.
- Files tab, the changes dropdown: pick one or more updates (hold Shift for several) and the diff shows only their changes, for reviewing just what was pushed since your last review. Each entry is named after the message of the last commit of that push.
- Overview tab, the What's new filter: the comments and updates since you last opened the pull request.
A push can also take approvals away: when the minimum reviewers policy resets votes When new changes are pushed, the reviewers approve the new commits again (see why an approval does not count).
Comments written on an earlier update
A comment on lines is written while one diff is on screen, and its line numbers are those of that update's files. In the REST API a thread keeps that context in pullRequestThreadContext:
iterationContextnames the updates being compared when the thread was written (firstComparingIteration,secondComparingIteration).trackingCriteriais filled in when Azure DevOps has tracked the thread from its original place: it names the updates it was tracked to and keeps the original position (origFilePath,origRightFileStartand the like).- Listing the threads with
$iteration(and$baseIteration) asks for the positions tracked to that pair of updates; without them, each thread comes with the position it has.
So after a push that changed the commented file, the same line number can hold other code in the newest diff. A tool that shows the newest diff has to check which update a thread's line numbers belong to before it draws the thread there.
The updates in the REST API
GET …/_apis/git/repositories/{repository}/pullRequests/{id}/iterationslists the updates:sourceRefCommit(the source commit of that push),commonRefCommit(the first common commit of the source and target),reasonand the dates. Iteration 1 is the head of the source branch when the pull request was created; each push adds one.includeCommits=trueadds their commits.GET …/pullRequests/{id}/iterations/{iterationId}/changeslists the changed files.$compareTois the update to compare against; its default, 0, is the common commit of the source and target branches, that is the whole pull request up to that update.$toptakes up to 2,000 changes (100 when not given).GET …/pullRequests/{id}/threads?$iteration={n}&$baseIteration={m}lists the threads with their positions tracked to updatesnandm.
Each needs the scope Code (Read).
What changed since you last looked, in IntelliJ IDEA
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, with what changed since you last looked: the files changed since your last visit are flagged, and a file you marked as viewed loses the mark only when a later push changes it. Its diff is the whole pull request, from the common commit to the newest push. From version 1.0.65, a comment on lines of a file that a later push changed is not drawn in the diff at its old line number: it stays under the comments, marked outdated, and opens its file at the top. The review inbox, diffs and viewed marks are free; voting, commenting, resolving, completing and creating pull requests are Pro, with a 30-day trial.
Get it on JetBrains Marketplace
Azure DevOps is a trademark of Microsoft Corporation; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.
More: comment status and the comment resolution policy · votes · why an approval does not count · merge conflicts · 日本語