Skip to content

Chromium Extension - Additional Comparison for Azure DevOps PR Page

Notifications You must be signed in to change notification settings

der3318/extension-adoprcmp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪄 Azure DevOps PR Comparison Plugin

version manifest size semanticui browsers

A chromium extension that helps compare with additional commit when reviewing pull requests on Azure DevOps.

💭 Why I Need This

Image the scenario below:

A new feature called feature/5 has been integrated and tested in the latest dev branch. And now, we want to bring it back and make it also available on an existing release named 21H2. Thus, one of the engineer check-picks all the commits (while resolving conflicts) and creates a pull request targeting branch release/21H2.

The PR will of course list all the touched files as usual. However, this might not be comprehensive enough for reviewers to approve. For example, we might also want to check whether all the changes has be properly picked, and what the tiny difference between the migrated and the original one could be, especially when branch release/21H2 does not have feature no.2 and no.4. As a result, an additional page showing the diff between feature/5 and feature/5-on-21H2 should be very helpful.

🔧 How To Use

After installing the unpacked extension package (will need to toggle developer mode), fill in the commit ID of the original feature (e.g., the HEAD of branch feature/5) in popup text box.

Refresh the PR page, and a new diff button will be displayed next to the button "View". It is linked to the ADO's built-in comparison page, with specific parameters fulfilled (so it can show the diff between HEAD of feature/5 and feature/5-on-21H2).

💡 How This Works

The plugin finds the current branch name (a.k.a., the PR request's source branch) by class name filter: pr-header-branches. Please refer to tryGetCurrentBranchName() for more info.

The plugin also locates the "View" spans (i.e., where the diff buttons will be shown) by class name filter: flex-row flex-grow justify-end. Additional logics can be found in renderDiffLinks().

The URL of the comparison page has the following format: https://${AzureRepoRoot}?path=${FilePath}&_a=compare&mversion=GC${TargetCommitId}&oversion=GB${PullRequestBranchName}. What the extension does is simply putting in all the correct info to make the link works as expected.

About

Chromium Extension - Additional Comparison for Azure DevOps PR Page

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published