title: Overview
Branch analysis is available as part of Developer Edition and above.
Branch analysis allows you to
Short-Lived This corresponds to Pull/Merge Requests or Feature Branches. This kind of branch:
For more, see Short-lived Branches
This corresponds to “Maintenance” Branches that will house several release versions. This kind of branch will:
For more, see Long-lived Branches
This is the default, and typically corresponds to what’s being developed for your next release. This is usually known within a development team as “master” or “head”, and is what is analyzed when no specific branch parameters are provided. It is labeled “Main Branch” and defaults to the name “master”, but can be renamed from within the interface. When you are not using Developer Edition, this is the only branch you see.
A branch is created when the sonar.branch.name
parameter is passed during analysis.
Parameter Name | Description |
---|---|
sonar.branch.name |
Name of the branch (visible in the UI) |
sonar.branch.target |
Name of the branch where you intend to merge your short-lived branch at the end of its life. If left blank, this defaults to the master branch. It can also be used while initializing a long-lived branch to sync the issues from a branch other than the Main Branch. |
By default, TravisCI only fetches the last 50 git commits. You must use git fetch --unshallow
to get the full history. If you don’t, new issues may not be assigned to the correct developer.
A regular expression is used to determine whether a branch is treated as long-lived or short-lived. By default, branches that have names starting with either “branch” or “release” will be treated as long-lived.
This can be updated globally in Configuration > General > Detection of long-lived branches or at project’s level in the Admininstration > Branches.
Once a branch type has been set, it cannot be changed. Explicitly, you cannot transform a long-lived to short-lived branch, or vice-versa.