Issues from old code rediscovered once merged into master

  • ALM used: GitHub

  • CI system used: Jenkins

  • Scanner command used when applicable (private details masked):

      sh #!/bin/bash
        ${scannerHome}/bin/sonar-scanner \
        -Dsonar.projectKey=${project} \
        -Dsonar.branch.name=${env.branch}
    
  • Languages of the repository: PHP

We have noticed (not the first time) some behaviour we cannot really explain. Could you shed some light here please?

We have usual flow release branch → master
Note: quality gate is set to only check new code.

  1. Release branch has no new issues - green in SonarCloud
  2. Master has no new issues - green in SonarCloud
  3. Release branch is merged into master and now SonarCloud complains about new issues in the code, but those issues are from files not even touched by the release branch.
  4. Another things here are the issue creation dates and author don’t match real data on git/GitHub. The code is 4 years old but report says it was created now.

No settings were changed in SonarCloud.

1 Like

We are having the same issue in Azure DevOps with C# code. For PRs it works well. But when master branch is analysed, some old issues are reported as issues in new code, which is blocking our pipelines.

It seems this started to happen randomly, because there was no configuration changes. And it doesn’t happen for all our projects.