Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab error "codequality artifact not found"

I have a pipeline with the code quality report (I can load and view this report): enter image description here

But I see a message linked to this pipeline in the merge request

Failed to load codeclimate report

the tooltip is:

Base pipeline codequality artifact not found

enter image description here

When can I get the reason of it?

Job description:

code-quality:
  stage: test
  image: local-docker-hub-cache/docker:19.03.1
  allow_failure: true
  services:
    - name: docker:19.03.1-dind
  variables:
    DOCKER_HOST: tcp://localhost:2375
    DOCKER_DRIVER: overlay2
    DOCKER_TLS_CERTDIR: ""
  script:
    - iamge="local-docker-hub-cache/codeclimate:0.85.18"
    - docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}
    - docker pull ${iamge}
    - docker run --env CODECLIMATE_CODE="$PWD" --volume ~/.m2:/home/root/.m2 --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc ${iamge} analyze -f json > codeclimate.json
  artifacts:
    reports:
      codequality: codeclimate.json
like image 558
Vladimir Avatar asked Oct 27 '25 04:10

Vladimir


2 Answers

Vladimir I also ran into this problem. As it turned out, this is not a mistake. It is described in detail here. In short, in order for this widget to work, you need to launch a pipeline with a code climate job on the target branch of the request. As I understand it, this is due to the fact that the widget displays data not about the current state of the branch, but about the state of the code in comparison with the target branch.

like image 105
Dmitriy Sokolov Avatar answered Oct 30 '25 11:10

Dmitriy Sokolov


This can happen when a codequality report was created in the base branch for the later commit than your branch and the base branch have in common.

Try to rebase your feature branch against the branch you are creating a merge request to, and force-push it.

More information here.

like image 32
cronfy Avatar answered Oct 30 '25 12:10

cronfy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!