SonarCloud’s Automatic Analysis sometimes fails to detect Gradle projects whenever they are stored in a subfolder inside a GitHub repo. For example, this is the root folder structure:
And this are the spring-batch folder contents:
However, this is the result after compatibility checking:
There is a known issue, the content of the pop-up shows a wrong information in some specific cases. We already implemented a fix and we are testing the functionality as we speak. It should be deployed to production in the following days, after that you should be able to see the correct description of why is your project not eligible for Automatic Analysis. I will let you know here once the fix is deployed.
In the meanwhile, is your project using a Monorepo strategy? Because for such repositories, the Automatic Analysis is not supported. More information about this topic is in our Documentation:
The fix to the issue mentioned in my previous message is now deployed in production. If you click on the button “Recheck compatibility”, you should see the correct description now.
Ok, to be able to investigate more, can you please open a console in your browser, go to Network tab, refresh the Analysis Method window on SonarCloud, find the response of the /api/autoscan/eligibility call and send a screenshot? This screenshot might help you to find it.
We use this GitHub endpoint to find if a repository contains build.gradle file, which is necessary to be present for Autoscan to run. As of today, we look in the root of the repository for the build.gradle file and if it’s not present there, the project is not eligible for Autoscan. In this case it might be necessary to set up a CI-based analysis.