mc1arke / sonarqube-community-branch-plugin

A plugin that allows branch analysis and pull request decoration in the Community version of Sonarqube
GNU Lesser General Public License v3.0
2.26k stars 526 forks source link

Enhancement: Sonarqube 10.4 support #870

Closed artyom-veselov closed 7 months ago

artyom-veselov commented 9 months ago

Hi @mc1arke! First of all I would take a chance to thank you for this plugin which allows to use SQ premium benefits for free SQ version, your huge efforts are appreciated 🔥

SQ 10.4 was recently released, so creating this ticket to know if the support for it will be added 🙏🏻

nixel2007 commented 9 months ago

What is an error with 10.4?

artyom-veselov commented 9 months ago

It’s not yet listed in readme for this repo thus I haven’t even tried upgrading SQ (and plugin)

nixel2007 commented 9 months ago

Then why have you labeled it as bug? :)

artyom-veselov commented 9 months ago

@nixel2007 because while submitting from mobile phone I haven't managed to change label to enhancement (that's why I added it in title as prefix) 🤷

mc1arke commented 9 months ago

I've not attempted a build of the plugin against the latest Sonarqube release yet. I think the plugin will work with Sonarqube 10.4, but the tests will probably fail to compile. I'll try and run my test pack this coming week and confirm.

artyom-veselov commented 9 months ago

Thank you. New metrics were introduced for quality gates, maybe their support could also be added

https://www.sonarsource.com/products/sonarqube/whats-new/sonarqube-10-4/#pull-requests-show-issues-that-will-be-fixed-when-merged

C4tWithShell commented 9 months ago

I see the following error after update when I am validating GitHub integration:

2024.02.14 06:30:42 ERROR web[][o.s.s.p.w.RootFilter] Processing of request /api/alm_settings/validate_binding?project=utils-Android failed
javax.servlet.ServletException: 'io.jsonwebtoken.JwtBuilder io.jsonwebtoken.JwtBuilder.setExpiration(java.util.Date)'
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:273)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:176)
    at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:137)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
    at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:83)
    at org.sonar.server.platform.web.UserSessionFilter.doFilter(UserSessionFilter.java:70)
    at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:222)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/javax.security.auth.Subject.doAsPrivileged(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:250)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:176)
    at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:137)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
    at org.sonar.server.platform.web.CspFilter.doFilter(CspFilter.java:63)
    at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:222)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/javax.security.auth.Subject.doAsPrivileged(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:250)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:176)
    at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:137)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
    at org.sonar.server.platform.web.CacheControlFilter.doFilter(CacheControlFilter.java:76)
    at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:222)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/javax.security.auth.Subject.doAsPrivileged(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:250)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:176)
    at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:137)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
    at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:60)
    at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:47)
    at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:222)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/javax.security.auth.Subject.doAsPrivileged(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:250)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:176)
    at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:137)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
    at org.sonar.server.platform.web.RedirectFilter.doFilter(RedirectFilter.java:56)
    at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:222)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/javax.security.auth.Subject.doAsPrivileged(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:250)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:176)
    at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:137)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
    at org.sonar.server.platform.web.EndpointPathFilter.doFilter(EndpointPathFilter.java:47)
    at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:222)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/javax.security.auth.Subject.doAsPrivileged(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:250)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:176)
    at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:137)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
    at org.sonar.server.platform.web.RequestIdFilter.doFilter(RequestIdFilter.java:66)
    at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:222)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/javax.security.auth.Subject.doAsPrivileged(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:250)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:176)
    at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:137)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
    at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:65)
    at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:222)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/javax.security.auth.Subject.doAsPrivileged(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:250)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:176)
    at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:137)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:115)
    at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:222)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/javax.security.auth.Subject.doAsPrivileged(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:250)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:176)
    at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:137)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
    at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:267)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoSuchMethodError: 'io.jsonwebtoken.JwtBuilder io.jsonwebtoken.JwtBuilder.setExpiration(java.util.Date)'
    at com.github.mc1arke.sonarqube.plugin.almclient.github.v3.RestApplicationAuthenticationProvider.getInstallationToken(RestApplicationAuthenticationProvider.java:81)
    at com.github.mc1arke.sonarqube.plugin.almclient.github.DefaultGithubClientFactory.createClient(DefaultGithubClientFactory.java:56)
    at com.github.mc1arke.sonarqube.plugin.server.pullrequest.validator.GithubValidator.validate(GithubValidator.java:43)
    at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.binding.action.ValidateBindingAction.validateProject(ValidateBindingAction.java:73)
    at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.binding.action.ValidateBindingAction.lambda$handleProjectRequest$0(ValidateBindingAction.java:58)
    at java.base/java.util.Optional.ifPresent(Unknown Source)
    at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.binding.action.ValidateBindingAction.handleProjectRequest(ValidateBindingAction.java:58)
    at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.binding.action.ProjectWsAction.handle(ProjectWsAction.java:73)
    at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:114)
    at org.sonar.server.platform.web.WebServiceFilter.doFilter(WebServiceFilter.java:84)
    at org.sonar.server.platform.web.MasterServletFilter$JavaxFilterAdapter.doFilter(MasterServletFilter.java:227)
    at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:198)
    at org.sonar.server.platform.web.MasterServletFilter$HttpFilterChainAdapter.doFilter(MasterServletFilter.java:241)
    at org.sonar.server.platform.web.SonarLintConnectionFilter.doFilter(SonarLintConnectionFilter.java:66)
    at org.sonar.server.platform.web.MasterServletFilter$JavaxFilterAdapter.doFilter(MasterServletFilter.java:227)
    at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:198)
    at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:146)
    at jdk.internal.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:222)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/javax.security.auth.Subject.doAsPrivileged(Unknown Source)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:250)
    ... 141 common frames omitted
GreyTeardrop commented 9 months ago

I was able to make the plugin work with SonarQube 10.4 a few minor code changes.

heidricha commented 9 months ago

Just tried the latest version with 10.4-community. The log has no errors, but the server doesn't work. redirects an admin/plugin-risc-consent page, which doesn't exist

NoCoker commented 8 months ago

Would be great to get a version for 10.4.1 support also

cbaerikebc commented 8 months ago

The plugin seems to run with SQ 10.4.1 (scans work, and the results land in the right branch), but the new Overview dashboard seems to have a few broken links:

mukundshah commented 8 months ago

@cbaerikebc when you say 'The plugin',which one are you referring to: mc1arke or GreyTeardrop's fork?

cbaerikebc commented 8 months ago

@mukundshah this is with @mc1arke's plugin, version 1.18.0

mc1arke commented 7 months ago

New metrics were introduced for quality gates, maybe their support could also be added

https://www.sonarsource.com/products/sonarqube/whats-new/sonarqube-10-4/#pull-requests-show-issues-that-will-be-fixed-when-merged

This has not been included in the plugin yet. I'd held up the release whilst I'd tried to get something that worked across all the decorators, but ultimately wasn't comfortable that the additional changes were ready.

mc1arke commented 7 months ago

Released in 1.19.0 of the plugin