Pass Tags from Azure Devops into SonarQube

Must-share information (formatted with Markdown):

  • which versions are you using
    SonarQube 8.2 Enterprise with Azure AD extension
    Currently evaluating using a staging license.
  • what are you trying to achieve

We are currently evaluating the functionalities and determine certain setups in order to achieve scale. What we are trying to see is whether the projects provisioned on SonarQube will have portfolios assigned automatically. We understand this is possible based on tags.

However, due to the large scale of our operations with many applications being developed, we provide permissions for the endpoint token to create projects in SonarQube if it does not exist. In order to leverage the portfolio mapping using tags, is it possible to pass tags from the Azure devops extension into SonarQube ?

If thats possible, then its easy for us to directly map all SonarQube projects to portfolios based on the tags we maintain in Azure DevOps.

Reminder… Can i have some guidance on this ?

Hi,

Welcome to the community!

Looks like your question initially got lost in the shuffle. I’m glad you bumped it.

You can’t apply project tags during an analysis. However, there is a web service you can automate calling to set those tags. Since what you describe is a wholly automated system (good for you!) you’ll want to run that extra automation after analysis to make sure that the project has been created (happens automatically on first analysis) before you try to set its tags.

 
HTH,
Ann

Thank you for the guidance Ann. Appreciate it. Can we pass the tag to the newly created project via API even before the analysis completes ?

Hi,

No, you can’t. On that first analysis, project creation takes place as part of the server-side processing of the analysis report. So in fact, you’ll need to wait until after the QG results are available before you push your tags.

 
HTH,
Ann

Thank you. I was able to use APIs to apply tags to the project and was able to repopulate the portfolio to view the data. At a start, we can atleast have a portfolio to project relationship whenever new pipelines are being created.

With that being said, i dont see the option for applications to pick up projects based on tags. any reason why ? or that planned in the future ?

Ideally we would like to figure out automation via a Portfolio->Applications->project route. Currently it seems to work only via Portfolios->project through tagging.

Hi,

Project selection for Applications is only manual. Since they’re synthetic projects - presumably an amalgam of projects that ship together & therefore need a collective Quality Gate - the assumption is that they’ll be small by nature, and not change composition frequently.

Does that make sense?

 
Ann

That helps. Thanks Ann for the guidance. Appreciate it !