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

Log rotator: empty values decorated with 'Not a positive integer'

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • Windows 2012R2 x64
      JRE 1.8_0161 x64
      Jenkins 2.105

      Since (I think) the last update from 2.104 to 2.105 something has changed in validation of integer fields resulting in the 'discard builds' section of a freestyle job showing validation warning 'Not a positive integer'.

      Empty values are (and always have been) stored as -1.

      <logRotator class="hudson.tasks.LogRotator">
        <daysToKeep>-1</daysToKeep>
        <numToKeep>20</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </logRotator>
      

       

      Changing the value to a positive integer clears the validation warning, but emptying it returns the warning.

          [JENKINS-49520] Log rotator: empty values decorated with 'Not a positive integer'

          Stefan Drissen created issue -
          Stefan Drissen made changes -
          Description Original: Since (I think) the last update from 2.104 to 2.105 something has changed in validation of integer fields resulting in the 'discard builds' section of a freestyle job showing validation warning 'Not a positive integer'.

          !image-2018-02-13-00-14-48-787.png!


          Empty values are stored as -1.

          Changing the value to a positive integer clears the validation warning, but emptying it returns the warning.
          New: Since (I think) the last update from 2.104 to 2.105 something has changed in validation of integer fields resulting in the 'discard builds' section of a freestyle job showing validation warning 'Not a positive integer'.

          !image-2018-02-13-00-14-48-787.png!

          Empty values are (and always have been) stored as -1.

          {code}
          <logRotator class="hudson.tasks.LogRotator">
            <daysToKeep>-1</daysToKeep>
            <numToKeep>20</numToKeep>
            <artifactDaysToKeep>-1</artifactDaysToKeep>
            <artifactNumToKeep>-1</artifactNumToKeep>
          </logRotator>
          {code} 

          Changing the value to a positive integer clears the validation warning, but emptying it returns the warning.
          Stefan Drissen made changes -
          Description Original: Since (I think) the last update from 2.104 to 2.105 something has changed in validation of integer fields resulting in the 'discard builds' section of a freestyle job showing validation warning 'Not a positive integer'.

          !image-2018-02-13-00-14-48-787.png!

          Empty values are (and always have been) stored as -1.

          {code}
          <logRotator class="hudson.tasks.LogRotator">
            <daysToKeep>-1</daysToKeep>
            <numToKeep>20</numToKeep>
            <artifactDaysToKeep>-1</artifactDaysToKeep>
            <artifactNumToKeep>-1</artifactNumToKeep>
          </logRotator>
          {code} 

          Changing the value to a positive integer clears the validation warning, but emptying it returns the warning.
          New: Since (I think) the last update from 2.104 to 2.105 something has changed in validation of integer fields resulting in the 'discard builds' section of a freestyle job showing validation warning 'Not a positive integer'.

          Probably a result of changes made in JENKINS-47793

          !image-2018-02-13-00-14-48-787.png!

          Empty values are (and always have been) stored as -1.
          {code:java}
          <logRotator class="hudson.tasks.LogRotator">
            <daysToKeep>-1</daysToKeep>
            <numToKeep>20</numToKeep>
            <artifactDaysToKeep>-1</artifactDaysToKeep>
            <artifactNumToKeep>-1</artifactNumToKeep>
          </logRotator>
          {code}
           

          Changing the value to a positive integer clears the validation warning, but emptying it returns the warning.
          Stefan Drissen made changes -
          Description Original: Since (I think) the last update from 2.104 to 2.105 something has changed in validation of integer fields resulting in the 'discard builds' section of a freestyle job showing validation warning 'Not a positive integer'.

          Probably a result of changes made in JENKINS-47793

          !image-2018-02-13-00-14-48-787.png!

          Empty values are (and always have been) stored as -1.
          {code:java}
          <logRotator class="hudson.tasks.LogRotator">
            <daysToKeep>-1</daysToKeep>
            <numToKeep>20</numToKeep>
            <artifactDaysToKeep>-1</artifactDaysToKeep>
            <artifactNumToKeep>-1</artifactNumToKeep>
          </logRotator>
          {code}
           

          Changing the value to a positive integer clears the validation warning, but emptying it returns the warning.
          New: Since (I think) the last update from 2.104 to 2.105 something has changed in validation of integer fields resulting in the 'discard builds' section of a freestyle job showing validation warning 'Not a positive integer'.

          !image-2018-02-13-00-14-48-787.png!

          Empty values are (and always have been) stored as -1.
          {code:java}
          <logRotator class="hudson.tasks.LogRotator">
            <daysToKeep>-1</daysToKeep>
            <numToKeep>20</numToKeep>
            <artifactDaysToKeep>-1</artifactDaysToKeep>
            <artifactNumToKeep>-1</artifactNumToKeep>
          </logRotator>
          {code}
           

          Changing the value to a positive integer clears the validation warning, but emptying it returns the warning.

          Stefan Drissen added a comment - - edited

          I am fairly sure that JENKINS-47793 introduced the issue, the pipe (|) was removed rendering blank an invalid value:

          https://github.com/ksenia-nenasheva/jenkins/commit/f8e3526244af53178439b9a73e1297cf3f7f5ce4#diff-da911448bbb85d374f604da9c1e00136

           

          Stefan Drissen added a comment - - edited I am fairly sure that JENKINS-47793 introduced the issue, the pipe (|) was removed rendering blank an invalid value: https://github.com/ksenia-nenasheva/jenkins/commit/f8e3526244af53178439b9a73e1297cf3f7f5ce4#diff-da911448bbb85d374f604da9c1e00136  
          Kseniia Nenasheva made changes -
          Assignee New: Kseniia Nenasheva [ ks_nenasheva ]
          Kseniia Nenasheva made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          smd Thanks!
          Fixed in PR #3292

          Kseniia Nenasheva added a comment - smd Thanks! Fixed in PR #3292
          Kseniia Nenasheva made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Oleg Nenashev made changes -
          Labels New: lts-candidate regression

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

              Created:
              Updated:
              Resolved: