Clone with a reference was detected - warning

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

I get the following warning on one of our repository.

‘Clone with a reference was detected. Some files will miss SCM information. This will affect features like auto-assignment of issues. Please configure your build to not clone using a local reference.’

I use Bamboo to build the software and not sure why I am getting such warning on this repo (Android Kotlin repo) but not on anything else (iOS - swift and Java repo don’t have such warning).

I am currently on 7.9.1.27448 SonarQube.

Thank you

3 Likes

Hi,

Same problem here since last LTS usage ; SonarQube v7.9.1 & sonar-scm-git-plugin (Git SCM Provider for SonarQube) v1.9.

CI tool is TeamCity and using a local mirror for git clone is the default option, to speeds-up clean checkout & saves disk space.

In this case, the working directory contains:

$ cat .git/objects/info/alternates
/home/ubuntu/teamcityBuildAgent/system/git/git-1C49EF47.git/objects

And sonar-scm-git - JGitBlameCommand provides this warning.

I can understand that it is more complicated for SonarQube plugin to manage this kind of feature/architecture ; but seems a good practice for a correct health of CI tool.

So I’m a little speechless on “which has the true” :confused:. Perhaps the beginning of a troll thread :smile:.

Best regards

2 Likes

Looks like the code checkout done with Bamboo is done using a reference to a local git repository (to optimize the cloning operation and not download from the remote repository). This kind of clones are currently not supported by SonarQube.

See if you can change the way Bamboo does the code checkout.