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

SCM Polling frequency in Branch Source generated Multibranch projects seems hardcoded

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Use-case: a Jenkins deployment on internal LAN, corporate IT won't allow incoming connections - so no webhooks. Polling must be used to find and build new code from public or corporate SCM systems.

      • Prerequisite: have a Github (or Stash) organization with some component repositories, each has Jenkinsfile pipelines in master and other branches - and those pipeline scripts define a speedy polling frequency (H/2 .. H/5)
      • On Jenkins: create a New Item / Github Organization (AFAIK backed by Branch source nowadays - at least I have no Github Organization plugin installed anymore)
      • point the setup at desired organization
      • have it scan the org, find repos, set up MultiBranch pipelines for the repos, scan repos, find branches, find Jenkinsfiles, set up jobs for each matching branch.
      • Review that the final jobs have the frequent polling in their read-only configuration, and that it is indeed honored (add a commit, see it built in a couple of minutes)
      • Add a branch or PR against the monitored repo... and wait a day for it to be found!
      • When it is finally found, see the subsequent additions to the branch (or origin of the PR) get discovered and built as frequently as set up via Jenkinsfile.

       

      The problem highlighted here is the implicit 1-day polling rate of the generated Multibranch pipeline jobs, which is not editable (it works well as expected in manually created MBP jobs).

       

      Our current workaround is to either wait the day for non-urgent PRs, or to manually trigger a "build" of the generated MBP job so it rescans the repo and finds new PRs/branches to build. Probably a regularly running Jenkins job with a bit of groovy could be made to that effect as well, by capable devs  But the preferable solution would be to have that default (1-day) frequency actually just configurable from the organization-level job.

        Attachments

          Issue Links

            Activity

            Hide
            jimklimov Jim Klimov added a comment - - edited

            So far my workaround was to add a job to regularly rescan MBPs that are inside folders : https://pastebin.com/xKM7CStM

            It still is sub-optimal and has its quirks, but at least seems to work.

            Thanks to Andrew Bayer and many others for hints on IRC, and to people asking good questions on StackOverflow et al

            Show
            jimklimov Jim Klimov added a comment - - edited So far my workaround was to add a job to regularly rescan MBPs that are inside folders : https://pastebin.com/xKM7CStM It still is sub-optimal and has its quirks, but at least seems to work. Thanks to Andrew Bayer and many others for hints on IRC, and to people asking good questions on StackOverflow et al
            Hide
            jimklimov Jim Klimov added a comment -

            Closing my report as a duplicate of another with more activity.

            Show
            jimklimov Jim Klimov added a comment - Closing my report as a duplicate of another with more activity.
            Hide
            aairey Andy Airey added a comment -

            Jim Klimov you haven't closed it yet

            Show
            aairey Andy Airey added a comment - Jim Klimov you haven't closed it yet
            Hide
            jimklimov Jim Klimov added a comment -

            Right, I only linked it, thanks... This one essentially duplicates JENKINS-48960

            Show
            jimklimov Jim Klimov added a comment - Right, I only linked it, thanks... This one essentially duplicates JENKINS-48960

              People

              • Assignee:
                Unassigned
                Reporter:
                jimklimov Jim Klimov
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: