SonarQube New Code Still report issues after merge to reference branch

Must-share information (formatted with Markdown):

  • SonarQube version 9.5
  • Setup New code in the format “reference: develop”. Merged feature branch into the develop branch. Did not expect to see issues in new code that already had been committed to the develop branch one month earlier.

After analyzing logs it seems that SonarQube is using the correct commit to analyze but is using an old merge commit as reference. There had been around 10 merges from the branch into the reference branch since the commit used for reference.

Hi,

Do you have a fresh clone of your target ref?

 
Ann

Based on the way we pull the code its supposed to have a correct fresh clone. But it might be a problem in the way that the local Git client pulls the code since it seem to still refer to an early commit. I have noticed that our builds gives a warning about the client. Seems that we have a Jgit client used by our CI server, and the warning says its getting deprecated. I need to install another git client and see how that works.

Thanks for the advice about cloning process though. It might be that anyway. We have a setting in our builds that performs some caching. “Enable repository caching on agents”. I should probably try unchecking that one to start with. Although the text say that caches are always full clones in the text by the checkbox.

1 Like