- SonarQube Version: 188.8.131.52349
I’m running into the following error in SonarQube:
Invalid new code period. ‘2021-01-01’ is not one of: integer > 0, date before current analysis j, “previous_version”, or version string that exists in the project’ Please contact a project administrator to correct this setting
The answer @ganncamp provided within the thread below has solved my problem temporarily:
However, I was curious if it would it be possible to avoid the fail-fast approach?
The reason is:
My company would like to be able to track the “New Code” coverage metrics for ALL projects within our company starting at the beginning of each quarter.
I recently set the default/sonar-system-level “New Code Period” to 01/01/2021 about a week ago (this is when we decided that we wanted to begin monitoring quarterly new code metrics).
Unfortunately, there are many projects which have not had any analysis performed since before 01/01/2021; For these projects, when anyone tries to perform a new analysis against them they receive the error mentioned above.
When a project receives this error we are reactively adjusting it’s project-level “New Code Period” date to a date before the last successful analysis then running a new analysis and readjusting the project’s “New Code Period” back to 01-01-2021
As you can see, the next time we adjust the system-level “New Code Period” to the start of the new/next quarter (04/01/2021) then I suspect we will begin to see these errors appear more often.
Any ideas on how I could come up with a proper solution?