Disable/Enable SCM polling for individual Pipeline checkout steps.

16 views
Skip to first unread message

pallen

unread,
Apr 9, 2019, 7:15:30 AM4/9/19
to Jenkins Developers
Hi Guys,

I have a customer with two 'checkout' steps in their pipeline script, one where they have set 'poll: true' and the other 'poll: false'.  For example:

pipeline {
  agent any
  options {
    skipDefaultCheckout(true)
  }
  stages {
    stage('A') {
      steps {
        checkout poll: true, scm: perforce(
          credential: '" + CREDENTIAL ', 
          populate: forceClean(quiet: true),
          workspace: manualSpec(name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-A', 
            spec: clientSpec(view: '//depot/main/A/... //${P4_CLIENT}/A/...')))
      }
    }
    stage('B') {
      steps {
        checkout poll: false, scm: perforce(
          credential: '" + CREDENTIAL ', 
          populate: forceClean(quiet: true),
          workspace: manualSpec(name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-B', 
            spec: clientSpec(view: '//depot/main/B/... //${P4_CLIENT}/B/...')))
      }
    }
  }
}



The problem is that polling (compareRemoteRevisionWith) gets called for both SCMRevisionState baselines checkout step A and B.  I can't see any way to detect the state of the 'poll' option so I'm unable to skip polling from compareRemoteRevisionWith.

The SCM getKey() method returns a unique value for each checkout steps, A and B.

Kind regards,
Paul

Jesse Glick

unread,
Apr 9, 2019, 11:01:32 AM4/9/19
to Jenkins Dev
On Tue, Apr 9, 2019 at 7:15 AM pallen <pal...@perforce.com> wrote:
> polling (compareRemoteRevisionWith) gets called for both SCMRevisionState baselines checkout step A and B.

If true, that sounds like a bug. Perhaps you can track down the culprit.
Reply all
Reply to author
Forward
0 new messages