NX Monorepo integration + .NET Core coverage

  • SonarQube Enterprise Edition Version 10.3 (build 82913)
    We have 2 questions:
    Question 1: Integration of sonarqube with Nx monorepo is not working. How to set it up, we need expert step-by-step guide here.
    Question 2: .Net core code coverages in cobertura format are not getting published to sonarqube when run on linux agents. Please help with this.

Hey there.

What is not working? What exactly have you tried, and what were the results?

Hi Colin,

We have around 130+ Angular library packages which needs to be scanned using SonarQube.
We tried to do sonar-cube PR validation using Azure Devops yaml pipeline with SonarQubePrepare, SonarQubeAnalyze & SonarQubePublish steps.

Doing this serially would take very long time crossing 1hours+ leading to PR validation failing due to time taken, which is not feasible.

To overcome this, scanning was divided into multiple jobs in chunks of 15 library in each job. This reduced overall time to 20 min (still taking time), but this results in error like below in publish steps (error occurs randomly, since we have around 9 parallel jobs, if one of scan fails with mentioned error, PR validation fails which is annoying to rerun the failed jobs).


Starting: publish.

Task : Publish Quality Gate Result
Description : Publish SonarQube’s Quality Gate result on the Azure DevOps build result, to be used after the actual analysis.
Version : 5.5.4
Author : sonarsource
Help : Version: 5.5.4. More Information

##[error][SQ] API GET ‘/api/ce/task’ failed, error is Invalid response body while trying to fetch https://sonarqube.kognif.ai/api/ce/task?id=AYxJyowPpJBbQnXWlh5E: Premature close
##[error][SQ] Could not fetch task for ID ‘AYxJyowPpJBbQnXWlh5E’


  1. Is there any alternative way to do SonarQube scan for Mono-repo packages? which would speed up the PR validation process?

To confirm – these are Angular library packages that you’re writing yourself and not third-party libraries, is that correct?

Do you see any reference to this task ID (or any other task ID that cannot be fetched) on your SonarQube instance’s Administration > Project > Background Tasks?