Unable to close/resolve issues in pull request analysis

Since about a week we’ve not been able to resolve or close issues that the scanner found in a pull request build. On master this option is still there but on PR analysis the drop-down is not there.

it seems like the same problem as this issue

Cannot close issue on PR analysis

and this

Unable to suppress pull request issue because drop down option missing

but both of those seem to be fixed


As shown in the screenshot it is a problem with a roslyn issue which should be fixed according to this comment

Unable to suppress pull request issue because drop down option missing - #11 by Nicolas_Harraudeau

I know we can just simply disable/ignore the roslyn issues in the settings but we’d much rather be able to close or resolve the issues in the PR analysis.

Can you help us find the solution for this problem
We’re using Azure devops with SonarCloud

Cheers,
Thimo

Hi Thimo,

Welcome to the community!

The problem mentioned in the second link is not related to your problem. These were issues which were miscategorized as “external issues”, and it has indeed been fixed.

In your case this is a real external issue, i.e. an issue coming from a third party analyzer: Roslyn Analyzer.

SonarCloud does not enable users to change the status of external issues. Each third party analyzer has its own way of configuring which issues should be ignored. If SonarCloud enabled users to ignore such issues, it would create a mess as issues would appear in the IDE (Visual Studio/VSCode) but not in SonarCloud.

Roslyn issues can be disabled in different ways. Here are a few examples:

  • You can disable this Roslyn analyzer rule specifically via a ruleset file.
  • You can disable the rule in a specific file using #pragma warning disable ... The ID of the rule is visible if you click on “See Rule” and look on the top right of the rule description. You will see something like roslyn:CSxxxx. The roslyn rule id will be the second part: CSxxxx.

There are other ways and I recommend to read Microsoft documentation on the subject.

Cheers,
Nicolas