Leak Period Help

We are running version 7.5 of SonarQube. Im trying to understand the process to set the leak period and scanning. We set the Leak Period yesterday to 2019-06-024. Today when we tried to scan the project the error message was

We resolved the issue quickly by removing the Leak Period Date re scanning the code,and re enabling the Leak Period as of 2019-06-24.

What is the proper process for setting a Leak Period when it comes to scans?
I have a large volume of projects coming down the road, and I dont want to be scanning, enabling, and re scanning projects. Ill be doing this for 50+ projects.

Heres the projects scanning history


Hi Pam,

Yesterday you set the New Code Period (NCP) to yesterday. If you had set it to the day before it would have worked. Essentially, what happens when you set the New Code Period to a date is that the first analysis inside the date range is taken as the New Code Period baseline. Setting the NCP to the current date means “use the first analysis after midnight this morning as the baseline” which can make things really weird depending on your analyses that day. So instead it simply fails.


Thanks and just so I am 100% clear on this.
In this example,
Using the gating status, we are looking to fail Jenkins builds effective 6/24/19 should code not pass the gating criteria.
The New Code Date should have been set to 6/23/19? Meaning it would really start on 6/24 and this date would be the baseline?
Does the last scan date have any impact on setting the New Code Date?

Hi Pam,

It’s actually a little tricky when you’re working with dates. The functionality was build for the primary case of a New Code Period based on version strings. When you use a date instead, the baseline (against which all NCP comparisons will be made) is the first analysis after midnight on the chosen date. So if you had set the NCP to the 23rd and happened to analyze multiple times on that day then those analyses would have been included in the NCP.

If you were on 7.7 or higher then you’d have access to a web service that allows you to specify a specific analysis as the baseline (MMF-1524).


THANK YOU! Once again your help is greatly appreciated.


1 Like