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

Wrong "sonarBuildLink" URL within SonarQubePointGenerator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • influxdb-plugin
    • None

      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

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

              Created:
              Updated:
              Resolved: