Skip to content

SonarQube - Branch Analysis

Details the branch analysis configurations for SonarQube.

NOTE: We currently have two instances of SonarQube. This document is intended for the enterprise configuration installed at https://sonarqube.mdtproductdevelopment.com. Important to make a distinction as the versions are quite different and the settings/configurations may be different between the two. At the time of this writing, that installation is version LTS 9.9.

Definitions

Long-Lived Branches

Branches that are specified in the Branches to keep when inactive list. Uses regular expressions to pattern match branch names. Branches that match do not have their results pruned.

Short-Lived Branches

Implied as any branch that does not match the patterns in Branches to keep when inactive. These are deleted when the branch becomes inactive.

Settings - Description and Configuration Values

  • Link to the sonarqube.mdtproductiondevelopment.com instance branch analysis configuration.
  • SonarQube Branch Analysis configuration can be found at Administration-->Configuration-->Housekeeping.
  • Can also reference the official docs at https://docs.sonarqube.org/9.9/branches/overview.
  • The list below have a description of the configuration and then the value that is set for that specific configuration.

NOTE: These are copy pasta from the SonarQube Housekeeping page.

Number of days before purging inactive branches and pull requests

Description

Branches and pull requests are permanently deleted when there has been no analysis for the configured number of days.

Configuration

Value: 30 days

Branches to keep when inactive

Description

By default, branches and pull requests are automatically deleted when inactive. This setting allows you to protect branches (but not pull requests) from this deletion. When a branch is created with a name that matches any of the regular expressions on the list of values of this setting, the branch will not be deleted automatically even when it becomes inactive.

Example: * develop * release-.*

Configuration

Values: * main * develop * project/* * release/*

Keep only one analysis a day after

Description

After this number of hours, if there are several analyses during the same day, the DbCleaner keeps the most recent one and fully deletes the other ones.

Configuration

Value: 24 hours

Keep only one analysis a week after

Description

After this number of weeks, if there are several analyses during the same week, the DbCleaner keeps the most recent one and fully deletes the other ones

Configuration

Value: 4 weeks

Keep only one analysis a month after

Description

After this number of weeks, if there are several analyses during the same month, the DbCleaner keeps the most recent one and fully deletes the other ones.

Configuration

Value: 52 weeks

Keep only analyses with a version event after

Description

After this number of weeks, the DbCleaner keeps only analyses with a version event associated.

Configuration

Value: 104 weeks

Delete all analyses after

Description

After this number of weeks, all analyses are fully deleted.

Configuration

Value: 260 weeks

Delete closed issues after

Description

Issues that have been closed for more than this number of days will be deleted.

Configuration

Value: 30 days