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

Seed job (job-dsl) runs trigger a rebuild of all multibranch pipelines branches

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Fixed but Unreleased (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      I have a fully configured as code jenkins deployed in GKE using the official Helm [chart|https://github.com/helm/charts/tree/master/stable/jenkins] (version 0.33.1). I also use a seed job (pre-installed by the chart) which creates all the other jobs.

      My problem is that each time someone triggers the seed job, it triggers a branch indexing in every existing multibranch pipelines. Those branch indexing trigger a build for every branches discovered even when they were already previously discovered and builtt.

      The consequence is that we get huge build spikes each time someone runs the jenkins seed. I searched the web for months for a fix but all I could find was workarounds. The latest I put in place is to install the "Basic Branch Strategy plugin" and enforce the newly added "skip initial build on first branch indexing" strategy on all my multibranch pipelines. It fixed my problem but the downside is that, my newly discovered branches stopped building automatically so the workaround isn't satisfying.

      From what I understood, the seed job recreates all its managed jobs every time it is run, so I guess the problem must come from there but I don't know how to confirm it.

      I can debug this further but I will need a bit of help (debugging tips).

      To me the solutions are:

      • Fix either the seed or the way the multibranch pipelines handles recreation.
      • Create a basic branch strategy which filters an initial trigger when the branch was already built before and the current commit is the same than the previous build's.

      I can provide further information if needed. I can even submit a fix if it is trivial/simple (I am not a Java developer).

       

      Thanks for your help!

       

       

        Attachments

          Issue Links

            Activity

            Hide
            jpigree Jonathan Pigrée added a comment -

            Thanks. I found this solution myself a while ago and forgot to update the ticket.

             

            Show
            jpigree Jonathan Pigrée added a comment - Thanks. I found this solution myself a while ago and forgot to update the ticket.  

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                jpigree Jonathan Pigrée
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: