Hi Community,
We are using the SonarQube in our CI infrastructure to analyse C/C++ code.
Recently we have faced with the issue related to retaining issue resolution status after merge into master.
How the workflow looks like:
During the feature branch scan, SonarQube found an issue:
We resolved the issue status as āFalse Positiveā:
3. We re-run sonar scanner on the feature branch and after successful scan merged it into master
4. After merge feature branch into master sonar scanner fails with the issue that was previously resolved as " False Possitive" in the feature branch before merging:
For all feature branches, master branch is configured as reference branch in the project settings.
As I know from documentation, issue resolution retain its status after merge if reference branch is configured for the feature branch. Branch FAQ
Please help us to find the root of the issue.
Thank you for your advice.
Hi @ganncamp ,
Thank you for reply. Weāve already resolved it manually as Won't Fix and for this reason I did not attach it.
Here is the resolved issue:
As I see - the issue was created by another branch (not the same branch where weāve resolved it),
But in this branch - all scans were passed successfully without any issues, besides I canāt find this issue neither in new code nor in old code.
Here is activity for the that branch scans:
In our Issue-tracking algorithm, there are a few ways that issues will propagate to the master branch. For example, an issue will persist if the algorithm identifies a similar enough existing in master but not exactly the same one (for example, different line numbers).
The reason you might not be able to see the issue in phy-index-fix is if the issue was already closed (not found in the latest analysis) or marked as resolved by a user. The fact that phy-index-fix shows up in the issue log of master makes it almost certain that the issue did exist in phy-index-fix when master was analyzed.
Could you go to the issue page for that branch (phy-index-fix) and try to change the issue āresolutionā search criteria to include resolved issues (accepted, false positive, fixed) and then see if it shows up?
(should look something like this, sorry the screenshot is from the latest SQ version)
This will tell us if the issue did exist in the branch analysis, and that it was resolved within the branch. Unfortunately, if the issue was indeed āclosedā (as mentioned above) it wonāt show up in the UI, although it might still be in the database.
Iām not sure if this helps at all, but the hope is to understand better if this is a valid persistence of the issue or if, indeed, it is a bug.
Hi @Lucas_Paulger ,
Thank you for your answer. Unfortunately, phy-index-fix no longer exists in SQ, and I canāt provide additional details.
Thank you for your help.