From 2d590048a5f23cd8d0754d7afb27e8dcc7a3d6f1 Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Wed, 6 Sep 2023 12:41:37 +0530 Subject: [PATCH] Add sites to metadata path (#4169) This makes the following change to the metadata path: ```diff -tenant/groupsMetadata/resourceOwner/libraries +tenant/groupsMetadata/resourceOwner/libraries/sites/site-id ``` The change only affect groups and no other services. --- #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Supportability/Tests - [ ] :computer: CI/Deployment - [x] :broom: Tech Debt/Cleanup #### Issue(s) * # #### Test Plan - [ ] :muscle: Manual - [x] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/m365/collection/drive/group_handler.go | 5 +++++ src/internal/m365/collection/drive/group_handler_test.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/internal/m365/collection/drive/group_handler.go b/src/internal/m365/collection/drive/group_handler.go index 386b3c696..5a2438c21 100644 --- a/src/internal/m365/collection/drive/group_handler.go +++ b/src/internal/m365/collection/drive/group_handler.go @@ -63,6 +63,11 @@ func (h groupBackupHandler) MetadataPathPrefix(tenantID string) (path.Path, erro return nil, clues.Wrap(err, "making metadata path") } + p, err = p.Append(false, odConsts.SitesPathDir, h.siteID) + if err != nil { + return nil, clues.Wrap(err, "appending sites to metadata path") + } + return p, nil } diff --git a/src/internal/m365/collection/drive/group_handler_test.go b/src/internal/m365/collection/drive/group_handler_test.go index bd44d5796..44847e80e 100644 --- a/src/internal/m365/collection/drive/group_handler_test.go +++ b/src/internal/m365/collection/drive/group_handler_test.go @@ -59,7 +59,7 @@ func (suite *GroupBackupHandlerUnitSuite) TestMetadataPathPrefix() { }{ { name: "group", - expect: "tenant/groupsMetadata/resourceOwner/libraries", + expect: "tenant/groupsMetadata/resourceOwner/libraries/sites/site-id", expectErr: assert.NoError, }, }