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

Initial poll (just after project creation) spawns builds for all the existing branches in repository

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      git plugin 2.2.1
    • Similar Issues:

      Description

      When project that polls for multiple branches (like '**') is created, jenkins spawns a build for each existing leaf branch in repository.

      When repository contains dozens of such branches (like for example monthly release patch branches that are leaves because commits were cherry-picked from master), jenkins would need several hours or maybe days to build them all, and there is no option to stop it from doing that.

      It would be nice if git plugin could ignore SHA1s that had already existed in the repository during the project creation (probably should be easy to implement - just mark all the existing branches as already built), so that it would spawn builds only for commits that appear after the creation.

      Alternative approach could be ignoring commits older then some configurable date, however it might be a bit risky, if you consider the fact that committer can set the commit date to any value in past or future in purpose or by accident.

        Attachments

          Activity

          Hide
          cobexer Ing. Christoph Obexer added a comment -

          Maybe this should be merged with https://issues.jenkins-ci.org/browse/JENKINS-38552?
          Also this is not specific to git is it?

          Show
          cobexer Ing. Christoph Obexer added a comment - Maybe this should be merged with https://issues.jenkins-ci.org/browse/JENKINS-38552 ? Also this is not specific to git is it?
          Hide
          normanrichards norman richards added a comment -

          Yes - throttling is not the desired effect.  I would like old branches to not be built.  I either have to sit through hundreds of builds (possibly with side effects like deploying new versions of old artifacts) or I have to manually list every single existing branch as an exclude. 

          Show
          normanrichards norman richards added a comment - Yes - throttling is not the desired effect.  I would like old branches to not be built.  I either have to sit through hundreds of builds (possibly with side effects like deploying new versions of old artifacts) or I have to manually list every single existing branch as an exclude. 
          Hide
          naer Fran Aguiar added a comment -

          Any workaround to avoid this?

          Show
          naer Fran Aguiar added a comment - Any workaround to avoid this?
          Hide
          idacrobert Robert Churchill added a comment -

          I've not tried this, but you could look at "Additional behaviours" > "Strategy for choosing what to build" > "Maximum age of commit" to limit what is getting built.

          Show
          idacrobert Robert Churchill added a comment - I've not tried this, but you could look at "Additional behaviours" > "Strategy for choosing what to build" > "Maximum age of commit" to limit what is getting built.
          Hide
          naer Fran Aguiar added a comment -

          Perfect! I set "Maximum age of commit" to 1 day and works like a charm.

          I want to build and test current working branches, so that solution is perfect for me.

          Show
          naer Fran Aguiar added a comment - Perfect! I set "Maximum age of commit" to 1 day and works like a charm. I want to build and test current working branches, so that solution is perfect for me.

            People

            • Assignee:
              Unassigned
              Reporter:
              robbl Robert Luberda
            • Votes:
              10 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

              • Created:
                Updated: