enables lists restore (#5158)
enables lists restore should go in after https://github.com/alcionai/corso/pull/5121 #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [x] 🕐 Yes, but in a later PR - [ ] ⛔ 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) #4754 #### Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [x] ⚡ Unit test - [x] 💚 E2E
This commit is contained in:
parent
576c9f6b53
commit
820d6aba33
4
.github/workflows/sanity-test.yaml
vendored
4
.github/workflows/sanity-test.yaml
vendored
@ -403,7 +403,7 @@ jobs:
|
||||
service: sharepoint
|
||||
kind: first-backup-lists
|
||||
backup-args: '--site "${{ vars.CORSO_M365_TEST_SITE_URL }}" --data lists'
|
||||
restore-args: "--list ${{ steps.new-data-creation-sharepoint-lists.outputs.result }} --destination Corso_Test_Sanity_Restore_$(date +'%Y%m%d_%H%M%S') --allow-lists-restore"
|
||||
restore-args: "--list ${{ steps.new-data-creation-sharepoint-lists.outputs.result }} --destination Corso_Test_Sanity_Restore_$(date +'%Y%m%d_%H%M%S')"
|
||||
export-args: "--list ${{ steps.new-data-creation-sharepoint-lists.outputs.result }}"
|
||||
restore-container: "${{ steps.sharepoint-lists-store-restore-container.outputs.result }}"
|
||||
log-dir: ${{ env.CORSO_LOG_DIR }}
|
||||
@ -446,7 +446,7 @@ jobs:
|
||||
service: sharepoint
|
||||
kind: incremental-lists
|
||||
backup-args: '--site "${{ vars.CORSO_M365_TEST_SITE_URL }}" --data lists'
|
||||
restore-args: "--list ${{ steps.inc-data-creation-sharepoint-lists.outputs.result }},${{ steps.new-data-creation-sharepoint-lists.outputs.result }} --destination Corso_Test_Sanity_Restore_$(date +'%Y%m%d_%H%M%S') --allow-lists-restore"
|
||||
restore-args: "--list ${{ steps.inc-data-creation-sharepoint-lists.outputs.result }},${{ steps.new-data-creation-sharepoint-lists.outputs.result }} --destination Corso_Test_Sanity_Restore_$(date +'%Y%m%d_%H%M%S')"
|
||||
export-args: "--list ${{ steps.inc-data-creation-sharepoint-lists.outputs.result }},${{ steps.new-data-creation-sharepoint-lists.outputs.result }}"
|
||||
restore-container: "${{ steps.sharepoint-lists-store-restore-container-inc.outputs.result }},${{ steps.sharepoint-lists-store-restore-container.outputs.result }}"
|
||||
log-dir: ${{ env.CORSO_LOG_DIR }}
|
||||
|
||||
@ -18,7 +18,6 @@ const (
|
||||
ListModifiedBeforeFN = "list-modified-before"
|
||||
ListCreatedAfterFN = "list-created-after"
|
||||
ListCreatedBeforeFN = "list-created-before"
|
||||
AllowListsRestoreFN = "allow-lists-restore"
|
||||
|
||||
PageFolderFN = "page-folder"
|
||||
PageFN = "page"
|
||||
@ -35,7 +34,6 @@ var (
|
||||
ListModifiedBeforeFV string
|
||||
ListCreatedAfterFV string
|
||||
ListCreatedBeforeFV string
|
||||
AllowListsRestoreFV bool
|
||||
|
||||
PageFolderFV []string
|
||||
PageFV []string
|
||||
@ -101,11 +99,6 @@ func AddSharePointDetailsAndRestoreFlags(cmd *cobra.Command) {
|
||||
&ListCreatedBeforeFV,
|
||||
ListCreatedBeforeFN, "",
|
||||
"Select lists created before this datetime.")
|
||||
fs.BoolVar(
|
||||
&AllowListsRestoreFV,
|
||||
AllowListsRestoreFN, false,
|
||||
"enables lists restore if provided")
|
||||
cobra.CheckErr(fs.MarkHidden(AllowListsRestoreFN))
|
||||
|
||||
// pages
|
||||
|
||||
|
||||
@ -6,7 +6,6 @@ import (
|
||||
"github.com/alcionai/corso/src/cli/flags"
|
||||
"github.com/alcionai/corso/src/cli/utils"
|
||||
"github.com/alcionai/corso/src/pkg/dttm"
|
||||
"github.com/alcionai/corso/src/pkg/selectors"
|
||||
)
|
||||
|
||||
// called by restore.go to map subcommands to provider-specific handling.
|
||||
@ -87,11 +86,6 @@ func restoreSharePointCmd(cmd *cobra.Command, args []string) error {
|
||||
sel := utils.IncludeSharePointRestoreDataSelectors(ctx, opts)
|
||||
utils.FilterSharePointRestoreInfoSelectors(sel, opts)
|
||||
|
||||
if !opts.AllowListsRestore {
|
||||
// Exclude lists from restore since they are not supported yet.
|
||||
sel.Exclude(sel.Lists(selectors.Any()))
|
||||
}
|
||||
|
||||
return runRestore(
|
||||
ctx,
|
||||
cmd,
|
||||
|
||||
@ -30,7 +30,6 @@ type SharePointOpts struct {
|
||||
ListModifiedBefore string
|
||||
ListCreatedBefore string
|
||||
ListCreatedAfter string
|
||||
AllowListsRestore bool
|
||||
|
||||
PageFolder []string
|
||||
Page []string
|
||||
@ -82,7 +81,6 @@ func MakeSharePointOpts(cmd *cobra.Command) SharePointOpts {
|
||||
ListModifiedBefore: flags.ListModifiedBeforeFV,
|
||||
ListCreatedAfter: flags.ListCreatedAfterFV,
|
||||
ListCreatedBefore: flags.ListCreatedBeforeFV,
|
||||
AllowListsRestore: flags.AllowListsRestoreFV,
|
||||
|
||||
Page: flags.PageFV,
|
||||
PageFolder: flags.PageFolderFV,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user