Set up cronjob to clean up expired placeholder references
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=527002) </details> <!--IssueSummary end--> ## Background As part of the data retention policy for user contribution mapping tables https://gitlab.com/groups/gitlab-org/-/epics/17248, group owners have a 1-year window to perform user reassignments. After this period expires, contributions remain assigned to placeholder users if no action is taken. ## Description We need to implement an automated cleanup process to remove placeholder and expired membership references that have passed their expiration date. ### Technical Details - Create a new worker: `CleanupExpiredPlaceholderReferencesWorker` - Schedule to run every 6 hours using cron expression: `0 */6 * * *` - Worker should: - Remove expired records from `import_source_user_placeholder_references` table - Remove expired records from `import_placeholder_memberships` table - Implement loop-based batching with 5,000 records per batch - Delete records where `expires_at <= NOW()` ## Acceptance Criteria - [ ] Worker is implemented and properly scheduled - [ ] Expired records are successfully removed from both tables - [ ] Batching is implemented to handle large datasets efficiently
issue