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

"DELETE generated files" does not work when the workspace has several view mappings

      In case you use perforce View Mappings to obtain several disjoint parts of your project as in:

      //repo/project/engine/... //jenkins${NODE_NAME}${JOB_NAME}${EXECUTOR_NUMBER}/engine/...

      //repo/project/libx/... //jenkins${NODE_NAME}${JOB_NAME}${EXECUTOR_NUMBER}/libx/...

      //repo/project/engine_test_files/... //jenkins${NODE_NAME}${JOB_NAME}${EXECUTOR_NUMBER}/engine_test_files/... 

       

      The option "DELETE generated files" does nothing (the files are not deleted).

      It might be useful to note that in such a case the p4 clean command also does not work when ran in the workspace root for example /var/jenkins/workspace/EngineTest. However it will succeed if ran independently in /var/jenkins/workspace/EngineTest/engine/var/jenkins/workspace/EngineTest/libx, and /var/jenkins/workspace/EngineTest/engine_test_files, nevertheless still leaving the root workspace folder not cleaned.**

          [JENKINS-67331] "DELETE generated files" does not work when the workspace has several view mappings

          Karl Wirth added a comment -

          Hi pcatvi - For me this seems to be working. For example I created a Freestyle project with 'Auto Clean and Sync'. My view is:

          //depot/sub/... //${P4_CLIENT}/sub/...
          //depot/project1/... //${P4_CLIENT}/project1/...
          //depot/Freestyle/main/...  //${P4_CLIENT}/main/...
          

          and in my build job I add files to the 'project1' subdirectory.

          When the job executes the next time I see these files being removed:

          P4 Task: cleaning workspace to match have list.
          ... p4 reconcile -f -w /filestoreSSD/Vagrant/Swarm/20.2/jenkins_node/root/workspace/Del___ -p4 reconcile -f -w /workspace/DeleteGeneratedFiles00865351/...
          
          //depot/project1/test2_2021-12-10T131512.txt#none - /workspace/DeleteGeneratedFiles00865351/project1/test2_2021-12-10T131512.txt deleted
          //depot/project1/test_2021-12-10T131512.txt#none - /workspace/DeleteGeneratedFiles00865351/project1/test_2021-12-10T131512.txt deleted
          

          If I don not tick "DELETE generated files" then the build assets do not get deleted.

          Would you like me to email you directly so I can get more information about your Perforce server, location of these files and the way you have your job setup?

          Karl Wirth added a comment - Hi pcatvi - For me this seems to be working. For example I created a Freestyle project with 'Auto Clean and Sync'. My view is: //depot/sub/... //${P4_CLIENT}/sub/... //depot/project1/... //${P4_CLIENT}/project1/... //depot/Freestyle/main/... //${P4_CLIENT}/main/... and in my build job I add files to the 'project1' subdirectory. When the job executes the next time I see these files being removed: P4 Task: cleaning workspace to match have list. ... p4 reconcile -f -w /filestoreSSD/Vagrant/Swarm/20.2/jenkins_node/root/workspace/Del___ -p4 reconcile -f -w /workspace/DeleteGeneratedFiles00865351/... //depot/project1/test2_2021-12-10T131512.txt#none - /workspace/DeleteGeneratedFiles00865351/project1/test2_2021-12-10T131512.txt deleted //depot/project1/test_2021-12-10T131512.txt#none - /workspace/DeleteGeneratedFiles00865351/project1/test_2021-12-10T131512.txt deleted If I don not tick "DELETE generated files" then the build assets do not get deleted. Would you like me to email you directly so I can get more information about your Perforce server, location of these files and the way you have your job setup?

            Unassigned Unassigned
            pcatvi Paweł Cichocki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: