Missing git blame - update JGit version required?

Hi all,
I’m having an issue with missing git blame information, am wondering if an update to JGit is required for SonarQube/Scanner. Initially found the issue when attempting to upload scan results to our SonarQube Developer instance (windows host) from a Jenkins build machine (linux-based). First, I verified the server was not using a sparse checkout/shallow clone. I was then able to reproduce the problem with a local scan from my Ubuntu 20.04.2 LTS machine. The scan is being performed using branches (git and SonarQube), if that makes a difference.

  • SonarQube 8.9.1 LTS Developer Edition, tested with sonar-scanner-cli-4.4.0.2170-linux, sonar-scanner-cli-4.6.2.2472-linux
  • Observed the following logs during analysis:
INFO: SCM Publisher 0/7 source files have been analyzed (done) | time=1519ms
WARN: Missing blame information for the following files:
WARN:   * (redacted).js 
WARN:   * (redacted).js 
WARN:   * (redacted).js 
...
WARN: This may lead to missing/broken features in SonarQube
1 Like

Hi,

Welcome to the community!

Are those files modified by the build? Are the files under analysis exactly what’s in the branch, or is a merge happening pre-analysis in an attempt to see what the post-merge results would be?

 
HTH,
Ann

Hi Ann,
I’m not aware that the files under test are being modified during the build process…I was able to repeat the ‘Missing blame’ issue when performing scan from a local machine with a clean checkout of the branch in question. Do you happen to know what version of JGit is currently being used? If so, I can also try testing that version via console.

Hi,

It looks like we’re currently using 5.11.

Are you starting analysis from the checkout directory?

 
Ann

Hi Ann,

Discovered the problem on my end. Apparently a developer changed a linting check in our build process to fix issues instead of only generating a report, which resulted in uncommitted changes being created prior to the scan. (apparently I ran the same check on my local when reproducing build steps)

I tested 5.11 and 5.11.1 with console with no issues. SonarQube server 8.9.1 is running with JGit 5.9.0.202009080501-r, in case anybody wants to know.

Thanks for your help,

David

1 Like