Hello @StefanMadsen and @Vossekop ,
Thanks for your explanations! That clears things up.
There are two slightly different scenarios here, but they end up with the same result.
You are using a custom script to automatically create a project, whereas @Vossekop expects the sonar-scanner to create the project automatically.
In the case of @Vossekop the project only gets created on SonarCloud side when the scan is complete, so during the scan the project is not available yet. In the case of @StefanMadsen your custom script fails to create the project on SonarCloud side, so during the scan the project is not available either.
It seems that we broke something when the scanner runs on a project that is not known on SonarCloud side. As @mickaelcaro noted this probably only happens when the analysis is done is not a main branch analysis. If it is done in the context of a PR the scanner will automatically detect this from the CI and fail if it can’t find any branch on SonarCloud side. (like you mentioned @Vossekop we do support scanning a PR without having scanned the base branch first so the scanner should not fail here, and it wouldn’t have failed if your project was already created on SonarCloud).
However as @mickaelcaro and I mentioned before we plan to stop supporting running scans on projects that do not exist on SonarCloud side soon. That means that the scenario that @Vossekop is using won’t be supported anymore. However we have noted your feedback and will look into supporting your usecase.
I will follow-up with @StefanMadsen privately to see why the creation of the project using the API failed. However the api/alm_integration/provision_projects
API is currently an internal one, this means that it can change at anytime without any warning.