Code coverage broken on SonarCloud for .NET projects

Something happened recently where sonarcloud stopped loading codecoverage for our project - this broke without any change in code on our end, our github action was unchanged and sonarcloud stopped ingesting the codecoverage & source

Here’s the github action

        run: |
          ./.sonar/scanner/dotnet-sonarscanner begin /k:"mykeyname" /o:"myorg" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:"sonar.verbose=true"

          dotnet build --no-incremental -p:SkipSchema=true
          ./.sonar/coverage/dotnet-coverage collect 'dotnet test --no-build --filter Category=Unit' -f xml  -o 'coverage.xml'

          ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

In the output I can see, for example:

18:32:39.667 DEBUG: Did not find deterministic source path in '/home/runner/work/c2c-exchange/c2c-exchange/src/C2C.Exchange.GraphQL/Program.cs'. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.

Yet up above I see

512EED1A-6FE9-437E-9934-2A6B68667DB4.sonar.sources=\
 <omitted for brevity>
"/home/runner/work/c2c-exchange/c2c-exchange/src/C2C.Exchange.GraphQL/Program.cs",\

Which is the same path

Update: It appears that sonarcloud’s include/exclude settings are to broken/to blame?

Having set ‘source file inclusions’ to ‘src/**’ means everything is excluded, but removing all my inclusions/exclusions allows coverage to happen. Exclusions do not appear to work at all

Hi @onionhammer

(I split the topic to create a new one)

We missed this apparently, sorry. For the future, please follow the guidelines and open a new topic whenever you have an issue.

If it relates to an existing one, add a link in your topic.

Did your problem get solved in the meanwhile by SonarCloud updates, or do you still encounter it?

Thanks,
Andrei