Integrating projects with Atlassian Compass
SonarQube Cloud allows you to monitor the performance of your project from within your Atlassian Compass account. This can be done by simply using the SonarQube Cloud Quality Gate application to add scorecards and metric cards to any of your components in Compass which tell you what the current status of your quality gate is.
A Scorecard is a set of criteria that you apply to a component to measure its health. The SonarQube Cloud Quality Gate scorecard tells you whether your project’s quality gate is passing (100% score) or failing (0%), prompting you to address the root cause of the failure of your project.
Integrating your project with Atlassian Compass
The SonarQube Cloud Quality Gate app is already listed in the Atlassian Compass App Catalog.
Configuration of the app takes place within Atlassian Compass itself. Here are the main steps you need to complete setup of your project:
- Create a user token in SonarQube Cloud to authenticate SonarQube Cloud to Atlassian Compass
- Start the configuration process of the app
- Add the token to complete authentication within Compass
- Add your SonarQube Cloud project to your Compass component
Generating a SonarQube Cloud user token
First of all, you need to create a user token in SonarQube Cloud for which will be used to authenticate SonarQube Cloud Quality Gate app to Atlassian Compass. To generate a token, to go Account > My Account > Security. There you can see a list of your existing tokens.
Enter a name for your token, for example, My Compass Token, and select Generate Token. Make sure to copy the token and save it immediately before you dismiss the notification or leave this screen. Otherwise, you may have to start the process again. You will need to enter this token during the configuration process later in Compass.
Configuring the SonarQube Cloud Quality Gate app in Compass
Note that these steps take place within Atlassian Compass. For more details on how Compass works, see the Atlassian Compass help center.
Go to your Atlassian Compass account.
Select Apps from the top navigation bar in Compass. Search for the SonarQube Cloud Quality Gate app.
Select Configure. This takes you to the configuration page.
Select Allow Access. This takes you to the authorization screen to allow SonarQube Cloud access to your Atlassian account.
Select Accept. The configuration screen appears.
Enter the user token you created and saved earlier in SonarQube Cloud in the Access Token field and click Connect.
That's it! You are now configured and can add your projects to your Compass components.
Integrating SonarQube Cloud projects with Atlassian Compass
You now need to go to your SonarQube Cloud account and copy the URL of the project that you want to integrate with Compass.
Then, go to Atlassian Compass > Components and select your component.
On your team's dashboard on the right hand side, enter the URL saved in the project field, along with a text to display as the name of your project. Then refresh your screen.
Once you have refreshed your screen, you can view the Scorecard and Metric for your project. The status of your project will be updated every hour and you'll receive a warning if your quality gate has failed in SonarQube Cloud.
To remove an existing SonarQube Cloud project from Atlassian Compass, just click on the X button to the right of the project field (highlighted above).
You can also view the current ratings of your components under the Health tab in Compass. Under Health, there are sub-tabs for both Scorecards and Metrics. There you can see a list of your apps and the components that the apps are applied to.
Was this page helpful?