modify onenote skip, clues add collection scope (#4472)

some additional logging context for collection scope.

---

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

- [x]  No

#### Type of change

- [x] 🤖 Supportability/Tests


#### Test Plan

- [x]  Unit test
- [x] 💚 E2E
This commit is contained in:
Keepers 2023-10-10 20:28:17 -06:00 committed by GitHub
parent 3656e04676
commit 107b6883d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 9 deletions

View File

@ -273,9 +273,9 @@ func (oc *Collection) getDriveItemContent(
// Skip big OneNote files as they can't be downloaded // Skip big OneNote files as they can't be downloaded
if clues.HasLabel(err, graph.LabelStatus(http.StatusServiceUnavailable)) && if clues.HasLabel(err, graph.LabelStatus(http.StatusServiceUnavailable)) &&
// oc.scope == CollectionScopePackage && *item.GetSize() >= MaxOneNoteFileSize {
// TODO: We've removed the file size check because it looks like we've seen persistent // TODO: We've removed the file size check because it looks like we've seen persistent
// 503's with smaller OneNote files also. // 503's with smaller OneNote files also.
// oc.scope == CollectionScopePackage && *item.GetSize() >= MaxOneNoteFileSize {
oc.scope == CollectionScopePackage { oc.scope == CollectionScopePackage {
// FIXME: It is possible that in case of a OneNote file we // FIXME: It is possible that in case of a OneNote file we
// will end up just backing up the `onetoc2` file without // will end up just backing up the `onetoc2` file without
@ -283,10 +283,18 @@ func (oc *Collection) getDriveItemContent(
// "item". This will have to be handled during the // "item". This will have to be handled during the
// restore, or we have to handle it separately by somehow // restore, or we have to handle it separately by somehow
// deleting the entire collection. // deleting the entire collection.
logger.CtxErr(ctx, err).With("skipped_reason", fault.SkipBigOneNote).Info("max OneNote file size exceeded") logger.
errs.AddSkip(ctx, fault.FileSkip(fault.SkipBigOneNote, driveID, itemID, itemName, graph.ItemInfo(item))) CtxErr(ctx, err).
With("skipped_reason", fault.SkipOneNote).
Info("inaccessible one note file")
errs.AddSkip(ctx, fault.FileSkip(
fault.SkipOneNote,
driveID,
itemID,
itemName,
graph.ItemInfo(item)))
return nil, clues.Wrap(err, "max oneNote item").Label(graph.LabelsSkippable) return nil, clues.Wrap(err, "inaccesible oneNote item").Label(graph.LabelsSkippable)
} }
errs.AddRecoverable( errs.AddRecoverable(

View File

@ -813,6 +813,8 @@ func (c *Collections) UpdateCollections(
colScope = CollectionScopePackage colScope = CollectionScopePackage
} }
ictx = clues.Add(ictx, "collection_scope", colScope)
col, err := NewCollection( col, err := NewCollection(
c.handler, c.handler,
c.protectedResource, c.protectedResource,

View File

@ -102,7 +102,7 @@ func New(
switch true { switch true {
case s.HasCause(fault.SkipMalware): case s.HasCause(fault.SkipMalware):
malware++ malware++
case s.HasCause(fault.SkipBigOneNote): case s.HasCause(fault.SkipOneNote):
invalidONFile++ invalidONFile++
default: default:
otherSkips++ otherSkips++

View File

@ -18,12 +18,12 @@ const (
// permanently fail any attempts to backup or restore. // permanently fail any attempts to backup or restore.
SkipMalware skipCause = "malware_detected" SkipMalware skipCause = "malware_detected"
// SkipBigOneNote identifies that a file was skipped because it // SkipOneNote identifies that a file was skipped because it
// was big OneNote file and we can only download OneNote files which // was a OneNote file that remains inaccessible (503 server response)
// are less that 2GB in size. // regardless of the number of retries.
//nolint:lll //nolint:lll
// https://support.microsoft.com/en-us/office/restrictions-and-limitations-in-onedrive-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07630fa#onenotenotebooks // https://support.microsoft.com/en-us/office/restrictions-and-limitations-in-onedrive-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07630fa#onenotenotebooks
SkipBigOneNote skipCause = "big_one_note_file" SkipOneNote skipCause = "inaccessible_one_note_file"
) )
var _ print.Printable = &Skipped{} var _ print.Printable = &Skipped{}