When scanning a project for the first time through SonarCloud in your Azure DevOps build pipeline, a new SonarCloud project is created automatically.
The second time your build runs a comparison is done and you’ll have your first Quality Gate results. At least that is the theory…
When we tried to do this for a new project, the corresponding SonarCloud project was created. However we got the following warning when browsing to this project in SonarCloud:
This is a new requirement for every SonarCloud project to specify how ‘new code’ is identified. You can choose between the following options:
- Previous version: All code that has changed since the previous version
- Number of days: All code that has changed in the last x days
- Specific date: All code that has changed since the specified date
It can be set in the organization settings(Organization –> Administration –> New Code) and applies to all new projects.
Unfortunately setting this didn’t resolve the issue for this already existing project. I couldn’t find a way to get rid of the error so in the end I solved it by throwing away and recreating the project.