-
Notifications
You must be signed in to change notification settings - Fork 208
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
Plugin is executed yet doesn't add anything to commits in GitLab #3
Comments
Hi, 2016-07-01 15:22 GMT+02:00 Daniël van de Giessen notifications@github.com:
Gabriel ALLAIGRE Directeur technique [image: Le blog de TalanLabs] 8 rue Euler 75008 PARIS Tel : 01 53 34 05 72 Por : 06 22 33 78 56 gabriel.allaigre@talanlabs.com PAdoptez l'éco-attitude. N'imprimez ce mail que si cela est vraiment nécessaireCe message contient des informations confidentielles protégées par le The information transmitted is intended only for the person or entity to |
Setting There were (multiple) new issues were introduced in that commit, and those new issues did show up in the SonarQube web interface. (I've tested with multiple commits, all with different kind of issues introduced. SonarQube picks them up, they just don't get commented on in GitLab.) |
GitLab plugin must a sonar preview mode only 2016-07-01 20:10 GMT+02:00 Daniël van de Giessen notifications@github.com:
Gabriel ALLAIGRE Directeur technique [image: Le blog de TalanLabs] 8 rue Euler 75008 PARIS Tel : 01 53 34 05 72 Por : 06 22 33 78 56 gabriel.allaigre@talanlabs.com PAdoptez l'éco-attitude. N'imprimez ce mail que si cela est vraiment nécessaireCe message contient des informations confidentielles protégées par le The information transmitted is intended only for the person or entity to |
Ah, that was the issue! Running the scanner in preview mode ( Is this a inherent limitation of how Sonar Scanner operates? Right now I have to run the analysis twice, once for the GitLab-plugin to work and then directly again to also actually publish the results to SonarQube. |
In my case Regarding running the analysis twice, it looks like it's by design: http://www.sonarqube.org/analysis-vs-preview-vs-incremental-preview-in-sonarqube/ and it makes sense, but it would still be nice to have the comments in GitLab for full analysis. @gabrie-allaigre any news on this matter? |
I don't know if this will help but I was not seeing any comments neither. My solution was to:
To help troubleshoot the second problem, I had to clone this plugin, add debug traces in the console in various files and upload the modified version of the plugin to the Sonar server. This surely helps ! |
Nothing of the above has helped me in running this plugin successfully. I tried everything with no sucess.
But no issue message in gitlab of any mistake in the code :( |
Something bugs me: if the preview mode is really enabled, new issues should NOT be reported to sonarqube. |
Well I'm executing sonar-scanner from go.cd ant the reported running command is:
Edit:
I'll keep trying things... |
The error seems quite clear, do you have any language plugin installed on your SonarQube server ? |
I thought the same an it was the first thing to check with no success. I've tried to:
Nothing has changed. But it seems weird to me that other scan types were able to find the proper plugins. I've found the same error published in google goups but still not fixed: https://groups.google.com/forum/#!topic/sonarqube/G77UKtXQUAo |
Hi @gtrias , Have given some guidance on the Google Group thread where the same error was reported. Long story short: double-check what's configured in your SonarQube Admin settings (General section), for the properties Plugins accepted for Preview mode and Plugins excluded for Preview mode. These properties restrict the set of plugins seen by the scanner when executed in preview mode, so it can likely explain why your preview analysis fails with No language plugins are installed (e.g. if include/exclude properties hide all language plugins). Best is to leave the include property blank, and review what you decide to exclude. Keep us posted. |
@n-b-sonar Thank you so much!! Was the "Plugins accepted for Preview mode", I didn't known there was an option to avoid the preview mode to fetch all the plugins. |
I want to understand better how this plugin works with Gitlab CI. My goal is to run this plugin on Gitlab MRs so it could make necessary comments there.
I was able to launch full project sonar analysis by
These variables - $CI_BUILD_REF, $CI_BUILD_REF_NAME, $CI_PROJECT_ID - will they be automatically resolved? |
These variables are predefined by GitLab and accessible from the .gitlab-ci.yml file. See here : https://docs.gitlab.com/ce/ci/variables/. The only thing different in my script is the |
@amilien here is my .gitlab-ci.yml for sonarqube sonarqube_preview:
script:
- mvn --batch-mode verify sonar:sonar -DskipITs -DskipTests -Dgpg.sign=false -Dsonar.host.url=https://xxx -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.analysis.mode=preview -Dsonar.issuesReport.console.enable=true -Dsonar.gitlab.commit_sha=$CI_BUILD_REF -Dsonar.gitlab.ref_name=$CI_BUILD_REF_NAME
stage: test
except:
- develop
- master
- /^hotfix_.*$/
- /.*-hotfix$/
tags:
- java
sonarqube:
script:
- mvn --batch-mode verify sonar:sonar -DskipITs -DskipTests -Dgpg.sign=false -Dsonar.host.url=https://xxx
stage: test
only:
- master
tags:
- java |
@DvdGiessen please try with 2.0.0-beta2 and report back. |
wow, just scrolled up and see your issue was actually resolved here #3 (comment) @gabrie-allaigre should be good to close this issue 👍 |
I used sonar-gitlab-plugin for php. The test project is sample project of sonarqube scanner.
File .gitlab-ci.yml
|
@dinhkk I think you can drop |
Good, |
It have some trouble in configure sonar-gitlab-plugin. @gabrie-allaigre I want SonarQube to report the analysis result to gitlab, and I had done the following step:
then I go into my maven project root directory(where pom.xml stay in), and use the following command:
but the result tells me something is wrong :
but when I run with |
Hi, For |
Thanks for your reply, I had been trying to solve this problem for several days. @gabrie-allaigre Follow your reply, I change the value of
that means I run the following three command seprately:
but they all turns the same error :
would you know what's wrong with the maven command. thanks. |
try chenyurong/code |
Have you set access token in SonarQube ? |
what do you mean access token in SonarQube, in which menu ? |
In SonarQube Administration -> General Settings -> GitLab -> GitLab User Token |
Just now I add the
the project compile SUCCESS. But when I browse the SonarQube Web Page, the by the way, I did set the GitLab User Token already in |
Sonar preview mode not change page in SonarQube.
|
Thanks for your instruction, I really really appreciate that. Without your reply, maybe I can't solve this problem. I can see the inline comment in gitlab now. Thanks again~~ |
Good |
hi |
Hi everyone, can this question be reopened? My problems:when I used sonar.projectKey=org.sonarqube:java-print-demo-scanner
sonar.projectName=Java :: print-demo :: SonarQube Scanner
sonar.projectVersion=1.0
sonar.sources=src
sonar.language=java
sonar.sourceEncoding=UTF-8
sonar.login=admin
sonar.password=admin
sonar.analysis.mode=preview
sonar.issuesReport.console.enable=true
sonar.gitlab.project_id=$CI_PROJECT_PATH
sonar.gitlab.commit_sha=$GIT_COMMIT
sonar.gitlab.ref_name=$GIT_BRANCH The error message after executing sonar-scanner is as follows:
I hope to get your help. Thank you |
I seem to have some trouble getting this plugin set up correctly. I've added to plugin to SonarQube (currently 5.6, but I also tried with earlier versions), and set up all configuration for my project:
sonar.gitlab.url
,sonar.gitlab.user_token
andsonar.gitlab.max_global_issues
set in SonarQube's global settings.sonar.gitlab.project_id
is also set in SonarQube's project settings.I'm running using the Sonar Scanner (2.6.1) in a GitLab CI build, as follows:
The scanner runs without errors, the scan results appear in SonarQube and judging by the output the GitLab plugin is loaded and executed. (See http://pastebin.com/dySw8B2N for the output.)
However, the plugin doesn't seem to work: No comments are added in GitLab to any new commits.
I'm not sure if I'm missing something in my configuration, but as far as I can gather from the README I've set up everything correctly, and the output doesn't show any errors or other messages to point me in the direction of any solution.
The text was updated successfully, but these errors were encountered: