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

Active Choice Reactive Reference parameter value rendered as File Selector not cascaded

    Details

    • Similar Issues:

      Description

      When an Active Choice reactive reference is rendered as a Jenkins File Chooser, the name of the selected file is not cascaded to other active choices that reference it.

        Attachments

          Activity

          Hide
          ioannis Ioannis Moutsatsos added a comment -

          After investigating a bit more, the issue is as follows:

          When the AC-RefParam is rendered as:

          <input name="file" type="file" jsonaware="true">
          
          • we render a file button that we can use to choose a file.
          • the name of the file is NOT cascaded
          • the file is uploaded.

          When the AC-RefParam is rendered as:

          <input name="value" type="file" jsonaware="true">
          
          • we render a file button that we can use to choose a file
          • the name of the file is cascaded
          • the file however, is NOT uploaded

          This is expected as we need to render a parameter with name="value". It's just not useful for us to propagate the name of the selected file.

          Show
          ioannis Ioannis Moutsatsos added a comment - After investigating a bit more, the issue is as follows: When the AC-RefParam is rendered as: <input name= "file" type= "file" jsonaware= " true " > we render a file button that we can use to choose a file. the name of the file is NOT cascaded the file is uploaded. When the AC-RefParam is rendered as: <input name= "value" type= "file" jsonaware= " true " > we render a file button that we can use to choose a file the name of the file is cascaded the file however, is NOT uploaded This is expected as we need to render a parameter with name="value". It's just not useful for us to propagate the name of the selected file.
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Hi Ioannis,

          Thanks for attaching the config.xml file. That is extremely helpful.

          Here are some screen shots.

           

          I am not sure if I can reproduce it or not... I suspect it is working in my environment? Could be because I am running within Eclipse, locally, with no security policies, HTTP server, etc.

           

          But at least when I choose a file from my desktop, the input fields are updated, and the values are both submitted to Jenkins.

          Show
          kinow Bruno P. Kinoshita added a comment - Hi Ioannis, Thanks for attaching the config.xml file. That is extremely helpful. Here are some screen shots.   I am not sure if I can reproduce it or not... I suspect it is working in my environment? Could be because I am running within Eclipse, locally, with no security policies, HTTP server, etc.   But at least when I choose a file from my desktop, the input fields are updated, and the values are both submitted to Jenkins.
          Hide
          ioannis Ioannis Moutsatsos added a comment -

          Maybe the example is confusing. But you have actually reproduced the issue as described in my comment.
          Your screenshot shows that the Krita.desktop file, attached using the AC_RENDERED file button was NOT uploaded. And this is exactly my issue.
          I want an Active Choice rendered 'Choose File' button that both cascades its value AND uploads the file

          Show
          ioannis Ioannis Moutsatsos added a comment - Maybe the example is confusing. But you have actually reproduced the issue as described in my comment. Your screenshot shows that the Krita.desktop file, attached using the AC_RENDERED file button was NOT uploaded. And this is exactly my issue. I want an Active Choice rendered 'Choose File' button that both cascades its value AND uploads the file
          Hide
          ioannis Ioannis Moutsatsos added a comment -

          Changed the severity, as this is directly affecting the expected behavior of the AC control

          Show
          ioannis Ioannis Moutsatsos added a comment - Changed the severity, as this is directly affecting the expected behavior of the AC control
          Hide
          kinow Bruno P. Kinoshita added a comment - - edited

          Ok, I think I finally understood the issue and what's going on. What we have when we use Jenkins' File parameter is a FileParameterValue.

          The Jelly file used to render is very simple and it seems like the part we are missing here is that the input field's name must be "file", not "value".

          If you want to cascade to other parameters, I think you will have to find some JavaScript that reacts to the event when the user chooses the file, then copies the file name in another input name="value".

          So in summary, the only thing I changed from your example to get it working was: <input name="file" type="file" jsonAware="true" />

          To match Jenkins' jelly file.

          Could you check if that works for you Ioannis Moutsatsos, please? Here's a screen shot (also checked in the disk, and both files were uploaded, but no file name in the latter).

          Show
          kinow Bruno P. Kinoshita added a comment - - edited Ok, I think I finally understood the issue and what's going on. What we have when we use Jenkins' File parameter is a FileParameterValue . The Jelly file used to render is very simple and it seems like the part we are missing here is that the input field's name must be "file", not "value". If you want to cascade to other parameters, I think you will have to find some JavaScript that reacts to the event when the user chooses the file, then copies the file name in another input name="value". So in summary, the only thing I changed from your example to get it working was: <input name="file" type="file" jsonAware="true" /> To match Jenkins' jelly file. Could you check if that works for you Ioannis Moutsatsos , please? Here's a screen shot (also checked in the disk, and both files were uploaded, but no file name in the latter).
          Hide
          ioannis Ioannis Moutsatsos added a comment -

          Thanks for looking into this Bruno! So you have clearly confirmed my previous investigation: https://issues.jenkins-ci.org/browse/JENKINS-38893?focusedCommentId=305784&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-305784 Excellent!

           

          I will investigate the workaround  you suggested, but I think this is the first case where we can't reproduce a functional Jenkins UI control whose value can be cascaded in the typical AC way. I will try to document on wiki after I find a workaround for it.

          Thank you-have a great Sunday afternoon in NZ!

          Show
          ioannis Ioannis Moutsatsos added a comment - Thanks for looking into this Bruno! So you have clearly confirmed my previous investigation: https://issues.jenkins-ci.org/browse/JENKINS-38893?focusedCommentId=305784&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-305784  Excellent!   I will investigate the workaround  you suggested, but I think this is the first case where we can't reproduce a functional Jenkins UI control whose value can be cascaded in the typical AC way. I will try to document on wiki after I find a workaround for it. Thank you-have a great Sunday afternoon in NZ!
          Hide
          dozinbatty Sunil Batra added a comment -

          The issue mentioned Ioannis Moutsatsos is there, but I could add another finding, when we use the same active choice in pipeline job, the file is not uploaded either you specify 
          <input name="file" type="file" jsonaware="true">
          OR
          <input name="value" type="file" jsonaware="true">
          In Pipeline type of job, you can get the name of the file, but do not have a space where the file could be located.

          Show
          dozinbatty Sunil Batra added a comment - The issue mentioned Ioannis Moutsatsos is there, but I could add another finding, when we use the same active choice in pipeline job, the file is not uploaded either you specify  <input name="file" type="file" jsonaware="true"> OR <input name="value" type="file" jsonaware="true"> In Pipeline type of job, you can get the name of the file, but do not have a space where the file could be located.

            People

            • Assignee:
              kinow Bruno P. Kinoshita
              Reporter:
              ioannis Ioannis Moutsatsos
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: