Question - Testing Pull Request builds

We recently upgraded from SonarQube 8.0 to 8.3. Our scanner is run on Bamboo and uses the Maven plugin.

Previously in our CI pipeline, we used the sonar.branch.name and sonar.branch.target parameters. This allowed us to have the build branch build fail if a Quality Gate did not pass.

Now that all branches are basically branches in 8.3, we have lost some of this Quality Gate / Build Breaker functionality if the code changes are included in the first build/analysis.

To get around that I started playing with the new Pull Request feature. I got this working with Bamboo and Sonar. All the parameters are correct and Sonar correctly recognizes the “merge into” and “from” branches. The problem that I’m having now is that most of our Pull Requests are small and will be less than 20 lines.

It seems that if we fully switch over to the Pull Request analysis method that most of our builds will have some false Passes because the “small number of lines” issue. How can we turn this off completely or change it to something really small like 5 lines?

Hey there!

Two bits to dive into here:

Hopefully, some of this will be addressed by MMF-1994 due for the next version of SonarQube.

It’s not really possible right now (if you’re interested in the history of why we have this 20-line threshold, you can check out SONAR-9352.), but there are some tickets worth voting on if it’s important to you, like SONAR-10485 - Provide a way to configure the Quality Gate fudge factor

Colin

Thank you for the info. I commented on SONAR-10485