Roslyn issue raised on main branch but not on Merge request with the new file

Must-share information (formatted with Markdown):

  • SonarQube Server Enterprise Edition v2025.6.1 (117629)
  • SonarQube deployed: Helm
  • SonarScanner: SonarScanner for .NET 11.0
  • what are you trying to achieve: Expect same issues raised for new code in Merge request and main branch
  • what have you tried so far to achieve this: Analyze context for both analyses

Dear Sonarsource,

We have observed the following issue where a maintainability issue coming from roslyn analyser was raised into the main branch of the project (master) but not in the MR where the new file with it was added.

A source file is missing a required header.

The file header does not match the required text(external_roslyn:IDE0073)roslyn

We can see the issue being raised in the client logs for both MR and master branch analysis and the project being processed successfully, furthermore in the scanner context for the project analysis also for both we can see the property sonar.cs.roslyn.reportFilePaths with the Issues.json path.

So we see no difference from client side nor from scanner context that explains this behaviour, unfortunately the compute engine logs are in info level and are not providing any further information on this.

Could you please let us know if you have any explanation for what we have observed?

Hi,

It’s worth pointing out that this is not a SonarQube rule key. It comes from an external Roslyn analyzer.

What I can tell you is that PR analysis only reports issues on the lines changed in the PR. So after merge, was this issue reported on a line that was changed in the PR or on a different line?

 
Ann

Hi Ann,

Thanks for your reply.

This issue (The file header does not match the required text(external_roslyn:IDE0073)roslyn) is raised at file level after merging to main branch. It is a new file created in the MR where the issue was not discovered.

Thanks a lot for your support.

Hi,

File-level issues aren’t raised in PRs.

 
HTH,
Ann

1 Like