Cannot generate code quality in MR widget

We use GitLab 12.0.2-ee. I have read everything about GitLab code quality / code climate but it doesn't work for me. The report is actually generated and I can download and open the json file with the code quality report, but nothing appears in the MR widgets.

I put this in my gitlab-ci.yml

include:
  - template: Code-Quality.gitlab-ci.yml

code_quality:
  tags:
   - cd-dind
  artifacts:
    paths:
      - gl-code-quality-report.json
    reports:
      codequality: gl-code-quality-report.json

What am I doing wrong? I tried submitting several merge requests and also merging them but code quality does not appear in the MR info widget. I see that the code_quality job/stage runs in the pipeline and that the report is generated as an artifact but there is no way to extract the information except trying to read the json file manually.

Update

I copypasted the pipeline from the latest code quality commit in the gitlab repo to my gitlab-ci.yml, and removed the above code. Now the code quality report appears in the merge request widget. It displays the difference in code quality from the latest merge request, which is helpful. But it would also be nice to see which are the total issues and not only the difference. So it seems I have at least two issues here. (1) I cannot follow the instructions and instead I must use the latest commit from gitlab's own source to make it work. (2) There seems to be no way to view the total code quality issues and it is only possible to view a difference based on the difference in the merge request.

Edited Jul 08, 2019 by Niklas Rosencrantz
Assignee Loading
Time tracking Loading