Skip to content

Refactor BackupManager#remove_old

James EJ requested to merge jej/fix-backup-manager-remove-old into master

What

Refactored BackupManager timestamp/regex handling.

Verified that tests were working correctly in response to https://gitlab.com/gitlab-org/gitlab-ce/issues/32796#note_30582742, and added names to describe the file names tested

Are there points in the code the reviewer needs to double check?

Yes, this will need to be rebased after the regex was updated in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14333

Why

https://gitlab.com/gitlab-org/gitlab-ce/issues/32796#things-to-improve

  • Improve the test suite so we're confident that no files that aren't supposed to be deleted could be deleted by an improper match
  • Potentially move from a regex to something more procedural, with multiple guards

Related

Edited by James EJ

Merge request reports