Skip to content

Commit

Permalink
VSTS-163 Add branch/PR in SQ description
Browse files Browse the repository at this point in the history
  • Loading branch information
christophelevis authored and henryju committed Oct 12, 2018
1 parent 6ac45f5 commit 811155f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Binary file added extensions/sonarqube/img/branches.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion extensions/sonarqube/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This extension provides the following features:
* **Prepare Analysis Configuration** task, to configure all the required settings before executing the build. This task is mandatory. In case of .NET solutions or Java projects, this tasks helps to integrate seamlessly with MSBuild, Maven and Gradle tasks.
* **Run Code Analysis** task, to actually execute the analysis of the source code. Not required for Maven or Gradle projects.
* **Publish Quality Gate Result** task, to display the quality gate status in the build summary. This tasks is optional, as it can increase the overall build time.
* Analysis of the branches and the **pull requests** of your projects

**Note for TFS installations older than TFS 2017 Update 2**: to install the extension, please follow instructions
available on the ["SonarQube Extension 3.0" documentation page](https://docs.sonarqube.org/display/SCAN/SonarQube+Extension+3.0).
Expand All @@ -21,6 +22,17 @@ The analysis of C# and VB. Net solution is really straightforward since it only
### Easy setup for Maven and Gradle projects
If you're doing Java, analyzing your source code is also very easy. It only requires adding the **Prepare Analysis Configuration** task, and check the **Run SonarQube Analysis** option in the "Code Analysis" panel of the Maven or Gradle task.

### Branch and Pull Request analysis
Whatever type of source repository you are analysing, when a build is run on a branch of your project, the extension automatically configures the analysis to be pushed to the relevant project branch on SonarQube:

![Branches](img/branches.png)

If you configure your build definition as a build validation for pull requests of that project (this can be done on "Branch policies"), SonarQube will also analyze the code changes and decorate the pull request with comments and overall status so that you can merge with confidence:

![PR-Decoration](img/pull-request-decoration.png)

**Important note**: to activate pull request decoration, you must specify a user token in the "General Settings > Pull Requests" administration page of your project in SonarQube.

### Quality Gate Status
The **Publish Quality Gate Result** task waits for the analysis report to be consumed by the SonarQube in order to flag the build job with the Quality Gate status. The Quality Gate is a major, out-of-the-box, feature of SonarQube. It provides the ability to know at each analysis whether an application passes or fails the release criteria. In other words it tells you at every analysis whether an application is ready for production "quality-wise".

Expand All @@ -34,5 +46,4 @@ Example of a failing Quality Gate:
This [Get Started][getstarted] guide provides all the required documentation for you to setup a build definition.

[sq]: <https://www.sonarsource.com/products/sonarqube/>
[sc_vsts]: <https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarcloud>
[getstarted]: <http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html>

0 comments on commit 811155f

Please sign in to comment.