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

Add configuration parameter, which defines, when filter must started work

      Add to "Active Choices Parameter" and "Active Choices Reactive Parameter" new configuration parameter. This parameters defines, when filter must start work.

      Eg, When you sets "4", filter work, when filter pattern length equals 0 or greater than or equal 4.

      Why?
      In my work I create jenkins job, which has a one Active Choices Parameter (eg. name PARAM_A) and few Active Choices Reactive Parameter (name PARAM_B, PARAM_C, PARAM_D...) depends on PARAM_A.
      Script in PARAM_B, _C, _D doing something for a few seconds (2-3s).
      When the filter is working (PARAM_A) when you type 1 or 2, 3 characters, it is not very effective, with such a configuration parameter.

          [JENKINS-31625] Add configuration parameter, which defines, when filter must started work

          Hi Boguslaw,

          Thanks for explaining the pull request. Let's leave this issue open and assigned to me. I've started a development cycle for the plug-in and will try to include your contribution in the next release

          Thanks again
          Bruno

          Bruno P. Kinoshita added a comment - Hi Boguslaw, Thanks for explaining the pull request. Let's leave this issue open and assigned to me. I've started a development cycle for the plug-in and will try to include your contribution in the next release Thanks again Bruno

          Personally I would discourage this behavior as it can get confusing for the user when the filter starts working, especially when different controls have different thresholds. I'm wondering whether you can simulate a similar behavior if needed on the reactive parameter script by checking the length of the referenced parameter?

          Ioannis Moutsatsos added a comment - Personally I would discourage this behavior as it can get confusing for the user when the filter starts working, especially when different controls have different thresholds. I'm wondering whether you can simulate a similar behavior if needed on the reactive parameter script by checking the length of the referenced parameter?

          You may be right, but I do not have an idea for a better description for this parameter.
          Currently this solution in my team uses a dozen of people
          no one has a problem.

          Operation of this parameter on the reactive side (PARAM_B) will be more confusing
          because, changes the active parameter (PARAM_A) will not change the reactive parameter (PARAM_B) (very strange!).

          Additionally, a one parameter does not have direct access to another parameter, such service would cause too much complication.

          I think we could change the label and description of the parameter on a more understandable.
          What do you say for this?

          Boguslaw Klimas added a comment - You may be right, but I do not have an idea for a better description for this parameter. Currently this solution in my team uses a dozen of people no one has a problem. Operation of this parameter on the reactive side (PARAM_B) will be more confusing because, changes the active parameter (PARAM_A) will not change the reactive parameter (PARAM_B) (very strange!). Additionally, a one parameter does not have direct access to another parameter, such service would cause too much complication. I think we could change the label and description of the parameter on a more understandable. What do you say for this?

          Bruno P. Kinoshita added a comment - - edited

          Updated the pull request with my last comments, but extremely happy with the code. Kudos klimas7!

          I created a job with the latest version available in the update center. Then updated the plug-in to the pull request code, and saving the job this is the only change in the config.xml file.

          27d26
          <           <filterLength>1</filterLength>
          49d47
          <           <filterLength>1</filterLength>
          

          In this case, I had two parameters, a normal active choices, and then a reactive referencing the previous parameter. Everything worked fine. I added a final request for changes regarding the noise in the JS console, and we will have to rethink the text in the documentation later.

          ioannis I read your previous comment now, when I came here to comment in the JIRA ticket. What do you think about this feature?

          Simply put, it adds a new input box after the check box to enable filter. This option can be any value (we can add validation later, as even negative values are accepted), by default it is set to 1, and the user may set that to 3 (a good value I believe) or even 10, in cases where it is known that parameters will have a common prefix, for example. This will save processing time, and improve the general performance.

          We may decide to move it (and maybe filter, or other options) under an Advanced section later.

          Waiting for ioannis feedback, and klimas7 feedback on the pull request, in order to merge it. Next release in the first or second week of December.

          Bruno P. Kinoshita added a comment - - edited Updated the pull request with my last comments, but extremely happy with the code. Kudos klimas7 ! I created a job with the latest version available in the update center. Then updated the plug-in to the pull request code, and saving the job this is the only change in the config.xml file. 27d26 < <filterLength>1</filterLength> 49d47 < <filterLength>1</filterLength> In this case, I had two parameters, a normal active choices, and then a reactive referencing the previous parameter. Everything worked fine. I added a final request for changes regarding the noise in the JS console, and we will have to rethink the text in the documentation later. ioannis I read your previous comment now, when I came here to comment in the JIRA ticket. What do you think about this feature? Simply put, it adds a new input box after the check box to enable filter. This option can be any value (we can add validation later, as even negative values are accepted), by default it is set to 1, and the user may set that to 3 (a good value I believe) or even 10, in cases where it is known that parameters will have a common prefix, for example. This will save processing time, and improve the general performance. We may decide to move it (and maybe filter, or other options) under an Advanced section later. Waiting for ioannis feedback, and klimas7 feedback on the pull request, in order to merge it. Next release in the first or second week of December.

          Ping ioannis

          Bruno P. Kinoshita added a comment - Ping ioannis

          Code changed in jenkins
          User: klimas7
          Path:
          src/main/java/org/biouno/unochoice/CascadeChoiceParameter.java
          src/main/java/org/biouno/unochoice/ChoiceParameter.java
          src/main/resources/org/biouno/unochoice/CascadeChoiceParameter/config.jelly
          src/main/resources/org/biouno/unochoice/CascadeChoiceParameter/index.jelly
          src/main/resources/org/biouno/unochoice/ChoiceParameter/config.jelly
          src/main/resources/org/biouno/unochoice/ChoiceParameter/index.jelly
          src/main/resources/org/biouno/unochoice/stapler/unochoice/unochoice.js
          src/main/webapp/help-filterLengthParameters.html
          src/test/java/org/biouno/unochoice/TestAbstractUnoChoiceParameter.java
          src/test/java/org/biouno/unochoice/TestCascadeChoiceParameter.java
          src/test/java/org/biouno/unochoice/TestChoiceParameter.java
          src/test/java/org/biouno/unochoice/TestParametersOrder.java
          src/test/java/org/biouno/unochoice/TestPersistingParameters.java
          src/test/java/org/biouno/unochoice/issue34818/TestGlobalNodePropertiesScript.java
          src/test/js/unochoiceTest.js
          http://jenkins-ci.org/commit/active-choices-plugin/24113d54c3cd977d68b4ca0eabfe0d17e465f970
          Log:
          JENKINS-31625 Add configuration parameter, which defines, when filter must started work

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: klimas7 Path: src/main/java/org/biouno/unochoice/CascadeChoiceParameter.java src/main/java/org/biouno/unochoice/ChoiceParameter.java src/main/resources/org/biouno/unochoice/CascadeChoiceParameter/config.jelly src/main/resources/org/biouno/unochoice/CascadeChoiceParameter/index.jelly src/main/resources/org/biouno/unochoice/ChoiceParameter/config.jelly src/main/resources/org/biouno/unochoice/ChoiceParameter/index.jelly src/main/resources/org/biouno/unochoice/stapler/unochoice/unochoice.js src/main/webapp/help-filterLengthParameters.html src/test/java/org/biouno/unochoice/TestAbstractUnoChoiceParameter.java src/test/java/org/biouno/unochoice/TestCascadeChoiceParameter.java src/test/java/org/biouno/unochoice/TestChoiceParameter.java src/test/java/org/biouno/unochoice/TestParametersOrder.java src/test/java/org/biouno/unochoice/TestPersistingParameters.java src/test/java/org/biouno/unochoice/issue34818/TestGlobalNodePropertiesScript.java src/test/js/unochoiceTest.js http://jenkins-ci.org/commit/active-choices-plugin/24113d54c3cd977d68b4ca0eabfe0d17e465f970 Log: JENKINS-31625 Add configuration parameter, which defines, when filter must started work

          Code changed in jenkins
          User: Bruno P. Kinoshita
          Path:
          src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java
          src/main/java/org/biouno/unochoice/CascadeChoiceParameter.java
          src/main/java/org/biouno/unochoice/ChoiceParameter.java
          src/main/resources/org/biouno/unochoice/CascadeChoiceParameter/config.jelly
          src/main/resources/org/biouno/unochoice/ChoiceParameter/config.jelly
          src/main/resources/org/biouno/unochoice/stapler/unochoice/unochoice.js
          src/main/webapp/help-filterLengthParameters.html
          src/test/js/unochoiceTest.js
          http://jenkins-ci.org/commit/active-choices-plugin/e31a02d2f4f465604bc7317e7b970b1e5378ce52
          Log:
          JENKINS-31625 small adjustments to the new code to follow a few conventions

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bruno P. Kinoshita Path: src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java src/main/java/org/biouno/unochoice/CascadeChoiceParameter.java src/main/java/org/biouno/unochoice/ChoiceParameter.java src/main/resources/org/biouno/unochoice/CascadeChoiceParameter/config.jelly src/main/resources/org/biouno/unochoice/ChoiceParameter/config.jelly src/main/resources/org/biouno/unochoice/stapler/unochoice/unochoice.js src/main/webapp/help-filterLengthParameters.html src/test/js/unochoiceTest.js http://jenkins-ci.org/commit/active-choices-plugin/e31a02d2f4f465604bc7317e7b970b1e5378ce52 Log: JENKINS-31625 small adjustments to the new code to follow a few conventions

          Code changed in jenkins
          User: klimas7
          Path:
          src/test/java/org/biouno/unochoice/TestParametersOrder.java
          http://jenkins-ci.org/commit/active-choices-plugin/5a6528ad621bae37ef02c1471ab1a985fc785fb9
          Log:
          JENKINS-31625 fix test

          This closes #13

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: klimas7 Path: src/test/java/org/biouno/unochoice/TestParametersOrder.java http://jenkins-ci.org/commit/active-choices-plugin/5a6528ad621bae37ef02c1471ab1a985fc785fb9 Log: JENKINS-31625 fix test This closes #13

          Code changed in jenkins
          User: Bruno P. Kinoshita
          Path:
          src/main/java/org/biouno/unochoice/CascadeChoiceParameter.java
          src/main/java/org/biouno/unochoice/ChoiceParameter.java
          src/main/resources/org/biouno/unochoice/CascadeChoiceParameter/config.jelly
          src/main/resources/org/biouno/unochoice/ChoiceParameter/config.jelly
          src/main/webapp/help-filterLengthParameters.html
          http://jenkins-ci.org/commit/active-choices-plugin/874cfcf3c18e08629fcba87a8f7c3b29bb444ad6
          Log:
          JENKINS-31625 update javadoc headers and jelly text

          Compare: https://github.com/jenkinsci/active-choices-plugin/compare/8a97011b547c...874cfcf3c18e

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bruno P. Kinoshita Path: src/main/java/org/biouno/unochoice/CascadeChoiceParameter.java src/main/java/org/biouno/unochoice/ChoiceParameter.java src/main/resources/org/biouno/unochoice/CascadeChoiceParameter/config.jelly src/main/resources/org/biouno/unochoice/ChoiceParameter/config.jelly src/main/webapp/help-filterLengthParameters.html http://jenkins-ci.org/commit/active-choices-plugin/874cfcf3c18e08629fcba87a8f7c3b29bb444ad6 Log: JENKINS-31625 update javadoc headers and jelly text Compare: https://github.com/jenkinsci/active-choices-plugin/compare/8a97011b547c...874cfcf3c18e

          Pull request merged.

          Bruno P. Kinoshita added a comment - Pull request merged.

            kinow Bruno P. Kinoshita
            klimas7 Boguslaw Klimas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: