From 820d6aba33616606dfaf83113f963189135db702 Mon Sep 17 00:00:00 2001 From: Hitesh Pattanayak <48874082+HiteshRepo@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:02:17 +0530 Subject: [PATCH] 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? - [ ] :white_check_mark: Yes, it's included - [x] :clock1: Yes, but in a later PR - [ ] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Supportability/Tests - [ ] :computer: CI/Deployment - [x] :broom: Tech Debt/Cleanup #### Issue(s) #4754 #### Test Plan - [x] :muscle: Manual - [x] :zap: Unit test - [x] :green_heart: E2E --- .github/workflows/sanity-test.yaml | 4 ++-- src/cli/flags/sharepoint.go | 7 ------- src/cli/restore/sharepoint.go | 6 ------ src/cli/utils/sharepoint.go | 2 -- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/sanity-test.yaml b/.github/workflows/sanity-test.yaml index c2c9609079..da18b22285 100644 --- a/.github/workflows/sanity-test.yaml +++ b/.github/workflows/sanity-test.yaml @@ -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 }} diff --git a/src/cli/flags/sharepoint.go b/src/cli/flags/sharepoint.go index 263bdcf923..2e8ff11808 100644 --- a/src/cli/flags/sharepoint.go +++ b/src/cli/flags/sharepoint.go @@ -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 diff --git a/src/cli/restore/sharepoint.go b/src/cli/restore/sharepoint.go index 2a04cb51f8..2b068ba9b5 100644 --- a/src/cli/restore/sharepoint.go +++ b/src/cli/restore/sharepoint.go @@ -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, diff --git a/src/cli/utils/sharepoint.go b/src/cli/utils/sharepoint.go index c7407a23e2..0270441a4a 100644 --- a/src/cli/utils/sharepoint.go +++ b/src/cli/utils/sharepoint.go @@ -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,