-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
skips lists with certain templates from being backed-up #4931
Conversation
Current Aviator status
This PR was merged using Aviator. See the real-time status of this PR on the Aviator webapp. Use the Aviator Chrome Extension to see the status of your PR within GitHub.
|
@@ -358,7 +358,7 @@ func (sc *Collection) handleListItems( | |||
rc := io.NopCloser(bytes.NewReader(entryBytes)) | |||
itemInfo := details.ItemInfo{ | |||
SharePoint: info, | |||
NotRecoverable: template == api.WebTemplateExtensionsListTemplateName, | |||
NotRecoverable: api.NonRestorableListTemplates.HasKey(template), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this could have been two ifs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a list entry needs to be NonRecoverable if the template is either 'webTemplateExtensionsList' or 'documentLibrary'(temporarily). And NonRestorableListTemplates map contains both of them, so if the current listTemplate is either of the two types, NotRecoverable becomes true for that entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense, I was mentioning that this could be template == api.WebTemplateExtensionsListTemplateName || template == api.documentLibrary
. I personally feel this to be more clear.
src/pkg/services/m365/api/lists.go
Outdated
ptr.Val(newList.GetList().GetTemplate()) == WebTemplateExtensionsListTemplateName { | ||
return nil, clues.StackWC(ctx, ErrCannotCreateWebTemplateExtension) | ||
NonRestorableListTemplates.HasKey(ptr.Val(newList.GetList().GetTemplate())) { | ||
return nil, clues.StackWC(ctx, ErrCannotCreateNonRestorableListTemplate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the error could be something smaller like SystemListTempalte
and we could have more information in the comments next to the const definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
documentLibrary will not fall under system generated. Lists with that template needs to handled differently. Putting documentLibrary under non-restorable is temporary change. Should we shorten it to 'ErrNonRestorableListTemplate'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good, lets do ErrNonRestorableListTemplate
.
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
skips documentLibrary templated lists from:
but the lists with 'documentLibrary' are backed-up.
this is in addition to 'webTemplateExtensionsList' templated lists which were previously skipped from restore.
the
skipping
of lists with template 'documentLibrary' is temporary and to be enabled with correct handling.update:27/12/2023
skips
documentLibrary
,sharingLinks
,webTemplateExtensionsList
templated lists from being backed-up altogethersite contents of
https://10rqc2.sharepoint.com/sites/CorsoCI
:backup details
restore details
Does this PR need a docs update or release note?
Type of change
Issue(s)
#4754
Test Plan