I am using SonarQube 9.9.1, GitLab Community Edition v17.2.7.
Our project is hosted on Gitlab and we already set up pull request decoration successfully.
However recently gitlab token is expired, and gitlab is upgraded and we just re-generate token and it is not working.
Steps:
gitlab: Go to gitlab > in Preferences of user > click Access Tokens > create new token with full permission
GitLab declared an incident on their side today. Among other things (I assume) it’s interfering with SonarCloud MR decoration, and that could be the problem here too. When did this start for you?
Apologies for the delay. If you are still facing the issue, we will need logs to understand what’s happening. As you had it working before the token change, and as we can assume the token is valid (the Check Configuration works ), the problem must be more complex than that, probably at the network layer or something.
What I suggest is to:
Enable TRACE logs. We already saw that DEBUG logs are not helpful and we have a chance that TRACE logs are more verbose, especially around network calls.
Rerun an analysis on an MR supposed to do a decoration (ie. reproduce the problem)
Stop TRACE logs right away, for 2 reasons:
They have performance implications
As they are very verbose, the shorter the timeframe is, the better it is to investigate (I’d say few minutes should be fine)
From there you’ll probably be able to understand which request to GitLab fails and for what reasons (network access, authentication, etc.).
If you don’t figure out what’s happening, let me know and we will arrange something so I can have a look at these logs.
This project is not configured to do MR decoration. I can see in logs such an SQL query made:
2024.12.16 02:56:18 TRACE ce[AZPNZOWXQZt_nUxqzcFU][sql] time=2ms | sql=insert into ce_task_message ( uuid, task_uuid, message, message_type, created_at ) values ( ?, ?, ?, ?, ? ) | params=AZPNZSUruOhmST0vOrI2, AZPNZOWXQZt_nUxqzcFU, No devops platform configured. To report the Quality Gate status to a devops platform, please configure it in the project administration., GENERIC, 1734317778219
ie. “No devops platform configured. To report the Quality Gate status to a devops platform, please configure it in the project administration.”
Are you sure it’s well configured? What do you see in the Project Settings > General settings > DevOps Platform Integration? It should look something like:
The screenshot you attached is the main configuration to connect to GitLab (defining the URL and Token). Once done, each project has to be bound to their GitLab repository. You don’t have to do it yourself if you import the project (Create project > From GitLab), but if you create a Local project, you have to take care of the binding.
This is done from the project homepage: Project Settings > General Settings > DevOps Platform Integration. From there, select your gitlab configuration and put the project ID that you will find on GitLab (from the project homepage, click the 3 dots logo on the top right > Copy project ID).
It works for us. When I re-create in the main configuration to connect to Gitlab (as token is expired), it seems automatically deleted MR decoration in all projects. After I add back configuration MR decoration in projects level then it works back.
Thank you a lot for your support!
PS: Since the issue is resolved then I delete the trace above log.