regarding to our previous problem with the housekeeping of pull requests and shorted-lived branch, we are now facing a new problem.
The settings for deleting analysis of short-lived branches and pull requests is set to 30.
We have two long-lived branches: master and develop
The only way to push into these is via pull requests.
And the normal process is to create a pull request to merge new code into develop and than create another pull request to merge develop into master.
For the develop branch the housekeeping seems to work, because we don’t have any analysis of pull request older then 30 days.
The problem: for the main branch master the list of pull requests analysis gets longer and longer
Normally we create a pull request in AzureDevOps from develop into master and name it something like “Merge develop into master”. In our build pipeline we set the following sonar properties for a pull request build:
sonar.pullrequest.key -> id of the pull request, e.g. 1018
sonar.pullrequest.branch -> source branch of the pull request, in this case develop
sonar.pullrequest.base -> target branch of the pull request, in this case master
sonar.pullrequest.provider -> always vsts
The property sonar.branch.name will not be set for pull request build, only for “normal” builds.
Hi @s-kip,
To be fully precise, the problem is the source branch of the pull request was part of the branchesToKeepWhenInactive when the pull request was first analyzed by SonarQube. Changing branchesToKeepWhenInactive now will not purge those stale pull requests that are already in SonarQube, it will only affect new pull requests.
We will fix this problem in 8.6 and the fix will also cleanup affected pull requests. If waiting for 8.6 is not an option, I imagine one workaround would be a combination of changing branchesToKeepWhenInactive and manually removing affected pull requests that were created prior changing this setting.