Skip to content
Snippets Groups Projects

WIP: Add SKIP options to backup restore task

Closed Davin Walker requested to merge dw-19347-skip-restore into master
3 unresolved threads

What does this MR do?

Add ENV['SKIP'] options for backup restore. Addresses #19347 (closed)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
70 70 end
71 71 end
72 72
73 Rake::Task['gitlab:backup:repo:restore'].invoke unless backup.skipped?('repositories')
74 Rake::Task['gitlab:backup:uploads:restore'].invoke unless backup.skipped?('uploads')
75 Rake::Task['gitlab:backup:builds:restore'].invoke unless backup.skipped?('builds')
76 Rake::Task['gitlab:backup:artifacts:restore'].invoke unless backup.skipped?('artifacts')
77 Rake::Task['gitlab:backup:pages:restore'].invoke unless backup.skipped?('pages')
78 Rake::Task['gitlab:backup:lfs:restore'].invoke unless backup.skipped?('lfs')
79 Rake::Task['gitlab:backup:registry:restore'].invoke unless backup.skipped?('registry')
73 Rake::Task['gitlab:backup:repo:restore'].invoke unless backup.skipped?('repositories') || ENV["SKIP"].include?("repositories")
  • Instead, I'd suggest including this skip logic in the restore commands themselves. That way you can note that they're being excluded. (Though I guess it'll still not say anything if it's skipped in configuration.)

  • Please register or sign in to reply
  • Alex Ives
  • 103 103
    104 104 task restore: :gitlab_environment do
    105 105 puts_time "Restoring repositories ...".color(:blue)
    106 106 Backup::Repository.new(progress).restore
    • So if you change this to be like the create task, then we get a little more information about things that are configured to be skipped

      Suggested change
      106 Backup::Repository.new(progress).restore
      106 if ENV["SKIP"] && ENV["SKIP"].include?("repositories")
      107 puts_time "[SKIPPED]".color(:cyan)
      108 else
      109 Backup::Repository.new(progress).restore
      110 puts_time "done".color(:green)
      111 end
    • Please register or sign in to reply
  • @davinwalker Just came across this and curious about the status. Let me know if the team can provide some more help.

  • @davinwalker Since the code here has been significantly updated, I opted to raise a new MR to implement this. !83783 (merged)

  • This is a sad combination of my dropping the ball and getting lost in the weeds. The new MR looks great and way cleaner than this! Excited for it! Going to close this in favor of that.

  • closed

  • Please register or sign in to reply
    Loading