SonarQube decoration on GitLab MR is using the GitLab API :
The body query parameter can be too long for the GitLab embedded Nginx reverse proxy, with the default configuration.
The visible effect of this is that the SonarQube background task is looping forever on the MR decoration, without ever failing (no timeout).
For on-prem GitLab instance, the fix for users is to add to the gitlab.rb configuration file this configuration :
which allows a bigger URL.
The definitive fix would be to fail properly on the SonarQube side, with a proper error. The same query with curl raise a correct error :
SonarQube should be able to detect such an error and fail accordingly, with the advice to increase the URL limit on the Gitlab size.
For GitLab.com, there is no workaround yet. But the limit has already been increased a bit, so the issue has not been reported yet. The issue will happen if a user has a very long Sonarqube URL (because of the links we put in the markdown).
From the community: https://community.sonarsource.com/t/gitlab-ci-loop-of-empty-posts-for-pr-decoration-when-quality-gate-fails/19137/33, and credits to Antoine DAVID for the suggested workaround.