WIP: Add SKIP options to backup restore task
What does this MR do?
Add ENV['SKIP']
options for backup restore. Addresses #19347 (closed)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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
Activity
2 Warnings This merge request does not refer to an existing milestone. You’ve made some app changes, but didn’t add any tests.
That’s OK as long as you’re refactoring existing code,
but please consider adding any of the ~”backstage”, ~”tooling”, ~”tooling::pipelines”, ~”tooling::workflow”, ~”documentation”, ~”QA” labels.1 Message CHANGELOG missing: If you want to create a changelog entry for GitLab FOSS, run the following:
bin/changelog -m 36738 "Add SKIP options to backup restore task"
If you want to create a changelog entry for GitLab EE, run the following instead:
bin/changelog --ee -m 36738 "Add SKIP options to backup restore task"
If this merge request doesn’t need a CHANGELOG entry, feel free to ignore this message.
Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category (e.g. frontend or backend), and by a maintainer in all other categories.
To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited, or the chosen person is unavailable.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, mention them as you normally would! Danger does not automatically notify them for you.
Category Reviewer Maintainer backend Alex Ives ( @alexives
) (UTC-5)Douglas Barbosa Alexandre ( @dbalexandre
) (UTC-4)If needed, you can retry the
danger-review
job that generated this comment.Generated by
DangerEdited by 🤖 GitLab Bot 🤖added Support Team Contributions rake tasks labels
added Category:Backup/Restore of GitLab instances typefeature labels
Setting label(s) devopsenablement groupgeo sectionenablement based on Category:Backup/Restore of GitLab instances groupgeo.
added devopssystems groupgeo sectioncore platform labels
@alexives I've gotten lost in the weeds a bit on this one. It seemed a bit hacky to just add the ENV lines, but it is what the backup create is basically doing. Any thoughts or suggestions? Not sure what is all needed to get this over the finish line.
@davinwalker, no worries! One of the limitations of
rake
is it's ability to take arguments, so this is one of the more reliable ways of getting options passed in.I left a couple of comments in there, but the next big thing is to look into why the specs are failing and get that sorted. Also probably needs to get updated with master!
If you want to pair up and see if we can get this over the finish line, I'm happy to pair up with you! Just go ahead and throw something on my calendar!
Just occurred to me that the spec is probably failing because
ENV['SKIP']
isn't defined. If you take a look at whatcreate
does to handle it (it checks forENV['SKIP']
to be defined first). We may want to add some specs for that to make sure that the new skip logic works as we expect!Edited by Alex Ives
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") 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
@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)