If sonar-scanner.bat -Dsonar.inclusions=$files causes no files to be scanned, can we get SUCCESS?

Windows 10 10.0 amd64
SonarQube Enterprise

I am trying to get incremental Sonar scans by populating $files with only the changes made by the pull request. But if the pull request only changes documentation or scripts or configs, Sonar will have no files to scan. The result is a failure. Can this be changed to successful somehow?

cheers, Michael

Hey there.

As of SonarQube v9.9.1, SonarQube now natively (and officially) supports incremental analysis, without trying to manipulate sonar.inclusions (something that was never supported). From the SonarQube 9.9 LTS announcement:

Pull Request (PR) analysis gets a significant speed boost. With the implementation of incremental analysis and server-side caching, only the changed files are analyzed.

No matter the programming language, your PR analysis will be considerably faster – the same high-precision results; just delivered faster. For example, a mid-size project with approx 300,000 Lines of Code is now analyzed more than twice as fast as before. This means that a PR that would have taken 5 minutes to be analyzed on SQ 8.x, now takes under 2 minutes.

There’s nothing special you need to do to enable this as long as the target branch is analyzed.

Hi Colin, oh, that is great! I must have missed this because it didn’t (seem to) work for a few days. But now I can confirm it! Thanks a lot.

1 Like