diff options
author | Krasimir Angelov <kangelov@gitlab.com> | 2019-05-30 09:40:53 +0300 |
---|---|---|
committer | Fabio Pitino <fpitino@gitlab.com> | 2019-06-06 11:21:18 +0300 |
commit | ad9ae16d8a44dd2523bd6e6109db9fe2da45d3a5 (patch) | |
tree | ee8445389c89b4c7f5cc71c3d35f469345a5016f /app/views | |
parent | 3fd99b4e7a58843943ade87a3658d477278aa412 (diff) |
Add project level git depth setting
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
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/settings/ci_cd/_form.html.haml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/views/projects/settings/ci_cd/_form.html.haml b/app/views/projects/settings/ci_cd/_form.html.haml index b38b8e3f686..2d108a1cba5 100644 --- a/app/views/projects/settings/ci_cd/_form.html.haml +++ b/app/views/projects/settings/ci_cd/_form.html.haml @@ -26,6 +26,14 @@ %hr .form-group + = f.fields_for :ci_cd_settings_attributes, @project.ci_cd_settings do |form| + = form.label :default_git_depth, _('Git shallow clone'), class: 'label-bold' + = form.number_field :default_git_depth, { class: 'form-control', min: 0, max: 1000 } + %p.form-text.text-muted + = _('The number of changes to be fetched from GitLab when cloning a repository. This can speed up Pipelines execution. Keep empty or set to 0 to disable shallow clone by default and make GitLab CI fetch all branches and tags each time.') + + %hr + .form-group = f.label :build_timeout_human_readable, _('Timeout'), class: 'label-bold' = f.text_field :build_timeout_human_readable, class: 'form-control' %p.form-text.text-muted |