Code Quality Widget not showing number of changes

  • Describe your question in as much detail as possible:

How do I get the number of improvements/degredations to appear in the Code Quality widget? I’m wondering if GitLab recently redesigned the Code Quality widget (and perhaps their docs are out-of-date)


  • What are you seeing, and how does that differ from what you expect to see?

The Code Quality widget only says whether code quality improved or degraded, but not the number of points.

I expect to see the number of improvements/degredations. The following is a screenshot from GitLab Docs | Code Quality:

image


  • What version are you on? Are you using self-managed or GitLab.com?

GitLab SaaS 14.7.3


  • Add the CI configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml)

For testing purposes, I used a hardcoded “dummy” code quality report with the following CI/CD configuration:

code_quality:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  script:
    - cat gl-code-quality-report.json
  artifacts:
    reports:
      codequality: gl-code-quality-report.json

Here is the code quality report:

[
  {
    "description": "Bad spelling",
    "fingerprint": "123",
    "severity": "major",
    "location": {
      "path": "src/Program.cs",
      "lines": {
        "begin": 1
      }
    }
  }
]

  • What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

I’ve tried manipulating the code quality report by: adding additional violations, removing violations, creating dummy merge requests, etc.

I was able to answer this myself:

When merged, gitlab-org/gitlab#244338 changed code quality widget text.

The original behavior is being discussed at gitlab-org/gitlab#337798.