{"id":225429,"date":"2019-05-20T15:00:04","date_gmt":"2019-05-20T22:00:04","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=225429"},"modified":"2019-05-20T14:48:07","modified_gmt":"2019-05-20T21:48:07","slug":"code-reviews-using-the-visual-studio-pull-requests-extension","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/code-reviews-using-the-visual-studio-pull-requests-extension\/","title":{"rendered":"Code Reviews Using the Visual Studio Pull Requests Extension"},"content":{"rendered":"<p>The Pull Requests for Visual Studio is a new experimental extension that adds several code review tools to Visual Studio. This extension aims to make it easy for you to launch and view <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/devops\/repos\/git\/pull-requests-overview?view=azure-devops\">pull requests<\/a> inside the integrated development environment (IDE) without needing to switch windows or use the web. We learned from customers that having a high-quality code review process is very important to increase productivity. To achieve that, this extension is enabling you to use existing and new Visual Studio code navigation, debugging and sharing capabilities in your code review process.<\/p>\n<p>As of today, Pull Requests for Visual Studio only supports Azure DevOps and is available for you to <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=VSIDEVersionControlMSFT.pr4vs&amp;ssr=false#overview\">download on the Marketplace<\/a>. For those looking for GitHub pull request support, consider using the <a href=\"https:\/\/visualstudio.github.com\/\">GitHub extension for Visual Studio<\/a>.<\/p>\n<p>This blog will focus on the basics of creating and reviewing a pull request, including:<\/p>\n<ul>\n<li>Creating new pull requests<\/li>\n<li>Reviewing pull requests<\/li>\n<li>Providing expressive comments using markdown, emojis, and likes<\/li>\n<li>Comparing code differences for over-the-shoulder and self-code review<\/li>\n<\/ul>\n<p>With this extension you can also:<\/p>\n<ul>\n<li>Review and checkout Pull Requests from Azure Repos<\/li>\n<li>Get an inline peek to see more details about methods used in the code<\/li>\n<li>View previous updates and understand how collaboration and discussion evolved over the course of the pull request<\/li>\n<\/ul>\n<p>To learn more about this extension, please feel free to watch the following online demo, which talks about building the award winning app, Seeing AI, with Visual Studio 2019.<\/p>\n<p><center><iframe width=\"562\" height=\"315\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" src=\"\/\/www.youtube.com\/embed\/hUWEG2oV7qM?start=2821\"><\/iframe><\/center>&nbsp;<\/p>\n<h2>Creating a New Pull Request<\/h2>\n<p>After <u>installing the pull requests extension<\/u> and <u>connecting to your Git repository on Azure DevOps<\/u>, you can create a new pull request when pushing your branch to remote by clicking on <span style=\"color: #3366ff;\">create a pull request<\/span> and filling the new pull request form.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-225440\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/1-new-PR-300x222.png\" alt=\"Creating a pull request right after pushing your branch\" width=\"600\" height=\"443\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/1-new-PR-300x222.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/1-new-PR-768x567.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/1-new-PR-1024x756.png 1024w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>You can also create pull requests using the pull requests page by navigating to <strong>Team Explorer &gt; Home &gt; Pull Requests <\/strong>and selecting <span style=\"color: #3366ff;\">New Pull Request<\/span>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-225444\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/2-new-PR-300x205.png\" alt=\"Creating a pull request using the pull requests page\" width=\"600\" height=\"411\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/2-new-PR-300x205.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/2-new-PR-768x526.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/2-new-PR-1024x701.png 1024w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>When you have local commits that have not been pushed to remote, the pull request extension reminds you to share your changes with remote before creating a new pull request. The Build &amp; Code Analysis Results section will automatically expand and let you know about any failing unit tests, errors, and warnings. (Compatible only with C++, C#, and VB)<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-225447\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/3-Un-pushed-changes-warning-300x188.png\" alt=\"Un pushed changes warning + Build &amp; Code Analysis Results\" width=\"600\" height=\"375\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/3-Un-pushed-changes-warning-300x188.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/3-Un-pushed-changes-warning-768x481.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/3-Un-pushed-changes-warning-1024x641.png 1024w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Reviewing Pull Requests<\/h2>\n<p>The pull requests page provides a summary of pull requests created by you and pull requests that have been assigned to you. You can do a brief review by opening the pull request, reviewing the changes that were made, and leaving comments or approving the pull request as shown below. To do a detailed review and be able to run and debug the pull request locally, you can use the <span style=\"color: #3366ff;\">Check out<\/span> option.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-225449\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/4-PR-page-300x157.png\" alt=\"Pull requests page\" width=\"900\" height=\"472\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/4-PR-page-300x157.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/4-PR-page-768x402.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/4-PR-page-1024x537.png 1024w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The pull requests details page is a focused screen that provides the pull request description and the discussion that the team is having. It also provides access to the code changes introduced by the pull request where you can add and view previous comments added by the team.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-225467 size-full\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/PR-review-final.gif\" alt=\"Reviewing the changes introduced by the pull request\" width=\"1618\" height=\"1038\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>You can add your comments by right clicking on the line of code that you would like to comment on and selecting <span style=\"color: #3366ff;\">Add Comment<\/span>. Markdown and emojis are supported and you can use the preview option to view your comment before creating it. You can also reference bugs, team members, and other context that you might want to bring into your comment. Comments can also be marked as resolved which sends notification to their authors.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-225456\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/6-Comments-and-social-coding-300x220.png\" alt=\"Comments and social coding\" width=\"450\" height=\"330\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/6-Comments-and-social-coding-300x220.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/6-Comments-and-social-coding-768x563.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/6-Comments-and-social-coding-1024x751.png 1024w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Reviewing Your Own Work<\/h2>\n<p>The Pull Requests extension for Visual Studio comes with a unique code diff tool that allows you to review your own work any time you want before creating a pull request. This allows you to see a history of changes as you code, which can be helpful when you are conducting over-the-shoulder code review and want to focus on the introduced code changes. To turn on code diff click on the <span style=\"color: #3366ff;\">Comparisons<\/span> button on the tool bar.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-225459\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/7-Code-diff-comparison-300x168.png\" alt=\"Code diff (comparison)\" width=\"800\" height=\"449\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/7-Code-diff-comparison-300x168.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/7-Code-diff-comparison-768x431.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/7-Code-diff-comparison-1024x574.png 1024w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>With the Pull Requests extension, we now have integrated pull requests and code reviews inside of Visual Studio.<\/p>\n<p>&nbsp;<\/p>\n<h2>We Need Your Feedback!<\/h2>\n<p>We continue to value your feedback. As always, let us know of any issues you run into by using the <a href=\"https:\/\/docs.microsoft.com\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio-2017?view=vs-2017\" target=\"blank\">Report a Problem tool<\/a> in Visual Studio. You can also head over to <a href=\"https:\/\/developercommunity.visualstudio.com\/\" target=\"blank\">Visual Studio Developer Community<\/a> to track your issues, suggest a feature, ask questions, and find answers from others. We use your feedback to continue to improve Visual Studio 2019, so thank you again on behalf of our entire team.<\/p>\n<p>&nbsp;<\/p>\n<p><center><a class=\"btn btn-success\" role=\"button\" href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=VSIDEVersionControlMSFT.pr4vs\" target=\"_blank\" rel=\"noopener\">Install the Pull Requests extension &amp; give us feedback!<\/a><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Pull Requests for Visual Studio is a new experimental extension that adds several code review tools to Visual Studio. This extension aims to make it easy for you to launch and view pull requests inside the integrated development environment (IDE) without needing to switch windows or use the web.<\/p>\n","protected":false},"author":4322,"featured_media":225479,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[3395,3394],"class_list":["post-225429","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-code-reviews","tag-the-visual-studio-pull-requests-extension"],"acf":[],"blog_post_summary":"<p>The Pull Requests for Visual Studio is a new experimental extension that adds several code review tools to Visual Studio. This extension aims to make it easy for you to launch and view pull requests inside the integrated development environment (IDE) without needing to switch windows or use the web.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/225429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/4322"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=225429"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/225429\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/225479"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=225429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=225429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=225429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}