Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55009

Wrong "sonarBuildLink" URL within SonarQubePointGenerator

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Within

       SonarQubePointGenerator.setSonarDetails(String sonarBuildLink)

       the sonarServerURL is parsed with

      sonarBuildLink.indexOf("/dashboard/index/" + this.sonarProjectName);

       

      Since SonarQube 5.2 this URL is not valid anymore.

      Using SonarQube 7.4 (and SonarQube Scanner 3.2) I find the following Message in my Logs:

      ANALYSIS SUCCESSFUL, you can browse https://<mySonarQube>/dashboard?id=<sonarProjectName>
      

      Running InfluxDB Plugin 1.20.1 I receive the following Exception (When Environment Variable SONAR_HOST_URL is not set):

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      	at java.lang.String.substring(String.java:1967)
      	at jenkinsci.plugins.influxdb.generators.SonarQubePointGenerator.setSonarDetails(SonarQubePointGenerator.java:89)
      	at jenkinsci.plugins.influxdb.generators.SonarQubePointGenerator.hasReport(SonarQubePointGenerator.java:66)
      	at jenkinsci.plugins.influxdb.InfluxDbPublicationService.perform(InfluxDbPublicationService.java:234)
      	at jenkinsci.plugins.influxdb.InfluxDbPublisher.perform(InfluxDbPublisher.java:357)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
      	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
      	at hudson.security.ACL.impersonate(ACL.java:290)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	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)
      

      As an Imrovement it would be nice to:
      1.) deactivate Generators which are not desired to use --> JENKINS-55031
      2.) Improve the logging within SonarQubePointGenerator.getResult() (which request does not return HTTP 200) --> JENKINS-55032

        Attachments

          Activity

          Hide
          aleksisimell Aleksi Simell added a comment -

          Fixed formatting to use /dashboard?id= instead of /dashboard/index. This fix will be available in the next release. Can you create a separate improvement suggestion ticket for the ideas you mentioned?

          Show
          aleksisimell Aleksi Simell added a comment - Fixed formatting to use /dashboard?id= instead of /dashboard/index. This fix will be available in the next release. Can you create a separate improvement suggestion ticket for the ideas you mentioned?
          Hide
          forster_ch Christoph Forster added a comment -

          Perfect, thanks for the fast solving.
          I created Tickets for both imrovements (linked within description).

          Show
          forster_ch Christoph Forster added a comment - Perfect, thanks for the fast solving. I created Tickets for both imrovements (linked within description).

            People

            • Assignee:
              aleksisimell Aleksi Simell
              Reporter:
              forster_ch Christoph Forster
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: