Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'GitLab Commit Issue Publisher' skipped because one of the required properties is missing #273

Closed
pavelpraulov opened this issue Feb 18, 2020 · 5 comments

Comments

@pavelpraulov
Copy link

pavelpraulov commented Feb 18, 2020

I've been trying to diagnose this issue without any luck. As far as I can tell, I have all the required configurations:

image: java:8-jdk

before_script:
  - export GRADLE_USER_HOME=`pwd`/.gradle

cache:
  paths:
    - .gradle/wrapper
    - .gradle/caches

variables:
  SONAR_URL: http://192.168.74.12:9000/
  SONAR_TOKEN: <SONAR_TOKEN>
  SONAR_PROJECT_KEY: sonarqube-scanner-gradle
  SONAR_PROJECT_NAME: sonarqube-scanner-gradle
  GITLAB_ACCESS_TOKEN: <GITLAB_ACCESS_TOKEN>


after_script:
  - echo "End CI"

sonarqube_preview_feature_job:
  stage: test
  only:
    - /^task\/*/
  script:
    - git config user.email <user.email> && git config user.name <user.name>    
    - git checkout origin/master
    - git merge $CI_COMMIT_SHA --no-commit --no-ff
    - ./gradlew --debug :sonarqube
      -Dsonar.login=$SONAR_TOKEN
      -Dsonar.host.url=$SONAR_URL
      -Dsonar.projectName=$SONAR_PROJECT_NAME
      -Dsonar.projectKey=$SONAR_PROJECT_KEY
      -Dsonar.gitlab.user_token="$GITLAB_ACCESS_TOKEN"
      -Dsonar.gitlab.project_id=$CI_PROJECT_PATH
      -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA
      -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
      -Dsonar.analysis.mode=publish

The script succeeds however Gitlab isn't updated and the following message is logged:

[INFO]  [org.sonarqube.gradle.SonarQubeTask] Analysis report uploaded in 12ms
[INFO]  [org.sonarqube.gradle.SonarQubeTask] ANALYSIS SUCCESSFUL, you can browse http://192.168.74.12:9000/dashboard?id=sonarqube-scanner-gradle
[INFO]  [org.sonarqube.gradle.SonarQubeTask] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO]  [org.sonarqube.gradle.SonarQubeTask] More about the report processing at http://192.168.74.12:9000/api/ce/task?id=AXBX2OmEPnOJAFLW2U-I
[DEBUG] [org.sonarqube.gradle.SonarQubeTask] Report metadata written to /builds/uname/sonar-gitlab-kotlin/build/sonar/report-task.txt
[DEBUG] [org.sonarqube.gradle.SonarQubeTask] 'GitLab Commit Issue Publisher' skipped because one of the required properties is missing

As I know:

Required is gitlab url, user token for gitlab, sha and project id

all of these properties are existed, but I still have the problem.


SonarQube CE 7.9.2 (build 30863)
GitLab CE 12.3.5
sonar-gitlab-plugin 4.1.0

@kortov
Copy link

kortov commented Feb 18, 2020

I guess for this sonar version you should use this PR, but not sure #253

@rusguliev
Copy link

rusguliev commented Feb 18, 2020

Hi, try replacing the parameter "$CI_PROJECT_PATH" with "$CI_PROJECT_ID", most likely the matter is in this parameter.

@pavelpraulov
Copy link
Author

pavelpraulov commented Feb 18, 2020

@kortov , @rusguliev
first of all, thank you for your quick response.

I guess for this sonar version you should use this PR, but not sure #253

I will try this way for sure.

try replacing the parameter "$CI_PROJECT_PATH" with "$CI_PROJECT_ID"

Unfortunately, the same result.

Anyway, once again spasibo.

@rusguliev
Copy link

as already mentioned by @kortov, the version of sonar-gitlab-plugin 4.1.0 is not compatible with SonarQube 7.9.2.

@pavelpraulov
Copy link
Author

Yes, right,
the problem was solved after migrating to javamachr/sonar-gitlab-plugin
and installing sonarqube-community-branch-plugin
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants