Add ability to poll per change when Jenkinsfile includes a checkout with poll per change ('filter: [ incremental(true) ]'). For example:
                      checkout perforce(credential: 'myCredential',
                               filter: [ incremental(true) ],
                               populate: forceClean(have: true,
                                       parallel:
                                              [
                                               enable: false,
                                               minbytes: '1024',
       

      At the moment when the pipeline polls it will build all changelists within the view since last poll.

          [JENKINS-47427] Poll per change with pipeline jobs

          Karl Wirth created issue -
          Daniel Hagström made changes -
          Comment [ +1 on this. I don't get why this is an option when it does nothing: the plugin pulls in all changelists since last in the build, rather than just the next one, right? ]

          Any updates on this? Is this still not working as intended?

          Daniel Hagström added a comment - Any updates on this? Is this still not working as intended?
          Karl Wirth made changes -
          Labels New: P4_SUPPORT

          Karl Wirth added a comment -

          Working with Daniel on this.

          Karl Wirth added a comment - Working with Daniel on this.

          Karl Wirth added a comment -

          Verified that polling per change does not work with Pipleline jobs if it is configured through the GUI using Polling Build Filters, or when using 'checkout' step.

          Variations tested that all fail:

          1. Lightweight checkout not selected, polling build filter from GUI
          2. Lightweight checkout selected, polling build filter from GUI, 'options { skipDefaultCheckout() }' not set.
          3. Lightweight checkout selected, polling build filter from GUI, 'options { skipDefaultCheckout() }' **set.
          4. Lightweight checkout not selected, polling build filter from Jenkinsfile checkout step.
          5. Lightweight checkout selected, polling build filter from Jenkinsfile checkout step, 'options { skipDefaultCheckout() }' not set.
          6. Lightweight checkout selected, polling build filter from Jenkinsfile checkout step, 'options { skipDefaultCheckout() }' set.

          Example Jenkinsfile with everything set below:

          pipeline {
            agent any
            //options { skipDefaultCheckout() }  
            stages {
              stage("PollPerChange") {
                steps {
                  script {
                    checkout perforce(credential: 'MasterServer', filter: [incremental(true)], populate: autoClean(delete: true, modtime: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: true, replace: true, tidy: false), workspace: manualSpec(charset: 'none', name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}', pinHost: false, spec: clientSpec(allwrite: false, backup: false, clobber: true, compress: false, line: 'LOCAL', locked: false, modtime: false, rmdir: false, serverID: '', streamName: '', type: 'WRITABLE', view: '//depot/pollperchange/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/...')))
                      echo "In script."
                      sh 'ls'  
                  }
                }
              }
            }
          }
          
          

          Karl Wirth added a comment - Verified that polling per change does not work with Pipleline jobs if it is configured through the GUI using Polling Build Filters, or when using 'checkout' step. Variations tested that all fail: Lightweight checkout not selected, polling build filter from GUI Lightweight checkout selected, polling build filter from GUI, 'options { skipDefaultCheckout() }' not set. Lightweight checkout selected, polling build filter from GUI, 'options { skipDefaultCheckout() }' **set. Lightweight checkout not selected, polling build filter from Jenkinsfile checkout step. Lightweight checkout selected, polling build filter from Jenkinsfile checkout step, 'options { skipDefaultCheckout() }' not set. Lightweight checkout selected, polling build filter from Jenkinsfile checkout step, 'options { skipDefaultCheckout() }' set. Example Jenkinsfile with everything set below: pipeline {   agent any   //options { skipDefaultCheckout() }     stages {     stage( "PollPerChange" ) {       steps {         script { checkout perforce(credential: 'MasterServer' , filter: [incremental( true )], populate: autoClean(delete: true , modtime: false , parallel: [enable: false , minbytes: '1024' , minfiles: '1' , threads: '4' ], pin: '', quiet: true , replace: true , tidy: false ), workspace: manualSpec(charset: ' none ', name: ' jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER} ', pinHost: false , spec: clientSpec(allwrite: false , backup: false , clobber: true , compress: false , line: ' LOCAL ', locked: false , modtime: false , rmdir: false , serverID: ' ', streamName: ' ', type: ' WRITABLE ', view: ' //depot/pollperchange/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/...')))             echo "In script."             sh 'ls'           }       }     }   } }
          Karl Wirth made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          Karl Wirth made changes -
          Issue Type Original: Improvement [ 4 ] New: Bug [ 1 ]
          Karl Wirth made changes -
          Labels Original: P4_SUPPORT New: P4_VERIFY

          Karl Wirth added a comment -

          Commenting on this bug to keep it close to top of backlog list.

          Karl Wirth added a comment - Commenting on this bug to keep it close to top of backlog list.

            p4paul Paul Allen
            p4karl Karl Wirth
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: