Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
enables lists restore (#5158)
Browse files Browse the repository at this point in the history
enables lists restore

should go in after #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
  • Loading branch information
HiteshRepo authored Jan 30, 2024
1 parent 576c9f6 commit 820d6ab
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sanity-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
7 changes: 0 additions & 7 deletions src/cli/flags/sharepoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -35,7 +34,6 @@ var (
ListModifiedBeforeFV string
ListCreatedAfterFV string
ListCreatedBeforeFV string
AllowListsRestoreFV bool

PageFolderFV []string
PageFV []string
Expand Down Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions src/cli/restore/sharepoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/cli/utils/sharepoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ type SharePointOpts struct {
ListModifiedBefore string
ListCreatedBefore string
ListCreatedAfter string
AllowListsRestore bool

PageFolder []string
Page []string
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 820d6ab

Please sign in to comment.