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

Add option to prevent git fetch for freestyle projects

XMLWordPrintable

      In our Jenkins build server we have a number of freestyle build jobs. Those build jobs are all working in the same workspace and each of those build jobs is calling another one after being finished: A->B->C->D->.... which is very time consuming. All build jobs have been configured for the same git repository to be able to track which developers contributed to the build and to checkout the same commit in each build. ... Some of those build jobs should be able to run in parallel since they only execute unit tests in separate subdirectories.

      To minimize execution time of the whole build chain we wanted to execute build jobs B, C and D in parallel: A->[B,C,D,...].

      Unfortunately, when B,C and D are started at the same time, they are all trying to fetch from the origin repository via git and store the update in the very same workspace's .git directory, which in the end results in failed builds for B, C and D.

      The error message in the build looks similar to this in such cases:

      ...
      [new branch] feature -> origin/feature
      error: cannot lock ref 'refs/remotes/origin/feature/task': is at d91b4e33b4a2d3404c0738c85b39314bb1d3c2be but expected 1b9026360df650a3ae1e224e09e92373fcafd9ef

      I think a workaround would be here to add an option in the git configuration to prevent polling of the git repository at all. Indeed, this option is already available for pipeline build jobs, but for freestyle ones it is missing.

      Can we have this option implemented also for freestyle build jobs?

      https://www.jenkins.io/doc/pipeline/steps/git/ - Search for "Example: Git step with https protocol and polling disabled"

            Unassigned Unassigned
            turboscholz Uwe Scholz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: