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

"Discard old builds" setting lost between 1.634 and 1.637

      Most of our jobs have "Discard old builds" enabled.

      We just noticed that if you look at the job configuration, "Discard old builds" is not set (ticked). However, if you look at the actual config.xml file, the setting is definitely there.

      This problem was noticed in Jenkins 1.637. When we reverted back to our previous version, 1.634, then the "Discard old builds" setting reappeared when you look at the job configuration.

      I don't know whether this is only a UI problem, or whether the discard action itself is also suppressed.

      Looking at the change log between 1.634 and 1.637, the only change that looks related is pull 1888.

          [JENKINS-31518] "Discard old builds" setting lost between 1.634 and 1.637

          Jesse Glick added a comment -

          I think I know what is wrong. “Only” a UI problem: if you configure and save the project with the setting unchecked, it may be lost, but if you do nothing builds will continue to be discarded as per previous configuration, or of course if you configure and save with the setting restored you should be fine too. Need to add some additional compatibility code to make the UI reflect the prior configuration.

          Jesse Glick added a comment - I think I know what is wrong. “Only” a UI problem: if you configure and save the project with the setting unchecked, it may be lost, but if you do nothing builds will continue to be discarded as per previous configuration, or of course if you configure and save with the setting restored you should be fine too. Need to add some additional compatibility code to make the UI reflect the prior configuration.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/model/Job.java
          test/src/test/java/jenkins/model/BuildDiscarderPropertyTest.java
          test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/buildDiscarderField.zip
          http://jenkins-ci.org/commit/jenkins/8a2849b441226ceaba282906af3fe3820fdfa03d
          Log:
          [FIXED JENKINS-31518] Translate Job.logRotator to BuildDiscarderProperty more seamlessly.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/Job.java test/src/test/java/jenkins/model/BuildDiscarderPropertyTest.java test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/buildDiscarderField.zip http://jenkins-ci.org/commit/jenkins/8a2849b441226ceaba282906af3fe3820fdfa03d Log: [FIXED JENKINS-31518] Translate Job.logRotator to BuildDiscarderProperty more seamlessly.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/model/Job.java
          test/src/test/groovy/jenkins/model/BuildDiscarderTest.groovy
          test/src/test/java/jenkins/model/BuildDiscarderPropertyTest.java
          test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/buildDiscarderField.zip
          test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/config.xml
          test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/jobs/foo/config.xml
          test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/config.xml
          test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/jobs/foo/config.xml
          http://jenkins-ci.org/commit/jenkins/d6b7c57dfb2417ed1ee8101d9135b543c111858b
          Log:
          JENKINS-31518 Merging #1910.

          Compare: https://github.com/jenkinsci/jenkins/compare/257004eff747...d6b7c57dfb24

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/Job.java test/src/test/groovy/jenkins/model/BuildDiscarderTest.groovy test/src/test/java/jenkins/model/BuildDiscarderPropertyTest.java test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/buildDiscarderField.zip test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/config.xml test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/jobs/foo/config.xml test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/config.xml test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/jobs/foo/config.xml http://jenkins-ci.org/commit/jenkins/d6b7c57dfb2417ed1ee8101d9135b543c111858b Log: JENKINS-31518 Merging #1910. Compare: https://github.com/jenkinsci/jenkins/compare/257004eff747...d6b7c57dfb24

          Jesse Glick added a comment -

          Ought to be fixed in the upcoming 1.639. Thanks for reporting and apologies for any disruption.

          Jesse Glick added a comment - Ought to be fixed in the upcoming 1.639. Thanks for reporting and apologies for any disruption.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #4367
          [FIXED JENKINS-31518] Translate Job.logRotator to BuildDiscarderProperty more seamlessly. (Revision 8a2849b441226ceaba282906af3fe3820fdfa03d)

          Result = UNSTABLE
          jesse glick : 8a2849b441226ceaba282906af3fe3820fdfa03d
          Files :

          • test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/buildDiscarderField.zip
          • test/src/test/java/jenkins/model/BuildDiscarderPropertyTest.java
          • core/src/main/java/hudson/model/Job.java

          dogfood added a comment - Integrated in jenkins_main_trunk #4367 [FIXED JENKINS-31518] Translate Job.logRotator to BuildDiscarderProperty more seamlessly. (Revision 8a2849b441226ceaba282906af3fe3820fdfa03d) Result = UNSTABLE jesse glick : 8a2849b441226ceaba282906af3fe3820fdfa03d Files : test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/buildDiscarderField.zip test/src/test/java/jenkins/model/BuildDiscarderPropertyTest.java core/src/main/java/hudson/model/Job.java

          >> Ought to be fixed in the upcoming 1.639. Thanks for reporting and apologies for any disruption.
          No worries, thanks for your prompt attention to this.

          Matthew Webber added a comment - >> Ought to be fixed in the upcoming 1.639. Thanks for reporting and apologies for any disruption. No worries, thanks for your prompt attention to this.

          To my understanding, the problem was introduced in 1.637[1] and therefore the fix does not need to be in 1.636 LTS.

          [1] https://github.com/jenkinsci/jenkins/commit/1cbbb23923d002dc6e676bfcaecbf8cbddb2e974

          Oliver Gondža added a comment - To my understanding, the problem was introduced in 1.637 [1] and therefore the fix does not need to be in 1.636 LTS. [1] https://github.com/jenkinsci/jenkins/commit/1cbbb23923d002dc6e676bfcaecbf8cbddb2e974

            jglick Jesse Glick
            mwebber Matthew Webber
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: