Warning : Shallow clone detected during the analysis. Some files will miss SCM information

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension): SonarQube Server 2025.1
  • how is SonarQube deployed: zip, Docker, Helm : Docker
  • what are you trying to achieve : We are scanning the repositories using Sonar and getting Shallow clone warnings below :
  1. Shallow clone detected during the analysis. Some files will miss SCM information. This will affect features like auto-assignment of issues. Please configure your build to disable shallow clone.
  2. Missing blame information for 1140 files. This may lead to some features not working correctly. Please check the analysis logs and refer to the documentation.

We were using Sonar Server 8.9 previously and recently upgraded to 2025.1. These warnings were not coming prior to the upgrade.

I explored the documentation GitHub Actions workflow | SonarQube Server Documentation and it mentions to explicitly set fetch-depth flag to 0 for shallow clones to be disabled.

Can someone help to resolve this issue

Hey there.

Indeed this is expected behavior. From the docs:

A full clone is required for this integration to be able to collect the required blame information (see Known Issues). If a shallow clone is detected, a warning will be logged and no attempt will be made to retrieve blame information.

Sounds like this is what you should do!

Thanks a lot Colin for the confirmation. But I am still not sure how this was working previously in the older releases.