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

Builds forgotten after containing folder renamed

      1.509.2 plus cloudbees-folder: if a folder is renamed while a job in it has some builds loaded, and the RunMap is purged e.g. by garbage collection, the builds disappear. Reloading configuration or restarting Jenkins restores the build records, though not all permalinks (until new builds are run).

          [JENKINS-18694] Builds forgotten after containing folder renamed

          Jesse Glick added a comment -

          Seems like the same problem could arise without folders, by editing Jenkins.buildsDir, though this would presumably be rare.

          The most obvious solution would be to deprecate AbstractLazyLoadRunMap.<init>(File) as well as related methods/constructors, and replace it with a () -> File callback. Not sure if there would be a significant performance impact of recalculating getBuildDir() whenever dir is currently used.

          Alternately, have each AbstractProject listen for renames of its parent ItemGroup as well as changes in buildsDir, and rerun createBuildRunMap when that happens. Less expensive in the normal case, more expensive when a rename does occur.

          Jesse Glick added a comment - Seems like the same problem could arise without folders, by editing Jenkins.buildsDir , though this would presumably be rare. The most obvious solution would be to deprecate AbstractLazyLoadRunMap.<init>(File) as well as related methods/constructors, and replace it with a () -> File callback. Not sure if there would be a significant performance impact of recalculating getBuildDir() whenever dir is currently used. Alternately, have each AbstractProject listen for renames of its parent ItemGroup as well as changes in buildsDir , and rerun createBuildRunMap when that happens. Less expensive in the normal case, more expensive when a rename does occur.

          Jesse Glick added a comment -

          Not an lts-candidate since fix requires APIs not expected to be backported to the current LTS line.

          Jesse Glick added a comment - Not an lts-candidate since fix requires APIs not expected to be backported to the current LTS line.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/model/AbstractProject.java
          test/src/test/groovy/hudson/model/AbstractProjectTest.groovy
          http://jenkins-ci.org/commit/jenkins/cb623640ccd820ad0540efc3b50cc596626e43a2
          Log:
          [FIXED JENKINS-18694] Generalizing fix of JENKINS-18678 to include also rename of parent folders, taking advantage of JENKINS-18028 API.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/AbstractProject.java test/src/test/groovy/hudson/model/AbstractProjectTest.groovy http://jenkins-ci.org/commit/jenkins/cb623640ccd820ad0540efc3b50cc596626e43a2 Log: [FIXED JENKINS-18694] Generalizing fix of JENKINS-18678 to include also rename of parent folders, taking advantage of JENKINS-18028 API.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3160
          [FIXED JENKINS-18694] Generalizing fix of JENKINS-18678 to include also rename of parent folders, taking advantage of JENKINS-18028 API. (Revision cb623640ccd820ad0540efc3b50cc596626e43a2)

          Result = SUCCESS
          Jesse Glick : cb623640ccd820ad0540efc3b50cc596626e43a2
          Files :

          • test/src/test/groovy/hudson/model/AbstractProjectTest.groovy
          • core/src/main/java/hudson/model/AbstractProject.java
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #3160 [FIXED JENKINS-18694] Generalizing fix of JENKINS-18678 to include also rename of parent folders, taking advantage of JENKINS-18028 API. (Revision cb623640ccd820ad0540efc3b50cc596626e43a2) Result = SUCCESS Jesse Glick : cb623640ccd820ad0540efc3b50cc596626e43a2 Files : test/src/test/groovy/hudson/model/AbstractProjectTest.groovy core/src/main/java/hudson/model/AbstractProject.java changelog.html

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: