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

Use p4 changes @date instead of @change when finding CL to sync

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin
    • 1.10.3

      Background

      This is a side effect of the way P4-Plugin now correctly only builds code that existed when the job was triggered.

      Imagine the following stream:

       

      Steam: //helix/dev
      Paths:   share ...   
         import+ imports/bin/... //builds-server/main/bin/... # A REMOTE DEPOT PATH
         import+ doc/html/... //doc/main/html/... # A LOCAL DEPOT PATH

      P4-Jenkins  runs 'p4 changes' to determine the correct changelist to build and then 'p4 sync' to get the code at that changelist.

      In the above scenario 'p4 changes -m1 ws'  will only return the highest changelist for the local depot paths '//helix/dev/...' and '//doc/main/html/...'.

      Problem

      This is fine unless the '//builds-server/main/bin/...' has been updated after the other two paths. In that case we will not sync any newer changes from the remote depot until a local depot change occurs even if you click 'Build Now'. This is because we are running that 'p4 changes' first to figure out what to build.

      Solution

      A possible solution would be to run 'p4 changes -m1 //...' against the whole server and then get the date for the highest changelist. Then sync workspace to the server date and time when the job was triggered e.g.

      p4 sync //ws/...@2019/08/15:02:07:21 

      NOTE: I understand this an edge case but it has impacted DS. Talk to me if you need more info.

       

       

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

              Created:
              Updated: