Long lived branch leak period not respected

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)


  • what are you trying to achieve

Set the leak period of a long lived branch to a version in the main branch (master).

  • what have you tried so far to achieve this

I have run sonar scanner on my master branch and passed in the project version for its analysis (sonar.projectVersion=1.0.0).

Next I have run sonar scanner on a new branch using the sonar.branch.name=feature/some_branch and sonar.leak.period=1.0.0

Analysis does not respect the sonar.leak.period. Instead it always uses what is configured in the general settings for leak period

Does sonar not allow me to set the leak period to a version in the main branch?


No. You’ll have to pick a date/version/analysis in the long-lived branch to use as that branch’s baseline.


Thanks Ann.

I see that I can manually override a long-lived branch leak period in the UI under “Manage branches”. Is there a way to do that via sonar-scanner or the API? When I look at the docs I only see an API key for updating it at the entire project level.


No, you really need to do this through the UI.