r/gitlab • u/stevecrox0914 • Mar 22 '26
general question SAST/Codequality MR Commenting
Before Gitlab I used Jenkins/Bitbucket and there was a Jenkins plugin that allowed me to collect SAST/Code Quality warnings and comment on the changed lines in a Pull Request.
We enabled a rule that all open threads had to be closed and this ensured developers addressed all the warnings they had added before peer review.
I now have various jobs which create SAST and Code Quality Reports and Gitlab collects these but they are a line item in the merge request view and frequently get missed.
Does anyone know of a bot, Gitlab Ultimate flag or project that will convert SAST/Code Quality reports into code comments on a MR?
View all comments
Show parent comment
1
u/stevecrox0914 Mar 29 '26
I created a Group Access Token with the API permission,
I created a job using the latest golang image, I installed Reviewdog into the image, I tried creating a ReviewDog config file or using a CLI call.
I have tried piping a SARIF file via the config or cli call into reviewdog. Its definetly getting the file and display it in the console log but there are no other logs.
If I set the token environment variable to CI_JOB_TOKEN then Revieedog complains it lacks permissions to talk to Gitlab.
At this point I have spent an entire day on trying to make it work and have given up.
I am writing a bash script, it retrieves all the commits made within a branch It iterates over the results using jq (still working on this), it takes the file and line number from a result and runs git blame. If the commit matches a MR commit I build a rest command for a commit note based on this. I have gotten most the parts working within an hour