External issues in Generic Issue Import Format ignored

  • ALM used Azure DevOps
  • CI system used Azure DevOps
  • Languages of the repository - C#
  • Build works correctly & Sonar & roslyn issues are reported to sonarcloud.io, but when
  1. We add test.json file,
    which is copy from SonarCloud documentation (it contains 2 issues)
    which changed filePath:

  2. We extend prepartion step with sonar.externalIssuesReportPaths=$(Build.SourcesDirectory)\test.json

Result fould in Run SonarCloud log:

INFO: Sensor Import external issues report
INFO: Imported 0 issues in 0 files
INFO: External issues ignored for 1 unknown files, including: D:\a\1\s\NuGet.Config
INFO: Sensor Import external issues report (done) | time=3ms

hi @Jan_Wagrowski

From https://docs.sonarqube.org/latest/analysis/external-issues/

Notes on external .NET issues
Issues from third-party Roslyn analyzers (including Roslyn analyzers provided by Microsoft) are included in the MSBuild output and imported by default into SonarQube so no properties exist to enable that behavior. Instead, properties are available to adjust the import and to stop importing those issues.
Note that Roslyn issues with an error severity automatically fail the build, and it is not recommended to run the Scanner for MSBuild’s end step if the MSBuild step fails for any reason because it will result in an essentially empty analysis, which will close all outstanding issues in the project.

And sonar.cs.roslyn.ignoreIssues - Set to true to disable import of external issues. Defaults to false .

By default we import external issues in our C# analysis. You can disable this.

I understand you looked at https://docs.sonarqube.org/latest/analysis/generic-issue/ to import issues in the generic format… What is your use case?

I have StyleCop rules imported - it works fine.

We would like to add custom broken rules.
We create broken rules in format https://docs.sonarqube.org/latest/analysis/generic-issue/
and add path to it, using parameter: sonar.externalIssuesReportPaths

Hi @Jan_Wagrowski and apologies for the delay.

Could you please run the analysis in verbose mode? In the BEGIN step, add sonar.verbose=true. This should give more information in the DEBUG logs. Please upload the full logs here.