SonarSource Developer Edition 8.6
Embedded database (for evaluation)
Maven scanner (3.4.0.905)
I am attempting to use a reference branch to filter out issues introduced on our master branch.
- Create a new project by doing a scan of an existing git repo on the master branch
- This isn’t required, but should put the system in a known state
- Set the “New Code” to reference the master branch
- Scan master branch
- Make a new branch locally from the same commit as master
- Scan the new branch
- Make a new commit that adds issues on the new branch
- Scan the new branch
- Issues are visible in the “New Code” as expected
- Switch back to the master branch
- Make a commit with an issue in a different file on the master branch
- Scan the master branch
- Merge the master branch into the new branch
- Scan the new branch
Expected behavior: The new branch would still only see the the issues introduced on that branch in the New Code tab.
Actual behavior: The new branch shows the issues introduced on both the master branch and the new branch in its New Code tab
I have tried this a number of times with slight tweaks to what files were being edited the order that the commits were made and gotten various other permutations of results, though I didn’t record the exact steps to reproduce these:
- Saw the issues from the master but not the issues from the new branch
- Saw the issues introduced on master from before the new branch was even created (master had been scanned several times at that point)