I am attempting my first SonarCloud scan as part of an Azure DevOps pipeline.
I am running the analysis against the master branch.
However, I am getting an error saying that “A regular analysis is required before a branch analysis”
I figured running against the default, master branch would be enough to indicate this. Seems like a bug, unless there is there some setting I’m missing somewhere??
The project was not on the SonarCloud side when I first posted this. It was a “new” project.
However, I have figured out the underlying issue - even though my new project had a new project-key assigned, the “name” was the same as an older, previously deleted project in my SonarCloud project. I was able to get a work-around by upping the project version.
Steps to reproduce (generic data but gives you the idea):
Create a project for SonarCloud analysis
project-name = Project
project-key = myunique-projectkey
version = 1.0
Run an analysis
Delete project in Sonarcloud
Configure a new project analysis with the following values
project-name = Project
project-key = myunique-projectkey-2
version = 1.0
Run analysis
Observe the error “A regular analysis is required before branch analysis”, which is confusing to this context.
If I up the version to 2.0, analysis happens with no issues. So it seems like there is some checking on project-name + version that is causing issues.