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

Double Build on Multibranch Pipeline with open PR

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • Jenkins v1.652 running on a Ubuntu 14.04

      The multi pipeline plugin is great, but there is one annoying thing that prevents me from actively using it:

      I have a BitBucket Git Repository where I experimentally created feature branches containing a Jenkinsfile with build instructions - it works very well. Whenever I push to the branch, the BitBucket hooks are set up and work, they trigger a new indexing - so far, so good.

      However, if I now open a PR for that branch (which is quite standard), then indexing will do the following:

      Finds the branch -> matches criteria
      Finds the PR -> of course, matches criteria too (that is, it contains a Jenkinsfile, as opposed to other branches)

      This results in everything being doubled: The build itself, along with all notifications, build messages... This is quite a waste of resources as one build takes around 8 Minutes. Also, the doubled builds interfere because they are unfortunately using the same MySql Database.

      Am I missing something here? The Doc says that the indexing scans for open branches and PRs, so this is not a bug. However, this will very often result in the behavior I just described. How can I prevent Jenkins from doubling everything? I would really like to start using this as it is much more clear than the old pipeline currently in place ...

      I would suggest either to give an option to disable scanning for PRs, or make the indexing smart enough to see that the branch for a PR was already scheduled - which would be what I'd prefer.

          [JENKINS-33865] Double Build on Multibranch Pipeline with open PR

          Lucas Manzke created issue -
          Matthew DeTullio made changes -
          Component/s New: workflow-plugin [ 18820 ]
          Component/s Original: multi-branch-project-plugin [ 21127 ]
          Matthew DeTullio made changes -
          Labels New: multibranch
          Matthew DeTullio made changes -
          Assignee Original: Matthew DeTullio [ mjdetullio ] New: Jesse Glick [ jglick ]
          Jesse Glick made changes -
          Component/s New: bitbucket-branch-source-plugin [ 21428 ]
          Component/s Original: workflow-plugin [ 18820 ]
          Assignee Original: Jesse Glick [ jglick ] New: Antonio Muñiz [ amuniz ]
          Labels Original: multibranch
          Nicholas Brown made changes -
          Link New: This issue duplicates JENKINS-36283 [ JENKINS-36283 ]
          Antonio Muñiz made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 169863 ] New: JNJira + In-Review [ 198716 ]

            amuniz Antonio Muñiz
            lmanzke Lucas Manzke
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: