Frontend Languages no longer detected with sonar-scanner-gradle 7.2.x

Since updating to version 7.2 of sonar-scanner-gradle we no longer get any analysis of our frontend files. We use a multi-module repo with mainly kotlin and typescript code. The typescript files are no longer detected after updating to 7.2.1.6560 or 7.2.2.6593.

I noticed the following difference in debug output while executing the scanner locally:

7.1.x:

Preprocessing files...
3 languages detected in 143 preprocessed files (done) | time=289ms
16 files ignored because of inclusion/exclusion patterns
0 files ignored because of scm ignore settings
Loading plugins for detected languages

7.2.x:

Preprocessing files...
1 language detected in 56 preprocessed files (done) | time=556ms
16 files ignored because of inclusion/exclusion patterns
0 files ignored because of scm ignore settings
Loading plugins for detected languages

These configuration properties might be relevant:

sonar.exclusions: "**/*generated*/**"
sonar.sources: "src"

What could be the reason for the change in behaviour between the versions? Why are fewer files preprocessed in the newer version?

I would appreciate any help and can provide further information if needed.

Hi,

Welcome to the community and thanks for this report!

Are you using sonar.gradle.scanAll?

 
Thx,
Ann

We haven’t used it so far. But if I enable it I now get

Preprocessing files…
11 languages detected in 320 preprocessed files (done) | time=3154ms
30 files ignored because of inclusion/exclusion patterns
78531 files ignored because of scm ignore settings
Loading plugins for detected languages

So this is more than we used to analyze. Probably because it ignores the sonar.sources property.

Hi,

So I’m not sure why your other files were being picked up before. Did you have a custom sonar.sources? Per the docs scanAll is disabled when sonar.sources is specified explicitly…

Anyway, this is the mechanism we added to pick up those other files. Now you’ll want to use exclusions, if necessary, to whittle down the expanded source set.

 
HTH,
Ann

I think I got it now. We did not set sonar.sourcesglobally. We only set it in the module with the frontend files. Anywhere else we used the standard behaviour. This seemed to work until version 7.2.x. Now the scanner seems to ignore all properties set in the submodules. Do you have any idea why? Was this approach not supported and did it work only by accident?

Hi,

I’m not seeing anything relevant-looking in Jira, but it’s entirely possible my Jira-fu is weak today. I’m going to flag this for the team to answer.

 
Ann

1 Like

The properties set in the submodule don’t get picked up at all anymore in the scanner context. (Visible in logs)

Hi,

Okay, it turns out that there’s a bug in the latest version of the Gradle scanner. We’re on it. And in the meantime, a reversion to version 7.1.0.6387 will restore the correct behavior.

 
Thx,
Ann

1 Like

Hi @BendixPetersen,

@ganncamp 's recommendation of downgrading to 7.1 is the right way to go to ensure that your project is properly analyzed. I amended the original announcement post to recommend downgrading to 7.1 until we work on fix.

Sorry for the inconvenience and thank you for your patience.

2 Likes