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

Declarative option for disableDefaultCheckoutPolling()

      I have a use case that stores our job definition in GitHub for auto-job population/source controlled jobs, but the source code to pull is from another SCM (Perforce). Perforce only supports polled triggering (Perforce Triggered Builds just fire off polling). As history ages out, this can cause bursts of infinite triggering when git-plugin thinks there are new changes. I'd like to be able to disable polling for this default repository.

       

      The current workaround is:

      pipeline {
          agent any
          options {
              skipDefaultCheckout()
          }
          
          steps {
              checkout poll: false, scm: scm
          }
      }

          [JENKINS-48544] Declarative option for disableDefaultCheckoutPolling()

          Andrew Bayer added a comment -

          So this'll probably end up as checkoutOptions(enablePolling: false, includeInChangelogs:false) - might as well provide both of those flags in one place. I'll probably bang this out within the next week.

          Andrew Bayer added a comment - So this'll probably end up as checkoutOptions(enablePolling: false, includeInChangelogs:false) - might as well provide both of those flags in one place. I'll probably bang this out within the next week.

          Robby Pocase added a comment -

          Sounds good to me.

          Robby Pocase added a comment - Sounds good to me.

          Andrew Bayer added a comment -

          Ok, this is weird. So far as I can tell, the erstwhile "checkout" for the Jenkinsfile is enough to result in polling and changelog inclusion, so even if I change the checkout scm calls to include poll: false, changelog: false, it makes no difference. I am confused.

          Andrew Bayer added a comment - Ok, this is weird. So far as I can tell, the erstwhile "checkout" for the Jenkinsfile is enough to result in polling and changelog inclusion, so even if I change the checkout scm calls to include poll: false, changelog: false , it makes no difference. I am confused.

          Andrew Bayer added a comment -

          Waaaaait, yeah, this wouldn't be the case for GitHub, would it? Because GitHub doesn't need to do a checkout to get the Jenkinsfile. Hrrrrm. Makes this hard to test.

          Andrew Bayer added a comment - Waaaaait, yeah, this wouldn't be the case for GitHub, would it? Because GitHub doesn't need to do a checkout to get the Jenkinsfile. Hrrrrm. Makes this hard to test.

            Unassigned Unassigned
            rpocase Robby Pocase
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: