Branch Analysis with Pull Requests

We use Bitbucket Server with SonarQube 7.9 and Branch Analysis.

This works so far but one problem is annoying:
When we close an issue in a short lived branch in sonar we can not merge the pull request because the Pull Request is build with a branch name like PR-XX and the sonar analysis does not consider the issue state of the corresponding branch.
So we also have to close the issues on the PR branch.

Is this something that can be solved by sonar or should we try to map the PR branches to the short-lived branches ourselves.

Kind regards,
Michael

Hi Michael,

I’m curious about your workflow. You’re analyzing both the short-lived branch and its PR? Why? Why not just analyze the PR?

 
Thx,
Ann

Yes we analyze both.
The short lived branch is used for 2-4 weeks and the sonar scan is run nightly, so the developer is aware of any issues and can fix them in time. Then if the work is ready a pull request is created and that pull request can only be merged to master if quality gate is passed.

Hi Michael,

Thanks for sharing. You may want to follow the progress of this initiative:

MMF-1603 - Simplify management of branches and PR

 
Ann