Today I’m facing an unexpected behavior on sonar.coverage.exclusions settings. When I save any exclusions, Sonar groups them in just one input, separated by comma, but does not exclude them in the analysis process.
That’s weird but not technically an issue (I’ll flag it internally).
You set sonar.coverage.exclusions rather than sonar.exclusions (scroll down). These do different things (the former excluding from code coverage only, the latter excluding from analysis overall). Which are you trying to acheive?
Thanks for your explanation Colin. My intention is really to remove only the code coverage, so I believe I made the configuration in the right place.
An important point is that this problem started when I went to add a new exclusion configuration. Before everything was working and visually the exclusions were one below the other. When I added the new one and clicked on save it started to have the mentioned behavior.
New grouping row in UI is incorrect.
Because it doesn’t add spaces after commas.
And if you have several excludes it will not work after grouping.
As quick fix you may add spaces in row after UI grouping.
Facing the same issue “,” separated values not working in coverage exclusions in sonarCloud, Andrii_Yefimov your quick fix is also not working of adding spaces
Can you help us with a specific example of the inputs on the SonarCloud side that result in a malformed/non-working exclusion? I’m having trouble reproducing it (I’m sure the issue is on my side and about my understanding if there are now multiple reports!)
Javascript global variables (sonar.javascript.globals)
Issue is not about the UX point about all of the same line, but well about the fact that result are incorrect. For example, before I update sonar inclusions I have in my reports :
INFO: Included sources: scripts/**/*, modules/**/*, vendors/**/*
INFO: Excluded sources: **/build-wrapper-dump.json, test/**/*
INFO: Included tests: test/**/*
INFO: 1261 files indexed
INFO: 141 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
After just a save, and add spaces after coma as suggested, logs seems to be the same, but results are differents :
INFO: Included sources: scripts/**/*, modules/**/*, vendors/**/*
INFO: Excluded sources: **/build-wrapper-dump.json, test/**/*
INFO: Included tests: test/**/*
INFO: 0 files indexed
INFO: 1254 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
Same for globals that I have added, they seems to be ignored and continue to be reported as issues…
I have a few code coverage exclusions setup and before adding a new exclusion, it used to work fine.
Today I added a new exclusion and noticed that on the web interface, the items are now being added as a comma delimited string (which sucks!)
It used to an exclusion per line.
Anyhow, after adding a new exclusion item, and running a sonar scan, none of the exclusions work anymore.
Do inspection and you guys can understand of error. After “collapsing of multi-line configuration into a comma seperate value”. The configuration value was changed from an array of strings to a single string.
Any updates on the resolution of the issue? as there is no way to revert to the original form and this comma-separated string is also not working, this is affecting the quality gates and deployments as well.