Use `#bulk_create` for Branches::CreateService
What does this MR do and why?
- Contributes to #368614
- Feature flag: #368797 (closed)
Problem
Creating branch one by one triggers Redis cache recreation for each iteration.
Solution
- Add
Branches::CreateService#bulk_create
method to handle creation of branches collection. - Add tests to ensure that Redis cache is created only once
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Enable feature flag
Feature.enable(:pull_mirror_bulk_branches)
- Create a new project with empty repository
- Setup a pull mirroring with
http://127.0.0.1:3000/flightjs/Flight.git
- After it's successfully mirrored, the number of branches should match the parent project
- Add new branches to the parent project - http://127.0.0.1:3000/flightjs/Flight/-/branches/new
- Restart the pull mirroring
- When update is complete, you will see new branches synchronized with your project
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 Vasilii Iakliushin