This file no longer exists in the latest pull request changes

We get Sonar comments in our PR’s of files not included in the PR

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Scanner command used:
      - task: SonarCloudPrepare@2
        inputs:
          SonarCloud: 'SonarCloud'
          organization: '***'
          scannerMode: 'MSBuild'
          projectKey: '***'
          projectName: '***'
          extraProperties: |
            # Additional properties that will be passed to the scanner, 
            sonar.exclusions=**/*.Data/Migrations/Sql/*.sql,**/*.Data/Migrations/*.cs
            sonar.coverage.exclusions=**/*.Data/**/*.cs
            sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/coverage.opencover.xml
  • Languages of the repository: C#
  • SonarCloud project URL: Not public
  • Error observed:
This file no longer exists in the latest pull request changes. It may have been moved or deleted.View the comment in its original context.
  • Steps to reproduce: Will provide if necessary
  • Potential workaround: None

Hey there!

Can you tell us more about what kind of project this is? I believe we’re aware of a specific issue faced by Azure Functions Projects, for example.

Hi, I have the same issue, though for me I get the messages in files that ARE in the PR.

The interesting part is that as far as I can tell it happens when code is moved within the same file. So, the issue did exist before, but was ignored then, but now that we touched the file it is analyzed again but because the offending code is now on a new line, the analyzer doesn’t understand it anymore.

We are seeing this same issue and it started in the last few weeks.

1 Like