Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{iframe:src=http://update.sonarsource.org/plugins/buildbreaker.html|width=700|height=250|frameborder=0}
Your browser does not support iframes.
{iframe}

Description / Features

This plugin will make mark the build report as failed if at least one alert is raised during analysis. Thresholds for alerts are defined in Quality profiles, for example "coverage < 50%". the project fails its quality gate. It is to be noted that the analysis does not stop , it will go if the quality gate fails; it continues successfully to the end. Only But the build status of the build will report failure.

This feature enables to plugin allows you benefit from notification the notifications built in into CI engines.

Example of logs :

Code Block
[ERROR] Coverage < 50%
[ERROR] Class complexity > 20
[INFO]  ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]  ------------------------------------------------------------------------
[INFO]  Can not execute Sonar

Embedded error: Alert thresholds are hit (2).

Installation

  1. copy the JAR file in the directory /extensions/plugins 
  2. restart Sonar server
  3. Define alert thresholds in the Quality profile of your project
  4. Execute code analysis

...

Include Page
Include - Plugin Installation
Include - Plugin Installation

Usage

  1. Associate a quality gate to your project
  2. Run a quality analysis on your project

Advanced Usage

By default this plugin is active on all projectsevery project. If you want a more elaborate behavior, skip this execution on some projects and run the plugin on other projects, you can use configuration property But you can skip its execution on some of them by setting the sonar.buildbreaker.skip .

sonar.buildbreaker.skip can be set globally or at project level. Its type is boolean, the default value being false.

Changelog

JIRA Issues
anonymoustrue
titleRelease 1.0
height70
width900
columnstype;key;summary;priority;status;resolution
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=16909&pid=11911&sorter/field=issuekey&sorter/order=DESC&tempMax=1000

 

JIRA IssuesanonymoustruetitleRelease 0.1height70width900columnstype;key;summary;priority;status;resolutionurlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=15589&pid=11911&sorter/field=issuekey&sorter/order=DESC&tempMax=1000 property to true at the project level. This property can also be set globally, so that it is off by default, but on for individual projects.

The property sonar.buildbreaker.forbidden.conf can be used to specify configurations that would break the build. For example, if you set in the sonar.buildbreaker.forbidden.conf property to sonar.gallio.mode=skip, each analysis on .NET projects executed with Gallio skipped would be marked "broken".