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

DynamicReferenceParameters do not work properly after 'Active Choices Plug-in' update at Jenkins Pipeline Jobs

      Hello,

      We have recently updated "Active Choices Plug-in" from 2.8.3 to 2.8.6 in our Jenkins. After downloading update we have restarted the whole virtual machine the Jenkins is running at.

      This update action caused issues at most of our Jenkins Pipeline jobs that were using DynamicReferenceParameter and CascadeChoiceParameter ** (using 'referencedParameters' attribute) classes at pipeline parameters.
       
      We are uploading an attachment 'example_Jenkinsfile' containing source code fragments of the job we have been studying the most due to occuring problems. All of our jobs have the same fallback script and the sub-scripts are builded similarly.
       

       
      On the image above there are two parameters that were affected by the bug. In our job page, when we clicked into "Build with parameters" the dynamic reference parameters instantly returned list containing 'ERROR' string from our fallback script. The code behind these parameters is builded similarly to the example code we provided. Almost the same result is returned here and there (choice type attribute is different).

      We have managed to temporarily solve this issue for a single job by:
      1. Going to "Configure" page of the job

      2. Clicking "Save" without any visible changes from web browser.

      3. This solved the problem for the single job until the first build execution.

       
      4. Our jobs are downloading the Jenkinsfiles from Git before each build execution (Pipeline SCM). Even if the source code was not changed, the parameters seemed to be "overwritten" by the build. After the build was executed the parameters stopped working - the same way as previously. We can "re-save" configuration again and the parameters page would work properly until next build execution.
       


       
      Since at this point we did not know yet what was causing issue, we attempted to fix this issue in source code of jobs. 

       We were working with the code we provided as the example. Simplyfing the code did not appear to change anything.

      The parameters state from the example code as provided:

      • InfoField1 was OK
      • PROJEKT and SERWER was OK
      • InfoField2 was returning value from the fall back script
      • Other dynamic reference parameters using the references (not provided, nothing changed after removal of them) were showing the same thing as InfoField2

      We have removed other parameters and changed the order of the main parameters (in the code) that we are talking about. The parameter order for the test was like this: InfoField2, PROJEKT, SERWER, InfoField1. 
      Unintuitively the error "stayed" at the last position:

      • InfoField2 was OK
      • PROJEKT and SERWER were OK
      • InfoField1 was returning value from the fall back script

       


       
      After the code changes did not seemed to help, we decided to downgrade plugin version from recent update to 2.8.3 (previous we were using). We have restarted the whole machine from the OS.
       
      We find out the dynamic reference parameters were working again after downgrade. To make sure we repeated the process by updating the plugin again to the newest possible (same bug) and downgrading again (worked fine) including OS rebooting. 

      All of the code we are talking about here is working perfectly fine at version 2.8.3. There were no update-compability issues since last 2 years.

      Could you provide us a solution to fix this bug at the newest version of the plugin if this is somehow our fault (maybe some source code / configuration changes)? We want to stick to our policies of keeping systems updated to the newest versions.
       
      Thanks.
       

            kinow Bruno P. Kinoshita
            dawid_kaj_veolia Dawid
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: