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

Add '-f' to 'p4 client -d' with cleanup/p4cleanup for pending CL cleanup

      Need an option to add '-f' to 'p4 client -d' but make it clear that the option requires the Perforce user to have 'admin' level access. This is to allow clients with empty pending changelists to be deleted.

      From doc:

       

          $ p4 help client
          ...cut...
          The -d flag deletes the specified spec, as long as the client
          workspace has no opened files or pending changes.  (See 'p4 help
          opened'.) The -f flag forces the delete. 
          ...cut...
          The -f flag can force the updating of locked clients; normally
          locked clients can only be modified by their owner.  -f also allows
          the last modified date to be set.  The -f flag requires 'admin'
          access granted by 'p4 protect'. 

       

       

      Reproduction Steps:

      • On Manage Jenkins > Configure System tick 'Delete Perforce client'.
      • Create a freestyle job that syncs files.
      • Create an 'execute Shell'  build step that creates a changelist.
      p4 -u $P4_USER -c $P4_CLIENT -p $P4_PORT --field Description=New_CL change -o | p4 -u $P4_USER -c $P4_CLIENT -p $P4_PORT change -i 
      • Select the Post-build Action 'Delete Client' and tick 'Delete Client'
      • Run job.
      • Client not deleted and error seen:
      P4 Task: remove client: jenkins-built-in-DeleteWorkspaceFreestyle-2
      ... p4 client -d jenkins-built-in-DeleteWorkspaceFreestyle-2 -p4 client -d jenkins-built-in-DeleteWorkspaceFreestyle-2
      
      Client 'jenkins-built-in-DeleteWorkspaceFreestyle-2' has pending changes. To delete the client, delete any pending changes first. An administrator may specify -f to force the delete of another user's client.
      
      Finished: SUCCESS 

       

       

          [JENKINS-73498] Add '-f' to 'p4 client -d' with cleanup/p4cleanup for pending CL cleanup

          Karl Wirth created issue -
          Karl Wirth made changes -
          Description Original: I am creating new workspace using template workspace.

          Template workspace is locked. So created workspace is also locked.

          In this situation, How to delete workspace?

          I used "cleanup true" in pipeline. I think I have to change workspace's option every time or you can provide cleanup true with force option.
          New: Need an option to add '-f' to 'p4 client -d' but make it clear that the option requires the Perforce user to have 'admin' level access.

           

          +*Reproduction Steps:*+
           * On Manage Jenkins > Configure System tick 'Delete Perforce client'.
           * Create a freestyle job that syncs files.
           * Create an 'execute Shell'  build step that creates a changelist.

           
          {code:java}
          p4 -u $P4_USER -c $P4_CLIENT -p $P4_PORT --field Description=New_CL change -o | p4 -u $P4_USER -c $P4_CLIENT -p $P4_PORT change -i {code}
           * Select the Post-build Action 'Delete Client' and tick 'Delete Client'

           
           * Run job.
           * Client not deleted and error seen:

           
          {code:java}
          P4 Task: remove client: jenkins-built-in-DeleteWorkspaceFreestyle-2
          ... p4 client -d jenkins-built-in-DeleteWorkspaceFreestyle-2 -p4 client -d jenkins-built-in-DeleteWorkspaceFreestyle-2

          Client 'jenkins-built-in-DeleteWorkspaceFreestyle-2' has pending changes. To delete the client, delete any pending changes first. An administrator may specify -f to force the delete of another user's client.

          Finished: SUCCESS {code}
           

           
          Karl Wirth made changes -
          Priority Original: Major [ 3 ] New: Minor [ 4 ]
          Karl Wirth made changes -
          Labels Original: P4_VERIFY New: P4_A P4_VERIFY
          Karl Wirth made changes -
          Description Original: Need an option to add '-f' to 'p4 client -d' but make it clear that the option requires the Perforce user to have 'admin' level access.

           

          +*Reproduction Steps:*+
           * On Manage Jenkins > Configure System tick 'Delete Perforce client'.
           * Create a freestyle job that syncs files.
           * Create an 'execute Shell'  build step that creates a changelist.

           
          {code:java}
          p4 -u $P4_USER -c $P4_CLIENT -p $P4_PORT --field Description=New_CL change -o | p4 -u $P4_USER -c $P4_CLIENT -p $P4_PORT change -i {code}
           * Select the Post-build Action 'Delete Client' and tick 'Delete Client'

           
           * Run job.
           * Client not deleted and error seen:

           
          {code:java}
          P4 Task: remove client: jenkins-built-in-DeleteWorkspaceFreestyle-2
          ... p4 client -d jenkins-built-in-DeleteWorkspaceFreestyle-2 -p4 client -d jenkins-built-in-DeleteWorkspaceFreestyle-2

          Client 'jenkins-built-in-DeleteWorkspaceFreestyle-2' has pending changes. To delete the client, delete any pending changes first. An administrator may specify -f to force the delete of another user's client.

          Finished: SUCCESS {code}
           

           
          New: Need an option to add '-f' to 'p4 client -d' but make it clear that the option requires the Perforce user to have 'admin' level access. This is to allow clients with empty pending changelists to be deleted.

          From doc:

           
          {code:java}
              $ p4 help client
              ...cut...
              The -d flag deletes the specified spec, as long as the client
              workspace has no opened files or pending changes.  (See 'p4 help
              opened'.) The -f flag forces the delete. 
              ...cut...
              The -f flag can force the updating of locked clients; normally
              locked clients can only be modified by their owner.  -f also allows
              the last modified date to be set.  The -f flag requires 'admin'
              access granted by 'p4 protect'. {code}
           

           

          +*Reproduction Steps:*+
           * On Manage Jenkins > Configure System tick 'Delete Perforce client'.
           * Create a freestyle job that syncs files.
           * Create an 'execute Shell'  build step that creates a changelist.

          {code:java}
          p4 -u $P4_USER -c $P4_CLIENT -p $P4_PORT --field Description=New_CL change -o | p4 -u $P4_USER -c $P4_CLIENT -p $P4_PORT change -i {code}
           * Select the Post-build Action 'Delete Client' and tick 'Delete Client'
           * Run job.
           * Client not deleted and error seen:

          {code:java}
          P4 Task: remove client: jenkins-built-in-DeleteWorkspaceFreestyle-2
          ... p4 client -d jenkins-built-in-DeleteWorkspaceFreestyle-2 -p4 client -d jenkins-built-in-DeleteWorkspaceFreestyle-2

          Client 'jenkins-built-in-DeleteWorkspaceFreestyle-2' has pending changes. To delete the client, delete any pending changes first. An administrator may specify -f to force the delete of another user's client.

          Finished: SUCCESS {code}
           

           
          Karl Wirth made changes -
          Summary Original: CLONE - Add '-f' to 'p4 client -d' with cleanup/p4cleanup New: Add '-f' to 'p4 client -d' with cleanup/p4cleanup
          Karl Wirth made changes -
          Summary Original: Add '-f' to 'p4 client -d' with cleanup/p4cleanup New: Add '-f' to 'p4 client -d' with cleanup/p4cleanup for pending CL cleanup

            Unassigned Unassigned
            p4karl Karl Wirth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: