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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      jenkins 2.86-SNAPSHOT
    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          scm_issue_link 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
          Show
          scm_issue_link 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
          Hide
          ks_nenasheva Kseniia Nenasheva added a comment -

          Fixed in PR #3141

          Show
          ks_nenasheva Kseniia Nenasheva added a comment - Fixed in PR #3141
          Hide
          vilacides 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 Kseniia Nenasheva!

          Show
          vilacides 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 Kseniia Nenasheva !
          Hide
          smd Stefan Drissen added a comment -
          Show
          smd Stefan Drissen added a comment - The change in war/src/main/webapp/scripts/hudson-behavior.js  has introduced JENKINS-49520 .
          Hide
          ks_nenasheva Kseniia Nenasheva added a comment -

          New PR #3292 contains bugfixes.

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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: