Use HumanString for export folder names (#4276)

`Libraries` is what gets used for SP libraries and using `channelMessages` here did not look good.

Ref: fe77c30e84/src/internal/m365/service/sharepoint/export.go (L49-L52)

---

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

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

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [x] 🧹 Tech Debt/Cleanup

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #<issue>

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
Abin Simon 2023-09-21 10:35:11 +05:30 committed by GitHub
parent 231c0a65a0
commit a28f57a6de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -40,7 +40,7 @@ func ProduceExportCollections(
var (
fp = restoreColl.FullPath()
cat = fp.Category()
folders = []string{cat.String()}
folders = []string{cat.HumanString()}
coll export.Collectioner
)
@ -66,13 +66,13 @@ func ProduceExportCollections(
driveName = drivePath.DriveID
}
folders := restoreColl.FullPath().Folders()
siteName := folders[1] // use siteID by default
rfds := restoreColl.FullPath().Folders()
siteName := rfds[1] // use siteID by default
webURL, ok := backupSiteIDWebURL.NameOf(siteName)
if !ok {
// This should not happen, but just in case
logger.Ctx(ctx).With("site_id", folders[1]).Info("site weburl not found, using site id")
logger.Ctx(ctx).With("site_id", rfds[1]).Info("site weburl not found, using site id")
}
if len(webURL) != 0 {
@ -83,7 +83,7 @@ func ProduceExportCollections(
}
baseDir := path.Builder{}.
Append("Libraries").
Append(folders...).
Append(siteName).
Append(driveName).
Append(drivePath.Folders...)

View File

@ -67,7 +67,7 @@ func (suite *ExportUnitSuite) TestExportRestoreCollections_messages() {
body = io.NopCloser(bytes.NewBufferString(
`{"displayname": "` + dii.Groups.ItemName + `"}`))
exportCfg = control.ExportConfig{}
expectedPath = path.ChannelMessagesCategory.String() + "/" + containerName
expectedPath = path.ChannelMessagesCategory.HumanString() + "/" + containerName
expectedItems = []export.Item{
{
ID: itemID,

View File

@ -47,7 +47,7 @@ func ProduceExportCollections(
}
baseDir := path.Builder{}.
Append("Libraries").
Append(path.LibrariesCategory.HumanString()).
Append(driveName).
Append(drivePath.Folders...)

View File

@ -67,7 +67,7 @@ func (suite *ExportUnitSuite) TestExportRestoreCollections() {
// Cache check with lowercased ids
map[string]string{strings.ToLower(driveID): driveName})
dii = odStub.DriveItemInfo()
expectedPath = "Libraries/" + driveName
expectedPath = path.LibrariesCategory.HumanString() + "/" + driveName
expectedItems = []export.Item{
{
ID: "id1.data",