SonarQube plugin

The Release SonarQube plugin enables Release to work with reports and metrics from a Sonar server.

Important: You must set up a connection to a Sonar server before adding SonarQube tasks or tiles. For information, see Set up a Sonar server.

Note: In the release flow editor, the SonarQube tasks have a red border.

Features

  • Create a SonarQube Check Compliance task.
  • Add a SonarQube analysis summary tile on the release dashboard.
  • Add a SonarQube metrics trend per version tile to a release dashboard.

Requirements

The SonarQube plugin requires the following:

  • A Sonar server running and accessible via HTTP(s).
  • A FPR artifact uploaded in the SonarQube for the application.
  • A configured SonarQube quality gate.

Set up a connection to a Sonar server

To set up a set up a connection to a Sonar server:

  1. In the top navigation bar, click Settings.
  2. Click Shared configuration.
  3. Under configurations, beside Sonar: Server, click add button.
  4. In the Title field, enter a name for the configuration.
  5. In the URL field, enter the address of the server.
  6. In the Authentication method field, select: None, Basic, Ntlm, or PAT.
  7. If required, enter authentication and proxy details.
  8. To test the connection, click Test.
  9. To save the configuration, click Save.

Create a SonarQube Check Compliance task

The SonarQube Check Compliance task creates a gate in the release flow that fails if project metrics do not match the metrics configured in quality gate.

To add a SonarQube Check Compliance task:

  1. In the release flow tab of a Release template, add a task of type SonarQube > Check Compliance.
  2. Open the added task and in the Server field, select the Sonar server.
  3. In the Resource field, add the project you want to check for compliance.

SonarQube Check Compliance task

Add a SonarQube analysis summary tile to a release dashboard

The SonarQube analysis summary tile type creates a dashboard tile that displays metrics for the selected project and version.

To configure a SonarQube analysis summary tile:

  1. In the top navigation bar, click Dashboards.
  2. Select the dashboard where you want to add the new tile. Note: If you have not created a dashboard yet, you can do so by clicking the Add dashboard button in the top right of the screen.
  3. In the top right of the screen, click Configure dashboard.
  4. In the top right of the screen, click Add tiles.
  5. Hover over SonarQube analysis summary, and click Add.
  6. On the dashboard, hover over the new SonarQube analysis summary tile, and click configure.
  7. In the Title field, enter a name for the tile.
  8. In the Server field, enter the name of the SonarQube server you want to connect with.
  9. In the Project field, enter the project that you want to display metrics on.

SonarQube analysis Summary tile

Add a SonarQube metrics trend per version tile to a release dashboard

To add a SonarQube metrics trend per version tile:

  1. In the top navigation bar, click Dashboards.
  2. Select the dashboard where you want to add the new tile. Note: If you have not created a dashboard yet, you can do so by clicking the Add dashboard button in the top right of the screen.
  3. In the top right of the screen, click Configure dashboard.
  4. In the top right of the screen, click Add tiles.
  5. Hover over SonarQube metrics trend per version, and click Add.
  6. On the dashboard, hover over the new SonarQube metrics trend per version tile, and click configure.
  7. In the Title field, enter a name for the tile.
  8. In the Server field, enter the name of the SonarQube server to connect with.
  9. In the Project field, add the name project to pull data from.
  10. In the Metrics field, select the metrics you want to add. Note: Metrics of the same type will be available only. For example, if you select a metric that is measured as a percentage, then you can only select other metrics that measured in percentages thereafter.
  11. In the Version filter field, select the versions to display. Note: Version filters follow semantic versioning. A custom regex can also be used, provided that it is python compatible.
  12. In the Render as field, select the type of chart to display.
  13. Click Save.

SonarQube Summary tile

Release notes

Release SonarQube plugin 9.8.0

Bug fixes

  • [ENG-863] - Fixed python vulnerabilities

Release SonarQube plugin 9.7.1

Bug fixes

  • [ENG-863] - Fixed python vulnerabilities

Release SonarQube plugin 9.7.0

Improvements

  • [ENG-646] - Modified metrics api for sonarqube version 8 and above

Bug fixes

  • [ENG-345] - Fixed vulnerability issue

Release SonarQube plugin 9.6.0

Improvements

[XLINT-895] - Lodash library version upgrade to 4.17.15 [XLINT-1287] - Configure Dependabot, Overcommit, SonarCloud, Black Duck Server and GitHub pull request templates for Release

Release SonarQube plugin 9.5.0

  • Added compatibility with Release 9.5.0

Release SonarQube plugin 9.0.0

  • Added compatibility with Release 9.0.0
  • Added support for SonarCloud

Release SonarQube plugin 8.5.0

  • Added SonarQube metrics trend per version tile to a release dashboard