SonarQube analysis is not working properly on the basis of leak period

  • SonarQube version: Community Edition Version 7.1 (build 11001)
  • Scanner version: SonarQube Scanner 3.2

we are using quality gate with below coditions

|Duplicated Lines on New Code (%)|Always|is greater than|1|
|New Bugs|Always|is greater than|0|
|New Code Smells|Always|is greater than|0|
|New Vulnerabilities|Always|is greater than|0|

git as VCS

  1. set leak period as 2019-10-10(yyyy-MM-dd) in project level, triggered a build from master branch of the project, quality gate went successful(as expected)
  2. triggered a build from feature branch of the project, which has some new code compared to master branch code.quality gate got failed(as expected)
    3)again , we triggered a build from master branch, master branch does not have new code , but quality gate is failing with new code smells(not expected)

What are you trying to achieve?

quality gate should not fail for Master brach code, untill unless some new code changes in master branch.

How should we configure SonarQube to get the comparison we would like to have?

Thanks in advance.

Hello @sanjib_samal,

Community edition does not support branch analysis. It is available for Developer Edition and more.
Also on Community Edition every analysis you do regardless of a branch will be marked as analysis of a main branch.

To see how to configure it on Developer Edition see: https://docs.sonarqube.org/pages/viewpage.action?pageId=11640256

I know - on Community Edition every analysis you do regardless of a branch will be marked as analysis of a main branch.

I took base line with master branch code, if i do build again master branch code, it should not fail,because there is no new code in master branch.

if you need more details to understand my problem, let me know

even if i have not added new code to master branch, why it’s failing in second attempt?