Skip to content

Fix Wiki Pipeline network error if group wiki does not exist

George Koltsov requested to merge georgekoltsov/fix-wiki-pipeline into master

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 just BulkImports::NetworkError, now it's going to be Unsuccessful 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

  1. Feature.enable(:bulk_import).
  2. Feature.enable(:bulk_import_projects).
  3. Create a top level group and project in it.
  4. Do not add any wikis to the project/group
  5. Go to /groups/new#import-group-pane page and enter instance url and access token (needs to be api & read_repository scope).
  6. Select newly created group and click Import.
  7. Wait for Group import to complete and verify bulk_import_failures table. It should not contain any errors from WikiPipeline
  8. 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.

Edited by George Koltsov

Merge request reports

Loading