Hi, we have the following problem and we’re out of ideas:
We implemented an Azure pipeline to automatically scan .net code on branches (we work with feature branches), and everything works fine, except on our main branch (which is not actually set as MAIN_BRANCH in SQ, instead we use develop for this). Specifically, both the analysis and publication succeed, but we are unable to access the analysis in the SonarQube portal.
I’ve tried running our pipeline for main
and another branch, feature/test-sq
, which is a copy of main
(I just did git checkout -b feature/test-sq
while on main
). In both branches the analysis and publication succeed, but we can only see the feature/test-sq
branch in the UI.
This is the relevant piece of our pipeline:
- stage: 'SonarQubeAnalysis'
displayName: 'SonarQube Analysis'
dependsOn: []
jobs:
- job: SonarQubeAnalyze
steps:
- task: UseDotNet@2
displayName: 'Use .NET 6 Core sdk'
inputs:
version: 6.0.x
- task: NuGetToolInstaller@1
displayName: 'Install NuGet'
inputs:
versionSpec:
- task: NodeTool@0
displayName: 'Install Node 20'
inputs:
versionSpec: '20.x'
- script: |
sudo apt-get update
sudo apt-get install -y openjdk-17-jdk
displayName: 'Install JDK 17'
- task: SonarQubePrepare@5
continueOnError: true
inputs:
SonarQube: '$(sonarQubeServiceConnectionName)'
scannerMode: 'MSBuild'
projectKey: 'PROJECT_KEY(REDACTED)'
projectName: 'PROJECT_NAME(REDACTED)'
extraProperties: |
sonar.sources=charts/PROJECT_NAME
sonar.exclusions=src/COMPANY_NAME.PROJECT_NAME.EntityFrameworkCore.DbMigrations/Migrations/**/*,src/COMPANY_NAME.PROJECT_NAME.HttpApi.Host/wwwroot/libs/**/*
- task: DotNetCoreCLI@2
displayName: 'Backend build'
inputs:
command: 'publish'
publishWebProjects: false
projects: '$(backendSolution)' # Expands to: 'aspnet-core/src/COMPANY_NAME.PROJECT_NAME.HttpApi.Host/COMPANY_NAME.PROJECT_NAME.HttpApi.Host.csproj'
- task: SonarQubeAnalyze@5
inputs:
jdkversion: 'JAVA_HOME_17_X64'
continueOnError: true
- task: SonarQubePublish@5
continueOnError: true
inputs:
pollingTimeoutSec: '300'
There aren’t any errors on the tasks’ executions. The SonarQube Analyze task does not output anything relevant to the console.
As far as I can tell, the behaviour on all branches seems identical, except that we can’t access the reports on main
.
Any idea what we can do to fix the problem?
Extra information Information:
- SonarQube edition: Developer
- Deployed on Kubernetes
- DevOps platform: Azure DevOps
- SQ version: 10.4.1.88267