Fix retry mechanism for projects with pending_delete status

What does this MR do and why?

Projects with pending_delete: true were being excluded from the marked_for_deletion_before scope due to the without_deleted filter. This prevented the retry mechanism from working properly for projects that failed to complete the deletion process, leaving them stuck in a pending state.

References

https://gitlab.com/gitlab-com/request-for-help/-/issues/3859

Query plans

Ref: !216459 (merged)

How to set up and validate locally

  1. Start the Rails console: rails console

  2. Find a project and mark it as pending_delete:

   project = Project.last
   project.update!(
     marked_for_deletion_by_user_id: User.first.id,
     marked_for_deletion_at: 10.days.ago,
     pending_delete: true
   )
  1. Verify the project is now included in the scope:
   Project.marked_for_deletion_before(Date.today).include?(project) # Expected: true (was false before the fix)

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 #583421

Edited by Abdul Wadood

Merge request reports

Loading