Skip to content

Stop backup files from requiring directories to exist when skipped

James Fargher requested to merge fix_backup_files into master

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

  1. Temporarily move a previously required directory.
    $ mv shared/artifacts shared/artifacts.old
  2. 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.

Edited by James Fargher

Merge request reports