Azure DevOps Pull Request Review VS Code Extension
Overview
The Azure DevOps Pull Request Review extension for Visual Studio Code enables users to manage their Azure DevOps pull requests directly from the IDE. This extension provides features for listing, approving, rejecting, commenting on, and creating new pull requests, all from within the VS Code interface
Features
- List Pull Requests: View all pull requests across repositories within a specified Azure DevOps project.
- View Pull Request Content: View file that were added, edited, deleted in the Pull request.
- Approve Pull Request: Approve pull requests directly from the VS Code interface.
- Reject Pull Request: Reject pull requests with a single command.
- Create New Pull Request: Create new pull requests by selecting the repository and source branch.
- Abandon Pull Request: Mark pull requests as abandoned.
- Open Pull Request in Browser: Quickly navigate to the pull request in your default browser.
- Add Comment to Pull Request: Add comments to pull requests using a custom webview.
Installation
- Download and install Visual Studio Code.
- Open VS Code and go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
- Search for "Azure DevOps Pull Request Review" and install the extension.
Configuration
During the first startup the extension will prompt you to enter the needed configuration but if you want to change it you can follow this procedure.
Before using the extension, you need to configure it with your Azure DevOps details:
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
- Run the command
Azure DevOps Pull Request: Configure
.
- Enter the following details:
- Organization URL: The URL of your Azure DevOps organization (e.g.,
https://dev.azure.com/your-organization
).
- Project Name: The name of your Azure DevOps project.
- Personal Access Token (PAT): A personal access token with sufficient permissions to access pull requests.
The extension will store your PAT securely using VS Code's Secret Storage.
Usage
List Pull Requests
- Click on the Azure DevOps Pull Request view in the Activity Bar.
- The extension will display all pull requests for each repository in your configured Azure DevOps project.
View the content of the Pull Request
- Select a pull request and click on the file/view to open the file or a diff.
Approve or Reject Pull Request
- Select a pull request and click on the check or cross button to approve of reject
- The extension will add you as a reviewer and register your vote accordingly.
Create New Pull Request
- Click on the add button in the Azure DevOps Pull Request view.
- Follow the prompts to select the repository, source branch, and provide a title and description.
- Select a pull request and click on the comment icon.
- A webview will open, displaying existing comments.
- Enter your comment and click
Submit
.
- You can also reply to a comment an resolve a comment
- You can also add a comment to a specific file
Open Pull Request in Browser
- Select a pull request and click on the open in browser icon.
- This will open the pull request in your default web browser
Refresh Pull Requests
- Click on the refresh button in the Azure DevOps Pull Request view to reload the list of pull requests.
Commands
The extension provides the following commands:
azureDevopsPullRequest.listPullRequests
: List all pull requests for the configured Azure DevOps project.
azureDevopsPullRequest.approvePullRequest
: Approve a selected pull request.
azureDevopsPullRequest.rejectPullRequest
: Reject a selected pull request.
azureDevopsPullRequest.createPullRequest
: Open the form to create a new pull request.
azureDevopsPullRequest.refreshPullRequests
: Refresh the list of pull requests.
azureDevopsPullRequest.abandonPullRequest
: Mark a selected pull request as abandoned.
azureDevopsPullRequest.openPullRequestInBrowser
: Open a selected pull request in the default web browser.
azureDevopsPullRequest.addCommentToPullRequest
: Add a comment to a selected pull request.
Configuration Options
You can configure the following settings in your VS Code settings.json
:
azureDevopsPullRequest.azureDevOpsOrgUrl
: The URL of your Azure DevOps organization.
azureDevopsPullRequest.azureDevOpsProject
: The name of your Azure DevOps project.
azureDevopsPullRequest.personalAccessToken
: Your Azure DevOps personal access token.
azureDevopsPullRequest.userAgent
: Custom user agent for the HTTP requests made to Azure DevOps.
Troubleshooting
- Ensure that your Personal Access Token has the necessary permissions to access pull requests and repositories.
- Verify that the organization URL and project name are correctly configured.
- If you encounter issues, try reloading the window (
Ctrl+Shift+P
> Reload Window
).
Contributing
If you would like to contribute to the extension, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a clear description of your changes.
License
This project is licensed under the MIT License. See the LICENSE
file for more details.
Acknowledgements
For questions or suggestions, please open an issue on the GitHub repository.