Project Import uses Issue attachment upload limits

Summary

When using workhorse, Project import via the UI uses the setting Gitlab::CurrentSettings.max_attachment_size which the user can set in the admin settings: https://gitlab.com/gitlab-org/gitlab/blob/8160ad36/app/controllers/import/gitlab_projects_controller.rb#L41-41

.../admin/application_settings/general Screen_Shot_2020-05-07_at_1.20.04_PM

This setting should govern the max attachment size for attachments to entities like issues, not to the entire size of the export. In the Project import API, we use a constant of 50 megabytes instead: https://gitlab.com/gitlab-org/gitlab/blob/8160ad36/lib/api/project_import.rb#L7-7

We should align both these endpoints to use the same value, and not base this on the attachment size.

Steps to reproduce

  1. Export a project with a size larger than 10mb
  2. Try to import to an instance that is using object store and direct uploads

What is the current bug behaviour?

When uploading a gitlab import file via the UI, the response is "error": "entity is too large"

What is the expected correct behaviour?

The user can upload an export file via the UI that is the same size as a file they can upload via the API. In this case, that would be up to 50 megabytes.

Workarounds

  1. Increase the maximum attachment size while doing the importing
  2. Import the project via the API or Rake tasks instead.
Edited by Katrin Leinweber