Enable OneDrive incrementals, disable incrementals for permission backup (#2642)

Permissions backup requires more work, so we only support delta incrementals for OneDrive if that's not enabled.

---

#### Does this PR need a docs update or release note?

- [x]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [ ]  No

#### Type of change

- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

* #2333

Pending merge of
* #2650
* #2496

#### Test Plan

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2023-03-18 10:37:44 -07:00 committed by GitHub
parent c28d5399ef
commit a13479a0f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 11 deletions

View File

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Sharepoint library (document files) support: backup, list, details, and restore.
- OneDrive item downloads that return 404 during backup (normally due to external deletion while Corso processes) are now skipped instead of quietly dropped. These items will appear in the skipped list alongside other skipped cases such as malware detection.
- Listing a single backup by id will also list the skipped and failed items that occurred during the backup. These can be filtered out with the flags `--failed-items hide`, `--skipped-items hide`, and `--recovered-errors hide`.
- Enable incremental backups for OneDrive if permissions aren't being backed up.
### Fixed
- Fix repo connect not working without a config file
@ -20,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Known Issues
- Owner (Full control) or empty (Restricted View) roles cannot be restored for OneDrive
- OneDrive will not do an incremental backup if permissions are being backed up.
### Known Issues
- Event instance exceptions (ie: changes to a single event within a recurring series) are not backed up.

View File

@ -292,12 +292,20 @@ func (op *BackupOperation) do(
// checker to see if conditions are correct for incremental backup behavior such as
// retrieving metadata like delta tokens and previous paths.
func useIncrementalBackup(sel selectors.Selector, opts control.Options) bool {
// Delta-based incrementals currently only supported for Exchange
if sel.Service != selectors.ServiceExchange {
enabled := !opts.ToggleFeatures.DisableIncrementals
switch sel.Service {
case selectors.ServiceExchange:
return enabled
case selectors.ServiceOneDrive:
// TODO(ashmrtn): Remove the && part once we support permissions and
// incrementals.
return enabled && !opts.ToggleFeatures.EnablePermissionsBackup
default:
return false
}
return !opts.ToggleFeatures.DisableIncrementals
}
// ---------------------------------------------------------------------------
@ -458,9 +466,7 @@ func consumeBackupDataCollections(
ctx,
bases,
cs,
// TODO(ashmrtn): When we're ready to enable incremental backups for
// OneDrive replace this with `excludes`.
nil,
excludes,
tags,
isIncremental,
errs)

View File

@ -1096,9 +1096,6 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_oneDrive() {
// TestBackup_Run ensures that Integration Testing works for OneDrive
func (suite *BackupOpIntegrationSuite) TestBackup_Run_oneDriveIncrementals() {
// TODO: Enable once we have https://github.com/alcionai/corso/pull/2642
suite.T().Skip("Enable once OneDrive incrementals is available")
ctx, flush := tester.NewContext()
defer flush()
@ -1413,7 +1410,7 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_oneDriveIncrementals() {
containerIDs[container3] = ptr.Val(resp.GetId())
},
itemsRead: 4, // 2*2 (.data and .meta for 2 files)
itemsRead: 2, // 2 .data for 2 files
itemsWritten: 6, // read items + 2 directory meta
},
}