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

changeView option ignored, not added to client spec

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      Jenkins v2.175
      p4-plugin v1.9.7
      Perforce Server: P4D/LINUX26X86_64/2017.1/1559660 (2017/08/31)
    • Similar Issues:

      Description

      Using the following checkout step, the changeView option is ignored. It is not added to the client spec and files from later changelists are synced to the workspace:

      Stage('Test') {
          checkout([
              $class: 'PerforceScm',
              credential: 'mycredentials',
              populate: [
                  $class: 'ForceCleanImpl',
                  have: true,
                  pin:  '',
                  quiet: true,
                  parallel: [
                      enable: false,
                      minbytes: '1024',
                      minfiles: '1',
                      path: '/usr/bin/p4',
                      threads: '4'
                  ]
              ],
              workspace: [
                  $class: 'ManualWorkspaceImpl',
                  charset: 'none',
                  name: 'jenkins-mynode-testing',
                  syncID: 'jenkins-mynode-testing',
                  pinHost: false,
                  spec: [
                      allwrite: true,
                      backup: false,
                      clobber: false,
                      compress: false,
                      line: 'LOCAL',
                      locked: false,
                      modtime: false,
                      rmdir: false,
                      serverID: '',
                      streamName: '',
                      type: 'WRITABLE',
                      view: '//depot/mypath/... //jenkins-mynode-testing/...',
                      changeView: '//depot/mypath/...@1185739'
                  ]
              ]
          ])
      }

      Console output:

      Started by user Aaron Miller
      Replayed #12
      Running in Durability level: PERFORMANCE_OPTIMIZED
      Loading library sharedlibrary@now
      (p4):cmd:... p4 changes -m1 //depot/jenkins-path/sh___
      p4 changes -m1 //depot/jenkins-path/shared/.../...@now
      
      Change 1187280 on 2019/05/04 by amiller@am_ws_kilo 'Remove debug code
      
      reviewed by:'
      (p4):stop:3
      (p4):cmd:... p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      
      (p4):stop:3
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      
      (p4):stop:6
      (p4):cmd:... p4 client -i
      p4 client -i
      
      Client jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5 saved.
      
      (p4):stop:7
      (p4):cmd:...   View:
            //depot/jenkins-path/shared/... //jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5/...
      ...   Root: /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary
      (p4):stop:
      (p4):cmd:... p4 counter change
      p4 counter change
      
      (p4):stop:8
      (p4):cmd:... p4 changes -m1 -ssubmitted //jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5/...
      p4 changes -m1 -ssubmitted //jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5/...
      
      Change 1187280 on 2019/05/04 by amiller@am_ws_kilo 'Remove debug code
      
      reviewed by:'
      (p4):stop:9
      (p4):cmd:... p4 repos -C
      p4 repos -C
      
      (p4):stop:10
      P4: builds: 1187280 
      (p4):cmd:... p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      
      (p4):stop:3
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      
      (p4):stop:6
      
      P4 Task: establishing connection.
      ... server: p4.mydomain.com:1666
      ... node: jenkins2.mydomain.com
      Building on Node: master
      (p4):cmd:... p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      
      (p4):stop:3
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      
      (p4):stop:6
      
      P4 Task: establishing connection.
      ... server: p4.mydomain.com:1666
      ... node: jenkins2.mydomain.com
      
      P4 Task: reverting all pending and shelved revisions.
      (p4):cmd:... p4 revert /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary/...
      p4 revert /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary/...
      
      /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary/... - file(s) not opened on this client.
      
      (p4):stop:7
      ... rm [abandoned files]
      duration: (4ms)
      
      (p4):cmd:... p4 sync -q /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary/...#none
      p4 sync -q /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary/...#none
      
      (p4):stop:8
      ... rm -rf /home/jenkins/jobs/testing/workspace@libs/sharedlibrary
      
      P4 Task: syncing files at change: 1187280
      (p4):cmd:... p4 sync -f -q /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary/...@1187280
      p4 sync -f -q /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary/...@1187280
      
      ... totalFileSize 75308
      ... totalFileCount 18
      
      (p4):stop:9
      duration: (21ms)
      
      P4: unable to save changes, null changelogFile.
      
      P4Task: cleanup Client: jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      (p4):cmd:... p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      
      (p4):stop:3
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      
      (p4):stop:6
      
      P4 Task: establishing connection.
      ... server: p4.mydomain.com:1666
      ... node: jenkins2.mydomain.com
      P4 Task: cleanup client: jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      (p4):cmd:... p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      p4 client -o jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      
      (p4):stop:7
      (p4):cmd:... p4 revert /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary/...
      p4 revert /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary/...
      
      /home/jenkins/jobs/testing/workspace%40libs/sharedlibrary/... - file(s) not opened on this client.
      
      (p4):stop:8
      P4 Task: remove client: jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      (p4):cmd:... p4 client -d jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      p4 client -d jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5
      
      Client jenkins-lib-67d02aa4-11d4-4b7a-ae6f-4965f0aa80c5 deleted.
      
      (p4):stop:9
      [Pipeline] Start of Pipeline
      Scripts not permitted to use staticMethod org.jenkinsci.plugins.workflow.cps.Safepoint safepoint. Administrators can decide whether to approve or reject this signature.
      [Pipeline] stage
      [Pipeline] { (Test)
      Scripts not permitted to use staticMethod org.jenkinsci.plugins.workflow.cps.Safepoint safepoint. Administrators can decide whether to approve or reject this signature.
      [Pipeline] node
      Running on mynode in /home/jenkins/workspace/testing
      [Pipeline] {
      Scripts not permitted to use staticMethod org.jenkinsci.plugins.workflow.cps.Safepoint safepoint. Administrators can decide whether to approve or reject this signature.
      [Pipeline] checkout
      (p4):cmd:... p4 client -o jenkins-mynode-testing
      p4 client -o jenkins-mynode-testing
      
      (p4):stop:3
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 client -o jenkins-mynode-testing
      p4 client -o jenkins-mynode-testing
      
      (p4):stop:6
      (p4):cmd:... p4 counter change
      p4 counter change
      
      (p4):stop:7
      (p4):cmd:... p4 changes -m1 -ssubmitted //jenkins-mynode-testing/...
      p4 changes -m1 -ssubmitted //jenkins-mynode-testing/...
      
      Change 1186739 on 2019/05/01 by someone@vm-ca-2 'Don't consume license if the De'
      (p4):stop:8
      (p4):cmd:... p4 repos -C
      p4 repos -C
      
      (p4):stop:9
      P4: builds: 1186739 
      Building on Node: mynode
      (p4):cmd:... p4 client -o jenkins-mynode-testing
      p4 client -o jenkins-mynode-testing
      
      (p4):stop:3
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 client -o jenkins-mynode-testing
      p4 client -o jenkins-mynode-testing
      
      (p4):stop:6
      
      P4 Task: establishing connection.
      ... server: p4.mydomain.com:1666
      ... node: mynode.mydomain.com
      (p4):cmd:... p4 client -o jenkins-mynode-testing
      p4 client -o jenkins-mynode-testing
      
      (p4):stop:3
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 client -o jenkins-mynode-testing
      p4 client -o jenkins-mynode-testing
      
      (p4):stop:6
      
      P4 Task: establishing connection.
      ... server: p4.mydomain.com:1666
      ... node: mynode.mydomain.com
      
      P4 Task: reverting all pending and shelved revisions.
      (p4):cmd:... p4 revert /home/jenkins/workspace/testing/...
      p4 revert /home/jenkins/workspace/testing/...
      
      /home/jenkins/workspace/testing/... - file(s) not opened on this client.
      
      (p4):stop:7
      ... rm [abandoned files]
      duration: (6ms)
      
      (p4):cmd:... p4 sync -q /home/jenkins/workspace/testing/...#none
      p4 sync -q /home/jenkins/workspace/testing/...#none
      
      ... totalFileSize 0
      ... totalFileCount 21818
      
      (p4):stop:8
      ... rm -rf /home/jenkins/workspace/testing
      
      P4 Task: syncing files at change: 1186739
      (p4):cmd:... p4 sync -f -q /home/jenkins/workspace/testing/...@1186739
      p4 sync -f -q /home/jenkins/workspace/testing/...@1186739
      
      ... totalFileSize 5853084823
      ... totalFileCount 28808
      
      P4: saving built changes.
      Found last change 1186739 on syncID jenkins-mynode-testing
      (p4):cmd:... p4 client -o jenkins-mynode-testing
      p4 client -o jenkins-mynode-testing
      
      (p4):stop:3
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 client -o jenkins-mynode-testing
      p4 client -o jenkins-mynode-testing
      
      (p4):stop:6
      (p4):cmd:... p4 client -o jenkins-mynode-testing
      p4 client -o jenkins-mynode-testing
      
      (p4):stop:3
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 client -o jenkins-mynode-testing
      p4 client -o jenkins-mynode-testing
      
      (p4):stop:6
      ... done
      
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] End of Pipeline
      Finished: SUCCESS

      If I manually create a comparable client spec and sync with the command-line p4 client, the workspace is limited to the specified changelist as expected.

        Attachments

          Activity

          Hide
          aaronm Aaron Miller added a comment -

          Hi Karl,

          Apologies for not getting back to you sooner.

          I created a new job with only the checkout step shown above wrapped in a node() step and got the same result. I also used a workspace name that didn't already exist. I verified with

          p4 client -o jenkins-mynode-testing

          that the ChangeView was not added to the client spec, and that the workspace contains the latest file revisions.

          Let me know if there's any other info I can provide, thanks.

          Show
          aaronm Aaron Miller added a comment - Hi Karl, Apologies for not getting back to you sooner. I created a new job with only the checkout step shown above wrapped in a node() step and got the same result. I also used a workspace name that didn't already exist. I verified with p4 client -o jenkins-mynode-testing that the ChangeView was not added to the client spec, and that the workspace contains the latest file revisions. Let me know if there's any other info I can provide, thanks.
          Hide
          p4karl Karl Wirth added a comment -

          Hi Aaron Miller - I just wanted to check if you got my last message - included above.

          Show
          p4karl Karl Wirth added a comment - Hi Aaron Miller - I just wanted to check if you got my last message - included above.
          Hide
          p4karl Karl Wirth added a comment -

          Hi Aaron Miller,

          Strangely mine works.

          checkout perforce(credential: 'JenkinsMaster',
          	 populate: forceClean(have: false,
          	 parallel: 
          		[
          		 enable: false,
          		 minbytes: '1024',
          		 minfiles: '1',
          		 threads: '4'
          		],
          	 pin: '',
          	 quiet: false),
          	 workspace: manualSpec(charset: 'none',
          	 cleanup: false,
          	 name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-changeview',
          	 pinHost: false,
          	 spec: clientSpec(allwrite: false,
          	 backup: true,
          	 changeView: '//depot/Project1/...@307',
          	 clobber: true,
          	 compress: false,
          	 line: 'LOCAL',
          	 locked: false,
          	 modtime: false,
          	 rmdir: false,
          	 serverID: '',
          	 streamName: '',
          	 type: 'WRITABLE',
          	 view: '//depot/Project1/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-changeview/...')))
          

          You can see that '307' is the CL I have set for my 'changeview'. In the job output I see it correctly syncing 307:

          P4 Task: syncing files at change: 307
          ... p4 sync /var/lib/jenkins/ANOTHER_SLAVE/workspace/PipelineEditor/...@307
          

          Note - The latest CL is '363' on this path:

          $ p4 changes -m1 //depot/Project1/...
          Change 363 on 2019/04/08 by super@test_ws 'Submit of ./f363'
          

          Can you please try a simple test where your checkout step is the only one in the code from a fresh job. Do you still see the same bug?

           

           

           

          Show
          p4karl Karl Wirth added a comment - Hi Aaron Miller , Strangely mine works. checkout perforce(credential: 'JenkinsMaster' , populate: forceClean(have: false , parallel: [ enable: false , minbytes: '1024' , minfiles: '1' , threads: '4' ], pin: '', quiet: false ), workspace: manualSpec(charset: 'none' , cleanup: false , name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-changeview' , pinHost: false , spec: clientSpec(allwrite: false , backup: true , changeView: ' //depot/Project1/...@307' , clobber: true , compress: false , line: 'LOCAL' , locked: false , modtime: false , rmdir: false , serverID: '', streamName: '', type: 'WRITABLE' , view: ' //depot/Project1/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-changeview/...' ))) You can see that '307' is the CL I have set for my 'changeview'. In the job output I see it correctly syncing 307: P4 Task: syncing files at change: 307 ... p4 sync / var /lib/jenkins/ANOTHER_SLAVE/workspace/PipelineEditor/...@307 Note - The latest CL is '363' on this path: $ p4 changes -m1 //depot/Project1/... Change 363 on 2019/04/08 by super @test_ws 'Submit of ./f363' Can you please try a simple test where your checkout step is the only one in the code from a fresh job. Do you still see the same bug?      
          Hide
          p4karl Karl Wirth added a comment -

          Hi Aaron Miller. Thanks for highlighting this. I'll test it here and update the job with my findings.

          Show
          p4karl Karl Wirth added a comment - Hi Aaron Miller . Thanks for highlighting this. I'll test it here and update the job with my findings.

            People

            • Assignee:
              p4karl Karl Wirth
              Reporter:
              aaronm Aaron Miller
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: