Is it possible to add tags to a project within the sonar-projects.properties file?
There’s no mention of it in the documentation (from what i’ve seen) - it would not be good if we (the administrators) have to do this manually on the project page.
Would you explain why, please? Project tags are not meant to be ephemeral; changing from analysis to analysis. They’re meant to categorize the project as a whole.
We would use the feature to tag the project (e.g. technology, or architectural context).
We would use the tags within Sonarqube then to define portfolios with the help of the tags, without the need to manually maintain this.
Hi Ann,
I know that I can do this via the UI, but I’d like to automate this, as I said: “without the need to manually maintain this”.
So no, not “perfectly” supported. If we can automate this, we could define these project attributes or tags in the source itself in one place, and the build process could use it in multiple contexts, for Sonar, but also e.g. to link to the architectural documentation, …
I don’t really understand this answer.
sonar.projectKey is not ‘ephemeral’
sonar.projectName is not really either nor sonar.projectDescription
Why couldn’t we add project metadata directly in the properties ?
Projects are mostly created automatically from CI, adding the tags in the properties file makes the whole process a lot easier.
I hope all is well with you!
I’m a +1 for this feature request. We have a documented template for the sonar-project.properties file for a given domain context. When a new project is created, this template is used and only sonar.projectKey and projectName need to be set. But we need to manually tag the new project in the UI (the issue is that one might forget). Having the tags already in the sonar-project.properties template would be an easier and more reliable solution.
I would like to add my support for this feature request. We are a large organization with many (1000+) projects. We use project tags to differentiate components belonging to different teams or departments. Having a way for teams to add in project level metadata without having to log into a UI would be a tremendous help for us. Unfortunately, the ability to add tags is restricted to Administrators (ASFAIK) and this is not something that we’re willing to distribute to all developers.
For the record @jorcutt.ebsco, Project Administrators can add tags, and IMO someone in each project should be a project admin. Otherwise, yeah. You really are biting off a lot at the global admin level.
+1 for this feature as well exactly as Jonathan suggested.
We have to create a properties file for each new project. The projects are split between teams. It makes sense to add the team name as a tag when we create the property file. The project is then immediately tagged when created for the first time (this would be done when the project first builds in CI).
Having to have some ‘admin’ go in and then tag the project via the UI seems a little backwards. I would assume most devs in SonarSource would agree with this point of view. You should ask them.
I also would like to see this feature.
Could have the portfolios based on a regex of the project key, but that is quite limited.
Would be easiest to just have a sonar.project.tags property.
There will be an issue with manually added tags vs property added, as which one will take precedence?
Simplest solution is to remove capability to manually tag projects. The projectKey cannot be changed manually, so why should the tags be changed manually?
Hi! One more +1 to have this feature in terms like @Johnathan_Elmore suggested. It would be very helpful to set in via CI as well with other project attributes avoiding UI clicks which are significantly increase the time to maintenance thousands of SonarQube projects.
API workaround is nice, but it’s much harder to implement this in CI because it requires extra scripting. Just setting sonar.tags would be great!