osf.io icon indicating copy to clipboard operation
osf.io copied to clipboard

[ENG-8515] - Add management command to manual archive

Open Vlad0n20 opened this issue 3 months ago • 3 comments

Purpose

Changes

process_manual_restart_approvals checks all manually restarted registrations and determines if they're ready for approval

  • Celery Tasks:
    • check_manual_restart_approval - handles individual registrations
    • check_manual_restart_approvals_batch - processes multiple registrations
    • delayed_manual_restart_approval - schedules delayed checks

Added was_manually_restarted() function that checks if a registration was manually restarted within the last 48 hours Modified archive_success() to automatically schedule an approval check 5 minutes after successful archival This ensures manually restarted registrations get back into the approval pipeline When an admin uses the "Force Archive" feature, it now logs this action in AdminLogEntry

old flow:

  1. Admins manually restart failed registrations
  2. The registration archives successfully
  3. But it never enters the auto-approval queue because it missed the original workflow
  4. The registration sits in "pending approval" state indefinitely
  5. Requires manual intervention to approve each one

new one:

  1. System tracks when admins manually restart registrations (audit log)
  2. Upon successful archival, automatically schedules approval check
  3. Management command verifies the registration meets all approval criteria
  4. Automatically approves if past 48-hour window and all checks pass
  5. Closes the gap in the approval workflow

QA Notes

Please make verification statements inspired by your code and what your code touches.

  • Verify
  • Verify

What are the areas of risk?

Any concerns/considerations/questions that development raised?

Documentation

Side Effects

Ticket

https://openscience.atlassian.net/browse/ENG-8515?atlOrigin=eyJpIjoiZjdmOTIyZTYxOGIxNDAzNjhhZmY5ZjliYzQzMjg4MzciLCJwIjoiaiJ9

Vlad0n20 avatar Oct 13 '25 12:10 Vlad0n20

@Vlad0n20 Could you rebase this onto the latest feature/pbs-25-21 branch?

adlius avatar Oct 22 '25 14:10 adlius

@Vlad0n20 Could you rebase this onto the latest feature/pbs-25-21 branch? @adlius Done

Vlad0n20 avatar Oct 23 '25 12:10 Vlad0n20

@Vlad0n20 There is a merge conflict. Also, could you update the PR description to include a bit more info for the fix (e.g. the purpose of the two management commands) so that reviewers have a better idea about the fix? Thanks.

adlius avatar Oct 23 '25 16:10 adlius