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:
parent
231c0a65a0
commit
a28f57a6de
@ -40,7 +40,7 @@ func ProduceExportCollections(
|
|||||||
var (
|
var (
|
||||||
fp = restoreColl.FullPath()
|
fp = restoreColl.FullPath()
|
||||||
cat = fp.Category()
|
cat = fp.Category()
|
||||||
folders = []string{cat.String()}
|
folders = []string{cat.HumanString()}
|
||||||
coll export.Collectioner
|
coll export.Collectioner
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -66,13 +66,13 @@ func ProduceExportCollections(
|
|||||||
driveName = drivePath.DriveID
|
driveName = drivePath.DriveID
|
||||||
}
|
}
|
||||||
|
|
||||||
folders := restoreColl.FullPath().Folders()
|
rfds := restoreColl.FullPath().Folders()
|
||||||
siteName := folders[1] // use siteID by default
|
siteName := rfds[1] // use siteID by default
|
||||||
|
|
||||||
webURL, ok := backupSiteIDWebURL.NameOf(siteName)
|
webURL, ok := backupSiteIDWebURL.NameOf(siteName)
|
||||||
if !ok {
|
if !ok {
|
||||||
// This should not happen, but just in case
|
// 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 {
|
if len(webURL) != 0 {
|
||||||
@ -83,7 +83,7 @@ func ProduceExportCollections(
|
|||||||
}
|
}
|
||||||
|
|
||||||
baseDir := path.Builder{}.
|
baseDir := path.Builder{}.
|
||||||
Append("Libraries").
|
Append(folders...).
|
||||||
Append(siteName).
|
Append(siteName).
|
||||||
Append(driveName).
|
Append(driveName).
|
||||||
Append(drivePath.Folders...)
|
Append(drivePath.Folders...)
|
||||||
|
|||||||
@ -67,7 +67,7 @@ func (suite *ExportUnitSuite) TestExportRestoreCollections_messages() {
|
|||||||
body = io.NopCloser(bytes.NewBufferString(
|
body = io.NopCloser(bytes.NewBufferString(
|
||||||
`{"displayname": "` + dii.Groups.ItemName + `"}`))
|
`{"displayname": "` + dii.Groups.ItemName + `"}`))
|
||||||
exportCfg = control.ExportConfig{}
|
exportCfg = control.ExportConfig{}
|
||||||
expectedPath = path.ChannelMessagesCategory.String() + "/" + containerName
|
expectedPath = path.ChannelMessagesCategory.HumanString() + "/" + containerName
|
||||||
expectedItems = []export.Item{
|
expectedItems = []export.Item{
|
||||||
{
|
{
|
||||||
ID: itemID,
|
ID: itemID,
|
||||||
|
|||||||
@ -47,7 +47,7 @@ func ProduceExportCollections(
|
|||||||
}
|
}
|
||||||
|
|
||||||
baseDir := path.Builder{}.
|
baseDir := path.Builder{}.
|
||||||
Append("Libraries").
|
Append(path.LibrariesCategory.HumanString()).
|
||||||
Append(driveName).
|
Append(driveName).
|
||||||
Append(drivePath.Folders...)
|
Append(drivePath.Folders...)
|
||||||
|
|
||||||
|
|||||||
@ -67,7 +67,7 @@ func (suite *ExportUnitSuite) TestExportRestoreCollections() {
|
|||||||
// Cache check with lowercased ids
|
// Cache check with lowercased ids
|
||||||
map[string]string{strings.ToLower(driveID): driveName})
|
map[string]string{strings.ToLower(driveID): driveName})
|
||||||
dii = odStub.DriveItemInfo()
|
dii = odStub.DriveItemInfo()
|
||||||
expectedPath = "Libraries/" + driveName
|
expectedPath = path.LibrariesCategory.HumanString() + "/" + driveName
|
||||||
expectedItems = []export.Item{
|
expectedItems = []export.Item{
|
||||||
{
|
{
|
||||||
ID: "id1.data",
|
ID: "id1.data",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user