From ad9ae16d8a44dd2523bd6e6109db9fe2da45d3a5 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Thu, 30 May 2019 18:40:53 +1200 Subject: 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 --- db/schema.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index fcf9e397ac1..05392da0260 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1644,6 +1644,7 @@ ActiveRecord::Schema.define(version: 20190530154715) do t.boolean "group_runners_enabled", default: true, null: false t.boolean "merge_pipelines_enabled" t.boolean "merge_trains_enabled", default: false, null: false + t.integer "default_git_depth" t.index ["project_id"], name: "index_project_ci_cd_settings_on_project_id", unique: true, using: :btree end -- cgit v1.2.3