Log if file tagged as malware by graph (#2700)

Graph exposes a "malware" filed in the delta response. This just logs that if we fail to download an item.


---

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

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

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 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. -->
* #<issue>

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
Abin Simon 2023-03-04 02:51:44 +05:30 committed by GitHub
parent 214db6fe97
commit 5255517067
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -410,7 +410,12 @@ func (oc *Collection) populateItems(ctx context.Context, errs *fault.Bus) {
// check for errors following retries
if err != nil {
logger.Ctx(ctx).With("error", err.Error()).Error("downloading item")
if item.GetMalware() != nil {
logger.Ctx(ctx).With("error", err.Error(), "malware", true).Error("downloading item")
} else {
logger.Ctx(ctx).With("error", err.Error()).Error("downloading item")
}
el.AddRecoverable(clues.Stack(err).WithClues(ctx).Label(fault.LabelForceNoBackupCreation))
return nil, err
}

View File

@ -183,6 +183,7 @@ func defaultItemPager(
"sharepointIds",
"size",
"deleted",
"malware",
},
)
}