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

P4 plugin reports incorrect changes on changes page when using populate:previewOnly

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • p4-plugin
    • None
    • P4 Plugin 1.11.4

      When using previewOnly or FlushOnly for populate,

      p4-plugin uses "p4 counter changes" and grabs the latest change number on the server.  This may not reflect what changelist actually syncd on the client.

      What p4-plugin does:

      p4 counter change
      p4 changes -m1 -ssubmitted //jenkins_test2_453/...@55287791

      Instead it should use :

      p4 changes -m1 -ssubmitted //jenkins_test2_453/...#have 

       

       

       

      To acquire the 

          [JENKINS-65982] P4 plugin reports incorrect changes on changes page when using populate:previewOnly

          Karl Wirth added a comment -

          Thanks for letting us know. I will test and let you know what I find.

          Karl Wirth added a comment - Thanks for letting us know. I will test and let you know what I find.

          Karl Wirth added a comment -

          Hi atwatsoniii ,

          I'm probably missing something here but when I run the preview job it run's p4 counters and p4 changes to find the highest CL that applies to that workspace view:

          p4 counter change
          
          ... p4 changes -m1 -ssubmitted //jenkins-master-PreviewOnlyChangeReporting-___ -
          p4 changes -m1 -ssubmitted //jenkins-master-PreviewOnlyChangeReporting-0/...@220
          
          Change 217 on 2021/06/25 by super@test_ws 'Submit of ./f217
          

          Then does the preview sync to that change:

          P4 Task: syncing files at change: 217
          ... p4 sync -n /var/lib/jenkins/workspace/PreviewOnlyChangeReporting6/...@21___ -
          p4 sync -n /var/lib/jenkins/workspace/PreviewOnlyChangeReporting/...@217
          

          Then reports changes bounded by the last sync and that change it synced to:

          P4: saving built changes.
          Found last change 215 on syncID jenkins-NODE_NAME-PreviewOnlyChangeReporting-EXECUTOR_NUMBER
          ... p4 login -s +
          ... p4 client -o jenkins-master-PreviewOnlyChangeReporting-0 +
          ... p4 info +
          ... p4 info +
          ... p4 client -o jenkins-master-PreviewOnlyChangeReporting-0 +
          ... p4 changes -m20 //jenkins-master-PreviewOnlyChangeReporting-0/...@215,2___ -
          p4 changes -m20 //jenkins-master-PreviewOnlyChangeReporting-0/...@215,217
          

          Note - When I ran this test 220 was the highest CL in the server.

          Do you have an example console log where the change it syncs to and the one it reports on are different? If yes is this a stream with imports or a complicated view? Please provide the fullconsole log (note - if it contains sensitive data you can send it to support@perforce.com).

          Also note that I tested this on 1.11.5 but the only difference I can see in the code is the security fix.

          Thanks in advance,

          Karl

           

          Karl Wirth added a comment - Hi atwatsoniii , I'm probably missing something here but when I run the preview job it run's p4 counters and p4 changes to find the highest CL that applies to that workspace view: p4 counter change ... p4 changes -m1 -ssubmitted //jenkins-master-PreviewOnlyChangeReporting-___ - p4 changes -m1 -ssubmitted //jenkins-master-PreviewOnlyChangeReporting-0/...@220 Change 217 on 2021/06/25 by super @test_ws 'Submit of ./f217 Then does the preview sync to that change: P4 Task: syncing files at change: 217 ... p4 sync -n / var /lib/jenkins/workspace/PreviewOnlyChangeReporting6/...@21___ - p4 sync -n / var /lib/jenkins/workspace/PreviewOnlyChangeReporting/...@217 Then reports changes bounded by the last sync and that change it synced to: P4: saving built changes. Found last change 215 on syncID jenkins-NODE_NAME-PreviewOnlyChangeReporting-EXECUTOR_NUMBER ... p4 login -s + ... p4 client -o jenkins-master-PreviewOnlyChangeReporting-0 + ... p4 info + ... p4 info + ... p4 client -o jenkins-master-PreviewOnlyChangeReporting-0 + ... p4 changes -m20 //jenkins-master-PreviewOnlyChangeReporting-0/...@215,2___ - p4 changes -m20 //jenkins-master-PreviewOnlyChangeReporting-0/...@215,217 Note - When I ran this test 220 was the highest CL in the server. Do you have an example console log where the change it syncs to and the one it reports on are different? If yes is this a stream with imports or a complicated view? Please provide the fullconsole log (note - if it contains sensitive data you can send it to support@perforce.com). Also note that I tested this on 1.11.5 but the only difference I can see in the code is the security fix. Thanks in advance, Karl  

          Al Watson added a comment -

          You've missed the point.  I don't think you should be reporting whatever the highest CL which is on the server.  I want you to report the highest CL which is actually *in the client*

          Al Watson added a comment - You've missed the point.  I don't think you should be reporting whatever the highest CL which is on the server.  I want you to report the highest CL which is actually * in the client *

          Al Watson added a comment -

          For preview only, you should report:  

          p4 changes -m 1 //<path>...#have  (or equivalent)

          instead of 

          p4 counter changes

           

          You can try this on any perforce client to see the difference.

          Al Watson added a comment - For preview only, you should report:   p4 changes -m 1 //<path>...#have  (or equivalent) instead of  p4 counter changes   You can try this on any perforce client to see the difference.

          Karl Wirth added a comment -

          Hi atwatsoniii -Please raise a support call with support@perforce.com so we can discuss this further.

          We dont use the result of 'p4 counters' in the reporting. We use it to find the highest CL in the workspace to do the changelist reporting in my testing:

          # Find highest in server:
          p4 counter change
          Result = 220
          
          # Find highest change in workspace:
          p4 changes -m1 -ssubmitted //jenkins-master-PreviewOnlyChangeReporting-0/...@220
          Result = 217
          
          # Run pretend (preview only) sync against 217
          p4 -c jenkins-master-PreviewOnlyChangeReporting-0 sync -n /var/lib/jenkins/workspace/PreviewOnlyChangeReporting/...@217
          
          # There is no HAVE list because it was a sync -n so do do a pretend changes //WS/...#have (bound by 217)
          p4 changes -m20 //jenkins-master-PreviewOnlyChangeReporting-0/...@215,217
          

          The code assumes there is no #have (it's doing a sync -n) so nothing in the client.  It is reporting on highest in the client view which is subtly different.  Are you possibly saying that you have files synced in the same workspace?

           

          Karl Wirth added a comment - Hi atwatsoniii -Please raise a support call with support@perforce.com so we can discuss this further. We dont use the result of 'p4 counters' in the reporting. We use it to find the highest CL in the workspace to do the changelist reporting in my testing: # Find highest in server: p4 counter change Result = 220 # Find highest change in workspace: p4 changes -m1 -ssubmitted //jenkins-master-PreviewOnlyChangeReporting-0/...@220 Result = 217 # Run pretend (preview only) sync against 217 p4 -c jenkins-master-PreviewOnlyChangeReporting-0 sync -n / var /lib/jenkins/workspace/PreviewOnlyChangeReporting/...@217 # There is no HAVE list because it was a sync -n so do do a pretend changes //WS/...#have (bound by 217) p4 changes -m20 //jenkins-master-PreviewOnlyChangeReporting-0/...@215,217 The code assumes there is no #have (it's doing a sync -n) so nothing in the client.  It is reporting on highest in the client view which is subtly different.  Are you possibly saying that you have files synced in the same workspace?  

          Al Watson added a comment -

          "The code assumes there is no #have (it's doing a sync -n) so nothing in the client.  It is reporting on highest in the client view which is subtly different.  Are you possibly saying that you have files synced in the same workspace?"

           

          Yes, the workspace has been setup outside of jenkins, and I just want the changes page to reflect the changelist that client was sync'd to.   I don't want it to report the highest change available in the clientspec, as is reported currently.  

           

          If this is not what previewOnly was meant for, then I would request to add another option to just use "p4 changes -m 1 //<path>...#have" for the changes page.

           

           

           

           

          Al Watson added a comment - "The code assumes there is no #have (it's doing a sync -n) so nothing in the client.  It is reporting on highest in the client view which is subtly different.  Are you possibly saying that you have files synced in the same workspace?"   Yes, the workspace has been setup outside of jenkins, and I just want the changes page to reflect the changelist that client was sync'd to.   I don't want it to report the highest change available in the clientspec, as is reported currently.     If this is not what previewOnly was meant for, then I would request to add another option to just use "p4 changes -m 1 //<path>...#have" for the changes page.        

          Al Watson added a comment -

          Ping.  Can you add an option that works for a pre-populated workspace?

          Al Watson added a comment - Ping.  Can you add an option that works for a pre-populated workspace?

            p4karl Karl Wirth
            atwatsoniii Al Watson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: