- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension): Data Center Edition Version 8.9.7
- how is SonarQube deployed: zip, Docker, Helm: I don’t know
- what are you trying to achieve: We would like to have a new code analysis on first feature branch analysis by comparing this new feature branch with the develop branch from where the feature branch was created.
- what have you tried so far to achieve this: I tried to edit the configuration of the project by using a reference branch for new code but it didn’t worked out.
Let’s say we have a C# solution which has a sonar project associated. The solution has a default “develop” branch which contains all the joined features of the project. When we want to create a new feature for the solution we create a new feature branch and we merge this branch to the develop branch when the code development it’s done.
When we create a new feature branch it is not mandatory for developers to push this new branch directly to sonar but to start to work on code development right away. The issue with that is when there is some work done the new code is pushed and the analysis in sonar won’t highlight any information under the “New code” tab as it is the first push of that branch to sonar.
From my understanding those first commits of this branch will be considered as the base for the “New code” in the future, so whether there will be later modification in the code the comparison by sonar on new code will be done with those first commits pushed as a base and not with all the changes done on that branch compared to the initial branch creation from develop.
My question here is how can I do a comparison of the “New code” in the feature branch with the develop branch on the first feature branch sonar analysis?
I already tried to edit the sonar configuration to use a “reference branch” during the analysis but it is not working.