With the SonarQube Gradle plugin 6.1.0.5360, if you are executing a SonarQube analysis and during the analysis abort the Gradle build, the Analysis nevertheless continues running and finishes, uploading the result.
When the Gradle build is aborted, the analysis should also stop, and in no case the result should be uploaded to the SQ server.
The Gradle build is stopped as usual, but the analysis process which now happens in a separate process in latest version continues running.
I notified it because I had a debugger attached on the analysis process to find out why our custom rules are not triggered anymore, but even without the debugger it would then have continued running and submit the analysis result to SonarQube server even though the intention was to abort the analysis.
Maybe there needs to be some mechanics that the scanner can control how the analysis process is forked, so that for example with the Gradle plugin a Gradle worker process via Worker API is used to execute the analysis which can then be properly aborted by Gradle when the build is aborted or something like that.
Thanks for those details. I’ll flag this for the team.
On the custom rule side, depending on what version they were written against, you probably need to catch up with some API changes, requiredForLanguages among them..
Yes, we already found out that requiredForLanguages was the culprit, thanks.
It was additionally confusing, that in SonarLint the rules were still used, just during normal SonarQube analysis they were ignored.