How to reset analysis parameters?

We have iOS project with SonarQube analysis implemented using multiple tools like GitHub actions and Azure. There is a common sonar-project.properties file used by them.

sonar.coverageReportPaths=reports/sonarqube-generic-coverage.xml is set in the sonar-project.properties file so that in the Azure pipeline, SonarQube can parse it. sonarqube-generic-coverage.xml is generated after building the project and running unit tests.

However, we also have a GitHub action which also uses the same sonar-project.properties file but we do not run unit tests there. Therefore, no sonarqube-generic-coverage.xml is generated which results in this error:

Error during SonarScanner execution
3907
ERROR: Error during parsing of the generic coverage report '/github/workspace/reports/sonarqube-generic-coverage.xml'. Look at SonarQube documentation to know the expected XML format.
3908
ERROR: Caused by: /github/workspace/reports/sonarqube-generic-coverage.xml (No such file or directory)

Is there any way we could reset the keys set in sonar-project.properties file by overriding them from the command line (GitHub workflow file in my case)?

Hi,

Welcome to the community!

Your best bet is to move the generic coverage parameter to the command line. There’s no unset for properties, only override.

 
HTH,
Ann

1 Like

I could achieve what I wanted. The following works both on CLI and inside GitHub workflow.

-Dsonar.coverageReportPaths=""
-Dsonar.swift.lizard.report=""
-Dsonar.swift.swiftlint.report=""

Hi,

Thanks for the followup! I learned something and I’m sure this will help others in the future!

 
:heart_eyes:
Ann