We’re attempting to use Sonarqube quality gates to block PRs that contain new bugs from being merged.
There isn’t much more to say, but let me be explicit so there is no confusion.
- Developer creates branch from “master” and makes some code changes
- Developer pushes branch to github and initiates pull request
- Jenkins tests pull request including triggering sonarqube testing.
- Sonarqube does analysis on the new code in that PR and fails the quality gate if that code would introduce a bug.
I had assumed that this would be the default behavior: only fail on the code that’s actually changed in that PR, but it seems that any bug that previously existed in the repo is also included.
I’ve looked all through the documentation and read all the threads I could find on this topic, if this has already been covered please point me to the right documentation. I feel like I’m missing something incredibly obvious here.
- SonarQube Developer Edition 7.9.1
- Jenkins SonarQube plugin 2.8