My .NET Framework project is stored in a TFVC repository with multiple branches. I was able to analyze the master code on SonarQube Server using an Azure Pipeline, but when I try to analyze Feature branch, it overwrites the master results and the Feature branch does not appear in the branches section. I want to confirm whether SonarQube Server supports branch analysis for TFVC repositories.
Since you’re using Enterprise Edition($$), this is not a question of branch analysis not being supported. Can you provide your pipeline and your analysis log?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
There are no errors in the pipeline logs, and the pipeline completes successfully, but the branch analysis is not appearing in the SonarQube branch dropdown. I want to confirm whether SonarQube supports branch analysis for TFVC repositories in Azure DevOps (non-Git) or not.
PFA of the screenshot of pipeline and analysis result on SonarQube server.
We don’t offer native support of TFVC, but there’s a community plugin for it. I assume you’re using it to extract the SCM blame data. However, that’s probably not going to get you the automatic population of the analysis parameters needed to properly recognize a branch or pull request. For that, you’ll need to manually populate the values for pull requests and for branches.
SonarQube Server supports branch analysis. Period. The question is whether the data needed to perform a branch analysis will be picked up automatically from your environment. If you can get the data where it needs to go, then yes, your configuration is supported.