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

Jobs should have built in option to never clean workspace

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Not A Defect
    • Major
    • core
    • None
    • Windows 7 x64

    Description

      I am relatively new to Jenkins and was recently working on a new build configuration for my company when I discovered that Jenkins has a very odd feature I have never noticed before: it automatically tries to delete the working folder (ie: workspace) before performing the job operations. At best, this is an annoying feature and at worse it is a feature that can have extreme consequences if the content being deleted is irreplaceable.

      For example, the build configuration I was configuring was essentially an automation task that monitors a folder in SVN for changes and updates the local working folder on the build box with one or more custom script files required by our build infrastructure. Further, because these configuration scripts are global we need to store them in one of several different places including c:\Program Data, c:\users\local_build_user, etc. Given that these folders are system folders, often co-existing with other system critical files, you can imagine my surprise when Jenkins just magically started deleting anything and everything in these folders without my approval.

      So, on the one hand, I am very surprised that Jenkins would automatically delete anything without the sys admin explicitly telling the system to do so. In this vein I would suggest that it would be preferable to remove all such "automatic cleanup logic" from the application.

      On the other hand, I suspect this logic was put in place for some reason, and may be critical the behavior of the application. This being the case there should, at the very least, be an option on the configuration page for each job to turn off such logic in situations like mine.

      So, to summarize my build configuration, I have the following job parameters:

      • Use custom workspace: c:\
      • Source code management: Subversion
        • Repo URL: http:
          path_to_my_repo
        • Local module directory: users\local_builder_profile
        • Checkout strategy: Use 'svn update' as much as possible
      • Build triggers: Poll SCM
        • Schedule: H * * * *

      Then, as soon as I try to run this job for the first time Jenkins attempts to delete my entire user profile folder.

      It is also worth noting that I currently have a trivial configuration of Jenkins on one build PC (no distributed builds, agents, etc.) with minimal changes to the host OS to allow Jenkins to work.

      Also, I am using the latest version of Jenkins (1.512 at the moment).

      Finally, I did come across several other defects in your system related to this cleanup task, most notably JENKINS-3841. In the comment thread there in they mention the hudson.model.WorkspaceCleanupThread.disabled custom property as well. I have tried setting this to true but Jenkins' behavior seems to be unaffected.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              leedega Kevin Phillips
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: