Fix Wiki Pipeline network error if group wiki does not exist
What does this MR do and why?
This MR:
- Fixes a bug when importing project/group wikis as part of GitLab Group Migration (that includes projects) https://docs.gitlab.com/ee/user/group/import/ Bug occurred when groups or projects do not have any wiki pages and exception was raised
Gitlab::Git::CommandError 2:fetch remote: "remote: A repository for this group wiki does not exist yet.\nfatal: repository 'http://gdk.test:3000/mygroup/testing-group.wiki.git/' not found\n": exit status 128.
- This MR adds a preliminary check on source to see if there are any wiki pages available before doing wiki repository import
- This MR also updates
BulkImports::Clients::HTTP
to have a more detailed error message when a non-successful http response is returned. Before it was justBulkImports::NetworkError
, now it's going to beUnsuccessful response 404 from /api/v4/.../wikis
to bring more information on what went wrong.
Mentions #345923 (closed)
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
-
Feature.enable(:bulk_import)
. -
Feature.enable(:bulk_import_projects)
. - Create a top level group and project in it.
- Do not add any wikis to the project/group
- Go to
/groups/new#import-group-pane
page and enter instance url and access token (needs to beapi
&read_repository
scope). - Select newly created group and click Import.
- Wait for Group import to complete and verify
bulk_import_failures
table. It should not contain any errors fromWikiPipeline
- Add any wikis to project/group and rerun import. Verify that wikis are migrated.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by George Koltsov