Importing group as a top level group targeting an existing namespace give false positive status
Summary
When using the group import from other GitLab instance to GitLab.com. If the target group namespace already exist, the import will start and complete successfully but if the user who import the project try to access the namespace, it will result in a 404 because the target namespace has already been taken and owned by other users on the target instance.
Steps to reproduce
- Have a group in a Self-Managed GitLab instance (
kebab
in the screenshot`) - Try to import the group onto a different instance using a different name or the same name that's already being used (
totallyprivate
in the screenshot) - Observe that the import process has a green ticket which give the impression that the import was successfully complete
- Try to navigate to the target group and see the 404
source group is owned by userA while the target group is owned by userB
Example Project
https://gitlab.com/totallyprivate
What is the current bug behavior?
Group import status is completed even though nothing is imported because the target namespace already exist
What is the expected correct behavior?
Group import status should ask the customer to use a different namespace before start importing.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com; GitLab Enterprise Edition 14.3.0-pre 0e3a3aa5
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)