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:
- In the top navigation bar, click Settings.
- Click Shared configuration.
- Under configurations, beside Sonar: Server, click
.
- In the Title field, enter a name for the configuration.
- In the URL field, enter the address of the server.
- In the Authentication method field, select: None, Basic, Ntlm, or PAT.
- If required, enter authentication and proxy details.
- To test the connection, click Test.
- 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:
- In the release flow tab of a Release template, add a task of type SonarQube > Check Compliance.
- Open the added task and in the Server field, select the Sonar server.
- In the Resource field, add the project you want to check for compliance.
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:
- In the top navigation bar, click Dashboards.
- 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.
- In the top right of the screen, click Configure dashboard.
- In the top right of the screen, click Add tiles.
- Hover over SonarQube analysis summary, and click Add.
- On the dashboard, hover over the new SonarQube analysis summary tile, and click
.
- In the Title field, enter a name for the tile.
- In the Server field, enter the name of the SonarQube server you want to connect with.
- In the Project field, enter the project that you want to display metrics on.
Add a SonarQube metrics trend per version tile to a release dashboard
To add a SonarQube metrics trend per version tile:
- In the top navigation bar, click Dashboards.
- 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.
- In the top right of the screen, click Configure dashboard.
- In the top right of the screen, click Add tiles.
- Hover over SonarQube metrics trend per version, and click Add.
- On the dashboard, hover over the new SonarQube metrics trend per version tile, and click
.
- In the Title field, enter a name for the tile.
- In the Server field, enter the name of the SonarQube server to connect with.
- In the Project field, add the name project to pull data from.
- 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.
- 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.
- In the Render as field, select the type of chart to display.
- Click Save.
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