From 341f953b586b2ac7822cdc217dab4dd0c9dbf068 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 29 Nov 2017 12:57:53 +0000 Subject: Merge branch 'bvl-fork-networks-for-deleted-projects' into 'master' Create fork networks for deleted source projects Closes #40072 See merge request gitlab-org/gitlab-ce!15595 (cherry picked from commit 552c90893059dc5a9a525d7ed79359542f70aad6) Conflicts: lib/gitlab/background_migration/populate_fork_networks_range.rb --- .../background_migration/populate_fork_networks_range_spec.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb') diff --git a/spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb b/spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb index 994992f79d4..e52baf8dde7 100644 --- a/spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb +++ b/spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb @@ -62,12 +62,15 @@ describe Gitlab::BackgroundMigration::PopulateForkNetworksRange, :migration, sch expect(base2_membership).not_to be_nil end - it 'skips links that had their source project deleted' do - forked_project_links.create(id: 6, forked_from_project_id: 99999, forked_to_project_id: create(:project).id) + it 'creates a fork network for the fork of which the source was deleted' do + fork = create(:project) + forked_project_links.create(id: 6, forked_from_project_id: 99999, forked_to_project_id: fork.id) migration.perform(5, 8) expect(fork_networks.find_by(root_project_id: 99999)).to be_nil + expect(fork_networks.find_by(root_project_id: fork.id)).not_to be_nil + expect(fork_network_members.find_by(project_id: fork.id)).not_to be_nil end it 'schedules a job for inserting memberships for forks-of-forks' do -- cgit v1.2.1