Uploaded image for project: 'Jenkins SonarQube plugin'
  1. Jenkins SonarQube plugin
  2. SONARJNKNS-82

Changing name of Sonar server do not change the name in jobs

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      By changing the name of Sonar server in Jenkins administration, only the name in the administration is changed.
      The jobs referencing this server are not updated.
      By the way, the jenkins jobs don't fail the build in this case :

      ...
      No Sonar installation on this job. Sonar, available installations count : 2
      Finished: SUCCESS
      

      I think that in this case the plugin should mark the build as failed (this may be an option on the admin part).

        Activity

        Hide
        henryju OLD - Julien HENRY added a comment -

        Proposed fix:

        • Improve error message and break the build when job has no valid Sonar installation
        • Provide a sample groovy script on the wiki to help admins to fix jobs

        Here is the location of the sample scripts: http://docs.codehaus.org/display/SONAR/Reassign+jobs+to+another+Sonar+instance

        Show
        henryju OLD - Julien HENRY added a comment - Proposed fix: Improve error message and break the build when job has no valid Sonar installation Provide a sample groovy script on the wiki to help admins to fix jobs Here is the location of the sample scripts: http://docs.codehaus.org/display/SONAR/Reassign+jobs+to+another+Sonar+instance
        Hide
        fabemn OLD - Fabrice Bellingard added a comment -

        Works well Julien.

        Could you just:

        • Add a more visible "BUILD FAILURE" message in the log - because at first, it looks like the build should not be considered as failed when quickly looking at the log:
        ...
        [INFO] [12:23:22.599] <- Clean snapshot 70
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD SUCCESSFUL
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 12 seconds
        [INFO] Finished at: Thu Oct 11 12:23:22 CEST 2012
        [INFO] Final Memory: 30M/81M
        [INFO] ------------------------------------------------------------------------
        channel stopped
        Sonar installation defined on this job (Local Sonar) do not match anything. Available installations count: 2.
        If you want to reassign a lot of jobs to a different Sonar installation see http://docs.codehaus.org/display/SONAR/Reassign+jobs+to+another+Sonar+instance
        Build step 'Sonar' marked build as failure
        Finished: FAILURE
        
        • give a cleaner error message when using the Groovy script to reassign a Sonar server to some jobs, but the name provided does not match an existing Sonar server. Currently, the following is printed out:
        Assertion failed: 
        
        assert(listOfSonarInstance.contains(newSonarInstance))
               |                   |        |
               |                   false    My Sonar
               [Fab Sonar, Foo Sonar]
        
        	at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:386)
        	...
        
        Show
        fabemn OLD - Fabrice Bellingard added a comment - Works well Julien. Could you just: Add a more visible "BUILD FAILURE" message in the log - because at first, it looks like the build should not be considered as failed when quickly looking at the log: ... [INFO] [12:23:22.599] <- Clean snapshot 70 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12 seconds [INFO] Finished at: Thu Oct 11 12:23:22 CEST 2012 [INFO] Final Memory: 30M/81M [INFO] ------------------------------------------------------------------------ channel stopped Sonar installation defined on this job (Local Sonar) do not match anything. Available installations count: 2. If you want to reassign a lot of jobs to a different Sonar installation see http: //docs.codehaus.org/display/SONAR/Reassign+jobs+to+another+Sonar+instance Build step 'Sonar' marked build as failure Finished: FAILURE give a cleaner error message when using the Groovy script to reassign a Sonar server to some jobs, but the name provided does not match an existing Sonar server. Currently, the following is printed out: Assertion failed: assert (listOfSonarInstance.contains(newSonarInstance)) | | | | false My Sonar [Fab Sonar, Foo Sonar] at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:386) ...
        Hide
        henryju OLD - Julien HENRY added a comment -

        Done!

        Show
        henryju OLD - Julien HENRY added a comment - Done!
        Hide
        fabemn OLD - Fabrice Bellingard added a comment -

        Perfect Julien!

        Show
        fabemn OLD - Fabrice Bellingard added a comment - Perfect Julien!

          People

          • Assignee:
            henryju OLD - Julien HENRY
            Reporter:
            ehartmann OLD - Eric Hartmann
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: