I am having all the comments deleted from a MR when SonarCloud posts the comment with the data from the report.
I first contacted gitlab support, which confirmed the issue is related with SonarCloud:
Thanks for contacting GitLab Support.
We’re sorry to hear about the issue. We’ve received a few reports from other customers of this same behavior and have tracked it down to be a bug with SonarCloud in how it interacts with GitLab. Other customers have reported that SonarCloud will delete old comments on a merge request once an analysis has run and could be doing it at other times as well.
In this particular case I’ve checked our logs and have confirmed this is the case. On that merge request there are numerous
DELETErequests made via the API to comments on it all with the user agent
SonarQube/220.127.116.1134originating from three AWS IP addresses:
As a potential workaround, we did have a customer experiencing this issue report that they got around it by creating a user specifically for the SonarCloud integration rather than having it be run through the account of a normal member of your group such as yourself.