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

hidden build parameters with its value "xxxBuildSelector" causes rebuild to fail


      The Rebuild plugin in jenkins fails to rebuild a job when it contains a hidden string parameter that contains the character string "MultiJobBuildSelector" in the default value field. For a simple reproducible example do the following:

      • install the following plugins: copy artifact, rebuild, hidden parameter
      • create a new job with the following configuration:
        • Add a parameter of type "hidden" with an arbitrary name and a defult value of "MultiJobBuildSelector"
      • save the job and run it once
      • select the build that just completed and click the "rebuild" link

      This produces the following error (see attached screenshot):

      javax.servlet.ServletException: java.lang.ClassCastException: com.wangyin.parameter.WHideParameterDefinition cannot be cast to hudson.model.SimpleParameterDefinition

      This is fragile for those rare cases when a hidden parameter actually does need to contain that exact string, but it is also problematic when one wants to have a hidden job parameter to control which build the copy artifact plugin should use.

      I would suggest two changes here:

      1. modify the logic of the multijob build selector to look for an exact match for the XML configuration needed to correctly populate a build selector parameter (avoiding accidental matches )
      2. modify the rebuild logic so that when a hidden parameter contains this exact XML that it correctly instantiates the multijob build selector so copy artifacts will work correctly when rebuilt using a hidden string parameter

            ragesh_nair ragesh_nair
            leedega Kevin Phillips
            0 Vote for this issue
            2 Start watching this issue