Using Sonarqube 8.2 self hosted, with gitlab integration.
We have SQ configured to do merge request decoration. It works nicely.
However, the gitlab user we have set up for Sonarqube to use is shared by other services and scripts that do Merge Request Decoration. This keeps our gitlab license costs down.
Sonarqube’s behaviour is that when making a merge request comment, it will find all other comments from the same user, and delete them - this is clearly to ensure that it doesn’t repeat its own posts. However, in our case, it’s deleting posts that are not its concern. Given how straightforward the Gitlab API is to use, this feels like lazy coding.
It would be better if either:
1 - Sonarqube identified just it’s own previous comments and deleted just the one, before reposting or
2 - Edited its previous comment (I would prefer this - it keeps the comment history available)
Of course there is the risk of a false positive - what if something else posted a comment that started with the text ‘SonarQube Code Analysis’? But I feel that is a much lesser evil than the current ‘delete it all’ behaviour.