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

Sonar can not feedback report to gitlab when pull_request. #284

Open
gth7754125 opened this issue Aug 28, 2020 · 0 comments
Open

Sonar can not feedback report to gitlab when pull_request. #284

gth7754125 opened this issue Aug 28, 2020 · 0 comments

Comments

@gth7754125
Copy link

gth7754125 commented Aug 28, 2020

i use drone ci to trigger a sonar scan when a pull_request manually attached.
However, it can create the report but don't feedback report at all.
How to make it work? Somebody can help ?

- name: feedback
    image: maven:3-jdk-8
    volumes:
      - name: cache
        path: /root/.m2
    environment:
      SONAR_URL: http://sonar.****
      SONAR_LOGIN:
        from_secret: sonar_token
      CI_PROJECT_PATH: http://git.*****/wiki001/testproject
      CI_COMMIT_SHA: ${DRONE_COMMIT_SHA}
      CI_COMMIT_REF_NAME: ${DRONE_COMMIT_BRANCH}
      CI_PROJECT_ID: 11
    commands:
      - mvn --batch-mode verify sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.analysis.mode=preview -Dsonar.issuesReport.console.enable=true -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
    when:
      branch:
        include:
          - develop
          - master
      event:
        include:
          - pull_request

Part of drone's logs here:

187 | [INFO] ------------- Run sensors on project
-- | --
188 | [INFO] No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
189 | [INFO] Load server issues
190 | [INFO] Load server issues (done) \| time=92ms
191 | [INFO] Performing issue tracking
192 | [INFO] 11/11 components tracked
193 | [INFO] Load server rules
194 | [INFO] Load server rules (done) \| time=171ms
195 | [INFO] ANALYSIS SUCCESSFUL
196 | [INFO] Analysis total time: 6.432 s
197 | [INFO] ------------------------------------------------------------------------
198 | [INFO] BUILD SUCCESS
199 | [INFO] ------------------------------------------------------------------------
200 | [INFO] Total time:  26.587 s
201 | [INFO] Finished at: 2020-08-28T07:16:37Z

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

1 participant