- ALM used (Azure DevOps)
- CI system used (Azure DevOps)
- Scanner command used when applicable (private details masked)
- task: SonarCloudPrepare@3
displayName: 'SonarCloud - Prepare Analysis Configuration (pre-build)'
inputs:
SonarCloud: 'SonarCloud - ${{ parameters.projectName }}'
organization: '***'
scannerMode: 'dotnet'
projectKey: '***'
projectName: '***'
extraProperties: |
sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx
sonar.cs.opencover.reportsPaths = $(Agent.TempDirectory)/**/coverage.opencover.xml
sonar.verbose=true
- task: SonarCloudAnalyze@3
displayName: 'SonarCloud - Run Code Analysis (post-build)'
- task: SonarCloudPublish@3
displayName: 'sonarcloud - publish quality gate result in PR'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
inputs:
pollingTimeoutSec: '300'
- Languages of the repository
C# - Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
We use this scanner command template for multiple projects/repositories and it works for all except this project. It used to work for this project also, but the latest successful run was in the beginning of December 2024.
In SonarCloud, we see the code analysis being run successfully, but somehow the result is never shown in the Azure DevOps PR.
We do see a weird warning in the analysis though:
Could not find ref 'master' in refs/heads, refs/remotes/upstream or refs/remotes/origin. You may see unexpected issues and changes. Please make sure to fetch this ref before pull request analysis.
But we did see this warning in the latest successful run also.
Also, the service connection is valid.
Any idea how to solve this issue?