Skip to content

Use `#bulk_create` for Branches::CreateService

Vasilii Iakliushin requested to merge 368614_bulk_branch_create into master

What does this MR do and why?

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.

  1. Enable feature flag
Feature.enable(:pull_mirror_bulk_branches)
  1. Create a new project with empty repository
  2. Setup a pull mirroring with http://127.0.0.1:3000/flightjs/Flight.git
  1. After it's successfully mirrored, the number of branches should match the parent project
  1. Add new branches to the parent project - http://127.0.0.1:3000/flightjs/Flight/-/branches/new
  2. Restart the pull mirroring
  1. 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.

Edited by Vasilii Iakliushin

Merge request reports

Loading