Core clones on builds of contrib projects should use a shallow clone

Created on 28 June 2023, over 1 year ago

Problem/Motivation

While checking a test run on https://dispatcher.drupalci.org/job/drupal8_contrib_patches/162590/console, I noticed we clone Drupal core for each job using just the -b <branch> -v flags. Which appears to take 17 seconds. I suspect we could reduce that time significantly by doing a shallow clone by passing --depth 1 -b <branch> -v instead. It would be nice to cut some CI run time.

I just did a comparison locally on a file:/// clone:

  • shallow clone: 2.6 sec
  • normal branch clone: 12,8 sec
  • normal with -v: 12.8 sec too

Steps to reproduce

Check https://dispatcher.drupalci.org/job/drupal8_contrib_patches/162590/console

Proposed resolution

Add --depth 1 to the git clone command on the line that gets executed as sudo -u www-data git clone -v -b 9.5.x https://git.drupalcode.org/project/drupal.git '/var/lib/drupalci/workspace/jenkins-drupal8_contrib_patches-162590/source'

Remaining tasks

Try it on dispatcher.

User interface changes

None

API changes

None

Data model changes

None

📌 Task
Status

Active

Component

Codebase Build

Created by

🇫🇷France fgm Paris, France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024