we are running:
- SonarQube: Version 7.9.2 (build 30863)
- SonarScanner for Azure DevOps - 4.11.0 (Latest)
- Azure Pipeline Agent (on-premise) - Version 2.174.1 (latest)
our analysis is running just fine.
But we have one question that puzzles us, that is the
We currently have the subfolder under the “_work” folder hard coded in the sonar-project.properties
# DB folder contains our code to analyze sonar.sources=/opt/azure_pipline_agent/_work/9/s/DB/ sonar.projectBaseDir=/opt/azure_pipline_agent/_work/9/s/DB/
Randomly the Agent is creating new sub-folders, for example:
What ended up happening is the agent put new code to another folder and the Sonar analyzer was analyzing old stale code from the hard-coded old folder.
I’m sure that hard coding the working folders is not the recommended way of configuring the path to the sources to be analyzed. The Agent should be free to create any sub-folders it needs and the Analyzer should get that folder passed over prior to starting the analysis.The documentation: https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-azure-devops/ unfortunately didn’t give us any additional hints.
Our question is:
How do we configure the sonar.source folder correctly with an Azure Agent configuration to get rid of specific sub-folders inside the internal _work folder of the Agent?
Thanks for any hints, support and tips someone could provide to us.