Export miss merge requests when source branch doesn't exist
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
As the title suggests importing a project from a self-managed export is not working as expected. It doesn't import all the MR's and the behavior is random on GitLab.com.
Steps to reproduce
- Pick a repository(upstream).
- Create a fork of upstream. Create branches in own forks, push code to it, create MR in the upstream targeting develop branch.
- Simultaneously create another branch on upstream. Let's call it hotfix/name branch is created off the master branch in the main repository (upstream) hotfix/name branch is created off the master branch
- developer creates ticket-branch in own fork off hotfix/name, pushes code to it, creates MR in the upstream targeting hotfix/name branch
- hotfix/name is merged to master and to develop
- hotfix/name is deleted afterward
Once done create an export of the project and try to import it on GitLab.com
The Gitlab instance where the project is hosted is {"version":"13.11.3","revision":"b321336e443"}.
What is the current bug behavior?
It will skip all those MR's that were created from the fork whose branches are now deleted. Also, note all my imports have shown different results of MR's missing. If you look at this project (GitLab internal) it hasn't imported any MR's. While I have tested the same on my self-managed instance and I was able to get a few MR's imported but still many of them were missing. Looking at the import failiuers we have received quite a few like:
#<ImportFailure:0x00007f1f0249d6f8
id: 980554,
relation_index: 1770,
project_id: SOMEID,
created_at: Mon, 24 May 2021 14:07:25 UTC +00:00,
relation_key: "[FILTERED]",
exception_class: "NoMethodError",
correlation_id_value: "01F6F999K08VHAWJY9Z3V8KNJY",
exception_message: "undefined method `b' for nil:NilClass",
retry_count: 0,
group_id: nil,
source: "process_relation_item!">
What is the expected correct behavior?
It should import all the MR's regardless.
ZD: https://gitlab.zendesk.com/agent/tickets/211631 (internal)