Multiple hardware analysis result on single branch

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension): Enterprise Edition v9.9.6 (build 92038)
  • how is SonarQube deployed: I am using Jenkins and inside Jenkins I am building the project inside a docker
  • what are you trying to achieve: I have same code which is compiled for different hardware by changing the configuration of hardware. I am compiling it by using a python script where I give argument for which hardware need to be compiled. Each hardware build result are stored in separate build folder for example build/hardware1, build/hardware2 and so on. I want to achieve the sonar analysis with full report for all hardware in single branch.
  • what have you tried so far to achieve this: I could achieve the sonar analysis by putting a for loop for each hardware in my jenkins script. It creates analysis and add the report in its respective folder inside build but in sonarqube website it gives the result only for last analyzed hardware and not for all hardwares.

Is there any way to display result for all the hardwares?

Hi @Sanjeev_Embedded,

You can use a different projectKey for each “hardware” or change the branch name using parameter sonar.branch.name.

Thank you for response.
I am currently creating a separate branch for each hardware but it does not link to our master branch so, I was looking for solution where I can have all analysis in same master branch for all hardware together.
Regarding different ProjectKey for each hardware, then it will increase our line of code.

Is there any other solution where we can have all the hardware analysis in one branch inside one project only ?

Hi,

It’s not supported in 9.9, but if you’re willing to upgrade to the latest version, you can analyze code variants together. From the docs:

In Compilation Database mode, you can analyze different variants of the very same version of your code (different target architectures, different build options, etc) and see aggregated results on the server. All variants are analyzed in the same environment and during the same analysis. We do not support analyzing two variants requiring the code to be built on two different machines.

 
HTH,
Ann

1 Like