Pull request analysis questions. sonar.pullrequest.base role

Good day,
We have a large repository with a main master branch, where dozens of Merge Requests (MRs) are created every day. We use Sonar to analyze merge requests for new code.

A couple of questions:

  1. If we, for example, created an MR into the master branch, but for some reason, this master branch did not build with Sonar and Sonar does not have the latest statistics on it. Will this in any way affect what we see in the MR report for the new code? Especially regarding the identification of new lines that need to be covered by tests.
  2. There is a flow where the Jenkins plugin performs a pre-merge operation before building the project (merging master into the MR branch), how will Sonar behave in this case? Will the new code be incorrectly identified?


Hey there.

As mentioned in the template post, what version of SonarQube are you using?

Self-managed, Developer Edition, 10.3 version.

Thanks! And one more question – where is your code hosted? I know Jenkins runs the build, but are you using GitHub, GitLab, Bitbucket…?

My code is hosted on GitLab. However, that’s not particularly relevant to my question. I want to understand a few general things:
How is the new code identified in Merge Requests? Is it done by comparing commits locally only? Also, is it necessary to build the master branch for each commit? If so, how does this process impact the MR report?
Thank you!