MR always show No changes to code quality message

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Hello here

Summary

Merge request overview tab always show No changes to code quality in code quality widget even if:

  • there are errors in the current report which is right uploaded as artifact
  • a previous report exists for the destination branch which did not have these errors
  • the pipeline page shows all errors in code quality tab

Steps to reproduce

  1. add .gitlab-ci.yml defining a job which generate code quality artifact, for example using golang-ci:
stages:
  - lint

lint:
  image: golangci/golangci-lint
  stage: lint
  script:
    - '[ -e .golangci.yml ] || cp /golangci/.golangci.yml .'
    - golangci-lint run --issues-exit-code 0 --out-format code-climate | tee gl-code-quality-report.json
  artifacts:
    reports:
      codequality: gl-code-quality-report.json
    paths:
      - gl-code-quality-report.json
  1. Init a go module:
go mod init mymodule
  1. add code without error
package main

import (
    "fmt"
)

func main() {
    fmt.Printf("toto") //nolint
}
  1. commit && push on main branchto generate a first good a report

  2. change the code to introduce error:

package main

import (
	"fmt"
)

func main() {
    fmt.Printf("toto")
}
  1. commit && push on a new branch to generate a "bad" report

  2. open the PR for this new branch

  3. wait for job done and notice the message No changes to code quality

Example Project

Here is an example projet: https://gitlab.com/qmanfroi/golang-test

you can see:

What is the current bug behavior?

The merge request code quality widget show No changes to code quality which is wrong here because the report has been uploaded, contains error compared to the main branch one

What is the expected correct behavior?

The merge request code quality widget should show similar listing errors visible in the pipeline page

Relevant logs and/or screenshots

See previous section

Output of checks

This bug happens on GitLab.com

Possible fixes

No idea but given that the pipeline page properly show all the report errors I suppose the problem comes from the comparison with the old report because the MR code quality widget should only show the difference (and not all errors if already exist in main report).

It can be related to the old issue: #13026 (closed)

Edited by 🤖 GitLab Bot 🤖