Issues Marked as "False Positive" reappeared as status open in Base branch

Hi,
SonarQube version - 9.9 LTS

We have marked issues as “False Positive” in the Feature branch and created a new branch on base of it. Now issues that are Marked as “False positive” in the Feature branch are marked as status “Open” in the new branch. Is this expected behavior?.
we have changed the New code definition for the new branch to point to the Feature branch.

On the Feature branch New code tab it shows 1.4k Bugs and on Overall code 1.8Bugs but on new branch new code tab show 0 Bugs and on the Overall code 3.6k bugs.

Thanks,
Mani

Hey there.

Are you using the Reference Branch New Code Period?

Issues can be synchronized between branches if you’re using the Reference Branch new code definition. When using this new code definition, any new issue in the reference branch that comes from a feature branch automatically inherits its attributes (type, severity, etc.) from the feature branch. A comment is added to the change log of the issue on the branch: The issue has been merged from '<branch-1>' into '<branch-2> .

As I mentioned in my comment we have updated the reference branch in the new code definition of the Particular branch.
How can I check the changelog for the particular issue in the UI?. I tried with API but I don’t see any comment. I see the below output
“changelog”: [
{
“creationDate”: “2023-08-25T13:33:27-0400”,
“diffs”: [
{
“key”: “author”,
“newValue”: “name@example.com
},
{
“key”: “assignee”,
“newValue”: “Ht-UM-bydfuy6”
}
]
}
]
}

You can see the changelog here.

image

Thanks Colin. But the issue marked as false positive in Feature branch as Marked as open in new branch. I checked change log in both the branches in new branch issue doesn’t have any logs in the change log it just shows issue issue created Date and Autor name in it. In Feature branch change log it shows the details(Assignee, creator, resolution). If issue is inherited from Feature branch it should show previous resolution details as well right but it shows only creation date.
Feature Branch -
image
New Branch -
image

Created by looks same on the both branches.

Thanks.

Something definitely feels fishy between these branches.

  • How/where are you running the analysis? Locally (manually)? In a CI (which?)
  • Are you sure the same set of files are being analyzed? (there’s not vastly more files in the new branch than the feature branch, or very different file paths)?

Hi Colin,
running analysis in Jenkins.
Yes, same set of repo folders are analyzed and some new Lines of code added in the new branche.

For older issues it has to show the history in the change log right? but for same issue in both branches showing different data in change log

I suggest you extract DEBUG analysis logs for both the feature branch and the new branch so that they can be compared! This means executing the scanner like sonar-scanner -X (let me know if that doesn’t look like the command you run)