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

AbstractProject.doWipeOutWorkspace() should support SCM.processWorkspaceBeforeDeletion()

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: All

      Before a workspace is deleted by hudson.model.WorkspaceCleanupThread, it checks
      with the SCM for the job to see if it should be allowed to delete the workspace,
      by calling hudson.scm.SCM.processWorkspaceBeforeDeletion. I'm going to be adding
      an override of that method in the ClearCase plugin to remove the ClearCase view
      and then return true, so that we don't end up with a view still registered in
      ClearCase after its view storage, etc have been deleted.

      However, when "Wipe Out Workspace" is used, there is no check with the SCM
      first. The workspace is just deleted. I believe that doWipeOutWorkspace in
      AbstractProject should call processWorkspaceBeforeDeletion before deleting the
      workspace contents, and should only proceed if processWorkspaceBeforeDeletion
      returns true. This will give us the ability to remove the ClearCase view when
      "Wipe Out Workspace" is used, as well as the ability for SCMs to veto the
      deletion of the workspace.

          [JENKINS-3506] AbstractProject.doWipeOutWorkspace() should support SCM.processWorkspaceBeforeDeletion()

          Andrew Bayer added a comment -

          Modifying AbstractProject.doWipeOutWorkspace as I described earlier.

          Andrew Bayer added a comment - Modifying AbstractProject.doWipeOutWorkspace as I described earlier.

          Code changed in hudson
          User: : abayer
          Path:
          trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java
          trunk/hudson/main/core/src/main/resources/hudson/model/AbstractProject/wipeOutWorkspaceBlocked.jelly
          http://fisheye4.cenqua.com/changelog/hudson/?cs=18107
          Log:
          [FIXED JENKINS-3506] - doWipeOutWorkspace now calls SCM.processWorkspaceBeforeDeletion before deleting, same as WorkspaceCleanupThread and AbstractProject.processDelete. If processWorkspaceBeforeDeletion returns false, will redirect to explanatory page.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java trunk/hudson/main/core/src/main/resources/hudson/model/AbstractProject/wipeOutWorkspaceBlocked.jelly http://fisheye4.cenqua.com/changelog/hudson/?cs=18107 Log: [FIXED JENKINS-3506] - doWipeOutWorkspace now calls SCM.processWorkspaceBeforeDeletion before deleting, same as WorkspaceCleanupThread and AbstractProject.processDelete. If processWorkspaceBeforeDeletion returns false, will redirect to explanatory page.

          Code changed in hudson
          User: : abayer
          Path:
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=18109
          Log:
          JENKINS-3506

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=18109 Log: JENKINS-3506

            abayer Andrew Bayer
            abayer Andrew Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: