Introduce default_git_depth in project's CI/CD settings and set it to
50. Use it if there is no GIT_DEPTH variable specified. Apply this
default only to newly created projects and keep it nil for old ones
in order to not break pipelines that rely on non-shallow clones.
default_git_depth can be updated from CI/CD Settings in the UI, must be
either nil or integer between 0 and 1000 (incl).
Inherit default_git_depth from the origin project when forking projects.
MR pipelines are run on a MR ref (refs/merge-requests/:iid/merge) and it
contains unique commit (i.e. merge commit) which doesn't exist in the
other branch/tags refs. We need to add it cause otherwise it may break
pipelines for old projects that have already enabled Pipelines for merge
results and have git depth 0.
Document new default_git_depth project CI/CD setting
This model and the corresponding table will be used for storing settings
specific to CI/CD, starting with the "group_runners_enabled" boolean.
The model is called ProjectCiCdSetting and not ProjectCiCdSettings. The
project exporter doesn't like plural model names as it uses "classify"
which turns those into singular (so "ProjectCiCdSettings" becomes
"ProjectCiCdSetting", producing an error if said class is undefined).
The initial work in this commit was done by Dylan Griffith, with most of
the migration work being done by Yorick Peterse.