Change stage execution order in GitHub Import
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=431943) </details> <!--IssueSummary end--> ### Context As mentioned in our [GitHub Import development docs](https://docs.gitlab.com/ee/development/github_importer.html#stages), GitHub Import imports resources in stages and as described in https://gitlab.com/gitlab-org/gitlab/-/issues/431603, some stages can take a long time to complete because they use a single endpoint to retrieve the data. Currently, the stages are executed in the following order: 1. :rabbit: Stage::ImportRepositoryWorker 1. :rabbit: Stage::ImportBaseDataWorker 1. :rabbit: Stage::ImportPullRequestsWorker 1. :rabbit: Stage::ImportCollaboratorsWorker 1. :turtle: Stage::ImportPullRequestsMergedByWorker 1. :turtle: Stage::ImportPullRequestsReviewRequestsWorker 1. :turtle: Stage::ImportPullRequestsReviewsWorker 1. :turtle: Stage::ImportIssuesAndDiffNotesWorker 1. :turtle: Stage::ImportIssueEventsWorker 1. :turtle: Stage::ImportNotesWorker 1. :rabbit: Stage::ImportAttachmentsWorker 1. :rabbit: Stage::ImportProtectedBranchesWorker 1. :rabbit: Stage::ImportLfsObjectsWorker :rabbit: = Fast worker. Uses collection endpoint / :turtle: = Slow worker. Uses single endpoint ## Idea It seems that GitHub Import does not follow the correct order of importance when executing the stages and doesn't take into account how long each stage can take to execute. Migrating important items first can be beneficial to users in case a migration fails in the middle. For instance, the user can decide to use the project without the missing resources if they aren't too important to them. ## Proposed solution Change the execution order of the stages. 1. :rabbit: Stage::ImportRepositoryWorker 1. :rabbit: Stage::ImportBaseDataWorker 1. :rabbit: Stage::ImportProtectedBranchesWorker 1. :rabbit: Stage::ImportPullRequestsWorker 1. :rabbit: Stage::ImportIssues (Split ImportIssuesAndDiffNotesWorker into two stages) 1. :rabbit: Stage::ImportCollaboratorsWorker 1. :rabbit: Stage::ImportLfsObjectsWorker 1. :turtle: Stage::DiffNotesWorker (Split ImportIssuesAndDiffNotesWorker into two stages) 1. :turtle: Stage::ImportNotesWorker 1. :rabbit: Stage::ImportAttachmentsWorker 1. :turtle: Stage::ImportPullRequestsMergedByWorker 1. :turtle: Stage::ImportPullRequestsReviewRequestsWorker 1. :turtle: Stage::ImportPullRequestsReviewsWorker 1. :turtle: Stage::ImportIssueEventsWorker
issue