Use .json extension for message exports (#4600)

We were previously exporting json but without the proper file extension.

---

#### 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

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

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* closes https://github.com/alcionai/corso/issues/4581

#### Test Plan

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

View File

@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] (beta)
### Changed
- Change file extension of messages export to json to match the content
## [v0.15.0] (beta) - 2023-10-31
### Added

View File

@ -61,10 +61,12 @@ func streamItems(
stats.UpdateResourceCount(path.ChannelMessagesCategory)
body = data.ReaderWithStats(body, path.ChannelMessagesCategory, stats)
// messages are exported as json and should be named as such
name := item.ID() + ".json"
ch <- export.Item{
ID: item.ID(),
// channel message items have no name
Name: item.ID(),
ID: item.ID(),
Name: name,
Body: body,
}
}

View File

@ -46,7 +46,7 @@ func (suite *ExportUnitSuite) TestStreamItems() {
},
},
},
expectName: "zim",
expectName: "zim.json",
expectErr: assert.NoError,
},
{
@ -71,7 +71,7 @@ func (suite *ExportUnitSuite) TestStreamItems() {
clues.New("I miss my cupcake."),
},
},
expectName: "gir",
expectName: "gir.json",
expectErr: assert.Error,
},
}

View File

@ -70,7 +70,7 @@ func (suite *ExportUnitSuite) TestExportRestoreCollections_messages() {
expectedItems = []export.Item{
{
ID: itemID,
Name: dii.Groups.ItemName,
Name: dii.Groups.ItemName + ".json",
// Body: body, not checked
},
}