Skip to content

Testing: Faster gitaly component upgrade

Zeger-Jan van de Weg requested to merge zj-faster-gitaly-setup into master

What does this MR do?

When Gitaly is not on or ahead of the version required, it will need updating for the tests to be reliable. Currently this does remove the Gitaly repository and child directories.

This is not great as a lot of work needs redoing:

  1. Fetching the Git repository
  2. Obtaining and rebuilding libgit2
  3. Obtaining and rebuilding the Ruby gems (where not already present)

This process is time consuming and not required. The Gitaly Makefile is rugged enough to understand what to rebuild when. As such this change just tells the testing code that sets up Gitaly to keep the repository around.

Side effects of this change are limited. Nonetheless note that the inital clone is a shallow one, at --depth=1. This means that the git-fetch(1) done by GitLab::Taskhelpers#checkout_version creates a slightly more CPU intensive clone on the server side as the content negotiation is more expensive. Further, this change requires protocol version 2 to be used for Git. This is enforced by setting the config, which removes the dependency on the Git version. See also: https://gitlab.com/gitlab-org/git/-/blob/48bf2fa8bad054d66bd79c6ba903c89c704201f7/t/t5516-fetch-push.sh#L1247-1267

Conformity

Edited by Zeger-Jan van de Weg

Merge request reports