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

Disable preventing from delete soanar report #158

Open hoyho opened 6 years ago

hoyho commented 6 years ago

my jenkins'config

dotnet-sonarscanner \
/k:"dotne-demo" \
/n:"dotnet-demo" \
/d:sonar.host.url=xxx
/d:sonar.login=admin /d:sonar.password=xx \
/d:sonar.gitlab.url="https://gitlab.xxx.com" \
/d:sonar.gitlab.user_token="xxx-kw4cj" \
/d:sonar.analysis.mode=preview \
/d:sonar.gitlab.project_id=”xxx" \
/d:sonar.gitlab.ref_name=${branch} 
/d:sonar.gitlab.commit_sha=${GIT_COMMIT} 

jekins'output

18:09:48 INFO: Importing 1 Roslyn report
18:09:48 INFO: Sensor C# [csharp] (done) | time=118ms
18:09:48 INFO: Performing issue tracking
18:09:48 INFO: 4/4 components tracked
18:09:48 INFO: ANALYSIS SUCCESSFUL
18:09:48 INFO: Executing post-job GitLab Commit Issue Publisher
18:09:48 INFO: Report status=success, desc=SonarQube reported 3 issues, with 2 major and 1 minor
18:09:48 INFO: Task total time: 9.485 s
18:09:48 INFO: ------------------------------------------------------------------------
18:09:48 INFO: EXECUTION SUCCESS
18:09:48 INFO: ------------------------------------------------------------------------
18:09:48 INFO: Total time: 11.562s
18:09:48 INFO: Final Memory: 12M/189M
18:09:48 INFO: ------------------------------------------------------------------------
18:09:49 The SonarQube Scanner has finished
18:09:49 10:09:49.033  Creating a summary markdown file...
18:09:49 10:09:49.033  Analysis results: http://xxxx:9000/dashboard/index/dotne-demo
18:09:49 10:09:49.034  Post-processing succeeded.
18:09:49 Finished: SUCCESS

however when i get to analysis result(sonarqube) it says: The requested project does not exist. Either it has never been analyzed successfully or it has been deleted.

Go back to the homepage

and Gitlab has related comment and issues

question? how can i keep sonar's report ?

gabrie-allaigre commented 6 years ago

Hi, Sonar preview work only if in sonarqube, there is already the project analyzed at least once

alexeyzimarev commented 6 years ago

I think preview doesn't work anymore, the branch plugin is the only way to analyse MRs.