Tags in SonarQube, use and utilities in projects
November 2, 2024
SonarQube tags are a very useful tool to manage and find your organization’s projects. So in this article we will explain how you can use them and how you can extend their functionalities thanks to the products of bitegarden.
What is a tag on SonarQube?
Tags in SonarQube are “labels” that are added to projects and allow them to be categorized for easy administration. Tags can be managed through the ‘Project Information’ tab in the left sidebar. The ‘tags’ section shows the tags configured for that project and the option to add more.
In this image you can see an example of their location:
How to add tags to a SonarQube project?
In this same tab, by clicking on the ‘+’ button you can add more tags or create new ones if they are not already created. It is a simple and intuitive way to classify projects and then find them according to the criteria you want.
However, when the user wants to create tags when there are many projects, he is faced with a problem. The action of creating and assigning labels is completely manual, but at bitegarden we have two products that can help you during the management and configuration of labels.
With Project Tag for SonarQube, you can configure and tag projects automatically. With the Control Center for SonarQube you can assign labels to projects in bulk. Let’s step by step learning how to perform these actions.
How to automate the configuration of tags in SonarQube?
Here’s a step-by-step guide how you can automate the creation of labels in SonarQube:
1 - Write the tag through the property “-Dbitegarden.project.tag=YOUR_TAG” in any of your scanners and the plugin will capture the information and save it to SonarQube.
2 - Once your projects have been parsed using the property, you can launch the process that will tag the projects. In particular, you have to go to Administration -> Configuration -> Project Tag and click on the button ‘Update project tags’.
If you want to test this plugin on your instance, you can download it through this link
How to tag projects in bulk on SonarQube?
If your goal is to tag projects in bulk you should follow the following steps on SonarQube:
1 - Go to Administration -> Configuration -> Control Center - Project Management
2 - On the screen you will see all projects. This is when you select which projects you want to tag.
3 - Press the Bulk Actions -> Bulk Apply Tags button and select the tags you want to add to the selected projects.
If you want to test this plugin on your instance, you can download it through this link
If you have any questions or want to learn more about our products, please contact our team.
bitegarden team
Helping companies to develop better software