Monorepo with Azure DevOps results in the SonarCloud Quality Status is a stuck "waiting" status

We have a large Azure DevOps Repo that contains several Visual Studio Solutions and Projects. Projects are not shared outside of a Solution folder. In cases where we do need to share code, we’ve created NuGet packages and import those packages into the projects.

In SonarCloud, we have a separate SonarCloud project for each Visual Studio Solution in this repo. Each SonarCloud Project has the monorepo flag set to true/on.

The analysis seems to work however the integration with Azure DevOps Pull Requests doesn’t seem to be working. On the Azure DevOps Pull Request, the SonarCloud Quality Gate status is always stuck in a “waiting” status. We no longer see comments on the code. We have reset the Azure DevOps Personal Access Token multiple times and we don’t think that is the issue. Since the PR is showing that the SonarCloud Quality Gate is in a “waiting” status, an admin has to override the completion of the PR, which is not ideal.

Here is an example task id:

{
  "task": {
    "id": "<removed>",
    "type": "REPORT",
    "componentId": "<removed>",
    "componentKey": "DEP-Domain-Consumer",
    "componentName": "DEP-Domain-Consumer",
    "componentQualifier": "TRK",
    "analysisId": "<removed>",
    "status": "SUCCESS",
    "submittedAt": "2021-03-26T19:15:55+0100",
    "submitterLogin": "<removed>",
    "startedAt": "2021-03-26T19:15:55+0100",
    "executedAt": "2021-03-26T19:15:56+0100",
    "executionTimeMs": 776,
    "logs": false,
    "hasScannerContext": true,
    "organization": "<removed>",
    "pullRequest": "9919",
    "warningCount": 0,
    "warnings": []
  }
}

Removed values are available via direct message.

Note: We have several other SonarCloud Projects that are linked to Azure DevOps repos in a 1:1 scenario and those are not having this issue, so this appears to be a monorepo issue.

Any update on this? This issue is really causing issues with our teams and getting PR’s completed.

Hi @W0GER

Sorry for the late reply.

Can you give us a background task id related to one of these PR analysis you’re trying to get QG status from ?

Thanks.

1 Like

Mickaël,

Thanks for helping diagnose this problem.

Here’s a link to a background task from yesterday (5/3/2021)
https://sonarcloud.io/api/ce/task?id=AXkzFBthtkUgJLSlUY-P

{
“task”: {
“id”: “AXkzFBthtkUgJLSlUY-P”,
“type”: “REPORT”,
“componentId”: “AXkkyMlwN5Jy2gE_jn_h”,
“componentKey”: “DEP-Domain-Consumer”,
“componentName”: “DEP-Domain-Consumer”,
“componentQualifier”: “TRK”,
“analysisId”: “AXkzFBy9J3TaYXDmf8zq”,
“status”: “SUCCESS”,
“submittedAt”: “2021-05-03T18:33:46+0200”,
“submitterLogin”: “roger-wilson52936”,
“startedAt”: “2021-05-03T18:33:46+0200”,
“executedAt”: “2021-05-03T18:33:47+0200”,
“executionTimeMs”: 1070,
“logs”: false,
“hasScannerContext”: true,
“organization”: “outselldev”,
“pullRequest”: “10206”,
“warningCount”: 0,
“warnings”:
}
}

However, the PR in Azure DevOps still shows:
SonarCloud/quality gate Waiting

The SonarCloud project DEP-Domain-Consumer points to our Microservices Azure DevOps/Git repo. In that repo are all of the DEP-Domain-* and DEP-Integration-* Visual Studio solutions; each of those solutions has its own SonarCloud project and its own Azure DevOps Build Pipeline. All of the DEP-Domain-* and DEP-Integration-* SonarCloud projects are marked with Monorepo = True.

This used to work, it stopped working sometime last year, and we’ve been fighting with this since.

Thanks. Can you tell me what is the latest commit hash of that PR (normally the one that needs to be “decorated”) ?

This is the most recent hash for the branch that the PR is based off of

844356484180abd769ee20c58eb4dd5a6eb95b13

image001.jpg

image002.jpg

Thank you. Can you also tell me which interation is the “current” one ? (at least the one corresponding to the analysis you gave me this is the number displayed on the left bar of your timeline, something like this image

Mickaël,

The “current” one as described is # 5; there are no updates to, or other builds for this Pull Request since that iteration.

Kind regards,

image001.jpg

image002.jpg

Thank you.

We’re going to release a fix probably today or tomorrow, i’ll ask to to test again, and we’ll see that fix this issue.

Mickaël

Hi again @W0GER

Our fix has been deployed, may i ask you to trigger another automatic build on your pull request, to see if you get this Quality Gate status passed ? By the way, is this status name contains your SC project name as a prefix ?

Thanks.

Mickaël,

Thanks for the fix and your comment in the previous email. This led me to notice that there is a Sonar Cloud Quality Gate for each project within the monorepo. I updated our build policies and things are now working. Thank you!!

image001.jpg

image002.jpg

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.