Migration: Disable push mirrors exceeding the per-project limit
Overview
Create a database migration to disable push mirrors that exceed the per-project limit of 10 enabled mirrors.
Context
As part of !221965, we're enforcing an upper limit of 10 enabled push mirrors per project. However, there are existing projects with more than 10 mirrors:
- 265 projects have >10 mirrors
- 40 projects have >20 mirrors
- 3 projects have >100 mirrors
Solution
This migration should:
- Identify all projects with more than 10 enabled push mirrors
- For each project, disable mirrors beyond the first 10 (ordered by ID)
- Ensure the migration is idempotent and safe to run multiple times
Implementation Details
The migration should:
- Query projects with enabled mirrors count > 10
- For each project, disable mirrors with ID > the 10th mirror's ID
- Log the number of mirrors disabled for audit purposes
Related Issues
Acceptance Criteria
- Migration successfully disables excess mirrors
- Migration is idempotent
- No data loss occurs
- Migration includes appropriate logging
- Tests verify the migration behavior
Edited by 🤖 GitLab Bot 🤖