diff --git a/src/.golangci.yml b/src/.golangci.yml index d930de245..38e093fdf 100644 --- a/src/.golangci.yml +++ b/src/.golangci.yml @@ -49,7 +49,7 @@ linters-settings: # String formatting should be avoided in favor of structured errors (ie: err.With(k, v)). - '(errors|fmt)\.(New|Stack|Wrap|Error)f?\((# error handling should use clues pkg)?' # Avoid Warn-level logging in favor of Info or Error. - - 'Warn[wf]?\((# logging should use Info or Error)?' + - 'Warnw?f?\((# logging should use Info or Error)?' # Prefer suite.Run(name, func() {}) for subtests as testify has it instead # of suite.T().Run(name, func(t *testing.T) {}). - '(T\(\)|\st[a-zA-Z0-9]*)\.Run(# prefer testify suite.Run(name, func()) )?' diff --git a/src/cli/backup/exchange_e2e_test.go b/src/cli/backup/exchange_e2e_test.go index 0807addc6..3a0954e3f 100644 --- a/src/cli/backup/exchange_e2e_test.go +++ b/src/cli/backup/exchange_e2e_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/suite" "github.com/alcionai/corso/src/cli" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/print" cliTD "github.com/alcionai/corso/src/cli/testdata" @@ -20,6 +19,7 @@ import ( "github.com/alcionai/corso/src/internal/operations" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" "github.com/alcionai/corso/src/pkg/services/m365/api" @@ -69,7 +69,7 @@ func (suite *NoBackupExchangeE2ESuite) TestExchangeBackupListCmd_noBackups() { cmd := cliTD.StubRootCmd( "backup", "list", "exchange", - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) cmd.SetErr(&suite.dpnd.recorder) @@ -266,7 +266,7 @@ func (suite *BackupExchangeE2ESuite) TestBackupCreateExchange_fromConfigFile() { cmd := cliTD.StubRootCmd( "backup", "create", "exchange", "--user", suite.its.user.ID, - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) cmd.SetOut(&suite.dpnd.recorder) @@ -409,7 +409,7 @@ func runExchangeListCmdTest(suite *PreparedBackupExchangeE2ESuite, category path cmd := cliTD.StubRootCmd( "backup", "list", "exchange", - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) cmd.SetOut(&suite.dpnd.recorder) @@ -450,7 +450,7 @@ func runExchangeListSingleCmdTest(suite *PreparedBackupExchangeE2ESuite, categor cmd := cliTD.StubRootCmd( "backup", "list", "exchange", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backup", string(bID)) cli.BuildCommandTree(cmd) @@ -477,7 +477,7 @@ func (suite *PreparedBackupExchangeE2ESuite) TestExchangeListCmd_badID() { cmd := cliTD.StubRootCmd( "backup", "list", "exchange", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backup", "smarfs") cli.BuildCommandTree(cmd) @@ -519,7 +519,7 @@ func runExchangeDetailsCmdTest(suite *PreparedBackupExchangeE2ESuite, category p cmd := cliTD.StubRootCmd( "backup", "details", "exchange", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupFN, string(bID)) cli.BuildCommandTree(cmd) cmd.SetOut(&suite.dpnd.recorder) @@ -609,7 +609,7 @@ func (suite *BackupDeleteExchangeE2ESuite) TestExchangeBackupDeleteCmd() { cmd := cliTD.StubRootCmd( "backup", "delete", "exchange", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupIDsFN, fmt.Sprintf("%s,%s", string(suite.backupOps[0].Results.BackupID), @@ -623,7 +623,7 @@ func (suite *BackupDeleteExchangeE2ESuite) TestExchangeBackupDeleteCmd() { // a follow-up details call should fail, due to the backup ID being deleted cmd = cliTD.StubRootCmd( "backup", "details", "exchange", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backup", string(suite.backupOps[0].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -633,7 +633,7 @@ func (suite *BackupDeleteExchangeE2ESuite) TestExchangeBackupDeleteCmd() { // a follow-up details call should fail, due to the backup ID being deleted cmd = cliTD.StubRootCmd( "backup", "details", "exchange", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backup", string(suite.backupOps[1].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -651,7 +651,7 @@ func (suite *BackupDeleteExchangeE2ESuite) TestExchangeBackupDeleteCmd_SingleID( cmd := cliTD.StubRootCmd( "backup", "delete", "exchange", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupFN, string(suite.backupOps[2].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -663,7 +663,7 @@ func (suite *BackupDeleteExchangeE2ESuite) TestExchangeBackupDeleteCmd_SingleID( // a follow-up details call should fail, due to the backup ID being deleted cmd = cliTD.StubRootCmd( "backup", "details", "exchange", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backup", string(suite.backupOps[2].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -681,7 +681,7 @@ func (suite *BackupDeleteExchangeE2ESuite) TestExchangeBackupDeleteCmd_UnknownID cmd := cliTD.StubRootCmd( "backup", "delete", "exchange", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupIDsFN, uuid.NewString()) cli.BuildCommandTree(cmd) @@ -700,7 +700,7 @@ func (suite *BackupDeleteExchangeE2ESuite) TestExchangeBackupDeleteCmd_NoBackupI cmd := cliTD.StubRootCmd( "backup", "delete", "exchange", - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) // empty backupIDs should error since no data provided diff --git a/src/cli/backup/groups_e2e_test.go b/src/cli/backup/groups_e2e_test.go index 90d48d5d6..c6c4f456b 100644 --- a/src/cli/backup/groups_e2e_test.go +++ b/src/cli/backup/groups_e2e_test.go @@ -14,7 +14,6 @@ import ( "github.com/stretchr/testify/suite" "github.com/alcionai/corso/src/cli" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/print" cliTD "github.com/alcionai/corso/src/cli/testdata" @@ -22,6 +21,7 @@ import ( "github.com/alcionai/corso/src/internal/operations" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" selTD "github.com/alcionai/corso/src/pkg/selectors/testdata" @@ -65,7 +65,7 @@ func (suite *NoBackupGroupsE2ESuite) TestGroupsBackupListCmd_noBackups() { cmd := cliTD.StubRootCmd( "backup", "list", "groups", - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) cmd.SetErr(&suite.dpnd.recorder) @@ -226,7 +226,7 @@ func (suite *BackupGroupsE2ESuite) TestBackupCreateGroups_fromConfigFile() { cmd := cliTD.StubRootCmd( "backup", "create", "groups", "--group", suite.its.group.ID, - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) cmd.SetOut(&suite.dpnd.recorder) @@ -368,7 +368,7 @@ func runGroupsListCmdTest(suite *PreparedBackupGroupsE2ESuite, category path.Cat cmd := cliTD.StubRootCmd( "backup", "list", "groups", - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) cmd.SetOut(&suite.dpnd.recorder) @@ -409,7 +409,7 @@ func runGroupsListSingleCmdTest(suite *PreparedBackupGroupsE2ESuite, category pa cmd := cliTD.StubRootCmd( "backup", "list", "groups", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backup", string(bID)) cli.BuildCommandTree(cmd) @@ -436,7 +436,7 @@ func (suite *PreparedBackupGroupsE2ESuite) TestGroupsListCmd_badID() { cmd := cliTD.StubRootCmd( "backup", "list", "groups", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backup", "smarfs") cli.BuildCommandTree(cmd) @@ -482,7 +482,7 @@ func runGroupsDetailsCmdTest(suite *PreparedBackupGroupsE2ESuite, category path. cmd := cliTD.StubRootCmd( "backup", "details", "groups", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupFN, string(bID)) cli.BuildCommandTree(cmd) cmd.SetOut(&suite.dpnd.recorder) @@ -572,7 +572,7 @@ func (suite *BackupDeleteGroupsE2ESuite) TestGroupsBackupDeleteCmd() { cmd := cliTD.StubRootCmd( "backup", "delete", "groups", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupIDsFN, fmt.Sprintf("%s,%s", string(suite.backupOps[0].Results.BackupID), @@ -586,7 +586,7 @@ func (suite *BackupDeleteGroupsE2ESuite) TestGroupsBackupDeleteCmd() { // a follow-up details call should fail, due to the backup ID being deleted cmd = cliTD.StubRootCmd( "backup", "details", "groups", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backups", string(suite.backupOps[0].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -604,7 +604,7 @@ func (suite *BackupDeleteGroupsE2ESuite) TestGroupsBackupDeleteCmd_SingleID() { cmd := cliTD.StubRootCmd( "backup", "delete", "groups", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupFN, string(suite.backupOps[2].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -616,7 +616,7 @@ func (suite *BackupDeleteGroupsE2ESuite) TestGroupsBackupDeleteCmd_SingleID() { // a follow-up details call should fail, due to the backup ID being deleted cmd = cliTD.StubRootCmd( "backup", "details", "groups", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backup", string(suite.backupOps[2].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -634,7 +634,7 @@ func (suite *BackupDeleteGroupsE2ESuite) TestGroupsBackupDeleteCmd_UnknownID() { cmd := cliTD.StubRootCmd( "backup", "delete", "groups", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupIDsFN, uuid.NewString()) cli.BuildCommandTree(cmd) @@ -653,7 +653,7 @@ func (suite *BackupDeleteGroupsE2ESuite) TestGroupsBackupDeleteCmd_NoBackupID() cmd := cliTD.StubRootCmd( "backup", "delete", "groups", - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) // empty backupIDs should error since no data provided @@ -672,7 +672,7 @@ func buildGroupsBackupCmd( ) (*cobra.Command, context.Context) { cmd := cliTD.StubRootCmd( "backup", "create", "groups", - "--config-file", configFile, + "--"+flags.ConfigFileFN, configFile, "--"+flags.GroupFN, group, "--"+flags.CategoryDataFN, category) cli.BuildCommandTree(cmd) diff --git a/src/cli/backup/helpers_test.go b/src/cli/backup/helpers_test.go index b43bf0bd9..775a7ee68 100644 --- a/src/cli/backup/helpers_test.go +++ b/src/cli/backup/helpers_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/require" "github.com/alcionai/corso/src/cli" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/print" cliTD "github.com/alcionai/corso/src/cli/testdata" @@ -19,6 +18,7 @@ import ( "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" "github.com/alcionai/corso/src/pkg/account" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/count" "github.com/alcionai/corso/src/pkg/path" @@ -214,7 +214,7 @@ func buildExchangeBackupCmd( ) (*cobra.Command, context.Context) { cmd := cliTD.StubRootCmd( "backup", "create", "exchange", - "--config-file", configFile, + "--"+flags.ConfigFileFN, configFile, "--"+flags.UserFN, user, "--"+flags.CategoryDataFN, category) cli.BuildCommandTree(cmd) diff --git a/src/cli/backup/onedrive_e2e_test.go b/src/cli/backup/onedrive_e2e_test.go index a2bac18b6..f1604b03a 100644 --- a/src/cli/backup/onedrive_e2e_test.go +++ b/src/cli/backup/onedrive_e2e_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/suite" "github.com/alcionai/corso/src/cli" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/print" cliTD "github.com/alcionai/corso/src/cli/testdata" @@ -20,6 +19,7 @@ import ( "github.com/alcionai/corso/src/internal/operations" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" selTD "github.com/alcionai/corso/src/pkg/selectors/testdata" @@ -64,7 +64,7 @@ func (suite *NoBackupOneDriveE2ESuite) TestOneDriveBackupListCmd_empty() { cmd := cliTD.StubRootCmd( "backup", "list", "onedrive", - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) cmd.SetErr(&suite.dpnd.recorder) @@ -93,7 +93,7 @@ func (suite *NoBackupOneDriveE2ESuite) TestOneDriveBackupCmd_userNotInTenant() { cmd := cliTD.StubRootCmd( "backup", "create", "onedrive", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.UserFN, "foo@nothere.com") cli.BuildCommandTree(cmd) @@ -175,7 +175,7 @@ func (suite *BackupDeleteOneDriveE2ESuite) TestOneDriveBackupDeleteCmd() { cmd := cliTD.StubRootCmd( "backup", "delete", "onedrive", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupIDsFN, fmt.Sprintf("%s,%s", string(suite.backupOps[0].Results.BackupID), @@ -200,7 +200,7 @@ func (suite *BackupDeleteOneDriveE2ESuite) TestOneDriveBackupDeleteCmd() { // a follow-up details call should fail, due to the backup ID being deleted cmd = cliTD.StubRootCmd( "backup", "details", "onedrive", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backups", string(suite.backupOps[0].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -220,7 +220,7 @@ func (suite *BackupDeleteOneDriveE2ESuite) TestOneDriveBackupDeleteCmd_SingleID( cmd := cliTD.StubRootCmd( "backup", "delete", "onedrive", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupFN, string(suite.backupOps[2].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -242,7 +242,7 @@ func (suite *BackupDeleteOneDriveE2ESuite) TestOneDriveBackupDeleteCmd_SingleID( // a follow-up details call should fail, due to the backup ID being deleted cmd = cliTD.StubRootCmd( "backup", "details", "onedrive", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--backup", string(suite.backupOps[0].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -260,7 +260,7 @@ func (suite *BackupDeleteOneDriveE2ESuite) TestOneDriveBackupDeleteCmd_unknownID cmd := cliTD.StubRootCmd( "backup", "delete", "onedrive", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupIDsFN, uuid.NewString()) cli.BuildCommandTree(cmd) @@ -279,7 +279,7 @@ func (suite *BackupDeleteOneDriveE2ESuite) TestOneDriveBackupDeleteCmd_NoBackupI cmd := cliTD.StubRootCmd( "backup", "delete", "onedrive", - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) // empty backupIDs should error since no data provided diff --git a/src/cli/backup/sharepoint_e2e_test.go b/src/cli/backup/sharepoint_e2e_test.go index 7d7728020..bf34b430d 100644 --- a/src/cli/backup/sharepoint_e2e_test.go +++ b/src/cli/backup/sharepoint_e2e_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/suite" "github.com/alcionai/corso/src/cli" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/print" cliTD "github.com/alcionai/corso/src/cli/testdata" @@ -20,6 +19,7 @@ import ( "github.com/alcionai/corso/src/internal/operations" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" "github.com/alcionai/corso/src/pkg/selectors/testdata" @@ -62,7 +62,7 @@ func (suite *NoBackupSharePointE2ESuite) TestSharePointBackupListCmd_empty() { cmd := cliTD.StubRootCmd( "backup", "list", "sharepoint", - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) cmd.SetErr(&suite.dpnd.recorder) @@ -146,7 +146,7 @@ func (suite *BackupDeleteSharePointE2ESuite) TestSharePointBackupDeleteCmd() { cmd := cliTD.StubRootCmd( "backup", "delete", "sharepoint", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupIDsFN, fmt.Sprintf("%s,%s", string(suite.backupOp.Results.BackupID), @@ -173,7 +173,7 @@ func (suite *BackupDeleteSharePointE2ESuite) TestSharePointBackupDeleteCmd() { // // a follow-up details call should fail, due to the backup ID being deleted // cmd = cliTD.StubRootCmd( // "backup", "details", "sharepoint", -// "--config-file", suite.cfgFP, +// "--"+flags.ConfigFileFN, suite.cfgFP, // "--backup", string(suite.backupOp.Results.BackupID)) // cli.BuildCommandTree(cmd) @@ -190,7 +190,7 @@ func (suite *BackupDeleteSharePointE2ESuite) TestSharePointBackupDeleteCmd_unkno cmd := cliTD.StubRootCmd( "backup", "delete", "sharepoint", - "--config-file", suite.dpnd.configFilePath, + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath, "--"+flags.BackupIDsFN, uuid.NewString()) cli.BuildCommandTree(cmd) @@ -209,7 +209,7 @@ func (suite *BackupDeleteSharePointE2ESuite) TestSharePointBackupDeleteCmd_NoBac cmd := cliTD.StubRootCmd( "backup", "delete", "groups", - "--config-file", suite.dpnd.configFilePath) + "--"+flags.ConfigFileFN, suite.dpnd.configFilePath) cli.BuildCommandTree(cmd) // empty backupIDs should error since no data provided diff --git a/src/cli/cli.go b/src/cli/cli.go index 0f41e69a7..2ec57019d 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -10,7 +10,6 @@ import ( "golang.org/x/exp/slices" "github.com/alcionai/corso/src/cli/backup" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/debug" "github.com/alcionai/corso/src/cli/export" "github.com/alcionai/corso/src/cli/flags" @@ -20,6 +19,7 @@ import ( "github.com/alcionai/corso/src/cli/restore" "github.com/alcionai/corso/src/internal/observe" "github.com/alcionai/corso/src/internal/version" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/logger" ) @@ -38,7 +38,7 @@ var corsoCmd = &cobra.Command{ } func preRun(cc *cobra.Command, args []string) error { - if err := config.InitFunc(cc, args); err != nil { + if err := config.InitCmd(cc, args); err != nil { return err } diff --git a/src/cli/export/export.go b/src/cli/export/export.go index caa514331..e618aeb2d 100644 --- a/src/cli/export/export.go +++ b/src/cli/export/export.go @@ -11,10 +11,10 @@ import ( "github.com/alcionai/corso/src/cli/flags" . "github.com/alcionai/corso/src/cli/print" "github.com/alcionai/corso/src/cli/utils" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/data" "github.com/alcionai/corso/src/internal/observe" "github.com/alcionai/corso/src/pkg/control" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/export" "github.com/alcionai/corso/src/pkg/selectors" ) diff --git a/src/cli/flags/options.go b/src/cli/flags/options.go index 2d043ae1f..f8ac7174d 100644 --- a/src/cli/flags/options.go +++ b/src/cli/flags/options.go @@ -6,6 +6,7 @@ import ( const ( AlertsFN = "alerts" + ConfigFileFN = "config-file" DeltaPageSizeFN = "delta-page-size" DisableDeltaFN = "disable-delta" DisableIncrementalsFN = "disable-incrementals" @@ -24,6 +25,7 @@ const ( ) var ( + ConfigFileFV string DeltaPageSizeFV int DisableDeltaFV bool DisableIncrementalsFV bool diff --git a/src/cli/repo/filesystem.go b/src/cli/repo/filesystem.go index 7a012e503..37824a25e 100644 --- a/src/cli/repo/filesystem.go +++ b/src/cli/repo/filesystem.go @@ -5,11 +5,11 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/flags" . "github.com/alcionai/corso/src/cli/print" "github.com/alcionai/corso/src/cli/utils" "github.com/alcionai/corso/src/internal/events" + "github.com/alcionai/corso/src/pkg/config" ctrlRepo "github.com/alcionai/corso/src/pkg/control/repository" "github.com/alcionai/corso/src/pkg/repository" "github.com/alcionai/corso/src/pkg/storage" @@ -73,7 +73,7 @@ func initFilesystemCmd(cmd *cobra.Command, args []string) error { overrides[flags.FilesystemPathFN] = abs - cfg, err := config.GetConfigRepoDetails( + cfg, err := config.ReadCorsoConfig( ctx, storage.ProviderFilesystem, true, @@ -163,7 +163,7 @@ func connectFilesystemCmd(cmd *cobra.Command, args []string) error { overrides[flags.FilesystemPathFN] = abs - cfg, err := config.GetConfigRepoDetails( + cfg, err := config.ReadCorsoConfig( ctx, storage.ProviderFilesystem, true, diff --git a/src/cli/repo/filesystem_e2e_test.go b/src/cli/repo/filesystem_e2e_test.go index faeb5a5b1..59ef92b63 100644 --- a/src/cli/repo/filesystem_e2e_test.go +++ b/src/cli/repo/filesystem_e2e_test.go @@ -10,11 +10,12 @@ import ( "github.com/stretchr/testify/suite" "github.com/alcionai/corso/src/cli" - "github.com/alcionai/corso/src/cli/config" + "github.com/alcionai/corso/src/cli/flags" cliTD "github.com/alcionai/corso/src/cli/testdata" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" "github.com/alcionai/corso/src/pkg/account" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/repository" "github.com/alcionai/corso/src/pkg/storage" @@ -73,7 +74,7 @@ func (suite *FilesystemE2ESuite) TestInitFilesystemCmd() { cmd := cliTD.StubRootCmd( "repo", "init", "filesystem", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--path", cfg.Path) cli.BuildCommandTree(cmd) @@ -143,7 +144,7 @@ func (suite *FilesystemE2ESuite) TestConnectFilesystemCmd() { // then test it cmd := cliTD.StubRootCmd( "repo", "connect", "filesystem", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--path", cfg.Path) cli.BuildCommandTree(cmd) diff --git a/src/cli/repo/repo_test.go b/src/cli/repo/repo_test.go index 4c2885076..3f18b4903 100644 --- a/src/cli/repo/repo_test.go +++ b/src/cli/repo/repo_test.go @@ -10,11 +10,12 @@ import ( "github.com/stretchr/testify/suite" "github.com/alcionai/corso/src/cli" - "github.com/alcionai/corso/src/cli/config" + "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/repo" cliTD "github.com/alcionai/corso/src/cli/testdata" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/storage" storeTD "github.com/alcionai/corso/src/pkg/storage/testdata" ) @@ -76,7 +77,7 @@ func (suite *RepoE2ESuite) TestUpdatePassphraseCmd() { cmd := cliTD.StubRootCmd( "repo", "init", "s3", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--prefix", cfg.Prefix) cli.BuildCommandTree(cmd) @@ -88,7 +89,7 @@ func (suite *RepoE2ESuite) TestUpdatePassphraseCmd() { // connect with old passphrase cmd = cliTD.StubRootCmd( "repo", "connect", "s3", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--bucket", cfg.Bucket, "--prefix", cfg.Prefix) cli.BuildCommandTree(cmd) @@ -99,7 +100,7 @@ func (suite *RepoE2ESuite) TestUpdatePassphraseCmd() { cmd = cliTD.StubRootCmd( "repo", "update-passphrase", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--new-passphrase", "newpass") cli.BuildCommandTree(cmd) @@ -110,7 +111,7 @@ func (suite *RepoE2ESuite) TestUpdatePassphraseCmd() { // connect again with new passphrase cmd = cliTD.StubRootCmd( "repo", "connect", "s3", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--bucket", cfg.Bucket, "--prefix", cfg.Prefix, "--passphrase", "newpass") @@ -123,7 +124,7 @@ func (suite *RepoE2ESuite) TestUpdatePassphraseCmd() { // connect with old passphrase - it will fail cmd = cliTD.StubRootCmd( "repo", "connect", "s3", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--bucket", cfg.Bucket, "--prefix", cfg.Prefix) cli.BuildCommandTree(cmd) diff --git a/src/cli/repo/s3.go b/src/cli/repo/s3.go index 000513671..412de3ea6 100644 --- a/src/cli/repo/s3.go +++ b/src/cli/repo/s3.go @@ -7,11 +7,11 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/flags" . "github.com/alcionai/corso/src/cli/print" "github.com/alcionai/corso/src/cli/utils" "github.com/alcionai/corso/src/internal/events" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/repository" "github.com/alcionai/corso/src/pkg/storage" ) @@ -85,7 +85,7 @@ func s3InitCmd() *cobra.Command { func initS3Cmd(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - cfg, err := config.GetConfigRepoDetails( + cfg, err := config.ReadCorsoConfig( ctx, storage.ProviderS3, true, @@ -170,7 +170,7 @@ func s3ConnectCmd() *cobra.Command { func connectS3Cmd(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - cfg, err := config.GetConfigRepoDetails( + cfg, err := config.ReadCorsoConfig( ctx, storage.ProviderS3, true, diff --git a/src/cli/repo/s3_e2e_test.go b/src/cli/repo/s3_e2e_test.go index 2c19b48c8..6bb7f4ee9 100644 --- a/src/cli/repo/s3_e2e_test.go +++ b/src/cli/repo/s3_e2e_test.go @@ -11,12 +11,13 @@ import ( "golang.org/x/exp/maps" "github.com/alcionai/corso/src/cli" - "github.com/alcionai/corso/src/cli/config" + "github.com/alcionai/corso/src/cli/flags" cliTD "github.com/alcionai/corso/src/cli/testdata" "github.com/alcionai/corso/src/internal/common/str" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" "github.com/alcionai/corso/src/pkg/account" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/repository" "github.com/alcionai/corso/src/pkg/storage" @@ -79,7 +80,7 @@ func (suite *S3E2ESuite) TestInitS3Cmd() { cmd := cliTD.StubRootCmd( "repo", "init", "s3", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--bucket", test.bucketPrefix+cfg.Bucket, "--prefix", cfg.Prefix) cli.BuildCommandTree(cmd) @@ -113,7 +114,7 @@ func (suite *S3E2ESuite) TestInitMultipleTimes() { for i := 0; i < 2; i++ { cmd := cliTD.StubRootCmd( "repo", "init", "s3", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--bucket", cfg.Bucket, "--prefix", cfg.Prefix, "--succeed-if-exists") @@ -146,7 +147,7 @@ func (suite *S3E2ESuite) TestInitS3Cmd_missingBucket() { cmd := cliTD.StubRootCmd( "repo", "init", "s3", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--prefix", cfg.Prefix) cli.BuildCommandTree(cmd) @@ -219,7 +220,7 @@ func (suite *S3E2ESuite) TestConnectS3Cmd() { // then test it cmd := cliTD.StubRootCmd( "repo", "connect", "s3", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--bucket", test.bucketPrefix+cfg.Bucket, "--prefix", cfg.Prefix) cli.BuildCommandTree(cmd) @@ -279,7 +280,7 @@ func (suite *S3E2ESuite) TestConnectS3Cmd_badInputs() { cmd := cliTD.StubRootCmd( "repo", "connect", "s3", - "--config-file", configFP, + "--"+flags.ConfigFileFN, configFP, "--bucket", bucket, "--prefix", prefix) cli.BuildCommandTree(cmd) diff --git a/src/cli/restore/exchange_e2e_test.go b/src/cli/restore/exchange_e2e_test.go index 67896831b..34112219e 100644 --- a/src/cli/restore/exchange_e2e_test.go +++ b/src/cli/restore/exchange_e2e_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/suite" "github.com/alcionai/corso/src/cli" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/flags" cliTD "github.com/alcionai/corso/src/cli/testdata" "github.com/alcionai/corso/src/internal/common/idname" @@ -19,6 +18,7 @@ import ( "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" "github.com/alcionai/corso/src/pkg/account" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/repository" @@ -145,7 +145,7 @@ func (suite *RestoreExchangeE2ESuite) TestExchangeRestoreCmd() { cmd := cliTD.StubRootCmd( "restore", "exchange", - "--config-file", suite.cfgFP, + "--"+flags.ConfigFileFN, suite.cfgFP, "--"+flags.BackupFN, string(suite.backupOps[set].Results.BackupID)) cli.BuildCommandTree(cmd) @@ -180,7 +180,7 @@ func (suite *RestoreExchangeE2ESuite) TestExchangeRestoreCmd_badTimeFlags() { cmd := cliTD.StubRootCmd( "restore", "exchange", - "--config-file", suite.cfgFP, + "--"+flags.ConfigFileFN, suite.cfgFP, "--"+flags.BackupFN, string(suite.backupOps[set].Results.BackupID), timeFilter, "smarf") cli.BuildCommandTree(cmd) @@ -214,7 +214,7 @@ func (suite *RestoreExchangeE2ESuite) TestExchangeRestoreCmd_badBoolFlags() { cmd := cliTD.StubRootCmd( "restore", "exchange", - "--config-file", suite.cfgFP, + "--"+flags.ConfigFileFN, suite.cfgFP, "--"+flags.BackupFN, string(suite.backupOps[set].Results.BackupID), timeFilter, "wingbat") cli.BuildCommandTree(cmd) diff --git a/src/cli/restore/groups.go b/src/cli/restore/groups.go index c9ba2d6b7..4b2f93c33 100644 --- a/src/cli/restore/groups.go +++ b/src/cli/restore/groups.go @@ -6,7 +6,7 @@ import ( "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/utils" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" ) // called by restore.go to map subcommands to provider-specific handling. diff --git a/src/cli/restore/onedrive.go b/src/cli/restore/onedrive.go index 8b44d3758..27b2642c8 100644 --- a/src/cli/restore/onedrive.go +++ b/src/cli/restore/onedrive.go @@ -6,7 +6,7 @@ import ( "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/utils" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" ) // called by restore.go to map subcommands to provider-specific handling. diff --git a/src/cli/restore/sharepoint.go b/src/cli/restore/sharepoint.go index c79756e7a..3922add0e 100644 --- a/src/cli/restore/sharepoint.go +++ b/src/cli/restore/sharepoint.go @@ -6,7 +6,7 @@ import ( "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/utils" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" ) // called by restore.go to map subcommands to provider-specific handling. diff --git a/src/cli/utils/exchange_test.go b/src/cli/utils/exchange_test.go index 662532743..b8cbfd874 100644 --- a/src/cli/utils/exchange_test.go +++ b/src/cli/utils/exchange_test.go @@ -9,8 +9,8 @@ import ( "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/utils" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/tester" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/selectors" ) diff --git a/src/cli/utils/flags.go b/src/cli/utils/flags.go index 66d3e4fcd..4bcf52811 100644 --- a/src/cli/utils/flags.go +++ b/src/cli/utils/flags.go @@ -3,7 +3,7 @@ package utils import ( "strconv" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" ) diff --git a/src/cli/utils/groups_test.go b/src/cli/utils/groups_test.go index 38eb117bb..333210287 100644 --- a/src/cli/utils/groups_test.go +++ b/src/cli/utils/groups_test.go @@ -8,8 +8,8 @@ import ( "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/utils" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/tester" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" ) diff --git a/src/cli/utils/options.go b/src/cli/utils/options.go index ec61d866d..0a6c4c811 100644 --- a/src/cli/utils/options.go +++ b/src/cli/utils/options.go @@ -1,8 +1,8 @@ package utils import ( - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/flags" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/control" ) diff --git a/src/cli/utils/restore_config.go b/src/cli/utils/restore_config.go index 1f4137446..c7a7f00eb 100644 --- a/src/cli/utils/restore_config.go +++ b/src/cli/utils/restore_config.go @@ -9,8 +9,8 @@ import ( "github.com/alcionai/corso/src/cli/flags" . "github.com/alcionai/corso/src/cli/print" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/pkg/control" + "github.com/alcionai/corso/src/pkg/dttm" ) type RestoreCfgOpts struct { diff --git a/src/cli/utils/sharepoint_test.go b/src/cli/utils/sharepoint_test.go index 0e5cbd411..46b5887b7 100644 --- a/src/cli/utils/sharepoint_test.go +++ b/src/cli/utils/sharepoint_test.go @@ -8,8 +8,8 @@ import ( "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/utils" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/tester" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" ) diff --git a/src/cli/utils/testdata/opts.go b/src/cli/utils/testdata/opts.go index bb42f856a..a3892b1ff 100644 --- a/src/cli/utils/testdata/opts.go +++ b/src/cli/utils/testdata/opts.go @@ -9,10 +9,10 @@ import ( "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/cli/utils" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/pkg/backup" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/backup/details/testdata" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" ftd "github.com/alcionai/corso/src/pkg/fault/testdata" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/cli/utils/utils.go b/src/cli/utils/utils.go index 517aa3501..f397bb9cd 100644 --- a/src/cli/utils/utils.go +++ b/src/cli/utils/utils.go @@ -10,10 +10,10 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/flags" "github.com/alcionai/corso/src/internal/events" "github.com/alcionai/corso/src/pkg/account" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/path" @@ -51,7 +51,7 @@ func GetAccountAndConnectWithOverrides( provider storage.ProviderType, overrides map[string]string, ) (repository.Repositoryer, RepoDetailsAndOpts, error) { - cfg, err := config.GetConfigRepoDetails( + cfg, err := config.ReadCorsoConfig( ctx, provider, true, diff --git a/src/cmd/factory/impl/common.go b/src/cmd/factory/impl/common.go index 67e99aa24..077a7990e 100644 --- a/src/cmd/factory/impl/common.go +++ b/src/cmd/factory/impl/common.go @@ -11,7 +11,6 @@ import ( "github.com/google/uuid" "github.com/alcionai/corso/src/cli/print" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/idname" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/common/str" @@ -28,6 +27,7 @@ import ( "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/count" "github.com/alcionai/corso/src/pkg/credentials" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" diff --git a/src/cmd/longevity_test/longevity.go b/src/cmd/longevity_test/longevity.go index 71e21bd55..e9fd63846 100644 --- a/src/cmd/longevity_test/longevity.go +++ b/src/cmd/longevity_test/longevity.go @@ -11,8 +11,8 @@ import ( "github.com/spf13/cobra" "golang.org/x/exp/maps" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cli/utils" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/repository" @@ -90,7 +90,7 @@ func pitrListBackups( // TODO(ashmrtn): This may be moved into CLI layer at some point when we add // flags for opening a repo at a point in time. - cfg, err := config.GetConfigRepoDetails( + cfg, err := config.ReadCorsoConfig( ctx, storage.ProviderS3, true, @@ -151,7 +151,7 @@ func main() { cc.SetContext(context.Background()) - if err := config.InitFunc(&cc, []string{}); err != nil { + if err := config.InitCmd(&cc, []string{}); err != nil { return } diff --git a/src/cmd/s3checker/s3checker.go b/src/cmd/s3checker/s3checker.go index 7aa11e79a..f2fd334a3 100644 --- a/src/cmd/s3checker/s3checker.go +++ b/src/cmd/s3checker/s3checker.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/cobra" "golang.org/x/exp/maps" - "github.com/alcionai/corso/src/cli/config" "github.com/alcionai/corso/src/cmd/s3checker/pkg/s3" "github.com/alcionai/corso/src/internal/common/crash" + "github.com/alcionai/corso/src/pkg/config" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/storage" ) @@ -175,7 +175,7 @@ func handleCheckerCommand(cmd *cobra.Command, args []string, f flags) error { fmt.Printf("Checking objects with prefix(es) %v\n", f.prefixes) - if err := config.InitFunc(cmd, args); err != nil { + if err := config.InitCmd(cmd, args); err != nil { return clues.Wrap(err, "setting viper") } @@ -187,7 +187,7 @@ func handleCheckerCommand(cmd *cobra.Command, args []string, f flags) error { storage.Prefix: f.bucketPrefix, } - repoDetails, err := config.GetConfigRepoDetails( + repoDetails, err := config.ReadCorsoConfig( ctx, storage.ProviderS3, false, diff --git a/src/cmd/sanity_test/common/utils.go b/src/cmd/sanity_test/common/utils.go index cf232734c..7d9ff9b5c 100644 --- a/src/cmd/sanity_test/common/utils.go +++ b/src/cmd/sanity_test/common/utils.go @@ -10,7 +10,7 @@ import ( "github.com/alcionai/clues" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/logger" ) diff --git a/src/cmd/sanity_test/utils/utils.go b/src/cmd/sanity_test/utils/utils.go index d0a877d61..f13763d59 100644 --- a/src/cmd/sanity_test/utils/utils.go +++ b/src/cmd/sanity_test/utils/utils.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/logger" ) diff --git a/src/internal/archive/zip.go b/src/internal/archive/zip.go index a1ee8b725..21357fbd3 100644 --- a/src/internal/archive/zip.go +++ b/src/internal/archive/zip.go @@ -8,7 +8,7 @@ import ( "github.com/alcionai/clues" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/export" ) diff --git a/src/internal/common/ptr/pointer.go b/src/internal/common/ptr/pointer.go index bf7ad194e..5f34fec8f 100644 --- a/src/internal/common/ptr/pointer.go +++ b/src/internal/common/ptr/pointer.go @@ -3,7 +3,7 @@ package ptr import ( "time" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" ) // ptr package is a common package used for pointer diff --git a/src/internal/m365/collection/drive/item_test.go b/src/internal/m365/collection/drive/item_test.go index 928789ef9..b9ee441ce 100644 --- a/src/internal/m365/collection/drive/item_test.go +++ b/src/internal/m365/collection/drive/item_test.go @@ -14,7 +14,6 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/common/str" "github.com/alcionai/corso/src/internal/tester" @@ -22,6 +21,7 @@ import ( "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/control/testdata" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/selectors" "github.com/alcionai/corso/src/pkg/services/m365/api" "github.com/alcionai/corso/src/pkg/services/m365/api/graph" diff --git a/src/internal/m365/collection/drive/url_cache_test.go b/src/internal/m365/collection/drive/url_cache_test.go index 46cee7cd1..a562797f5 100644 --- a/src/internal/m365/collection/drive/url_cache_test.go +++ b/src/internal/m365/collection/drive/url_cache_test.go @@ -16,13 +16,13 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/control/testdata" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/services/m365/api" "github.com/alcionai/corso/src/pkg/services/m365/api/graph" diff --git a/src/internal/m365/collection/exchange/events_instance_restore.go b/src/internal/m365/collection/exchange/events_instance_restore.go index 96ec025a2..4f2296d1f 100644 --- a/src/internal/m365/collection/exchange/events_instance_restore.go +++ b/src/internal/m365/collection/exchange/events_instance_restore.go @@ -9,9 +9,9 @@ import ( "github.com/alcionai/clues" "github.com/microsoftgraph/msgraph-sdk-go/models" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/common/str" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/services/m365/api" ) diff --git a/src/internal/m365/collection/exchange/mail_restore.go b/src/internal/m365/collection/exchange/mail_restore.go index 0c78aa1f1..0c3646114 100644 --- a/src/internal/m365/collection/exchange/mail_restore.go +++ b/src/internal/m365/collection/exchange/mail_restore.go @@ -6,11 +6,11 @@ import ( "github.com/alcionai/clues" "github.com/microsoftgraph/msgraph-sdk-go/models" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/internal/m365/collection/site/restore.go b/src/internal/m365/collection/site/restore.go index c3a85ade3..2591c1340 100644 --- a/src/internal/m365/collection/site/restore.go +++ b/src/internal/m365/collection/site/restore.go @@ -10,7 +10,6 @@ import ( "github.com/alcionai/clues" "github.com/microsoftgraph/msgraph-sdk-go/models" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/idname" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/data" @@ -22,6 +21,7 @@ import ( "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/internal/m365/controller_test.go b/src/internal/m365/controller_test.go index 6a4b434ee..598ab467b 100644 --- a/src/internal/m365/controller_test.go +++ b/src/internal/m365/controller_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/idname" inMock "github.com/alcionai/corso/src/internal/common/idname/mock" "github.com/alcionai/corso/src/internal/data" @@ -29,6 +28,7 @@ import ( "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/control/testdata" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" diff --git a/src/internal/m365/onedrive_test.go b/src/internal/m365/onedrive_test.go index 71f1a81c3..83f501768 100644 --- a/src/internal/m365/onedrive_test.go +++ b/src/internal/m365/onedrive_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/m365/collection/drive/metadata" odConsts "github.com/alcionai/corso/src/internal/m365/service/onedrive/consts" @@ -23,6 +22,7 @@ import ( "github.com/alcionai/corso/src/internal/version" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/control/testdata" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/services/m365/api" "github.com/alcionai/corso/src/pkg/services/m365/api/graph" diff --git a/src/internal/m365/service/exchange/mock/event.go b/src/internal/m365/service/exchange/mock/event.go index 26d95a372..4dd3ea9e7 100644 --- a/src/internal/m365/service/exchange/mock/event.go +++ b/src/internal/m365/service/exchange/mock/event.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" ) // Order of fields to fill in: diff --git a/src/internal/m365/service/exchange/mock/mail.go b/src/internal/m365/service/exchange/mock/mail.go index aa9d85abe..5de3064b6 100644 --- a/src/internal/m365/service/exchange/mock/mail.go +++ b/src/internal/m365/service/exchange/mock/mail.go @@ -11,7 +11,7 @@ import ( "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/stretchr/testify/require" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" ) //nolint:lll diff --git a/src/internal/m365/service/groups/restore.go b/src/internal/m365/service/groups/restore.go index 3f23b9362..df94f4b20 100644 --- a/src/internal/m365/service/groups/restore.go +++ b/src/internal/m365/service/groups/restore.go @@ -7,7 +7,6 @@ import ( "github.com/alcionai/clues" "github.com/microsoftgraph/msgraph-sdk-go/models" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/idname" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/data" @@ -17,6 +16,7 @@ import ( "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/internal/m365/service/sharepoint/restore.go b/src/internal/m365/service/sharepoint/restore.go index ab26728af..ccd4a1bc9 100644 --- a/src/internal/m365/service/sharepoint/restore.go +++ b/src/internal/m365/service/sharepoint/restore.go @@ -6,7 +6,6 @@ import ( "github.com/alcionai/clues" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/data" "github.com/alcionai/corso/src/internal/m365/collection/drive" "github.com/alcionai/corso/src/internal/m365/collection/site" @@ -15,6 +14,7 @@ import ( "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/services/m365/api/graph" diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 5095ee8db..1a544caa5 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -8,7 +8,6 @@ import ( "github.com/google/uuid" "github.com/alcionai/corso/src/internal/common/crash" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/idname" "github.com/alcionai/corso/src/internal/common/prefixmatcher" "github.com/alcionai/corso/src/internal/data" @@ -28,6 +27,7 @@ import ( "github.com/alcionai/corso/src/pkg/backup/identity" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/internal/operations/export.go b/src/internal/operations/export.go index 685261c0d..26581f004 100644 --- a/src/internal/operations/export.go +++ b/src/internal/operations/export.go @@ -11,7 +11,6 @@ import ( "github.com/alcionai/corso/src/internal/archive" "github.com/alcionai/corso/src/internal/common/crash" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/data" "github.com/alcionai/corso/src/internal/diagnostics" "github.com/alcionai/corso/src/internal/events" @@ -24,6 +23,7 @@ import ( "github.com/alcionai/corso/src/pkg/account" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/export" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/logger" diff --git a/src/internal/operations/maintenance.go b/src/internal/operations/maintenance.go index d05d97182..06d5912a9 100644 --- a/src/internal/operations/maintenance.go +++ b/src/internal/operations/maintenance.go @@ -7,13 +7,13 @@ import ( "github.com/alcionai/clues" "github.com/alcionai/corso/src/internal/common/crash" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/events" "github.com/alcionai/corso/src/internal/kopia" "github.com/alcionai/corso/src/internal/stats" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/control/repository" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/store" ) diff --git a/src/internal/operations/restore.go b/src/internal/operations/restore.go index 9de55f73c..a2c122ad6 100644 --- a/src/internal/operations/restore.go +++ b/src/internal/operations/restore.go @@ -10,7 +10,6 @@ import ( "github.com/google/uuid" "github.com/alcionai/corso/src/internal/common/crash" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/idname" "github.com/alcionai/corso/src/internal/data" "github.com/alcionai/corso/src/internal/diagnostics" @@ -27,6 +26,7 @@ import ( "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/internal/operations/restore_test.go b/src/internal/operations/restore_test.go index 0bf7e375c..5ce0ed273 100644 --- a/src/internal/operations/restore_test.go +++ b/src/internal/operations/restore_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/idname" strTD "github.com/alcionai/corso/src/internal/common/str/testdata" "github.com/alcionai/corso/src/internal/data" @@ -29,6 +28,7 @@ import ( "github.com/alcionai/corso/src/pkg/control/repository" "github.com/alcionai/corso/src/pkg/control/testdata" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/selectors" "github.com/alcionai/corso/src/pkg/services/m365/api/graph" storeTD "github.com/alcionai/corso/src/pkg/storage/testdata" diff --git a/src/internal/operations/test/exchange_test.go b/src/internal/operations/test/exchange_test.go index c7f4bb666..6343b8b3d 100644 --- a/src/internal/operations/test/exchange_test.go +++ b/src/internal/operations/test/exchange_test.go @@ -13,7 +13,6 @@ import ( "github.com/stretchr/testify/suite" "golang.org/x/exp/maps" - "github.com/alcionai/corso/src/internal/common/dttm" inMock "github.com/alcionai/corso/src/internal/common/idname/mock" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/events" @@ -29,6 +28,7 @@ import ( "github.com/alcionai/corso/src/pkg/control" ctrlTD "github.com/alcionai/corso/src/pkg/control/testdata" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" diff --git a/src/internal/operations/test/helper_test.go b/src/internal/operations/test/helper_test.go index b39d825a6..4fbd959b0 100644 --- a/src/internal/operations/test/helper_test.go +++ b/src/internal/operations/test/helper_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/idname" "github.com/alcionai/corso/src/internal/common/ptr" strTD "github.com/alcionai/corso/src/internal/common/str/testdata" @@ -37,6 +36,7 @@ import ( "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/control/repository" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/extensions" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/internal/operations/test/onedrive_test.go b/src/internal/operations/test/onedrive_test.go index bffd5cd1c..77c7336da 100644 --- a/src/internal/operations/test/onedrive_test.go +++ b/src/internal/operations/test/onedrive_test.go @@ -15,7 +15,6 @@ import ( "github.com/stretchr/testify/suite" "golang.org/x/exp/maps" - "github.com/alcionai/corso/src/internal/common/dttm" inMock "github.com/alcionai/corso/src/internal/common/idname/mock" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/common/syncd" @@ -37,6 +36,7 @@ import ( "github.com/alcionai/corso/src/pkg/control" ctrlTD "github.com/alcionai/corso/src/pkg/control/testdata" "github.com/alcionai/corso/src/pkg/count" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/extensions" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/pkg/backup/backup.go b/src/pkg/backup/backup.go index 146df9834..ae8206069 100644 --- a/src/pkg/backup/backup.go +++ b/src/pkg/backup/backup.go @@ -10,11 +10,11 @@ import ( "github.com/dustin/go-humanize" "github.com/alcionai/corso/src/cli/print" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/str" "github.com/alcionai/corso/src/internal/model" "github.com/alcionai/corso/src/internal/stats" "github.com/alcionai/corso/src/internal/version" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/selectors" ) diff --git a/src/pkg/backup/backup_test.go b/src/pkg/backup/backup_test.go index 01a1bcf3e..cfc9847cf 100644 --- a/src/pkg/backup/backup_test.go +++ b/src/pkg/backup/backup_test.go @@ -11,12 +11,12 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/model" "github.com/alcionai/corso/src/internal/stats" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/version" "github.com/alcionai/corso/src/pkg/backup" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/selectors" ) diff --git a/src/pkg/backup/details/details_test.go b/src/pkg/backup/details/details_test.go index 73a5d1672..15a520dae 100644 --- a/src/pkg/backup/details/details_test.go +++ b/src/pkg/backup/details/details_test.go @@ -13,11 +13,11 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/m365/collection/drive/metadata" odConsts "github.com/alcionai/corso/src/internal/m365/service/onedrive/consts" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/version" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/path" ) diff --git a/src/pkg/backup/details/exchange.go b/src/pkg/backup/details/exchange.go index dda1f2d40..a43dffc16 100644 --- a/src/pkg/backup/details/exchange.go +++ b/src/pkg/backup/details/exchange.go @@ -6,7 +6,7 @@ import ( "github.com/alcionai/clues" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/path" ) diff --git a/src/pkg/backup/details/groups.go b/src/pkg/backup/details/groups.go index 282848c24..e7edb46b0 100644 --- a/src/pkg/backup/details/groups.go +++ b/src/pkg/backup/details/groups.go @@ -8,7 +8,7 @@ import ( "github.com/alcionai/clues" "github.com/dustin/go-humanize" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/path" ) diff --git a/src/pkg/backup/details/groups_test.go b/src/pkg/backup/details/groups_test.go index 33ab0acf5..3cf756743 100644 --- a/src/pkg/backup/details/groups_test.go +++ b/src/pkg/backup/details/groups_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/backup/details" + "github.com/alcionai/corso/src/pkg/dttm" ) type GroupsUnitSuite struct { diff --git a/src/pkg/backup/details/onedrive.go b/src/pkg/backup/details/onedrive.go index f0974030b..866cdb220 100644 --- a/src/pkg/backup/details/onedrive.go +++ b/src/pkg/backup/details/onedrive.go @@ -6,7 +6,7 @@ import ( "github.com/alcionai/clues" "github.com/dustin/go-humanize" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/path" ) diff --git a/src/pkg/backup/details/sharepoint.go b/src/pkg/backup/details/sharepoint.go index dceff7f99..88f134713 100644 --- a/src/pkg/backup/details/sharepoint.go +++ b/src/pkg/backup/details/sharepoint.go @@ -6,7 +6,7 @@ import ( "github.com/alcionai/clues" "github.com/dustin/go-humanize" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/path" ) diff --git a/src/cli/config/account.go b/src/pkg/config/account.go similarity index 100% rename from src/cli/config/account.go rename to src/pkg/config/account.go diff --git a/src/cli/config/config.go b/src/pkg/config/config.go similarity index 84% rename from src/cli/config/config.go rename to src/pkg/config/config.go index 0d341b35d..4657c02aa 100644 --- a/src/cli/config/config.go +++ b/src/pkg/config/config.go @@ -33,10 +33,9 @@ const ( ) var ( - configFilePath string - configFilePathFlag string - configDir string - displayDefaultFP = filepath.Join("$HOME", ".corso.toml") + defaultConfigFilePath string + configDir string + displayDefaultFP = filepath.Join("$HOME", ".corso.toml") ) // RepoDetails holds the repository configuration retrieved from @@ -58,7 +57,7 @@ func init() { Infof(context.Background(), "cannot stat CORSO_CONFIG_DIR [%s]: %v", envDir, err) } else { configDir = envDir - configFilePath = filepath.Join(configDir, ".corso.toml") + defaultConfigFilePath = filepath.Join(configDir, ".corso.toml") } } @@ -69,7 +68,7 @@ func init() { if len(configDir) == 0 { configDir = homeDir - configFilePath = filepath.Join(configDir, ".corso.toml") + defaultConfigFilePath = filepath.Join(configDir, ".corso.toml") } } @@ -77,40 +76,63 @@ func init() { func AddConfigFlags(cmd *cobra.Command) { pf := cmd.PersistentFlags() pf.StringVar( - &configFilePathFlag, - "config-file", displayDefaultFP, "config file location") + &flags.ConfigFileFV, + flags.ConfigFileFN, displayDefaultFP, "config file location") } // --------------------------------------------------------------------------------------------------------- // Initialization & Storage // --------------------------------------------------------------------------------------------------------- -// InitFunc provides a func that lazily initializes viper and +// InitCmd provides a func that lazily initializes viper and // verifies that the configuration was able to read a file. -func InitFunc(cmd *cobra.Command, args []string) error { - ctx := cmd.Context() +func InitCmd(cmd *cobra.Command, args []string) error { + _, err := commonInit(cmd.Context(), flags.ConfigFileFV) + return clues.Stack(err).OrNil() +} - fp := configFilePathFlag +// InitConfig allows sdk consumers to initialize viper. +func InitConfig( + ctx context.Context, + userDefinedConfigFile string, +) (context.Context, error) { + return commonInit(ctx, userDefinedConfigFile) +} + +func commonInit( + ctx context.Context, + userDefinedConfigFile string, +) (context.Context, error) { + fp := userDefinedConfigFile if len(fp) == 0 || fp == displayDefaultFP { - fp = configFilePath + fp = defaultConfigFilePath } vpr := GetViper(ctx) - - if err := initWithViper(vpr, fp); err != nil { - return err + if err := initWithViper(ctx, vpr, fp); err != nil { + return ctx, err } - ctx = SetViper(ctx, vpr) - - return Read(ctx) + return SetViper(ctx, vpr), clues.Stack(Read(ctx)).OrNil() } // initWithViper implements InitConfig, but takes in a viper // struct for testing. -func initWithViper(vpr *viper.Viper, configFP string) error { +func initWithViper( + ctx context.Context, + vpr *viper.Viper, + configFP string, +) error { + logger.Ctx(ctx).Debugw("initializing viper", "config_file_path", configFP) + + defer func() { + logger.Ctx(ctx).Debugw("initialized config", "config_file_path", configFP) + }() + // Configure default config file location if len(configFP) == 0 || configFP == displayDefaultFP { + configFP = defaultConfigFilePath + // Find home directory. _, err := os.Stat(configDir) if err != nil { @@ -242,19 +264,17 @@ func writeRepoConfigWithViper( return nil } -// GetStorageAndAccount creates a storage and account instance by mediating all the possible +// ReadCorsoConfig creates a storage and account instance by mediating all the possible // data sources (config file, env vars, flag overrides) and the config file. -func GetConfigRepoDetails( +func ReadCorsoConfig( ctx context.Context, provider storage.ProviderType, readFromFile bool, mustMatchFromConfig bool, overrides map[string]string, -) ( - RepoDetails, - error, -) { +) (RepoDetails, error) { config, err := getStorageAndAccountWithViper( + ctx, GetViper(ctx), provider, readFromFile, @@ -267,15 +287,13 @@ func GetConfigRepoDetails( // getSorageAndAccountWithViper implements GetSorageAndAccount, but takes in a viper // struct for testing. func getStorageAndAccountWithViper( + ctx context.Context, vpr *viper.Viper, provider storage.ProviderType, readFromFile bool, mustMatchFromConfig bool, overrides map[string]string, -) ( - RepoDetails, - error, -) { +) (RepoDetails, error) { var ( config RepoDetails err error @@ -285,6 +303,9 @@ func getStorageAndAccountWithViper( // possibly read the prior config from a .corso file if readFromFile { + ctx = clues.Add(ctx, "viper_config_file", vpr.ConfigFileUsed()) + logger.Ctx(ctx).Debug("reading config from file") + if err := vpr.ReadInConfig(); err != nil { configNotSet := errors.As(err, &viper.ConfigFileNotFoundError{}) configNotFound := errors.Is(err, fs.ErrNotExist) @@ -293,6 +314,8 @@ func getStorageAndAccountWithViper( return config, clues.Wrap(err, "reading corso config file: "+vpr.ConfigFileUsed()) } + logger.Ctx(ctx).Info("config file not found") + readConfigFromViper = false } diff --git a/src/cli/config/config_test.go b/src/pkg/config/config_test.go similarity index 96% rename from src/cli/config/config_test.go rename to src/pkg/config/config_test.go index 2fe27208b..1ad6f81b2 100644 --- a/src/cli/config/config_test.go +++ b/src/pkg/config/config_test.go @@ -149,6 +149,9 @@ func (suite *ConfigSuite) TestWriteReadConfig() { testConfigFilePath = filepath.Join(t.TempDir(), "corso.toml") ) + ctx, flush := tester.NewContext(t) + defer flush() + const ( bkt = "write-read-config-bucket" tid = "3c0748d2-470e-444c-9064-1268e52609d5" @@ -157,7 +160,7 @@ func (suite *ConfigSuite) TestWriteReadConfig() { host = "some-host" ) - err := initWithViper(vpr, testConfigFilePath) + err := initWithViper(ctx, vpr, testConfigFilePath) require.NoError(t, err, "initializing repo config", clues.ToCore(err)) s3Cfg := &storage.S3Config{ @@ -205,12 +208,15 @@ func (suite *ConfigSuite) TestMustMatchConfig() { testConfigFilePath = filepath.Join(t.TempDir(), "corso.toml") ) + ctx, flush := tester.NewContext(t) + defer flush() + const ( bkt = "must-match-config-bucket" tid = "dfb12063-7598-458b-85ab-42352c5c25e2" ) - err := initWithViper(vpr, testConfigFilePath) + err := initWithViper(ctx, vpr, testConfigFilePath) require.NoError(t, err, "initializing repo config") s3Cfg := &storage.S3Config{Bucket: bkt} @@ -285,6 +291,9 @@ func (suite *ConfigSuite) TestReadFromFlags() { vpr = viper.New() ) + ctx, flush := tester.NewContext(t) + defer flush() + const ( b = "read-repo-config-basic-bucket" tID = "6f34ac30-8196-469b-bf8f-d83deadbbbba" @@ -349,6 +358,7 @@ func (suite *ConfigSuite) TestReadFromFlags() { flags.PassphraseFV = "passphrase-flags" repoDetails, err := getStorageAndAccountWithViper( + ctx, vpr, storage.ProviderS3, true, @@ -401,6 +411,9 @@ func (suite *ConfigIntegrationSuite) TestGetStorageAndAccount() { t := suite.T() vpr := viper.New() + ctx, flush := tester.NewContext(t) + defer flush() + const ( bkt = "get-storage-and-account-bucket" end = "https://get-storage-and-account.com" @@ -411,7 +424,7 @@ func (suite *ConfigIntegrationSuite) TestGetStorageAndAccount() { // Configure viper to read test config file testConfigFilePath := filepath.Join(t.TempDir(), "corso.toml") - err := initWithViper(vpr, testConfigFilePath) + err := initWithViper(ctx, vpr, testConfigFilePath) require.NoError(t, err, "initializing repo config", clues.ToCore(err)) s3Cfg := &storage.S3Config{ @@ -435,7 +448,7 @@ func (suite *ConfigIntegrationSuite) TestGetStorageAndAccount() { err = vpr.ReadInConfig() require.NoError(t, err, "reading repo config", clues.ToCore(err)) - cfg, err := getStorageAndAccountWithViper(vpr, storage.ProviderS3, true, true, nil) + cfg, err := getStorageAndAccountWithViper(ctx, vpr, storage.ProviderS3, true, true, nil) require.NoError(t, err, "getting storage and account from config", clues.ToCore(err)) readS3Cfg, err := cfg.Storage.ToS3Config() @@ -464,6 +477,9 @@ func (suite *ConfigIntegrationSuite) TestGetStorageAndAccount_noFileOnlyOverride t := suite.T() vpr := viper.New() + ctx, flush := tester.NewContext(t) + defer flush() + const ( bkt = "get-storage-and-account-no-file-bucket" end = "https://get-storage-and-account.com/no-file" @@ -484,7 +500,7 @@ func (suite *ConfigIntegrationSuite) TestGetStorageAndAccount_noFileOnlyOverride storage.StorageProviderTypeKey: storage.ProviderS3.String(), } - cfg, err := getStorageAndAccountWithViper(vpr, storage.ProviderS3, false, true, overrides) + cfg, err := getStorageAndAccountWithViper(ctx, vpr, storage.ProviderS3, false, true, overrides) require.NoError(t, err, "getting storage and account from config", clues.ToCore(err)) readS3Cfg, err := cfg.Storage.ToS3Config() diff --git a/src/cli/config/storage.go b/src/pkg/config/storage.go similarity index 100% rename from src/cli/config/storage.go rename to src/pkg/config/storage.go diff --git a/src/pkg/control/restore.go b/src/pkg/control/restore.go index 228ffe303..829821e5b 100644 --- a/src/pkg/control/restore.go +++ b/src/pkg/control/restore.go @@ -8,7 +8,7 @@ import ( "github.com/alcionai/clues" - "github.com/alcionai/corso/src/internal/common/dttm" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/path" ) diff --git a/src/pkg/control/restore_test.go b/src/pkg/control/restore_test.go index e239c6663..66c609077 100644 --- a/src/pkg/control/restore_test.go +++ b/src/pkg/control/restore_test.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/control" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/path" ) diff --git a/src/pkg/control/testdata/testdata.go b/src/pkg/control/testdata/testdata.go index 5c4f5df20..ace849384 100644 --- a/src/pkg/control/testdata/testdata.go +++ b/src/pkg/control/testdata/testdata.go @@ -3,8 +3,8 @@ package testdata import ( "strings" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/pkg/control" + "github.com/alcionai/corso/src/pkg/dttm" ) const RestoreFolderPrefix = "Corso_Test" diff --git a/src/pkg/credentials/aws.go b/src/pkg/credentials/aws.go index 7e4bbf736..d99d048e3 100644 --- a/src/pkg/credentials/aws.go +++ b/src/pkg/credentials/aws.go @@ -1,6 +1,8 @@ package credentials import ( + "os" + "github.com/alcionai/clues" ) @@ -18,6 +20,14 @@ type AWS struct { SessionToken string // required } +func GetAWSEnvs() map[string]string { + return map[string]string{ + AWSAccessKeyID: os.Getenv(AWSAccessKeyID), + AWSSecretAccessKey: os.Getenv(AWSSecretAccessKey), + AWSSessionToken: os.Getenv(AWSSessionToken), + } +} + // GetAWS is a helper for aggregating aws secrets and credentials. func GetAWS(override map[string]string) AWS { return AWS{ diff --git a/src/internal/common/dttm/dttm.go b/src/pkg/dttm/dttm.go similarity index 100% rename from src/internal/common/dttm/dttm.go rename to src/pkg/dttm/dttm.go diff --git a/src/internal/common/dttm/dttm_test.go b/src/pkg/dttm/dttm_test.go similarity index 98% rename from src/internal/common/dttm/dttm_test.go rename to src/pkg/dttm/dttm_test.go index f2414cf66..3f5713ea0 100644 --- a/src/internal/common/dttm/dttm_test.go +++ b/src/pkg/dttm/dttm_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/tester" + "github.com/alcionai/corso/src/pkg/dttm" ) type DTTMUnitSuite struct { diff --git a/src/pkg/logger/logger.go b/src/pkg/logger/logger.go index 94648557f..e3ccae870 100644 --- a/src/pkg/logger/logger.go +++ b/src/pkg/logger/logger.go @@ -412,6 +412,8 @@ const ctxKey loggingKey = "corsoLogger" // a seeded context prior to cobra evaluating flags. func Seed(ctx context.Context, set Settings) (context.Context, *zap.SugaredLogger) { zsl := singleton(set) + zsl.Debugw("seeding logger", "logger_settings", set) + return SetWithSettings(ctx, zsl, set), zsl } diff --git a/src/pkg/path/service_type.go b/src/pkg/path/service_type.go index 9059615a2..37445eaa4 100644 --- a/src/pkg/path/service_type.go +++ b/src/pkg/path/service_type.go @@ -57,3 +57,20 @@ func ToServiceType(service string) ServiceType { return UnknownService } } + +var serviceToHuman = map[ServiceType]string{ + ExchangeService: "Exchange", + OneDriveService: "OneDrive", + SharePointService: "SharePoint", + GroupsService: "Groups", +} + +// HumanString produces a more human-readable string version of the service. +func (svc ServiceType) HumanString() string { + hs, ok := serviceToHuman[svc] + if ok { + return hs + } + + return "Unknown Service" +} diff --git a/src/pkg/selectors/exchange.go b/src/pkg/selectors/exchange.go index 987165199..26af761ea 100644 --- a/src/pkg/selectors/exchange.go +++ b/src/pkg/selectors/exchange.go @@ -7,9 +7,9 @@ import ( "github.com/alcionai/clues" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/backup/identity" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/filters" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/pkg/selectors/exchange_test.go b/src/pkg/selectors/exchange_test.go index 785a1e956..16d2541da 100644 --- a/src/pkg/selectors/exchange_test.go +++ b/src/pkg/selectors/exchange_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/backup/details" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/filters" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/pkg/selectors/groups.go b/src/pkg/selectors/groups.go index 2857d6592..33e302e82 100644 --- a/src/pkg/selectors/groups.go +++ b/src/pkg/selectors/groups.go @@ -6,9 +6,9 @@ import ( "github.com/alcionai/clues" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/backup/identity" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/filters" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/pkg/selectors/groups_test.go b/src/pkg/selectors/groups_test.go index 0dc4ee44e..616e584a3 100644 --- a/src/pkg/selectors/groups_test.go +++ b/src/pkg/selectors/groups_test.go @@ -11,10 +11,10 @@ import ( "github.com/stretchr/testify/suite" "golang.org/x/exp/slices" - "github.com/alcionai/corso/src/internal/common/dttm" odConsts "github.com/alcionai/corso/src/internal/m365/service/onedrive/consts" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/backup/details" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/path" ) diff --git a/src/pkg/selectors/onedrive.go b/src/pkg/selectors/onedrive.go index f97ceccaf..ab72887c3 100644 --- a/src/pkg/selectors/onedrive.go +++ b/src/pkg/selectors/onedrive.go @@ -6,9 +6,9 @@ import ( "github.com/alcionai/clues" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/backup/identity" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/filters" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/pkg/selectors/onedrive_test.go b/src/pkg/selectors/onedrive_test.go index ed3120241..a0f0b8ab4 100644 --- a/src/pkg/selectors/onedrive_test.go +++ b/src/pkg/selectors/onedrive_test.go @@ -9,10 +9,10 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" odConsts "github.com/alcionai/corso/src/internal/m365/service/onedrive/consts" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/backup/details" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/path" ) diff --git a/src/pkg/selectors/selectors_reduce_test.go b/src/pkg/selectors/selectors_reduce_test.go index 8ebde4670..decc7cc39 100644 --- a/src/pkg/selectors/selectors_reduce_test.go +++ b/src/pkg/selectors/selectors_reduce_test.go @@ -8,11 +8,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/version" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/backup/details/testdata" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/selectors" diff --git a/src/pkg/selectors/sharepoint.go b/src/pkg/selectors/sharepoint.go index 68f6655e5..0cd60d257 100644 --- a/src/pkg/selectors/sharepoint.go +++ b/src/pkg/selectors/sharepoint.go @@ -6,9 +6,9 @@ import ( "github.com/alcionai/clues" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/backup/identity" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/filters" "github.com/alcionai/corso/src/pkg/path" diff --git a/src/pkg/selectors/sharepoint_test.go b/src/pkg/selectors/sharepoint_test.go index 906c86621..7474afcd5 100644 --- a/src/pkg/selectors/sharepoint_test.go +++ b/src/pkg/selectors/sharepoint_test.go @@ -11,10 +11,10 @@ import ( "github.com/stretchr/testify/suite" "golang.org/x/exp/slices" - "github.com/alcionai/corso/src/internal/common/dttm" odConsts "github.com/alcionai/corso/src/internal/m365/service/onedrive/consts" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/backup/details" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/path" ) diff --git a/src/pkg/services/m365/api/events.go b/src/pkg/services/m365/api/events.go index 4ac6d5d89..3a2dd996c 100644 --- a/src/pkg/services/m365/api/events.go +++ b/src/pkg/services/m365/api/events.go @@ -16,10 +16,10 @@ import ( "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/microsoftgraph/msgraph-sdk-go/users" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/common/str" "github.com/alcionai/corso/src/pkg/backup/details" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/services/m365/api/graph" diff --git a/src/pkg/services/m365/api/events_test.go b/src/pkg/services/m365/api/events_test.go index abac05f6e..fd9b36bec 100644 --- a/src/pkg/services/m365/api/events_test.go +++ b/src/pkg/services/m365/api/events_test.go @@ -11,13 +11,13 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/ptr" exchMock "github.com/alcionai/corso/src/internal/m365/service/exchange/mock" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/internal/tester/tconfig" "github.com/alcionai/corso/src/pkg/backup/details" "github.com/alcionai/corso/src/pkg/control/testdata" + "github.com/alcionai/corso/src/pkg/dttm" graphTD "github.com/alcionai/corso/src/pkg/services/m365/api/graph/testdata" ) diff --git a/src/pkg/services/m365/api/mail.go b/src/pkg/services/m365/api/mail.go index f99f3c230..d8797b12d 100644 --- a/src/pkg/services/m365/api/mail.go +++ b/src/pkg/services/m365/api/mail.go @@ -12,9 +12,9 @@ import ( "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/microsoftgraph/msgraph-sdk-go/users" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/pkg/backup/details" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/fault" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/services/m365/api/graph" diff --git a/src/pkg/services/m365/api/pagers/pagers.go b/src/pkg/services/m365/api/pagers/pagers.go index 32a66b527..6c72337ef 100644 --- a/src/pkg/services/m365/api/pagers/pagers.go +++ b/src/pkg/services/m365/api/pagers/pagers.go @@ -9,8 +9,8 @@ import ( "github.com/alcionai/clues" - "github.com/alcionai/corso/src/internal/common/dttm" "github.com/alcionai/corso/src/internal/common/ptr" + "github.com/alcionai/corso/src/pkg/dttm" "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/services/m365/api/graph" )