I’m using SonarQube Version 6.7.3 (build 38370). I’m NOT using the new branch support.
I’m trying to implement automated builds of pull requests, integrating BitBucket and Jenkins with SonarQube. As I’m not using the new branch support, I’m setting “sonar.branch” instead of “sonar.branch.name”. As a result of this, I get a separate project for the pull request. This is ok, as I have automation that deletes the SonarQube project when the pull request branch is deleted (when it is merged).
What isn’t working correctly is that the pull request SonarQube project sometimes gets the wrong quality gate assigned to it on first creation. It’s not acceptable to have to modify it after the fact. If the wrong quality gate is assigned, and the correct thresholds are not observed, the pull request could be marked as mergeable, even though it violates our quality guidelines.
I know the name of the required quality gate. Is there a Sonar property I can set in the build (using the Maven plugin), which will ensure that the resulting project has the correct quality gate?