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

new option to delete perforce client view & workspace on job deletion

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • p4-plugin
    • O/S: RedHat Enterprise Linux Server 6.4 (Santiago)
      JRE: Java(TM) SE Runtime Environment 1.8.0_60-b27
      p4-plugin: 1.3.5
      running jenkins directly

      Could we please have two checkboxes on the options for the perforce plugin for a job. One would be 'delete client on job deletion' and the other would be 'delete client root on job deletion'.

      The first would delete the client workspace in Jenkins ie 'p4 client -d <ws_name>'

      The second would delete the client workspace root directory ie all the checked-out files.

      Perhaps the global plugin configuration could have two further checkboxes so that these could default to 'on'?

      Having this feature would facilitate admin on our jenkins servers.

      I hope this feature is seen as potentially useful to others.

          [JENKINS-32454] new option to delete perforce client view & workspace on job deletion

          Patrick Byrne created issue -
          Andrew Barnish made changes -
          Assignee New: Paul DeMarco [ paul ]
          Patrick Byrne made changes -
          Description Original: Could we please have two checkboxes on the options for the perforce plugin for a job. One would be 'delete client on job deletion' and the other would be 'delete client root on job deletion'.

          The first would delete the client workspace in Jenkins ie 'p4 client -f <ws_name>'

          The second would delete the client workspace root directory ie all the checked-out files.

          Perhaps the global plugin configuration could have two further checkboxes so that these could default to 'on'?

          Having this feature would facilitate admin on our jenkins servers.

          I hope this feature is seen as potentially useful to others.
          New: Could we please have two checkboxes on the options for the perforce plugin for a job. One would be 'delete client on job deletion' and the other would be 'delete client root on job deletion'.

          The first would delete the client workspace in Jenkins ie 'p4 client -d <ws_name>'

          The second would delete the client workspace root directory ie all the checked-out files.

          Perhaps the global plugin configuration could have two further checkboxes so that these could default to 'on'?

          Having this feature would facilitate admin on our jenkins servers.

          I hope this feature is seen as potentially useful to others.
          Andrew Barnish made changes -
          Assignee Original: Paul DeMarco [ paul ] New: Paul Allen [ p4paul ]
          Andrew Barnish made changes -
          Environment Original: O/S: RedHat Enterprise Linux Server 6.4 (Santiago)
          JRE: Java(TM) SE Runtime Environment 1.8.0_60-b27
          p4-plugin: 1.3.6-SNAPSHOT (private-1843330f-pallen)
          running jenkins directly
          New: O/S: RedHat Enterprise Linux Server 6.4 (Santiago)
          JRE: Java(TM) SE Runtime Environment 1.8.0_60-b27
          p4-plugin: 1.3.5
          running jenkins directly

          Paul Allen added a comment -

          The two checkboxes may need to be global (under the Perforce configuration page not the Job page).

          It would seem logical to have a common behaviour for workspace cleanup, rather than setting at the time you create the Jenkins Job?

          Still I would need to find out how to hook into the Jenkins Job deletion event.

          Paul Allen added a comment - The two checkboxes may need to be global (under the Perforce configuration page not the Job page). It would seem logical to have a common behaviour for workspace cleanup, rather than setting at the time you create the Jenkins Job? Still I would need to find out how to hook into the Jenkins Job deletion event.

          Patrick Byrne added a comment -

          That seems entirely reasonable to me: our many users are not going to bother setting checkboxes themselves and from my POV it would be much better to manage this centrally.

          Thanks for your attention.

          Patrick Byrne added a comment - That seems entirely reasonable to me: our many users are not going to bother setting checkboxes themselves and from my POV it would be much better to manage this centrally. Thanks for your attention.

          Code changed in jenkins
          User: Paul Allen
          Path:
          src/main/java/org/jenkinsci/plugins/p4/PerforceScm.java
          src/main/java/org/jenkinsci/plugins/p4/client/ConnectionHelper.java
          src/main/resources/org/jenkinsci/plugins/p4/PerforceScm/global.jelly
          http://jenkins-ci.org/commit/p4-plugin/55480ee7307e04f0a59f7f4a07dec865a0aa5b1a
          Log:
          Delete client workspace and files on a delete Jenkins Job

          Global Perforce options for delete files and/or delete client.
          JENKINS-32454

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Paul Allen Path: src/main/java/org/jenkinsci/plugins/p4/PerforceScm.java src/main/java/org/jenkinsci/plugins/p4/client/ConnectionHelper.java src/main/resources/org/jenkinsci/plugins/p4/PerforceScm/global.jelly http://jenkins-ci.org/commit/p4-plugin/55480ee7307e04f0a59f7f4a07dec865a0aa5b1a Log: Delete client workspace and files on a delete Jenkins Job Global Perforce options for delete files and/or delete client. JENKINS-32454
          Paul Allen made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

          This change does not appear to be deleting the workspace files (it is only deleting the perforce client) even though we have both checkboxes in the global configuration ticked.
          We do have a custom "Workspace Root Directory" set in the advanced global configuration. Could that be the reason why it does not work?

          Andrew Barnish added a comment - This change does not appear to be deleting the workspace files (it is only deleting the perforce client) even though we have both checkboxes in the global configuration ticked. We do have a custom "Workspace Root Directory" set in the advanced global configuration. Could that be the reason why it does not work?

            p4paul Paul Allen
            pjlbyrne Patrick Byrne
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: