API: Creating project via import_url should respond only after import is done
Description
When importing a project via the API by setting import_url
the request will respond with the project before the import is done. Thus immediate calls to /projects/:id/reposistory/tree
for instance result in a 404 error.
Proposal
Respond to the HTTP request only after importing of the project is done. If importing fails, respond with an error and don't create the project.
Links / references
https://docs.gitlab.com/ce/api/projects.html#create-project
This may also help with https://gitlab.com/gitlab-org/gitlab-ce/issues/26610.
Edited by Kaspar Emanuel