diff options
author | Krasimir Angelov <kangelov@gitlab.com> | 2019-05-30 18:40:53 +1200 |
---|---|---|
committer | Fabio Pitino <fpitino@gitlab.com> | 2019-06-06 09:21:18 +0100 |
commit | ad9ae16d8a44dd2523bd6e6109db9fe2da45d3a5 (patch) | |
tree | ee8445389c89b4c7f5cc71c3d35f469345a5016f /spec/migrations | |
parent | 3fd99b4e7a58843943ade87a3658d477278aa412 (diff) | |
download | gitlab-ce-ad9ae16d8a44dd2523bd6e6109db9fe2da45d3a5.tar.gz |
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 'spec/migrations')
-rw-r--r-- | spec/migrations/remove_orphaned_label_links_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/migrations/remove_orphaned_label_links_spec.rb b/spec/migrations/remove_orphaned_label_links_spec.rb index 13b8919343e..4c8135cd08c 100644 --- a/spec/migrations/remove_orphaned_label_links_spec.rb +++ b/spec/migrations/remove_orphaned_label_links_spec.rb @@ -10,6 +10,12 @@ describe RemoveOrphanedLabelLinks, :migration do let(:project) { create(:project) } # rubocop:disable RSpec/FactoriesInMigrationSpecs let(:label) { create_label } + before do + # This migration was created before we introduced ProjectCiCdSetting#default_git_depth + allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth?).and_return(true) + allow_any_instance_of(ProjectCiCdSetting).to receive(:default_git_depth).and_return(nil) + end + context 'add foreign key on label_id' do let!(:label_link_with_label) { create_label_link(label_id: label.id) } let!(:label_link_without_label) { create_label_link(label_id: nil) } |