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

Publish should use p4 reconcile -t to detect filetype changes

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • P4-Plugin 1.10.5

      When a file changes from being a symlink to a text file (using the same name) P4jenkins wont detect it properly because 'p4 reconcile' is not using the '-t' flag. This causes problems later in the job:

      P4 Task: reconcile files to changelist.
      ... p4 revert -k //jenkins-Windows10-SymlinkEdgeCases_WindowsOnly-9/...
       +... p4 sync -k //jenkins-Windows10-SymlinkEdgeCases_WindowsOnly-9/...
       +... p4 reconcile -e -a -f //jenkins-Windows10-SymlinkEdgeCases_WindowsOnly-9/.___
       +... p4 opened -Cjenkins-Windows10-SymlinkEdgeCases_WindowsOnly-9 //jenkins-Win___
       +duration: (24ms)
      
      P4 Task: publish files to Perforce.
      ... p4 change -i
       +... p4 change -o 2047
       +... pending change: 2047
      ... p4 reopen -c2047 //jenkins-Windows10-SymlinkEdgeCases_WindowsOnly-9/...
       +... p4 change -o 2047
       +... p4 opened -Cjenkins-Windows10-SymlinkEdgeCases_WindowsOnly-9 //jenkins-Win___
       +... ... edit //depot/SymlinkEdgeCases/Windows/SymLinks/windows_file_symlink
      ... submitting files
      ... p4 describe -s 2047
       +... p4 fixes -c2047
       +... p4 submit -i
       +
      Unable to publish workspace: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException: hudson.AbortException: P4JAVA: Error(s):
      Client side operation(s) failed.  Command aborted.
      
      Build step 'Perforce: Publish assets' marked build as failure
      Finished: FAILURE
      
      

      When you check the workspace 'windows_file_symlink' is opened for edit as type 'symlink'.

       

      Reproduction Steps:

      (1) Using a windows client create a target file ('a_target').

      (2) Create a symlink ('windows_file_symlink') to the target using 'mklink'.

      (3) Submit both files to the depot.

      (4) Create a Jenkins job that syncs both  files and then publishes changes from that workspace. Include a build step that is a batch file that replaces the symlink with the file contents. For example:

       

      dir /s
      attrib -r windows_file_symlink
      del windows_file_symlink
      copy a_target windows_file_symlink

      (7) Execute the Jenkins job.

       

       

       

       

       

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

              Created:
              Updated:
              Resolved: