Speed up project creation by inlining repository creation
What does this MR do?
Stops shelling out to gitlab-shell/bin/gitlab-projects when creating repositories. Instead, we do it directly in gitlab.
This is a 3 or 4-order-of-magnitude speedup when benchmarked locally (~120ms to < 0.1ms)
Each project creation involves two add_repository
calls - project and wiki - so this removes about 240ms from a 600ms API call locally.
Benchmarking it, project create calls to a personal namespace now take 250-350ms locally.
Project imports are left untouched as the time saved would be dwarfed by the git fetch
operation anyway.
Are there points in the code the reviewer needs to double check?
This replicates code currently in the gitlab-shell
repository. That code should really move to gitaly
instead. However, I don't think that should stop us from improving things now.
This is stomping all over our layers of abstraction, so I'll understand if this MR is deemed unacceptable
Why was this MR needed?
Speed up project creation
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
- [N/a] Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- [N/a]
Documentation created/updated - [N/a] API support added
-
Tests added for this feature/bug - Review
-
Has been reviewed by Backend
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together
What are the relevant issue numbers?
Closes #34533 (closed)