which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension) - SonarQube Enterprise Edition v2025.1 (102418), Sonar Scanner CLI 6.1.0.4477
how is SonarQube deployed: Docker
what are you trying to achieve - We use a Gitflow-like workflow where a release branch is created from master for a release, and developers create feature branches from the release branch to work on specific tasks. Developer merges code from feature to release branch when that task is complete. All branches are configured to build and analyze on merge. At the end of the release cycle, code is merged from release to master branch. When a developer marks a SonarQube issue as “False Positive” in a feature branch, that attribute should sync to the release branch when feature branch is merged, and should also sync to master branch when the release branch is eventually merged to master. This syncing is not happening.
what have you tried so far to achieve this - for the feature and release branches, New Code definition is set to use master branch as reference branch. We have tried multiple test cases, marking issues FP just in feature branch, just in release branch and in both feature and release branches. In all these test cases, the issue attribute is NOT synced after a merge. Issues marked FP in feature branch do not sync to release branch when merged; and issue marked FP in feature or release branch do not get synced to master when code is merged to master.
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
Are you currently using Pull Request (PR) analysis when merging branches into each other? SonarQube transfers issue dispositions (such as marking issues as False Positive) across branches when PR analysis is used.
Hi Colin,
No we don’t do pull request analysis due to some constraints in our CI pipeline. However, I am following the SonarQube documentation related to issue synchronization between branches (Issue management overview | SonarQube Server Documentation) which says this should work either with pull request analysis or without. I am following the instructions in the “Without pull request” bullet. I’ve copied the relevant section from the SQ documentation below.
Issue synchronization applies also in case of a merge:
With pull request: after the merge, SonarQube Server transfers the attributes of the issues from the pull request analysis to the target branch.
Without pull request: if the New Code Definition of the branch to be merged is Reference branch, and the branch is merged into its reference branch, after the merge, SonarQube Server transfers the attributes of the issues from the branch analysis to the reference branch.
Can you share a bit more about how you’re configuring the New Code Period? Are you using an analysis parameter, sonar.newCode.referenceBranch, or configuring it in the UI?
I am doing exactly as you show in the screenshot, i,e, selecting “Reference Branch” and “master” as the reference branch. For the master branch only, new code is configured to compare against Previous Version
I came across this ticket that sounds a lot like the issue you’re facing: SONAR-24139. This should only affect projects using sonar.newCode.referenceBranch, not configuring in the UI (I’m not sure what would happen if both are used)?
You’re definitely not using sonar.newCode.referenceBranch? It would be worth checking your pipeline config / sonar-project.properties.