Stop backup files from requiring directories to exist when skipped
What does this MR do and why?
Fixes #353242 (closed)
Calls to File.realpath where the directory does not exist will raise an exception. Since all backup tasks are initialized no matter if they are skipped or not, we need to stop calling realpath within the initializer. Instead here we are lazily initializing realpath as required.
Removed assertions for the now private realpath accessors. These paths are still correctly asserted by checking the exact tar commandline arguments.
How to set up and validate locally
- Temporarily move a previously required directory.
$ mv shared/artifacts shared/artifacts.old
- Create a backup, skipping the task that would backup this directory. This will fail without this bug fix.
$ rake gitlab:backup:create SKIP=artifacts
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by James Fargher