-
Bug
-
Resolution: Fixed
-
Critical
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).
- is related to
-
JENKINS-18678 Builds disappear some time after renaming job
-
- Resolved
-
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.