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

Node and Label Parameter not Compatible with Active Choices

    XMLWordPrintable

Details

    Description

      It seems like Active Choices Reactive Reference parameter is not able to reference a Node/Label paremeter.  Basically, it would be useful to dynamically define default build parameters given a node or label.  The Active Choices developers pointed out

      it depends on the parameter type. It should work with the default parameter types of Jenkins. If your parameter is provided by a plug-in, it depends on whether the plug-in created the parameter with the default DOM structure. If not, then we need some tweaks in JS first

      Attachments

        Activity

          js1 j s added a comment - see also https://issues.jenkins-ci.org/browse/JENKINS-42718

          Not really hard to implement. The difference between a simple parameter, and the node/label parameter, is that the input element with the value, is not named "value".

          String parameter:

          Label parameter:

          So what's needed, I think, is just to implement a strategy similar to:

          • find the element input[name="value"]
          • if we fail to find that element, then try input[name="not-empty-string"][0] (i.e. grab the first input element that has a name

          I think it wouldn't break current behaviour, and would immediately fix node/label, and potentially other plug-ins that might be using a similar HTML structure.

          kinow Bruno P. Kinoshita added a comment - Not really hard to implement. The difference between a simple parameter, and the node/label parameter, is that the input element with the value, is not named "value". String parameter: Label parameter: So what's needed, I think, is just to implement a strategy similar to: find the element input [name="value"] if we fail to find that element, then try input [name="not-empty-string"] [0] (i.e. grab the first input element that has a name I think it wouldn't break current behaviour, and would immediately fix node/label, and potentially other plug-ins that might be using a similar HTML structure.

          PR done, pending testing (unit & manual): https://github.com/imoutsatsos/uno-choice-plugin/pull/12

          It would be great if someone could test that code. If not possible to build the project, I've attached a hpi with the branch built and ready for testing in a test server

          Cheers

          Bruno

          kinow Bruno P. Kinoshita added a comment - PR done, pending testing (unit & manual): https://github.com/imoutsatsos/uno-choice-plugin/pull/12 It would be great if someone could test that code. If not possible to build the project, I've attached a hpi with the branch built and ready for testing in a test server Cheers Bruno

          To be released with 2.6.0

          kinow Bruno P. Kinoshita added a comment - To be released with 2.6.0

          People

            kinow Bruno P. Kinoshita
            js1 j s
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: