[go: up one dir, main page]

Skip to content

[[DO NOT MERGE]] Use RefsFinder to filter by protected_branches and protected_tags names

What does this MR do and why?

This MR improves the performance of protected branches and tags by replacing direct repository cache calls with RefsFinder to avoid expensive cache operations. Instead of using repository.branch_names and repository.tag_names which can be slow for large repositories, we now use Gitlab::Git::Finders::RefsFinder which provides more efficient ref searching with pattern matching support.

Key Changes:

  1. Protected Tags Controller: Updated show action to use RefsFinder instead of @protected_ref.matching(project_refs) and added pagination support
  2. Protected Branches Controller: Added ref_type method and updated to use RefsFinder pattern
  3. Caching Layer: Introduced ProtectedTags::CacheService to cache matching tag counts and reduce repeated calculations
  4. Service Layer: Updated protected tag services (Create/Update/Destroy) to refresh cache when tags are modified
  5. Repository Integration: Added cache invalidation hooks when tags are expired

References

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #555064 (closed)

Edited by Javiera Tapia

Merge request reports

Loading