Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab code quality: where is the report?

On this project: https://gitlab.com/tyvain/parcoursup/tree/master

I have a code quality stage:

code_quality:
  stage: code_quality
  image: docker:stable
  variables:
    DOCKER_DRIVER: overlay2
  allow_failure: true
  services:
    - docker:stable-dind
  script:
    - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    - docker run
        --env SOURCE_CODE="$PWD"
        --volume "$PWD":/code
        --volume /var/run/docker.sock:/var/run/docker.sock
        "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
  artifacts:
    paths: [gl-code-quality-report.json]

This stage always endup 'passed'. Logs: https://gitlab.com/tyvain/parcoursup/-/jobs/94665791

I doubt that my code is perfect, so there should be some code quality issues somewhere.

Where is the code quality report supposed to be output ?
What is this parameter: "paths: [gl-code-quality-report.json]" ?

like image 625
Tyvain Avatar asked Sep 04 '18 21:09

Tyvain


People also ask

How do you integrate SonarQube quality gate with GitLab CI CD?

Authenticate with GitLab - Sign in to SonarQube with your GitLab credentials. Import your GitLab projects - Import your GitLab Projects into SonarQube to easily set up SonarQube projects. Analyze projects with GitLab CI/CD - Integrate analysis into your build pipeline.

What is artifact in GitLab CI?

Artifacts are files generated through a process that we use Job or Pipeline. Of course, it's not all Jobs that create files, but if your projects generate files, we can use the GitLab Artifacts to manage the files for us. Gitlab will store that artifact, and we can download it using the UI or calling the API.

How do I comment in GitLab CI Yml file?

Comments begin with the number sign (#), can start anywhere on a line and continue until the end of the line. Comments must be separated from other tokens by whitespace characters.


1 Answers

2 problems here:

  • the report is only available for merge request in 'gitlab EE edition' (not free)
  • the report can be downloaded as a json file here: where to download artifacts
like image 169
Tyvain Avatar answered Sep 24 '22 20:09

Tyvain