mc1arke / sonarqube-community-branch-plugin Goto Github PK
View Code? Open in Web Editor NEWA plugin that allows branch analysis and pull request decoration in the Community version of Sonarqube
License: GNU Lesser General Public License v3.0
A plugin that allows branch analysis and pull request decoration in the Community version of Sonarqube
License: GNU Lesser General Public License v3.0
Describe the bug
For some reason, we need to upgrade to 8.0 ( sonarqube db is destroy, and 8.0 repair it ... ).
Did you plan to adapt the plugin for 8.0 ?
Here is the error from sonarqube :
java.lang.IllegalStateException: Fail to load plugin Community Branch Plugin [communityBranchPlugin]
at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:88)
at org.sonar.ce.container.ComputeEngineContainerImpl.startLevel4(ComputeEngineContainerImpl.java:230)
at org.sonar.ce.container.ComputeEngineContainerImpl.start(ComputeEngineContainerImpl.java:196)
at org.sonar.ce.ComputeEngineImpl.startup(ComputeEngineImpl.java:45)
at org.sonar.ce.app.CeServer$CeMainThread.attemptStartup(CeServer.java:163)
at org.sonar.ce.app.CeServer$CeMainThread.run(CeServer.java:141)
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")
at java.base/java.security.AccessControlContext.checkPermission(Unknown Source)
at java.base/java.security.AccessController.checkPermission(Unknown Source)
at java.base/java.lang.SecurityManager.checkPermission(Unknown Source)
at java.base/java.lang.ClassLoader.checkClassLoaderPermission(Unknown Source)
at java.base/java.lang.Class.getClassLoader(Unknown Source)
at com.github.mc1arke.sonarqube.plugin.classloader.ClassReferenceElevatedClassLoaderFactory.createClassLoader(ClassReferenceElevatedClassLoaderFactory.java:47)
at com.github.mc1arke.sonarqube.plugin.CommunityBranchPluginBootstrap.define(CommunityBranchPluginBootstrap.java:60)
at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:78)
... 5 common frames omitted
To Reproduce
Steps to reproduce the behavior:
Expected behavior
work
Software Versions
Additional context
First, I'm not a java developper .
I try this :
Go in build.gradle
,
change sonarqubeVersion
to 8.0
start gradlew check
return this :
C:\Users\thib3\repos\sonarqube-community-branch-plugin\src\main\java\com\github\mc1arke\sonarqube\plugin\scanner\CommunityProjectBranchesLoader.java:28: error: cannot find symbol
import org.sonar.scanner.util.ScannerUtils;
( this is not the full stacktrace ) .
If I go in the file CommunityProjectBranchesLoader.java, I see intellij idea can't resolve all import from sonarqube ( and from google ) ... ( and idea can't see class inside the .java file for 8.0, but can for 7.8 ) .
I don't know how to help, but If you need help, you can ask :) .
SonarQube 7.9.1 complains when I pass the sonar.branch.name parameter that it requires the developer edition. This is being passed through Gitlab CICD with the following line:
mvn package sonar:sonar -Dsonar.host.url=$Sonar_URL -Dsonar.login=$Sonar_USER -Dsonar.password=$Sonar_PASS -Dsonar.branch.name=$CI_COMMIT_REF_NAME
INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.979 s
[INFO] Finished at: 2019-11-20T21:22:50Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project hello_world: Validation of project reactor failed:
[ERROR] o To use the property "sonar.branch.name" and analyze branches, Developer Edition or above is required. See https://redirect.sonarsource.com/doc/branches.html for more information.
The plugin does appear to be working as I have branch options within the SonarQube UI now that I didn't previously since I added the plugin.
If I remove the sonar.branch.name parameter it goes through fine. I can also rename a master to a branch name inside the SQ UI, but cannot seem to push them through automatically from the CLI.
In sonarqube 7.4, I can see branches in the project summary but I can not switch from the master to others.
In the chrome console, I can see an error 404 on this request :
/api/navigation/component?componentKey=myproject-main&branch=develop%C2%A0
This does not happen on all projects. I do not know if there is a link but only project in TypeScript seems to have this issue.
Same happen with sonar-scanner :
ERROR: Caused by: Target branch 'develop' does not exist
Hi,
sorry for noob question and also for posting this as an issue but I didn't found any other way to ask a question.
We have simple quality that we would like to use as a check before merging PR into mastzer branch. One of the rules is that there is no failing unit tests but, it seems that Sonar (or this plugin take into account only rules that apply to 'new code') and test results are completely ignored.
For example, in one of PR branches (short-lived) I introduce some failing tests (without change in src code, just adding asserts within tests folder). When I scan branch it says that is ok but, if I merge this code back to master QG will fail due to failing tests.
Also, if this is a feature of short-lived branch, is thare any way to 'trick it' with configuring patter as long-lived branch? As far as I understood, in that case all gates should be verified but I'm worried how 'new code' would be calculated (e.g. is there any way to configure that all code on branch is a 'new code')? Also, is there any additional drawbacks that I could face?
Thx in advanced
Zoran
I am a fairly new user of SonarQube and stumbled upon your plugin, but I am starting to doubt if I am using it correctly, I hope that you can either confirm that or point me in the right direction. Sorry of the mistakes I make are obvious.
I have started running sonar-scanner for master branch and the results get displayed in SQ correctly, with many smells/issues detected.
Next, I checked out a branch "sprint_nn", edited the sonar.properties files and added the sonar.branch.name=xxx name. This branch becomes visible in SQ, but all of the metrics/issues/measures/code tabs shows nothing (all passed, while master fails while many smells/issues)
Am I using your plugin incorrectly?
Migrate variable sonar.branch.name to sonar.pullrequest.branch to be compatible with the dev edition branch plugin. sonar.branch.name is deprecated.
This feature will allow to configure the PR to make it required to pass the quality gate. It is only necessary to add a comment user to the required reviewers.
After downgrading from trial enterprise 8.0 to community 8.0, the following shows in the log every time I try to analyze the project:
2019.12.06 12:20:59 ERROR web[AW7ZokYU4EOXlpphAACM][o.s.s.w.WebServiceEngine] Fail to process request http://host:9000/api/ce/submit?projectKey=project.key&projectName=project-name&characteristic=branch%3Dfeature%2Fsome-feature&characteristic=branchType%3DSHORT
java.lang.IllegalStateException: Current edition does not support branch feature
at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:63)
at org.sonar.server.ce.queue.ReportSubmitter.submit(ReportSubmitter.java:83)
at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:113)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:92)
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:138)
at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:88)
at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:76)
at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RequestIdFilter.doFilter(RequestIdFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Unknown Source)
Plugin seems to be installed correctly (jar is copied into extensions/plugins and into lib/common), and shown as "Installed" in /admin/marketplace?filter=installed
Can anything be done for plugin to work correctly?
Thanks in advance.
Hi,
After the installation of the Community Branch Plugin it seems the parameters sonar.branch.target and sonar.branch.name doesn't work. On my logs I've the Current edition does not support branch feature
error.
What I'm missing?
Thank you.
Describe the bug
External issues are ignored in branches.
To Reproduce
Create a project with checkstyle report without errors and an empty quality profile.
Create the first build (create main sonar report for master).
Change branch and create checkstyle report with errors.
Run sonarqube in this branch.
There is no new condesmells. But if you run sonarqube on master with this report, new issues will appear.
Expected behavior
There is new condesmell in branch report.
Software Versions
Additional context
Report path configured in webUI.
Describe the bug
We upgraded to sonarqube 8.0 and sonarqube-community-branch-plugin 1.2.0, but we cannot choose branches anymore, with sonarqube 7.9 and branch-plugin 1.1.1 it worked fine.
The Marketplace shows it is installed, there are no errors regarding the plugin in the logs, only this:
2019.11.28 11:32:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Community Branch Plugin / 1.2.0
Expected behavior
Being able to switch branches
Software Versions
Anyone else experiencing this? Any way to debug why it is not loaded?
Thanks!
Describe the bug
the pull request analysis for gitlab is succefully created, while the pr decoration failed, with trace back as follows appearing in ce.log:
020.01.10 04:08:22 ERROR ce[AW-No1gDpsRBuIhDvm6H][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Execution of task class com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask failed
java.lang.IllegalStateException: There is no value when status is NO_VALUE
at com.google.common.base.Preconditions.checkState(Preconditions.java:197)
at org.sonar.ce.task.projectanalysis.api.posttask.ConditionImpl.getValue(ConditionImpl.java:163)
at java.base/java.util.Optional.map(Unknown Source)
at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.AnalysisDetails.createAnalysisSummary(AnalysisDetails.java:109)
at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.gitlab.GitlabServerPullRequestDecorator.decorateQualityGateStatus(GitlabServerPullRequestDecorator.java:160)
at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask.finished(PullRequestPostAnalysisTask.java:126)
at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:113)
at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:107)
at org.sonar.ce.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:91)
at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:63)
at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:209)
at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:191)
at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:158)
at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:133)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:85)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Software Versions
Whilst testing the fix for #4 an exception is thrown by the scanner engine when retrieving pull request info for a project containing an existing Pull Request analysis.
The stacktrace is
Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore: Unable to load component interface org.sonar
.scanner.scan.branch.BranchConfiguration: Unable to load component class org.sonar.scanner.scan.branch.ProjectPullRequests: java.lang.NumberFormatException: For input string: "2019-04-04T19:44:27+0100" -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project play-about: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentSto
re
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
...
and the content of a GET request to /api/project_pull_requests/list?project=xxx%3Aplay-about
is
{"pullRequests":[{"key":"101","title":"dummybranch","branch":"dummybranch","base":"master","status":{"qualityGateStatus":"OK","bugs":0,"vulnerabilities":0,"codeSmells":0},"analysisDate":"2019-04-04T19:44:27+0100"}]}
Hello I have an issue when i submit a pullrequest analysis on a branch wich has never been analysed first.
I use a 7.4 version of SonarQube
The plugins list :
Plugins:
I build using TfsGit as repository.
the relevant SonarQube parameters are:
It result with an execution failure as above
EXECUTION FAILURE
2019-04-09T11:28:19.2296634Z 13:28:19.228 INFO: ------------------------------------------------------------------------
2019-04-09T11:28:19.2297060Z 13:28:19.228 INFO: Total time: 2.362s
2019-04-09T11:28:19.2521514Z 13:28:19.248 INFO: Final Memory: 9M/77M
2019-04-09T11:28:19.2531285Z 13:28:19.249 ERROR: Error during SonarQube Scanner execution
2019-04-09T11:28:19.2531854Z 13:28:19.249 INFO: ------------------------------------------------------------------------
2019-04-09T11:28:19.2532296Z java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectSettings
2019-04-09T11:28:19.2532747Z ...
2019-04-09T11:28:19.2551496Z at org.sonarsource.scanner.cli.Main.main(Main.java:61)
2019-04-09T11:28:19.2552015Z Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.repository.ProjectRepositories
2019-04-09T11:28:19.2552466Z ...
2019-04-09T11:28:19.2567108Z ... 36 more
2019-04-09T11:28:19.2567442Z Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
2019-04-09T11:28:19.2567730Z ...
2019-04-09T11:28:19.2580320Z ... 51 more
2019-04-09T11:28:19.2580489Z Caused by: Could not target requested branch
2019-04-09T11:28:19.2580705Z Caused by: java.lang.IllegalStateException: **Target branch 'develop' does not exist**
If i first analyse the branch "develop" on non PullRequest build, i do not encounter an other issue:
Caused by: Could not target requested branch
2019-04-09T11:52:32.2246182Z Caused by: java.lang.IllegalStateException: Expected branch type of LONG but got SHORT
Is there any chance that your plugin can create the target and base branch if it not exist?
Thanks for your work anyway
Describe the bug
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to load component class org.sonar.scanner.scan.ProjectLock
ERROR: Caused by: Unable to load component class org.sonar.api.batch.fs.internal.DefaultInputProject
ERROR: Caused by: com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchParamsValidator.validate(Ljava/util/List;)V
SQ 8.0
Plugin 1.1.1
Describe the bug
Plugin does not work with the recently released Sonarqube 7.9
To Reproduce
Analyze a project against a Sonarqube 7.9 server with plugin version 1.1.1 installed.
Expected behavior
Analysis succeeds.
Scanner Output
The following can be seen in the output:
ERROR: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
ERROR: Caused by: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
ERROR: Caused by: Receiver class com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader does not define or inherit an implementation of the resolved method abstract load(Ljava/util/Map;Lorg/sonar/scanner/scan/branch/ProjectBranches;Lorg/sonar/scanner/scan/branch/ProjectPullRequests;)Lorg/sonar/scanner/scan/branch/BranchConfiguration; of interface org.sonar.scanner.scan.branch.BranchConfigurationLoader.
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Software Versions
Additional context
Project analysis works with SQ 7.8 and same plugin version 1.1.1. Upgrade to 7.9 shows this, most likely the Sonarqube branch API changed again.
Describe the bug
I've recently update all plugins on my SonarQube server and my developers noticed an issue with coverage on branches. With latest version of java-plugin 6.0 (build 20538) there is no coverage. I've downgrade plugin to 5.14 version and coverage come back.
In my opinion this is not an issue of a branch plugin, by u should look at this in future releases
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Coverage for branch)
Screenshots
If applicable, add screenshots to help explain your problem.
Software Versions
Additional context
Add any other context about the problem here.
Describe the bug
Report upload from Azure CIDI do not work on Community edition for any branch except Master
To Reproduce
Steps to reproduce the behavior:
_
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=47ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 14 source files to be analyzed
INFO: SCM Publisher 14/14 source files have been analyzed (done) | time=573ms
INFO: CPD Executor 29 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 136 files
INFO: CPD Executor CPD calculation finished (done) | time=109ms
INFO: SCM writing changed lines
INFO: SCM writing changed lines (done) | time=187ms
INFO: Analysis report generated in 312ms, dir size=377 KB
INFO: Analysis report compressed in 203ms, zip size=208 KB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 56.494s
INFO: Final Memory: 16M/160M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarQube Scanner execution
ERROR: Failed to upload report - An error has occurred. Please contact your administrator
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
ERROR: Error during SonarQube Scanner execution
ERROR: Failed to upload report - An error has occurred. Please contact your administrator
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
##[error]The process 'D:\a_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.8.0\sonar-scanner\bin\sonar-scanner.bat' failed with exit code 1
##[section]Finishing: Run Code Analysis
_
Also if we check the web.log under logs folder we can see below
2019.10.30 07:49:10 ERROR web[AW4bh8qen6DU8a66AAIS][o.s.s.w.WebServiceEngine] Fail to process request http:///api/ce/submit?projectKey=&projectName=&characteristic=branch%3&characteristic=branchType%3DSHORT
java.lang.IllegalStateException: Current edition does not support branch feature
at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:63)
at org.sonar.server.ce.queue.ReportSubmitter.submit(ReportSubmitter.java:83)
at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:113)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:92)
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:138)
at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:88)
at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:76)
at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RequestIdFilter.doFilter(RequestIdFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)
Expected behavior
The Report should be updated to Sonarqube server
Software Versions
Additional context
If we select the Master branch in CI for same it all works just fine and i can see the report under our install as seen in below screenshot
Issue during running sonar analysis since sonar 8.1.
To Reproduce
Steps to reproduce the behavior:
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar
Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
Caused by: java.lang.NoSuchFieldError: LONG
at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.createBranchConfiguration ([CommunityBranchConfigurationLoader.java:133])
at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.load (CommunityBranchConfigurationLoader.java:97)
at org.sonar.scanner.scan.branch.BranchConfigurationProvider.provide (BranchConfigurationProvider.java:43)
Error here in the code
Expected behavior
No error
Software Versions
Additional context
It seems that the place where to define long branch name by project has changed in sonar ui.
Describe the bug
SonarQube version: 7.9 LTS
Plugin version: 1.1.1
To Reproduce
Steps to reproduce the behavior:
Web server startup failed
java.lang.IllegalStateException: Unable to read plugin manifest from jar : /apps/tools/sonarqube-7.9/extensions/plugins/sonarqube-community-branch-plugin-1.1.1.jar
Screenshots
If applicable, add screenshots to help explain your problem.
Software Versions
Additional context
Add any other context about the problem here.
The following exception is raised when analysing a PR.
The master branch already exists for the project.
SonarScanner is started with parameters -Dsonar.pullrequest.branch=changes/19/14219/2 -Dsonar.pullrequest.key=14219
Any ideas ?
java.util.NoSuchElementException: No value present
at java.util.Optional.get(Optional.java:135)
at org.sonar.ce.task.projectanalysis.step.ValidateProjectStep.validateTargetBranch(ValidateProjectStep.java:94)
at org.sonar.ce.task.projectanalysis.step.ValidateProjectStep.execute(ValidateProjectStep.java:77)
at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:81)
at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:72)
at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:59)
at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:207)
at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:189)
at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:156)
at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:131)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:83)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:51)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Describe the bug
After the update to 1.2.0 Sonar checks checks not work anymore.
After rollback to 1.1.1 all works fine again.
The web log contains the following entries:
2019.11.25 07:53:02 ERROR web[AW6TnIhOcOtvJkIuAAEs][o.s.s.w.WebServiceEngine] Fail to process request http://localhost:9000/api/ce/submit?projectKey=com.xxx.yyy.vvvv%3Areactor&projectName=vvvjjjjjj&characteristic=pullRequest%3D2017
java.lang.IllegalStateException: Current edition does not support branch feature
at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:66)
at org.sonar.server.ce.queue.ReportSubmitter.submit(ReportSubmitter.java:83)
at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:121)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:88)
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:126)
at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:95)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:87)
at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:76)
at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.requestid.RequestIdFilter.doFilter(RequestIdFilter.java:63)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Unknown Source)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Software Versions
Additional context
Add any other context about the problem here.
Thanks for this Plugin!!
Describe the bug
Our jenkins pipeline worked well, but then I deleted a long living branch in sonarqube (not in git!) to be able to rename the default branch from master to the name of the long living branch. Then the pipeline stopped to work.
Expected behavior
The gradle plugin should run even if there is no existing analysis.
Stacktrace
Caused by: java.lang.NullPointerException
at com.github.mc1arke.sonarqube.plugin.scanner.CommunityProjectPullRequestsLoader.lambda$createPullRequestInfoJsonDeserialiser$0(CommunityProjectPullRequestsLoader.java:76)
at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
at com.google.gson.Gson.fromJson(Gson.java:922)
at com.google.gson.Gson.fromJson(Gson.java:860)
at com.github.mc1arke.sonarqube.plugin.scanner.CommunityProjectPullRequestsLoader.load(CommunityProjectPullRequestsLoader.java:87)
at org.sonar.scanner.scan.branch.ProjectPullRequestsProvider.provide(ProjectPullRequestsProvider.java:47)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 150 more
Software Versions
With SonarSource/sonarqube@8163870 in recent Sonar release (7.8),
targetScmBranch
in org.sonar.scanner.scan.branch.BranchConfiguration
is renamed to targetBranchName
Can we just replace the name?
When an organisation has many repositories/projects, configuring projectSlug/repositorySlug for each one is quite exhausting. It would be nice to let specify these parameters from cli
ex:
docker run -ti -v $(pwd):/usr/src newtmitch/sonar-scanner:4.0.0-alpine \
-Dsonar.host.url=$SONAR_URL \
-Dsonar.projectKey="project:sample" \
-Dsonar.projectName="sample" \
-Dsonar.projectBaseDir=/usr/src \
-Dsonar.sources=. \
-Dsonar.pullrequest.key="13" \
-Dsonar.pullrequest.branch="test-sonar" \
-Dsonar.pullrequest.base="master" \
-Dsonar.pullrequest.provider="BitbucketServer" \
-Dcom.github.mc1arke.sonarqube.plugin.branch.pullrequest.bitbucket.projectKey="project" \
-Dcom.github.mc1arke.sonarqube.plugin.branch.pullrequest.bitbucket.repositorySlug="sample"
PS I found similar solution from here https://community.sonarsource.com/t/post-analysis-task-only-when-scanner-parameter-set/12121.
If it fits, I can create a PR during the week.
Hi,
Our builds have for a long time populated the sonar branch properties; this was established some years ago and before sonarqube would error out when they were used without the developer version. I figure this plugin can help such workflows migrate to 7.9 LTS, but I ran into the requirement to scan the "main" branch first.
So I modified the plugin to proceed directly with the branch name rather than error out in the CommunityBranchConfigurationLoader:
if (projectBranches.isEmpty()) {
if (isTargetingDefaultBranch(localSettings)) {
return new DefaultBranchConfiguration();
} else {
String branchName = localSettings.get(ScannerProperties.BRANCH_NAME);
String branchTarget = localSettings.get(ScannerProperties.BRANCH_TARGET);
final BranchType branchType = computeBranchType(localSettings.get(CoreProperties.LONG_LIVED_BRANCHES_REGEX), branchName);
return new CommunityBranchConfiguration(branchName, branchType, branchTarget, branchTarget, null);
}
}
And I found it worked just fine. You can go on to scan the master at a later date, or rename and delete branches as appropriate.
So the above code is what I'm using, and I think that it might help others in the same situation.
I didn't feel confident enough to make this a PR though, because I'm not sure what the purpose of this limitation was in the first instance. Also, I wasn't sure whether there could be some subtleties with target branches for short-lived branches. If so perhaps the solution could be the following:
if (projectBranches.isEmpty()) {
if (isTargetingDefaultBranch(localSettings)) {
return new DefaultBranchConfiguration();
} else {
String branchName = localSettings.get(ScannerProperties.BRANCH_NAME);
final BranchType branchType = computeBranchType(localSettings.get(CoreProperties.LONG_LIVED_BRANCHES_REGEX), branchName);
if (branchType == BranchType.LONG) {
return new CommunityBranchConfiguration(branchName, branchType, branchName, branchName, null);
} else {
throw MessageException
.of("No branches currently exist in this project. Please either scan the main branch or a long-lived branch first");
}
}
}
But my preference would be the first, simpler approach which would basically make this plugin a complete solution to allow existing workflows that use sonar branch properties update to 7.9 LTS.
Thoughts?
I would like to start a discussion for how the plugin would be able to support pull request decorations in a similar way that the commercial plugin does.
A former discussion was made in #3, but the initial issue was not related to supporting pull request decorations so I open a new issue to track the discussion of supporting pull request decorations in one place. Please feel free to close this if it is more preferable to continue the discussion in the other issue.
This is a suggestion for a solution based on my initial investigation on how the plugin lifecycle works in sonarqube.
By hooking in as a ComputeEngine extension with a PostProjectAnalysisTask
, where we have access to the necessary metadata like quality gate results, we have the possibility to decorate the pull requests with some metadata.
For Bitbucket Server we would then use the Code Insights API.
However, the PostProjectAnalysisTask
does not expose the individual issues reported in the scan so I suggest that we do this in two steps.
Step 1 - Support pull request decoration with the data available within the PostProjectAnalysisTask
Step 2 - Support pull request decoration of individual issues per line.
For step 2 I have not found any internal sdk to use to obtain the issues reported in the scan. Other plugins like quboo-sonarqube-plugin leverages sonarqubes REST api to obtain the necessary data about the scan.
See QubooConnector.java
If it is decided to go with the REST api approach we could still use the PostProjectAnalysisTask
to decorate the changed lines within the pull request.
@mc1arke I guess that you have a lot of thoughts on how you want to tackle this?
Hi, thanks for the plugin work !
I am trying to decorate my pull requests on github, is this suposed to work ?
I didn't find any settings related to it in the plugin.
Any advice very apreciated ;)
We are currently using the Developer Edition.
Is this plugin using the same data model? Can we switch to community + this plugin?
Describe the bug
The problem is that the feature branch analysis doesn't show only new code and new bugs, code smells etc. It treats the entire codebase and every single quality issue as new.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Analysis result should be 1 modified file and 1 new vulnerabilty.
Screenshots
Master branch analysis:
Software Versions
Additional context
Maybe I should add that this is a project using TFVC (sigh). With Git everything works just fine.
When calling mvn sonar:sonar on a project where sonar.branch.name is not set at all, a Nullpointer will occur.
I would expect to get the main branch analysed.
[09:52:15] [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.1.1688:sonar (default-cli) on project xxx-maven-plugin: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration: NullPointerException -> [Help 1]
final Stacktrace:
Caused by: java.lang.NullPointerException at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.computeBranchType(CommunityBranchConfigurationLoader.java:145) at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.createBranchConfiguration(CommunityBranchConfigurationLoader.java:128) at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.load(CommunityBranchConfigurationLoader.java:97)
Sonar Qube 7.9.1 LTS
Branch Plugin 1.1.1
New Issues appear (difference) in Issues tab in short-lived branch
Once I purposely added new bug (possible null reference exception in c# code) in pull request branch, that bug was recognized and presented in Overview tab. But if i go to issues tab, I see nothing.
Example for PR-60 (Short lived branch) from develop (Base branch)
In addition I see interesting error on top, that lanalysis is failed. I observed that error appear on any failed analysis (develop branch - base) included. Could be this error related?
Sonar: 7.7.0.23042
Community Branch Plugin: 1.0.2
Describe the bug
2019.12.02 12:08:10 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Community Branch Plugin / 1.2.0
2019.12.02 12:08:10 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Git / 1.9.1.1834 / 178899f274b2e5340ea158ab885608a8ea228b61
2019.12.02 12:14:39 ERROR web[AW7Gg7T1/rt4OsQXAABL][o.s.s.w.WebServiceEngine] Fail to process request http://1.2.3.4:3000/api/ce/submit?projectKey=test&characteristic=branch%3Dredis&characteristic=branchType%3DSHORT
java.lang.IllegalStateException: Current edition does not support branch feature
at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:63)
at org.sonar.server.ce.queue.ReportSubmitter.submit(ReportSubmitter.java:83)
at org.sonar.server.ce.ws.SubmitAction.handle(SubmitAction.java:113)
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:88)
at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:138)
at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:88)
at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:76)
at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RequestIdFilter.doFilter(RequestIdFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Unknown Source)
To Reproduce
Steps to reproduce the behavior:
RUN COMMAND: sonar-scanner -Dsonar.host.url=http://1.2.3.4:3000 -Dsonar.projectKey=test -Dsonar.sources=. -Dsonar.branch.name=redis -X
Expected behavior
A clear and concise description of what you expected to happen.
Software Versions
Describe the bug
As a new user, I encounter difficulties understanding the meaning of the different parameters I can set in the sonar-project.properties
.
To Reproduce
What is the difference between sonar.branch.name
and sonar.branch.target
?
Expected behavior
A small description in the README
or some examples could help a lot.
Hello,
I'm trying to make use of this plugin for SonarQube Community 8.1, with Sonar Tasks triggered from Devops in a yaml pipeline. Running the Prepare, Analyse and Report tasks for a master branch work fine with the plugin installed, but when I try to run a branch pipeline, I'm receiving the following
(I've double-checked and the .jar is in both lib\common and extensions\plugin for the plugin)
##[error]ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component interface org.sonar.scanner.scan.branch.BranchConfiguration
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
##[error]at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 34 more
Caused by: java.lang.NoSuchFieldError: LONG
at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.computeBranchType(CommunityBranchConfigurationLoader.java:146)
at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.createBranchConfiguration(CommunityBranchConfigurationLoader.java:128)
at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.load(CommunityBranchConfigurationLoader.java:97)
at org.sonar.scanner.scan.branch.BranchConfigurationProvider.provide(BranchConfigurationProvider.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 48 more
ERROR:
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 34 more
Caused by: java.lang.NoSuchFieldError: LONG
at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.computeBranchType(CommunityBranchConfigurationLoader.java:146)
at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.createBranchConfiguration(CommunityBranchConfigurationLoader.java:128)
at com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchConfigurationLoader.load(CommunityBranchConfigurationLoader.java:97)
at org.sonar.scanner.scan.branch.BranchConfigurationProvider.provide(BranchConfigurationProvider.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)
at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 48 more
ERROR:
##[error]The SonarQube Scanner did not complete successfully
The SonarQube Scanner did not complete successfully
##[error]08:49:57.662 Post-processing failed. Exit code: 1
08:49:57.662 Post-processing failed. Exit code: 1
##[error]The process 'C:\Program Files\Azure\Agent\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.8.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
##[section]Finishing: Run Code Analysis
Any guidance would be appreciated
For now, the pullrequest decoration message only contains a brief summary of the analysis, but no direct link to guide the developer to the sonarqube's task page, where he/she can view the details of each metric category. As a workaround, one can find the sonar task link at gitlabci's CI/CD pipeline page, which could be more convenient if it was already included in the pullrequest decoration message. And on sonar's task page, a link to the corresponding PR/MR page would also make life easier.
When building the it complains that the manifest is absent in the created jar. Tried pointing main class to the com.github.mc1arke.sonarqube.plugin.CommunityBranchPlugin without any success.
Most organization/company host their repositories with a single ALM(actually I just know ALM is github like tools, but not its full name, could anyone tell me?), a global default value for sonar.pullrequest.provider
would reduce a lot of repeat configuration work.
I can contribute a PR if this feature is compatible with the original design.
Versions:
Sonar Docker sonarqube:7.9.1-community
Plugin: sonarqube-community-branch-plugin-1.1.1.jar
When I perform an analysis of a short living branch (branched from master) I do only see the coverage estimated after merge and not of the branch itself.
Command:
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.password=admin -Dsonar.branch.name=feature/test -Dsonar.branch.target=master
What is wrong here?
Is it possible to report the actual number of issues solved in a given branch instead of showing 0
?
Hello,
I'm using Sonarqube 7.4 in docker(official image) with an extended folder with extensions
If I'm running like this
bat "D:\\sonar-scanner-msbuild\\SonarQube.Scanner.MSBuild.exe begin /k:project /d:sonar.host.url=http://192.168.100.10:9000 /d:sonar.login=token"
bat "\"${MSBUILD}\" main\\project.sln"
bat "D:\\sonar-scanner-msbuild\\SonarQube.Scanner.MSBuild.exe end /d:sonar.login=token"
All works, but if I added /d:sonar.branch.name=test - I've got an error:
bat "D:\\sonar-scanner-msbuild\\SonarQube.Scanner.MSBuild.exe begin /k:project/d:sonar.host.url=http://192.168.100.10:9000 /d:sonar.branch.name=test /d:sonar.login=token"
bat "\"${MSBUILD}\" main\\project.sln"
bat "D:\\sonar-scanner-msbuild\\SonarQube.Scanner.MSBuild.exe end /d:sonar.login=token"
[ERROR: Error during SonarQube Scanner execution
ERROR: Unable to load component class org.sonar.scanner.phases.AbstractPhaseExecutor
ERROR: Caused by: Unable to load component class org.sonar.scanner.phases.PostJobsExecutor
ERROR: Caused by: Unable to load component class org.sonar.scanner.bootstrap.ScannerExtensionDictionnary
ERROR: Caused by: Unable to load component class org.sonar.scanner.sensor.DefaultSensorContext
ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.DefaultModuleFileSystem
ERROR: Caused by: Unable to load component class org.sonar.scanner.scan.filesystem.StatusDetection
ERROR:
The SonarQube Scanner did not complete successfully]
While SQ is running, I have warnings:
2019.05.06 18:56:11 INFO ce[][o.s.c.c.CePluginRepository] Load plugins
2019.05.06 18:56:13 WARN ce[][o.s.c.p.ComponentKeys] Bad component key: org.sonar.java.externalreport.ExternalRulesDefinition@11d7a390. Please implement toString() method on class org.sonar.java.externalreport.ExternalRulesDefinition
2019.05.06 18:56:13 WARN ce[][o.s.c.p.ComponentKeys] Bad component key: org.sonar.java.externalreport.ExternalRulesDefinition@4429ab31. Please implement toString() method on class org.sonar.java.externalreport.ExternalRulesDefinition
2019.05.06 18:56:13 WARN ce[][o.s.c.p.ComponentKeys] Bad component key: org.sonar.java.externalreport.ExternalRulesDefinition@7e3d1fb2. Please implement toString() method on class org.sonar.java.externalreport.ExternalRulesDefinition
Could you help me, what am I doing wrong?
P.S. I'm using plugin version 1.0.2
P.S.S. analyses from master branch exists
Hello.
Perhaps I didn't understand something, but how to use this plugin?
I installed it, restarted SonarQube and tried to run the analysis one more time with the 'branch' parameter defined, however it is still complaining that branch analysis is available in Developer Edition and above.
The command that I'm trying to run:
sonar:sonar -Dsonar.branch="4.5-SNAPSHOT" -Dsonar.projectName="4.5-SNAPSHOT"
Describe the bug
A clear and concise description of what the bug is.
mvn sonar:sonar -Dsonar.branch.name to run an anayalis and it was successfully executed and the result was pushed to a Sonar7.9.2 server.
But on this server, the project's status was not updated on SonarQube's dashboard.
To Reproduce
Steps to reproduce the behavior:
Software Versions
Hello.
I'm trying to test sources with command:
mvn test verify sonar:sonar $MAVEN_CLI_OPTS -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_TOKEN -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.gitlab.unique_issue_per_inline=true
But on new projects (that not yet created in Sonarqube) I've got exception:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project stat.profile: No branches currently exist in this project. Please scan the main branch without passing any branch parameters. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project stat.profile: No branches currently exist in this project. Please scan the main branch without passing any branch parameters.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: No branches currently exist in this project. Please scan the main branch without passing any branch parameters.
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.sonar.api.utils.MessageException: No branches currently exist in this project. Please scan the main branch without passing any branch parameters.
I have only one branch master and not passing any -Dsonar.branch.*
to default command. How can I bypass this error?
Hi,
We are working on integrating Gerrit on the pr-decoration branch.
What we observed is that whatever backend is used for PR, there is a need for the same basic datas.
Of course, depending on the tool, some additional informations may be useful.
What about creating a common internal model for issues decorated in PR ?
This plugin does not seem to work with Sonarqube 8.1 currently. Error is attached.
Not sure where else to request for this, so creating this issue.
scan error.txt
Web server startup failed when plugin placed in the latest 7.7 version of sonarqube. This is using the dockerised version of sonarqube community edition. Built the plugin using gradle in the repo and copied to mounted directory. No additional logging could be found on my attempt to run
Describe the bug
Hello,
When I want to setup Pull Request Decoration and I open the settings page, I get an error:
Unknown url : /api/alm_settings/list_definit...
Screenshot
It seems that whole /api/alm_settings/ API prefix is missing in Community Edition of SonarQube.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If Pull Request Decoration should be setup differently than it should be documented and maybe also mentioned that this error is expected when using Community Edition.
Is this a way how to setup Pull Request Decoration even in newer versions on SonarQube (7.8+)?https://docs.sonarqube.org/7.7/analysis/pull-request/#header-2
Screenshots
Screenshot
Software Versions
Additional context
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.