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
|
service: sharepoint
|
||||||
kind: first-backup-lists
|
kind: first-backup-lists
|
||||||
backup-args: '--site "${{ vars.CORSO_M365_TEST_SITE_URL }}" --data 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 }}"
|
export-args: "--list ${{ steps.new-data-creation-sharepoint-lists.outputs.result }}"
|
||||||
restore-container: "${{ steps.sharepoint-lists-store-restore-container.outputs.result }}"
|
restore-container: "${{ steps.sharepoint-lists-store-restore-container.outputs.result }}"
|
||||||
log-dir: ${{ env.CORSO_LOG_DIR }}
|
log-dir: ${{ env.CORSO_LOG_DIR }}
|
||||||
@ -446,7 +446,7 @@ jobs:
|
|||||||
service: sharepoint
|
service: sharepoint
|
||||||
kind: incremental-lists
|
kind: incremental-lists
|
||||||
backup-args: '--site "${{ vars.CORSO_M365_TEST_SITE_URL }}" --data 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 }}"
|
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 }}"
|
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 }}
|
log-dir: ${{ env.CORSO_LOG_DIR }}
|
||||||
|
|||||||
@ -18,7 +18,6 @@ const (
|
|||||||
ListModifiedBeforeFN = "list-modified-before"
|
ListModifiedBeforeFN = "list-modified-before"
|
||||||
ListCreatedAfterFN = "list-created-after"
|
ListCreatedAfterFN = "list-created-after"
|
||||||
ListCreatedBeforeFN = "list-created-before"
|
ListCreatedBeforeFN = "list-created-before"
|
||||||
AllowListsRestoreFN = "allow-lists-restore"
|
|
||||||
|
|
||||||
PageFolderFN = "page-folder"
|
PageFolderFN = "page-folder"
|
||||||
PageFN = "page"
|
PageFN = "page"
|
||||||
@ -35,7 +34,6 @@ var (
|
|||||||
ListModifiedBeforeFV string
|
ListModifiedBeforeFV string
|
||||||
ListCreatedAfterFV string
|
ListCreatedAfterFV string
|
||||||
ListCreatedBeforeFV string
|
ListCreatedBeforeFV string
|
||||||
AllowListsRestoreFV bool
|
|
||||||
|
|
||||||
PageFolderFV []string
|
PageFolderFV []string
|
||||||
PageFV []string
|
PageFV []string
|
||||||
@ -101,11 +99,6 @@ func AddSharePointDetailsAndRestoreFlags(cmd *cobra.Command) {
|
|||||||
&ListCreatedBeforeFV,
|
&ListCreatedBeforeFV,
|
||||||
ListCreatedBeforeFN, "",
|
ListCreatedBeforeFN, "",
|
||||||
"Select lists created before this datetime.")
|
"Select lists created before this datetime.")
|
||||||
fs.BoolVar(
|
|
||||||
&AllowListsRestoreFV,
|
|
||||||
AllowListsRestoreFN, false,
|
|
||||||
"enables lists restore if provided")
|
|
||||||
cobra.CheckErr(fs.MarkHidden(AllowListsRestoreFN))
|
|
||||||
|
|
||||||
// pages
|
// pages
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import (
|
|||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
"github.com/alcionai/corso/src/pkg/dttm"
|
"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.
|
// 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)
|
sel := utils.IncludeSharePointRestoreDataSelectors(ctx, opts)
|
||||||
utils.FilterSharePointRestoreInfoSelectors(sel, 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(
|
return runRestore(
|
||||||
ctx,
|
ctx,
|
||||||
cmd,
|
cmd,
|
||||||
|
|||||||
@ -30,7 +30,6 @@ type SharePointOpts struct {
|
|||||||
ListModifiedBefore string
|
ListModifiedBefore string
|
||||||
ListCreatedBefore string
|
ListCreatedBefore string
|
||||||
ListCreatedAfter string
|
ListCreatedAfter string
|
||||||
AllowListsRestore bool
|
|
||||||
|
|
||||||
PageFolder []string
|
PageFolder []string
|
||||||
Page []string
|
Page []string
|
||||||
@ -82,7 +81,6 @@ func MakeSharePointOpts(cmd *cobra.Command) SharePointOpts {
|
|||||||
ListModifiedBefore: flags.ListModifiedBeforeFV,
|
ListModifiedBefore: flags.ListModifiedBeforeFV,
|
||||||
ListCreatedAfter: flags.ListCreatedAfterFV,
|
ListCreatedAfter: flags.ListCreatedAfterFV,
|
||||||
ListCreatedBefore: flags.ListCreatedBeforeFV,
|
ListCreatedBefore: flags.ListCreatedBeforeFV,
|
||||||
AllowListsRestore: flags.AllowListsRestoreFV,
|
|
||||||
|
|
||||||
Page: flags.PageFV,
|
Page: flags.PageFV,
|
||||||
PageFolder: flags.PageFolderFV,
|
PageFolder: flags.PageFolderFV,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user