We’re using SonarQube EE version 7.9.4 with the following project level settings:
“New code period” definition as Reference branch for develop
Main branch - develop
The common practice at org is to create pull requests with base develop for anything that needs to go to prod.
So, we started using sonar pull request analysis for pull requests with reference branch as develop, which is working fine.
But for develop branch, we use normal analysis, which is throwing the following error:
Invalid new code period. 'develop' 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
I found this, but the APIs don’t exist on my server. I found this too, but I’m unable to figure out if it’s supported in my copy of sonarqube.
I’ve just spun up 7.9DE locally & I’m not seeing in it that you can set a reference branch. I hadn’t remembered that you could, but wanted to double check.
Here’s what I’m seeing:
So I believe what’s happening is that analysis is looking for a snapshot (record of a previous analysis) with ‘develop’ as the version stamp.
Sorry, but if you want to use reference branches you’ll need to upgrade.