Skip to content

Add backup cleanup and retention policy controls #1130

Description

@paullizer

Summary

Add admin-facing cleanup controls for Data Management backups, including manual backup deletion and an automatic retention policy that can delete backups after a configurable age expressed in days, weeks, months, or years.

User Value

Admins need a safe way to reduce backup storage growth and remove obsolete backups without editing Cosmos records or storage artifacts manually.

Proposed Behavior

  • Admins can delete selected backups from Backup Inventory after confirmation.
  • Data Management settings include a retention policy using a value and unit: days, weeks, months, or years.
  • Retention cleanup removes expired backup metadata and associated stored backup artifacts consistently.
  • Cleanup actions are logged as admin activity and return clear success/error feedback.

Acceptance Criteria

  • Backup Inventory exposes safe manual delete controls for eligible completed/failed/canceled backups.
  • Backend API validates and authorizes backup deletion requests for admins only.
  • Retention policy settings support days, weeks, months, and years with bounded validation.
  • Scheduled or background Data Management processing applies the retention policy without deleting backups newer than the cutoff.
  • Functional and route-policy tests cover validation, authorization, retention cutoff calculation, and deletion behavior.
  • UI tests cover retention settings and manual delete confirmation.

Notes

  • Existing backup settings already include retention_days; this work should preserve compatibility while adding the requested unit-based policy.
  • Relevant areas likely include functions_data_management.py, route_backend_data_management.py, admin_settings.html, admin_data_management.js, route tests, functional tests, and UI tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions