Sonarqube merge decoration deletes all comments from the same user

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.

Any comment from any one?

Hey, thanks for this feedback. We are discussing this internally. It would make sense to apply the same behaviour at what we did for GitHub, which is updating the comment for live update, and recreate it only for new analysis. In that case we can think about doing a search in the content of the comment, or store the comment id.

Great, thanks Pierre. My own scripts that do similar things on Gitlab search for content, as they are just scripts on the pipeline with no storage engine.

How would I track this change? Will my subscription to this bug alert me sufficiently?

This is tracked down here

Hi, FYI SONAR-13558 has been merged. That will be part of the 8.5 release.

That’s great - thanks for the feedback and letting me know