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

configurable scm polling for github organization folder jobs

      I would like to be able to configure my github organization folder to use scm polling for jobs it creates.

      My Jenkins server is behind a firewall and cannot be accessed by Github. The current web hook functionality doesn't work. I need some other way to trigger builds.

          [JENKINS-34779] configurable scm polling for github organization folder jobs

          mcrooney added a comment -

          Agree that this would be super useful. Unless I'm missing something, there's no way to poll the SCM regularly. Even if I change the whole Github Org folder to run regularly, it doesn't propagate to the created folders and jobs. In practice this means the jobs don't run automatically at all it appears :/ Getting builds after a commit occurs is a pretty important feature of a CI tool, so this seems like a big gap for people behind VPN/firewall/intranet who can't enable webhooks!

          mcrooney added a comment - Agree that this would be super useful. Unless I'm missing something, there's no way to poll the SCM regularly. Even if I change the whole Github Org folder to run regularly, it doesn't propagate to the created folders and jobs. In practice this means the jobs don't run automatically at all it appears :/ Getting builds after a commit occurs is a pretty important feature of a CI tool, so this seems like a big gap for people behind VPN/firewall/intranet who can't enable webhooks!

          Jesse Glick added a comment -

          This code sets repository projects to poll for changes once per day. I could have sworn there was an RFE to make this customizable at the OrganizationFolder level long since filed, but I cannot find it now.

          To use webhooks behind a firewall, IT department permitting, try ngrok.io. You must be sure that your Jenkins security configuration denies anonymous read access. Demo

          Jesse Glick added a comment - This code sets repository projects to poll for changes once per day. I could have sworn there was an RFE to make this customizable at the OrganizationFolder level long since filed, but I cannot find it now. To use webhooks behind a firewall, IT department permitting, try ngrok.io. You must be sure that your Jenkins security configuration denies anonymous read access. Demo

          mcrooney added a comment -

          Thanks so much for the update Jesse! So, should we consider this the RFE then? "IT department permitting" is the important part, other similar services (localtunnel.me) are already blocked, ngrok isn't yet but they certainly wouldn't allow this if they knew we wanted to use it. We could try it under the radar, but the better solution for us might just be to build our own version of the plugin with "5m" instead of "1d" for now until it is configurable

          mcrooney added a comment - Thanks so much for the update Jesse! So, should we consider this the RFE then? "IT department permitting" is the important part, other similar services (localtunnel.me) are already blocked, ngrok isn't yet but they certainly wouldn't allow this if they knew we wanted to use it. We could try it under the radar, but the better solution for us might just be to build our own version of the plugin with "5m" instead of "1d" for now until it is configurable

          mcrooney added a comment -

          I am happy to help with a PR, though I'd need some guidance. I assume the github-org-folder needs a configuration option, though I'm not sure how to pass/persist that option in a way that can be read from branch-api-plugin: https://github.com/jenkinsci/branch-api-plugin/blob/7d7c8e9e79da86d997367b7d47267f1f02cbe281/src/main/java/jenkins/branch/OrganizationFolder.java#L191. Any suggestions?

          mcrooney added a comment - I am happy to help with a PR, though I'd need some guidance. I assume the github-org-folder needs a configuration option, though I'm not sure how to pass/persist that option in a way that can be read from branch-api-plugin: https://github.com/jenkinsci/branch-api-plugin/blob/7d7c8e9e79da86d997367b7d47267f1f02cbe281/src/main/java/jenkins/branch/OrganizationFolder.java#L191 . Any suggestions?

          Wouldn't that be covered by JENKINS-34005?

          Allan BURDAJEWICZ added a comment - Wouldn't that be covered by JENKINS-34005 ?

          mcrooney added a comment -

          Hmm, maybe Allan, that's interesting, I'm not sure. Given that "1d" is currently hard-coded in branch-api plugin, and the configuration option would need to exist in the github-org plugin, that's why I assumed it needed to be changes to two plugins. Are you suggesting that we can use some kind of job property to enable standard SCM polling on the downstream jobs, via an option in the github-org plugin?

          mcrooney added a comment - Hmm, maybe Allan, that's interesting, I'm not sure. Given that "1d" is currently hard-coded in branch-api plugin, and the configuration option would need to exist in the github-org plugin, that's why I assumed it needed to be changes to two plugins. Are you suggesting that we can use some kind of job property to enable standard SCM polling on the downstream jobs, via an option in the github-org plugin?

          Dan Jasek added a comment - - edited

          I currently get around this by setting a property in the Jenkinsfiles.
          It is not ideal, and I would prefer this setting at the organization level, but it works (with the latest pipeline plugin version).

          I have the following in all my Jenkinsfiles:
          properties([pipelineTriggers([[$class: 'SCMTrigger', scmpoll_spec: 'H/5 * * * *']])])

          Dan Jasek added a comment - - edited I currently get around this by setting a property in the Jenkinsfiles. It is not ideal, and I would prefer this setting at the organization level, but it works (with the latest pipeline plugin version). I have the following in all my Jenkinsfiles: properties([pipelineTriggers([ [$class: 'SCMTrigger', scmpoll_spec: 'H/5 * * * *'] ])])

          I am inclined to suggest either using a service such as ngrok to allow tunnelling your GitHub webhook notification or close in favour of JENKINS-41072

          The design of multi-branch is to consolidate polling for all repositories at the org folder / branch project level where one "poll" can be used by all projects. Individual projects having polling is contra to the original design

          Stephen Connolly added a comment - I am inclined to suggest either using a service such as ngrok to allow tunnelling your GitHub webhook notification or close in favour of JENKINS-41072 The design of multi-branch is to consolidate polling for all repositories at the org folder / branch project level where one "poll" can be used by all projects. Individual projects having polling is contra to the original design

          Jesse Glick added a comment -

          Well if we implement JENKINS-41072 than I suppose this should be deleted, not customizable?

          Jesse Glick added a comment - Well if we implement JENKINS-41072 than I suppose this should be deleted , not customizable?

          mcrooney added a comment -

          "I am inclined to suggest either using a service such as ngrok to allow tunnelling your GitHub webhook notification". I think this is a great solution for some organizations where this is allowed, but I've been involved in multiple companies trying to set this up where that's simply not allowed from a networking/security standpoint. Perhaps polling the Github events API (Jenkins-41072) is a cool alternative, though

          mcrooney added a comment - "I am inclined to suggest either using a service such as ngrok to allow tunnelling your GitHub webhook notification". I think this is a great solution for some organizations where this is allowed, but I've been involved in multiple companies trying to set this up where that's simply not allowed from a networking/security standpoint. Perhaps polling the Github events API (Jenkins-41072) is a cool alternative, though

            cloudbees CloudBees Inc.
            danjasek Dan Jasek
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: