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

Active Choices Reactive Reference Parameter is not referring Boolean parameter in Jenkins

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • active-choices-plugin
    • None
    • 2.335+. Jenkins. Linux

      'm using Jenkins for the release processes. In a freestyle project, I need to show 'To Mail Id' input box to get mail ids to send mail only when 'Send Mail' check box should be checked. For the requirement, I am using 'Formatted HTML' in 'Active Choices Reactive Reference Parameter' to display 'To Mail Id' input box and 'Boolean Parameter' to display the 'Send Mail' check box. And I am referring 'Send Mail' boolean parameter name in 'Referenced parameters' of 'To Mail Id'-'Active Choices Reactive Reference Parameter'. Using groovy script, based on the boolean parameter, the mail id input text is displayed.

      The issue is that the 'Boolean Parameter' check and uncheck switching is not reflecting in 'Active Choices Reactive Reference Parameter'. How to resolve the same?

      Groovy Script used in 'Active Choices Reactive Reference Parameter'
       
      {{def sendMail = SEND_MAIL;
      if (sendMail.equals('on'))

      { html_to_be_rendered = """<table><tr><td><label>TO_MAIL_ID</label></td><td><input type="text" class="setting-input" name="value" size="70" id="to_mail_id"><small>Enter To Mail ID.This is a comma separated list (optional white space after commas) of mail IDs that should receive mails. E.g., ram@example.com, varun@example.com.</small></td></tr></table>""" return html_to_be_rendered }

      else {
      html_to_be_rendered =""
      return html_to_be_rendered
      }}}

      Screenshot #1 - Send Mail Boolean Parameter

      Screenshot #2 - To Mail Id Active Choices Reactive Reference Parameter

        1. diff_parameter_334.txt
          0.2 kB
        2. diff_parameter_335.txt
          0.2 kB
        3. form_334.JPG
          form_334.JPG
          34 kB
        4. form_335.JPG
          form_335.JPG
          36 kB

          [JENKINS-68013] Active Choices Reactive Reference Parameter is not referring Boolean parameter in Jenkins

          I wrote the comment above but didn't submit it. I've tried to fix the unit tests… I was going to debug it, but turns out something changed in Jenkins unit tests, or maybe due to my more recent JVM, and now I am not able to debug unit tests... sighs

          Sorry joho . The fix is ready, but this release will have to wait until I have time to deal with these unit tests and with running unit tests with Jenkins.

          A few weeks ago I had a small window for development, and was planning to cut a release, but then the latest release of Jenkins at that time had changed the SpotBugs rules and that blocked my release. Then the UI changes, and the unit tests. Every time I try to work on this plug-in I end up spending a lot longer dealing with Jira (unfortunately I am more accustomed to GH issues these days, so I'm a bit slow with Jira which is also slower than GH), or with Jenkins dependencies/UI/release process, rather than with the actual work.

          If you have time to look at these unit tests, or maybe just test the code in that branch and confirm that it works for you, joho , that'd be grand

          Thanks a lot!

          Bruno

          Bruno P. Kinoshita added a comment - I wrote the comment above but didn't submit it. I've tried to fix the unit tests… I was going to debug it, but turns out something changed in Jenkins unit tests, or maybe due to my more recent JVM, and now I am not able to debug unit tests... sighs Sorry joho . The fix is ready, but this release will have to wait until I have time to deal with these unit tests and with running unit tests with Jenkins. A few weeks ago I had a small window for development, and was planning to cut a release, but then the latest release of Jenkins at that time had changed the SpotBugs rules and that blocked my release. Then the UI changes, and the unit tests. Every time I try to work on this plug-in I end up spending a lot longer dealing with Jira (unfortunately I am more accustomed to GH issues these days, so I'm a bit slow with Jira which is also slower than GH), or with Jenkins dependencies/UI/release process, rather than with the actual work. If you have time to look at these unit tests, or maybe just test the code in that branch and confirm that it works for you, joho , that'd be grand Thanks a lot! Bruno

          Jonas Hommel added a comment - - edited

          Hi kinow ,

           

          i've just spent some time too today and wanted to share my investigation. Then I was really surprised about your comment and that you've found the same thing as I've found

          For documentation purposes, I've still added my snippets (diff_parameter_334.txt diff_parameter_335.txt) for the change in html structure.

          I'll check, try to merge, and understand your change in my local workspace now.

          Many thanks for your support!

          Jonas Hommel added a comment - - edited Hi kinow ,   i've just spent some time too today and wanted to share my investigation. Then I was really surprised about your comment and that you've found the same thing as I've found For documentation purposes, I've still added my snippets ( diff_parameter_334.txt diff_parameter_335.txt ) for the change in html structure. I'll check, try to merge, and understand your change in my local workspace now. Many thanks for your support!

          Jonas Hommel added a comment -

          Fix is working as expected in local workspace. But i've got issues with the unit tests too.

          Jonas Hommel added a comment - Fix is working as expected in local workspace. But i've got issues with the unit tests too.

          Released in 2.6.2. Remember to back up before installing, and/or using a test instance.

          Bruno P. Kinoshita added a comment - Released in 2.6.2. Remember to back up before installing, and/or using a test instance.

          Jonas Hommel added a comment -

          Thanks a lot kinow . I will try to install the update within our next update session.

          Jonas Hommel added a comment - Thanks a lot kinow . I will try to install the update within our next update session.

          Jeremy Cooper added a comment - - edited

          I tried this out with version 2.350  and it appears that the problem still persists.   I will do some more debugging to see if i can come up with anymore information.  Looks like this works for parameters of type "Active Choices Reactive Reference Parameter" but fails for "Active Choices Reactive Parameter"

          Jeremy Cooper added a comment - - edited I tried this out with version 2.350  and it appears that the problem still persists.   I will do some more debugging to see if i can come up with anymore information.  Looks like this works for parameters of type "Active Choices Reactive Reference Parameter" but fails for "Active Choices Reactive Parameter"

          Jeremy Cooper added a comment -

          Looks like /active-choices-plugin-uno-choice/src/main/resources/org/biouno/unochoice/CascadeChoiceParameter/index.jelly

          needs this at line 56:

          else if (child.tagName == 'DIV' || child.tagName == 'SPAN')

          Jeremy Cooper added a comment - Looks like /active-choices-plugin-uno-choice/src/main/resources/org/biouno/unochoice/CascadeChoiceParameter/index.jelly needs this at line 56: else if (child.tagName == 'DIV' || child.tagName == 'SPAN' )

          Sebastian added a comment - - edited

          Hi everybody,

          I tested the fix from jeremy_jenkins successfully and created a pull request for it: https://github.com/jenkinsci/active-choices-plugin/pull/62

          I hope it makes it into the next version

          Sebastian added a comment - - edited Hi everybody, I tested the fix from jeremy_jenkins successfully and created a pull request for it: https://github.com/jenkinsci/active-choices-plugin/pull/62 I hope it makes it into the next version

          Pull request merged and released. 2.6.3 should be available in the update center in the next hours. Thanks!

          Bruno P. Kinoshita added a comment - Pull request merged and released. 2.6.3 should be available in the update center in the next hours. Thanks!

          This and https://issues.jenkins.io/browse/JENKINS-68012 look to be fixed now, thank you!

          Krzysztof Mulica added a comment - This and https://issues.jenkins.io/browse/JENKINS-68012 look to be fixed now, thank you!

            kinow Bruno P. Kinoshita
            jeremy_jenkins Jeremy Cooper
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: