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

WARNING: codeclimate.json: no matching files #141

Open adamparmelee opened 6 years ago

adamparmelee commented 6 years ago

after my CI runs I'm able to see results in sonarqube, but codeclimate.json isn't being created...

here's what I'm running in gitlab-ci.yml

sonarqube_preview_feature_job: stage: test only:

iluwaa commented 6 years ago

i have a same problem, fixed with plugin update

Poeschl commented 6 years ago

Having the same issue, where no codeclimate.json is generated. (Plugin Ver. 3.0.1)

My gitlab-ci.yml config is:

sonarqube analysis preview:
  stage: analysis
  except:
  - master
  tags:
  - aws
  image: gradle:4.8.1-jdk8
  before_script:
  - export GRADLE_USER_HOME=`pwd`/.gradle
  script:
  - >
    gradle -info -Dsonar.login=$SONAR_LOGIN_TOKEN -Dsonar.host.url=$SONAR_URL -Dsonar.analysis.mode=preview
    -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
    -Dsonar.gitlab.json_mode=CODECLIMATE -Dsonar.gitlab.failure_notification_mode=commit-status
    sonarqube
  - ls -al
  artifacts:
    expire_in: 1 day
    paths:
    - codeclimate.json
gabrie-allaigre commented 6 years ago

Hi, Have you a log ?

Poeschl commented 6 years ago

I will provide one tomorrow. The log of the scanner, Sonarqube or both?

gabrie-allaigre commented 6 years ago

scanner log, please

Poeschl commented 6 years ago

Here is the obfuscated log from a execution on our gitlab. (Just removed all customer names) gitlab-scanner-log.log

gabrie-allaigre commented 6 years ago

Sonar Gitlab Plugin don't start Have you set GITLAB_URL & GITLAB_USER_TOKEN in sonarqube admin ?

Poeschl commented 6 years ago

Yes, I inserted https://gitlab.com as GITLAB_URL and my personal access token (with Owner permissions) as GITLAB_USER_TOKEN.

Is it necessary to access the sonarqube instance with https ?

gabrie-allaigre commented 6 years ago

no, verify password has saved

Poeschl commented 6 years ago

I renewed the gitlab access token and tried again. (No more save button visible in the settings) No change happens in log and still no codeclimate.json.

gabrie-allaigre commented 6 years ago

Ok, add debug mode in command line, gradle -d and get full log.

Poeschl commented 6 years ago

As you wish :wink: (This time its a local execution)

sonar-scan-debug.log

gabrie-allaigre commented 6 years ago

Thanks,

13:11:53.712 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] 'GitLab Commit Issue Publisher' skipped because one of the required properties is missing

Properties is mandatory : GitLabPlugin.GITLAB_URL, GitLabPlugin.GITLAB_USER_TOKEN, GitLabPlugin.GITLAB_PROJECT_ID, GitLabPlugin.GITLAB_COMMIT_SHA, GitLabPlugin.GITLAB_REF_NAME

What is sonarqube version use ?

Poeschl commented 6 years ago

As far as I see all of them are defined with the project setting and the execution parameters.

The sonarqube version is the 6.7.4 LTS

gabrie-allaigre commented 6 years ago

Ok, verify if GITLAB_USER_TOKEN is saved because a bug in UI in sonarqube 6.7 You have to save twice

gabrie-allaigre commented 6 years ago

Try to set -Dsonar.gitlab.url=... in command line

Poeschl commented 6 years ago

Saved two times, didn't work out.

~~When the sonar.gitlab.url and sonar.gitlab.user_token are set via command line parameter it works. I will test again if only the url is enough.~~

When the sonar.gitlab.url is set via command line parameter it works perfectly. A strange behaviour, but this workaround is fine for me