My setup:
- ALM: GitHub
- Languages of the repository: mainly Java
- Error observed: “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.”
- Steps to reproduce: Push to the repository, wait for Sonar workflow to complete
- Potential workaround: None
I am getting the above warning in the SonarQube Cloud web UI although my repositories (I check out two repositories in the same workflow) are not checked out “shallow”:
git rev-parse --is-shallow-repository
false
I also check for the presence of any .git/shallow files; none are found.
To my understanding, the presence of .git/shallow files is the only thing that should matter according to some Sonar code snippets (e.g.: sonarqube/sonar-scanner-engine/src/main/java/org/sonar/scm/git/CompositeBlameCommand.java at master · SonarSource/sonarqube) I have seen.
I am beginning to think that I am running into a SonarQube Cloud bug here. Anything else I could look out for?
Unfortunately SonarQube Cloud does not give any insights into its checks here; in particular there is no visible information on why the build is considered shallow. So it’s just a guessing game unfortunately.
Thanks!