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

Problem with the parameter value rendering for cascading parameters in the Jenkins Active Choices Plugin

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • active-choices-plugin
    • Jenkins version: 2.440.1 LTS (JDK17)

      Active Choices plugin version: 2.8.1
      (confirmed presence in v2.8.0-v2.8.4, allegedly present in v2.7.x, allegedly not present in v2.6.x)

      Jenkins Active Choices Plugin Parameter Rendering Bug

      This is a formal report of the issue related to the cascading parameters bug.

      The bug is related to the problem with the parameter value rendering for cascading parameters in the Jenkins Active Choices Plugin, primarily with the ordering of the dependent parameters.

      This issue has been reported already on multiple occasions:

      The bug caused cascading parameters (dynamic parameters + dynamic reference parameters) not to render correctly - the parameter values not being updated during the build UI interaction due to the lack of proper change propagation logic in the plugin.

      The Problem

      Our suspicion is that the root cause of the problem is most likely in one of the following:

      • UnoChoice frontend code
        • CascadeParameter.update() / DynamicReferenceParameter.update() methods
          • The methods returning prematurely due to incorrect use of asynchronous calls (e.g. Promise objects)
        • proxy.doUpdate() method
          • Potentially similar issues as stated above
      • Plugin Java code
        • AbstractCascadableParameter.update() method

      What is important to note is that the key problem is the clash between the parameter rendering timing which results in the wrong order of parameter rendering and the lack of proper change propagation logic in the plugin.

      The Solution (Workaround)

      We created a dedicated project for applying a fix / patch as a workaround for this project.

      More info is available here (on our GitHub).

      Pre-built patched bundles of the plugin (containing the workaround) are available here (on our GitHub) while we all wait for the maintainers to address and fix the issue.
      But please, make sure to read the associated documentation for a better understanding of what this workaround does, how it works, and what are its limitations. Also, preferably, for security reasons, you should build the patched plugin bundle yourself.

      We will also submit a proper PR which addresses this issue and attempts to fix it, but due to the nature of our current fix (a lot of code logic being appended to an existing JavaScript file), we are not sure what will the maintainers' reception be.

          [JENKINS-73935] Problem with the parameter value rendering for cascading parameters in the Jenkins Active Choices Plugin

          Hossted created issue -
          Hossted made changes -
          Description Original: h1. Jenkins Active Choices Plugin Parameter Rendering Bug

          This is a formal report of the issue related to cascading parameters issue.

          The bug is related to the problem with the parameter value rendering for cascading parameters in the Jenkins Active Choices Plugin.

          This issue has been reported already on multiple occasions:
           * [JENKINS-71909|https://issues.jenkins.io/browse/JENKINS-71909]
           * [JENKINS-72826|https://issues.jenkins.io/browse/JENKINS-72826]
           * [JENKINS-73239|https://issues.jenkins.io/browse/JENKINS-73239]
           * [JENKINS-73928|https://issues.jenkins.io/browse/JENKINS-73928]

          The bug caused cascading parameters (dynamic parameters + dynamic reference parameters) not to render correctly - the parameter values not being updated during the build UI interaction due to the lack of proper change propagation logic in the plugin.
          h2. The Problem

          Our suspicion is that the root cause of the problem is most likely in one of the following:
           * [_UnoChoice_ frontend code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/resources/org/biouno/unochoice/stapler/unochoice/UnoChoice.es6]
           ** {{CascadeParameter.update()}} / {{DynamicReferenceParameter.update()}} methods
           *** The methods returning prematurely due to incorrect use of asynchronous calls (e.g. {{Promise}} objects)
           ** {{proxy.doUpdate()}} method
           *** Potentially similar issues as stated above
           * [Plugin Java code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/java/org/biouno/unochoice/AbstractCascadableParameter.java]
           ** {{AbstractCascadableParameter.update()}} method

          What is important to note is that the key problem is the clash between the parameter rendering timing which results in the wrong order of parameter rendering and the lack of proper change propagation logic in the plugin.
          h2. The Solution (Workaround)

          We created a dedicated project for applying a fix / patch as a workaround for this project.

          More info is available [here|https://github.com/hossted-prs/jenkins-ac-plugin-cascading-workaround].

          We will also submit a proper PR which addresses this issue and attempts to fix it, but due to the nature of our current fix (a lot of code logic being appended to an existing JavaScript file), we are not sure what will the maintainers' reception be.
          New: h1. Jenkins Active Choices Plugin Parameter Rendering Bug

          This is a formal report of the issue related to cascading parameters issue.

          The bug is related to the problem with the parameter value rendering for cascading parameters in the Jenkins Active Choices Plugin, primarily with the ordering of the dependent parameters.

          This issue has been reported already on multiple occasions:
           * [JENKINS-71909|https://issues.jenkins.io/browse/JENKINS-71909]
           * [JENKINS-72826|https://issues.jenkins.io/browse/JENKINS-72826]
           * [JENKINS-73239|https://issues.jenkins.io/browse/JENKINS-73239]
           * [JENKINS-73928|https://issues.jenkins.io/browse/JENKINS-73928]

          The bug caused cascading parameters (dynamic parameters + dynamic reference parameters) not to render correctly - the parameter values not being updated during the build UI interaction due to the lack of proper change propagation logic in the plugin.
          h2. The Problem

          Our suspicion is that the root cause of the problem is most likely in one of the following:
           * [_UnoChoice_ frontend code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/resources/org/biouno/unochoice/stapler/unochoice/UnoChoice.es6]
           ** {{CascadeParameter.update()}} / {{DynamicReferenceParameter.update()}} methods
           *** The methods returning prematurely due to incorrect use of asynchronous calls (e.g. {{Promise}} objects)
           ** {{proxy.doUpdate()}} method
           *** Potentially similar issues as stated above
           * [Plugin Java code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/java/org/biouno/unochoice/AbstractCascadableParameter.java]
           ** {{AbstractCascadableParameter.update()}} method

          What is important to note is that the key problem is the clash between the parameter rendering timing which results in the wrong order of parameter rendering and the lack of proper change propagation logic in the plugin.
          h2. The Solution (Workaround)

          We created a dedicated project for applying a fix / patch as a workaround for this project.

          More info is available [here|https://github.com/hossted-prs/jenkins-ac-plugin-cascading-workaround].

          We will also submit a proper PR which addresses this issue and attempts to fix it, but due to the nature of our current fix (a lot of code logic being appended to an existing JavaScript file), we are not sure what will the maintainers' reception be.
          Hossted made changes -
          Description Original: h1. Jenkins Active Choices Plugin Parameter Rendering Bug

          This is a formal report of the issue related to cascading parameters issue.

          The bug is related to the problem with the parameter value rendering for cascading parameters in the Jenkins Active Choices Plugin, primarily with the ordering of the dependent parameters.

          This issue has been reported already on multiple occasions:
           * [JENKINS-71909|https://issues.jenkins.io/browse/JENKINS-71909]
           * [JENKINS-72826|https://issues.jenkins.io/browse/JENKINS-72826]
           * [JENKINS-73239|https://issues.jenkins.io/browse/JENKINS-73239]
           * [JENKINS-73928|https://issues.jenkins.io/browse/JENKINS-73928]

          The bug caused cascading parameters (dynamic parameters + dynamic reference parameters) not to render correctly - the parameter values not being updated during the build UI interaction due to the lack of proper change propagation logic in the plugin.
          h2. The Problem

          Our suspicion is that the root cause of the problem is most likely in one of the following:
           * [_UnoChoice_ frontend code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/resources/org/biouno/unochoice/stapler/unochoice/UnoChoice.es6]
           ** {{CascadeParameter.update()}} / {{DynamicReferenceParameter.update()}} methods
           *** The methods returning prematurely due to incorrect use of asynchronous calls (e.g. {{Promise}} objects)
           ** {{proxy.doUpdate()}} method
           *** Potentially similar issues as stated above
           * [Plugin Java code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/java/org/biouno/unochoice/AbstractCascadableParameter.java]
           ** {{AbstractCascadableParameter.update()}} method

          What is important to note is that the key problem is the clash between the parameter rendering timing which results in the wrong order of parameter rendering and the lack of proper change propagation logic in the plugin.
          h2. The Solution (Workaround)

          We created a dedicated project for applying a fix / patch as a workaround for this project.

          More info is available [here|https://github.com/hossted-prs/jenkins-ac-plugin-cascading-workaround].

          We will also submit a proper PR which addresses this issue and attempts to fix it, but due to the nature of our current fix (a lot of code logic being appended to an existing JavaScript file), we are not sure what will the maintainers' reception be.
          New: h1. Jenkins Active Choices Plugin Parameter Rendering Bug

          This is a formal report of the issue related to the cascading parameters bug.

          The bug is related to the problem with the parameter value rendering for cascading parameters in the Jenkins Active Choices Plugin, primarily with the ordering of the dependent parameters.

          This issue has been reported already on multiple occasions:
           * [JENKINS-71909|https://issues.jenkins.io/browse/JENKINS-71909]
           * [JENKINS-72826|https://issues.jenkins.io/browse/JENKINS-72826]
           * [JENKINS-73239|https://issues.jenkins.io/browse/JENKINS-73239]
           * [JENKINS-73928|https://issues.jenkins.io/browse/JENKINS-73928]

          The bug caused cascading parameters (dynamic parameters + dynamic reference parameters) not to render correctly - the parameter values not being updated during the build UI interaction due to the lack of proper change propagation logic in the plugin.
          h2. The Problem

          Our suspicion is that the root cause of the problem is most likely in one of the following:
           * [_UnoChoice_ frontend code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/resources/org/biouno/unochoice/stapler/unochoice/UnoChoice.es6]
           ** {{CascadeParameter.update()}} / {{DynamicReferenceParameter.update()}} methods
           *** The methods returning prematurely due to incorrect use of asynchronous calls (e.g. {{Promise}} objects)
           ** {{proxy.doUpdate()}} method
           *** Potentially similar issues as stated above
           * [Plugin Java code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/java/org/biouno/unochoice/AbstractCascadableParameter.java]
           ** {{AbstractCascadableParameter.update()}} method

          What is important to note is that the key problem is the clash between the parameter rendering timing which results in the wrong order of parameter rendering and the lack of proper change propagation logic in the plugin.
          h2. The Solution (Workaround)

          We created a dedicated project for applying a fix / patch as a workaround for this project.

          More info is available [here|https://github.com/hossted-prs/jenkins-ac-plugin-cascading-workaround].

          We will also submit a proper PR which addresses this issue and attempts to fix it, but due to the nature of our current fix (a lot of code logic being appended to an existing JavaScript file), we are not sure what will the maintainers' reception be.
          Hossted made changes -
          Description Original: h1. Jenkins Active Choices Plugin Parameter Rendering Bug

          This is a formal report of the issue related to the cascading parameters bug.

          The bug is related to the problem with the parameter value rendering for cascading parameters in the Jenkins Active Choices Plugin, primarily with the ordering of the dependent parameters.

          This issue has been reported already on multiple occasions:
           * [JENKINS-71909|https://issues.jenkins.io/browse/JENKINS-71909]
           * [JENKINS-72826|https://issues.jenkins.io/browse/JENKINS-72826]
           * [JENKINS-73239|https://issues.jenkins.io/browse/JENKINS-73239]
           * [JENKINS-73928|https://issues.jenkins.io/browse/JENKINS-73928]

          The bug caused cascading parameters (dynamic parameters + dynamic reference parameters) not to render correctly - the parameter values not being updated during the build UI interaction due to the lack of proper change propagation logic in the plugin.
          h2. The Problem

          Our suspicion is that the root cause of the problem is most likely in one of the following:
           * [_UnoChoice_ frontend code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/resources/org/biouno/unochoice/stapler/unochoice/UnoChoice.es6]
           ** {{CascadeParameter.update()}} / {{DynamicReferenceParameter.update()}} methods
           *** The methods returning prematurely due to incorrect use of asynchronous calls (e.g. {{Promise}} objects)
           ** {{proxy.doUpdate()}} method
           *** Potentially similar issues as stated above
           * [Plugin Java code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/java/org/biouno/unochoice/AbstractCascadableParameter.java]
           ** {{AbstractCascadableParameter.update()}} method

          What is important to note is that the key problem is the clash between the parameter rendering timing which results in the wrong order of parameter rendering and the lack of proper change propagation logic in the plugin.
          h2. The Solution (Workaround)

          We created a dedicated project for applying a fix / patch as a workaround for this project.

          More info is available [here|https://github.com/hossted-prs/jenkins-ac-plugin-cascading-workaround].

          We will also submit a proper PR which addresses this issue and attempts to fix it, but due to the nature of our current fix (a lot of code logic being appended to an existing JavaScript file), we are not sure what will the maintainers' reception be.
          New: h1. Jenkins Active Choices Plugin Parameter Rendering Bug

          This is a formal report of the issue related to the cascading parameters bug.

          The bug is related to the problem with the parameter value rendering for cascading parameters in the Jenkins Active Choices Plugin, primarily with the ordering of the dependent parameters.

          This issue has been reported already on multiple occasions:
           * [JENKINS-71909|https://issues.jenkins.io/browse/JENKINS-71909]
           * [JENKINS-72826|https://issues.jenkins.io/browse/JENKINS-72826]
           * [JENKINS-73239|https://issues.jenkins.io/browse/JENKINS-73239]
           * [JENKINS-73928|https://issues.jenkins.io/browse/JENKINS-73928]

          The bug caused cascading parameters (dynamic parameters + dynamic reference parameters) not to render correctly - the parameter values not being updated during the build UI interaction due to the lack of proper change propagation logic in the plugin.
          h2. The Problem

          Our suspicion is that the root cause of the problem is most likely in one of the following:
           * [_UnoChoice_ frontend code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/resources/org/biouno/unochoice/stapler/unochoice/UnoChoice.es6]
           ** {{CascadeParameter.update()}} / {{DynamicReferenceParameter.update()}} methods
           *** The methods returning prematurely due to incorrect use of asynchronous calls (e.g. {{Promise}} objects)
           ** {{proxy.doUpdate()}} method
           *** Potentially similar issues as stated above
           * [Plugin Java code|https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/java/org/biouno/unochoice/AbstractCascadableParameter.java]
           ** {{AbstractCascadableParameter.update()}} method

          What is important to note is that the key problem is the clash between the parameter rendering timing which results in the wrong order of parameter rendering and the lack of proper change propagation logic in the plugin.
          h2. The Solution (Workaround)

          We created a dedicated project for applying a fix / patch as a workaround for this project.

          More info is available [here (on our GitHub)|https://github.com/hossted-prs/jenkins-ac-plugin-cascading-workaround/].

          Pre-built patched bundles of the plugin (containing the workaround) are available [here (on our GitHub)|https://github.com/hossted-prs/jenkins-ac-plugin-cascading-workaround/releases/] while we all wait for the maintainers to address and fix the issue.
          But please, make sure to read the associated documentation for a better understanding of what this workaround does, how it works, and what are its limitations. Also, preferably, for security reasons, you should build the patched plugin bundle yourself.

          We will also submit a proper PR which addresses this issue and attempts to fix it, but due to the nature of our current fix (a lot of code logic being appended to an existing JavaScript file), we are not sure what will the maintainers' reception be.
          Hossted made changes -
          Environment Original: Jenkins version: 2.440.1 LTS (JDK17)
          Active Choices plugin version: 2.8.1
          New: Jenkins version: 2.440.1 LTS (JDK17)

          Active Choices plugin version: 2.8.1
          (confirmed presence in v2.8.0-v2.8.4, allegedly present in v2.7.x, allegedly not present in v2.6.x)
          Elod made changes -
          Rank New: Ranked higher
          Michael Moossen made changes -
          Priority Original: Major [ 3 ] New: Critical [ 2 ]

          Lou Fiorino added a comment -

          the problems persist in 2.8.5

          Lou Fiorino added a comment - the problems persist in 2.8.5

          Also confirm this is still present in 2.8.5.

          Federico Alaimo added a comment - Also confirm this is still present in 2.8.5.

          Thank you both for confirming the problem in 2.8.5. This issue has great description, links to previous issues, and a tentative fix (which cannot be merged as-is, but is great to help debugging the problem). I have to have a look at the issues in TAP Plug-in, and will come back to this one (not going to work on other issues for 2.8.6, so that release will be just for another try at fixing this issue).

          I note too the comment in the OP "The methods returning prematurely due to incorrect use of asynchronous calls (e.g. Promise objects)"; the promises were introduced in a previous release to make the code asynchronous – that caused the whole lot of issues related here. I tried reverting that, so there is a possible (not sure how likely) fix that involves simply finding out if I reverted the code correctly, or if I missed a part which is still causing this issue.

          If anyone has some config.xml, or detailed configurations that could be used to reproduce it, that'd be great. I added a e2e test for another issue that reported a possible scenario to reproduce this issue, but maybe a) the test is not good enough or b) there are other scenarios where the issue happens. In case of b), I'd like to add more tests to improve quality here.

          Cheers

          Bruno P. Kinoshita added a comment - Thank you both for confirming the problem in 2.8.5. This issue has great description, links to previous issues, and a tentative fix (which cannot be merged as-is, but is great to help debugging the problem). I have to have a look at the issues in TAP Plug-in, and will come back to this one (not going to work on other issues for 2.8.6, so that release will be just for another try at fixing this issue). I note too the comment in the OP "The methods returning prematurely due to incorrect use of asynchronous calls (e.g. Promise objects)"; the promises were introduced in a previous release to make the code asynchronous – that caused the whole lot of issues related here. I tried reverting that, so there is a possible (not sure how likely) fix that involves simply finding out if I reverted the code correctly, or if I missed a part which is still causing this issue. If anyone has some config.xml, or detailed configurations that could be used to reproduce it, that'd be great. I added a e2e test for another issue that reported a possible scenario to reproduce this issue, but maybe a) the test is not good enough or b) there are other scenarios where the issue happens. In case of b), I'd like to add more tests to improve quality here. Cheers

            kinow Bruno P. Kinoshita
            hossted Hossted
            Votes:
            9 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated: