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

          [JENKINS-39978] hidden build parameters with its value "xxxBuildSelector" causes rebuild to fail

          Kevin Phillips created issue -
          Kevin Phillips made changes -
          Link New: This issue is related to JENKINS-13644 [ JENKINS-13644 ]
          ikedam made changes -
          Component/s Original: copyartifact-plugin [ 15692 ]
          Description Original: 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):

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

          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:
           # 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 )
           # 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
          New: 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):

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

          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:
           # 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 )
           # 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
          Summary Original: Copy artifact plugin causes rebuild to fail when using hidden build parameters New: hidden build parameters causes rebuild to fail
          ikedam made changes -
          Summary Original: hidden build parameters causes rebuild to fail New: hidden build parameters with its value "xxxBuildSelector" causes rebuild to fail
          ikedam made changes -
          Link New: This issue is related to JENKINS-41529 [ JENKINS-41529 ]

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

              Created:
              Updated: