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

Scan Organisation stops after first matching branch in each repository

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      After upgrading all the plugins on our Jenkins server (many months of updates), the periodic scan of our Github organisation is now behaving oddly: it doesn't pick up all our branches, and within each repository it seems to stop as soon as it hits a branch with a Jenkinsfile. For example:

      Organization URL: SKA Africa
      [Thu Aug 23 11:39:17 UTC 2018] Consulting GitHub Organization
      11:39:17 Connecting to https://api.github.com with no credentials, anonymous access
      <snip lots of ignoring>
      Examining ska-sa/spead2
      
        Checking branches...
      
        Getting remote branches...
      
          Checking branch gcc_static_link_hack
            ‘Makefile.am’ not found
          Does not meet criteria
      
          Checking branch master
            ‘Makefile.am’ found
          Met criteria
      
        2 branches were processed (query completed)
      
        2 branches were processed
      
      Finished examining ska-sa/spead2
      

      There are more branches of ska-sa/spead2 but they're not checked.

      I've set up a brand new Jenkins install (from Docker) on my laptop to confirm this behaviour, so it's not just some gremlin left over from the upgrade.

      Steps to reproduce:

      1. Start a fresh Jenkins from jenkins/jenkins:2.121.3 Docker image, run the wizard with default options.
      2. Add a Github organisation project. No credentials (we use creds in production, this is just for a test), organisation ska-sa, repository filter spead2, change the recogniser to Makefile.am (obviously that's not going to be valid Groovy, but it's just to demonstrate the issue since the organisation doesn't have a suitable public repository).
      3. Look for the above in the scan.

      I haven't checked it on this toy Jenkins instance, but on our production Jenkins, scanning a single repository does pick up all the branches.

      I tried poking through the code to try to figure out why that might be happening or which plugin is responsible, but I got lost in the web of inter-plugin calls so I've listed a few plugins that seemed like they might have some role. As far as I got was that this line seems to be where it bails out, which I think implies that SCMHeadObserver.isObserving returned false, but I'm not too sure what SCMHeadObserver subclass is in use at the time.

        Attachments

          Activity

          Hide
          bmerry Bruce Merry added a comment -

          Actually, looking further I think I might have the wrong end of the stick. I had assumed that the branches listed in the organisation scan were those it was scanning for updates, but I think actually it's just checking whether the repository should be a child of the folder, for which it only needs at least one matching branch.

          The real problem we're having is that the periodic organisation scan (yes, we're behind a firewall, so no hooks) isn't in turn triggering repository scans. I'll close this issue and file a separate bug for that one to avoid causing confusion with my initial report.

          Show
          bmerry Bruce Merry added a comment - Actually, looking further I think I might have the wrong end of the stick. I had assumed that the branches listed in the organisation scan were those it was scanning for updates, but I think actually it's just checking whether the repository should be a child of the folder, for which it only needs at least one matching branch. The real problem we're having is that the periodic organisation scan (yes, we're behind a firewall, so no hooks) isn't in turn triggering repository scans. I'll close this issue and file a separate bug for that one to avoid causing confusion with my initial report.

            People

            Assignee:
            dnusbaum Devin Nusbaum
            Reporter:
            bmerry Bruce Merry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: