-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
PR Decoration not working on SonarQube 9.4 #569
Comments
I'm unable to replicate this on a snapshot build of the plugin containing no changes other than the underlying sonarqube version in the build.gradle. Can you confirm more about your setup please:
|
It's installed on AWS EC2 Centos 7 with no docker container (only one container for postgres db) |
Running on Mac OS inside a Sonarqube 9.4 unzipped distribution directory, the following works for me:
Whilst not identical to a Centos 7 setup, I'm fairly comfortable this works out the box. Are you able to confirm your current configuration looks similar (i.e. the plugin in the |
Yes, I have both properties setted. The only difference i see is the name, but i don't think that is gonna be a problem. |
I've just replicated the error you're seeing and believe this is due to Sonarqube switching to using Spring rather than PicoContainer for dependency injection, with Spring requiring annotations on classes with multiple constructors rather than the method PicoContainer used of ignoring low-visibility constructors. Can you confirm:
Given your latest comment, can you also confirm:
|
Yes, Sonarqube starts ok with no problems at all. |
The latest release of Sonarqube switches from using Pico Container for dependency injection to using Spring. The method used for detecting the constructor to be used for injecting in a multi-constructor class varies between the 2 frameworks, with Pico only looking for public constructors but Spring looking for any visible constructor, and then excluding any constructors that do not have the `@Autowired` annotation on a muti- constructor class. This change adds the relevant annotation onto the two classes impacted by this change in frameworks, thereby allowing for the Compute Engine to have the appropriate components generated for completing decoration of Pull Requests.
The latest release of Sonarqube switches from using Pico Container for dependency injection to using Spring. The method used for detecting the constructor to be used for injecting in a multi-constructor class varies between the 2 frameworks, with Pico only looking for public constructors but Spring looking for any visible constructor, and then excluding any constructors that do not have the `@Autowired` annotation on a muti- constructor class. This change adds the relevant annotation onto the two classes impacted by this change in frameworks, thereby allowing for the Compute Engine to have the appropriate components generated for completing decoration of Pull Requests.
Is there any release date? |
Could we please have any information on a potential release date? |
At least unit tests are failing after merging and resolving conflicts to master, looks like the utf8 detection? has changed..
|
@johnou Is this what you're having to apply to make unit tests pass? Can you confirm what version of Java, what OS you're running on, and if you have any changes applies to your project please? |
@mc1arke yep, without it I'm seeing these errors [1]. No modifications to my fork https://github.com/mc1arke/sonarqube-community-branch-plugin/compare/master...johnou:sulake?expand=1
[1]
|
@mc1arke looks like a problem with charsets, I'll take a closer look. |
@mc1arke this does the job johnou@9db30f6 unit tests now pass on Windows. |
I have just tried to build the master branch (sha fbbc416) and the following tests fail. Can't that be connected with all the Azure DevOps-related problems? Thanks AzureDevopsRestClientTest. checkAddCommentToThreadSubmitsCorrectContent() I built on Windows 11. Here is the complete test HTML log |
What version of Java are you building on @honzajscz? |
openjdk version "17.0.1" 2021-10-19 |
You need to be using Java 11. Sonarqube only support Java 11 for server-side components so the plugin is tested and built using Java 11. |
Released in 1.11.0 |
Describe the bug
PR Decorator is not working on the latest SonarQube version.
Below you can see ce.log from sonarqube server in TRACE mode.
Log
2022.04.04 17:55:59 TRACE ce[AX_1SkES6djQpz_x560U][o.s.c.p.PriorityBeanFactory] Ignoring constructor [public org.sonar.ce.task.step.ComputationStepExecutor(org.sonar.ce.task.step.ComputationSteps,org.sonar.ce.task.CeTaskInterrupter,org.sonar.ce.task.step.ComputationStepExecutor$Listener)] of bean 'jdk.internal.loader.ClassLoaders$AppClassLoader@42a57993-org.sonar.ce.task.step.ComputationStepExecutor': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@42a57993-org.sonar.ce.task.step.ComputationStepExecutor': Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@42a57993-org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor': Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@42a57993-com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@42a57993-com.github.mc1arke.sonarqube.plugin.ce.pullrequest.github.GithubPullRequestDecorator': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@42a57993-com.github.mc1arke.sonarqube.plugin.almclient.github.DefaultGithubClientFactory': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@42a57993-com.github.mc1arke.sonarqube.plugin.almclient.github.v3.RestApplicationAuthenticationProvider': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.almclient.github.v3.RestApplicationAuthenticationProvider]: No default constructor found; nested exception is java.security.PrivilegedActionException: java.lang.NoSuchMethodException: com.github.mc1arke.sonarqube.plugin.almclient.github.v3.RestApplicationAuthenticationProvider.<init>()
Software Versions
SonarQube Version: 9.4.0.54424
Plugin Version: 1.10.0
Thank you in advance.
The text was updated successfully, but these errors were encountered: