gabrie-allaigre / sonar-gitlab-plugin

Add to each commit GitLab in a global commentary on the new anomalies added by this commit and add comment lines of modified files
GNU Lesser General Public License v3.0
713 stars 208 forks source link

GitLab CI job disappears from pipeline #121

Closed jangrewe closed 6 years ago

jangrewe commented 6 years ago

Hi, your plugin is working great, except for one small (cosmetic) issue: After the scan has ran, the "External" job is created, and the original job disappears from the Pipeline view:

Pipeline

I have to go to the Jobs list to find the job again. Is there any way to fix this?

gabrie-allaigre commented 6 years ago

Hi, Can you get file .gitlab-ci.yml ? Thanks

jangrewe commented 6 years ago

Sure, here's a "sanitized" version:

stages:
  - test
  - docker
  - build
  - deploy

sonarqube:
  image: registry.example.com/sonar-scanner
  stage: test
  script:
    - sonar-scanner -Dsonar.projectBaseDir=$(pwd) -Dsonar.analysis.mode=preview -Dsonar.gitlab.commit_sha=${CI_COMMIT_SHA} -Dsonar.gitlab.ref_name=${CI_COMMIT_REF_NAME} -Dsonar.gitlab.project_id=${CI_PROJECT_ID}
    - sonar-scanner -Dsonar.projectBaseDir=$(pwd) -Dsonar.projectVersion=${CI_COMMIT_SHA}

build_deploy:
  stage: docker
  when: manual
  script:
    - docker build -t registry.example.com/build -f Dockerfile.deploy .
    - docker push registry.example.com/build
gabrie-allaigre commented 6 years ago

the problem must be because of the name of the job 'sonarqube', it's the same name as the status. Change the job name to 'sonarqube_jobs'?

jangrewe commented 6 years ago

yup, that fixes it. Thanks for the hint!