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

Jenkins master and agent configuration pages do not verify negative executor numbers

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • jenkins 2.86-SNAPSHOT

      TestCase #1:

      1. Go to /jenkins/configure page
      2. Set "# of executors" == any line, not a number
        Expected result: Validation error -  Not a number
        Actual result: No validation error
      3. Click Apply
        Expected result: Validation error - Not a number. New configuration was not saved.
        Actual result: Error page:
        net.sf.json.JSONException: JSONObject["numExecutors"] is not a number.
        	at net.sf.json.JSONObject.getDouble(JSONObject.java:1948)
        	at net.sf.json.JSONObject.getInt(JSONObject.java:1967)
        	at jenkins.model.MasterBuildConfiguration.configure(MasterBuildConfiguration.java:54)
        	at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:3715)
        	at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:3679)
                ..........
        

      ---------------------------------------------------

      TestCase #2:

      1. Go to /jenkins/configure page
      2. Set "# of executors" == any negative number
        Expected result == Actual result: Validation error -  Not a number
      3. Click Apply
        Expected result: Validation error - Not a number. New configuration was not saved.
        Actual result: New configuration saved.

          [JENKINS-47793] Jenkins master and agent configuration pages do not verify negative executor numbers

          Code changed in jenkins
          User: Kseniia Nenasheva
          Path:
          core/src/main/java/hudson/model/Computer.java
          core/src/main/java/jenkins/model/Jenkins.java
          core/src/main/java/jenkins/model/MasterBuildConfiguration.java
          core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure.jelly
          core/src/main/resources/jenkins/model/MasterBuildConfiguration/config.groovy
          core/src/main/resources/jenkins/model/Messages.properties
          war/src/main/webapp/scripts/hudson-behavior.js
          http://jenkins-ci.org/commit/jenkins/2eda7816e8007851ced3d618cd0fe42c78a486e2
          Log:
          JENKINS-47793 - Jenkins master and agent configuration pages do not verify negative executor numbers (#3141)

          • Fixed Regexps for number & positive-number
          • Progress saving
          • Fix for validation
          • bug fixing
          • bug fixing
          • Address comments
          • Address comments
          • Address comments from @jglick
          • Whitespace cleanup
          • Address comment for @jglick

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kseniia Nenasheva Path: core/src/main/java/hudson/model/Computer.java core/src/main/java/jenkins/model/Jenkins.java core/src/main/java/jenkins/model/MasterBuildConfiguration.java core/src/main/resources/jenkins/model/Jenkins/MasterComputer/configure.jelly core/src/main/resources/jenkins/model/MasterBuildConfiguration/config.groovy core/src/main/resources/jenkins/model/Messages.properties war/src/main/webapp/scripts/hudson-behavior.js http://jenkins-ci.org/commit/jenkins/2eda7816e8007851ced3d618cd0fe42c78a486e2 Log: JENKINS-47793 - Jenkins master and agent configuration pages do not verify negative executor numbers (#3141) Fixed Regexps for number & positive-number Progress saving Fix for validation bug fixing bug fixing Address comments Address comments Address comments from @jglick Whitespace cleanup Address comment for @jglick

          Fixed in PR #3141

          Kseniia Nenasheva added a comment - Fixed in PR #3141

          Isa Vilacides added a comment -

          Great to see this fix in place! I was going to do the same as I saw https://ci.jenkins.io/job/Core/job/acceptance-test-harness/job/master/56/testReport/core/FormValidationTest/validate/ failing due to this problem. Thanks ks_nenasheva!

          Isa Vilacides added a comment - Great to see this fix in place! I was going to do the same as I saw https://ci.jenkins.io/job/Core/job/acceptance-test-harness/job/master/56/testReport/core/FormValidationTest/validate/  failing due to this problem. Thanks ks_nenasheva !

          Stefan Drissen added a comment - The change in war/src/main/webapp/scripts/hudson-behavior.js  has introduced JENKINS-49520 .

          New PR #3292 contains bugfixes.

          Kseniia Nenasheva added a comment - New  PR #3292  contains bugfixes.

            ks_nenasheva Kseniia Nenasheva
            ks_nenasheva Kseniia Nenasheva
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: