I am setting up SonarQube and SonarLint in Visual Studio Code.
I have install SonarQube Community edition 9.6.1 and it is up and running fine.
I set up Jenkins to analyze one of my GitHub projects using the latest Jenkins SonarQube Scanner version 4.7.0. That also seems to work fine.
My project is using git with ‘master’ and ‘dev’ branches.
I run a Jenkins build that checked out and analyzed a feature branch from ‘dev’. This worked fine and uploaded to scan results to my SonarQube server where I could see the results.
So far so good.
Now I am trying to set up SonarLint version 3.9.0 in Visual Studio Code to show the scan results in the code there.
Here is where I am running into a problem. I see in all of the documentation and comments and help that in SonarQube Community edition the results will always be assigned to a branch called ‘master’, regardless of which branch was analyzed. Fair enough. However, in my SonarQube it shows the branch as ‘dev’ not ‘master’. I do not know why. I cannot change it, of course, and if I click on it I am asked to install the Developer edition, as expected.
My problem is that SonarLint is asking for information from the ‘master’ branch in SonarQube. That does not match the ‘dev’ branch shown in SonarQube so I get no scan data in Visual Studio Code (the log shows everything working except for the issue download calls which ask for ‘master’ and get “not found” responses).
What do I do now? I seem to only get results in ‘dev’ on SonarQube but I can only fetch results from ‘master’ in SonarLint.
Is there some change in behavior recently with SonarQube? I was expecting to only see a ‘master’ branch, which would match with SonarLint.