diff --git a/CHANGELOG.md b/CHANGELOG.md index 5274c39b7..f4f9baf89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 2555dbc27..a5d2080fa 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -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) diff --git a/src/internal/operations/backup_integration_test.go b/src/internal/operations/backup_integration_test.go index 2bc4678ba..32630dd6a 100644 --- a/src/internal/operations/backup_integration_test.go +++ b/src/internal/operations/backup_integration_test.go @@ -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 }, }