hide groups/teams cli behind env (#4128)

#### Does this PR need a docs update or release note?

- [x]  No

#### Type of change

- [x] 🤖 Supportability/Tests

#### Test Plan

- [x]  Unit test
- [x] 💚 E2E
This commit is contained in:
Keepers 2023-08-28 10:42:28 -06:00 committed by GitHub
parent 3e43028a88
commit d1f098b398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 4 deletions

View File

@ -172,6 +172,7 @@ jobs:
CORSO_SECONDARY_M365_TEST_USER_ID: ${{ vars.CORSO_SECONDARY_M365_TEST_USER_ID }}
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
S3_BUCKET: ${{ secrets.CI_TESTS_S3_BUCKET }}
CORSO_ENABLE_GROUPS: true
run: |
set -euo pipefail
go test \
@ -242,6 +243,7 @@ jobs:
CORSO_SECONDARY_M365_TEST_USER_ID: ${{ vars.CORSO_SECONDARY_M365_TEST_USER_ID }}
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
S3_BUCKET: ${{ secrets.CI_RETENTION_TESTS_S3_BUCKET }}
CORSO_ENABLE_GROUPS: true
run: |
set -euo pipefail
go test \
@ -275,6 +277,7 @@ jobs:
env:
CORSO_LOG_FILE: ${{ github.workspace }}/src/testlog/run-unit.log
LOG_GRAPH_REQUESTS: true
CORSO_ENABLE_GROUPS: true
steps:
- uses: actions/checkout@v3
@ -329,6 +332,7 @@ jobs:
env:
CORSO_LOG_FILE: ${{ github.workspace }}/testlog/run-fork.log
LOG_GRAPH_REQUESTS: true
CORSO_ENABLE_GROUPS: true
steps:
- name: Fail check if not repository_dispatch
if: github.event_name != 'repository_dispatch'

View File

@ -59,6 +59,7 @@ jobs:
AZURE_CLIENT_ID_NAME: ${{ needs.SetM365App.outputs.client_id_env }}
AZURE_CLIENT_SECRET_NAME: ${{ needs.SetM365App.outputs.client_secret_env }}
CLIENT_APP_SLOT: ${{ needs.SetM365App.outputs.client_app_slot }}
CORSO_ENABLE_GROUPS: true
steps:
- uses: actions/checkout@v3

View File

@ -39,6 +39,7 @@ jobs:
CORSO_LOG_FILE: ${{ github.workspace }}/src/testlog/run-sanity.log
RESTORE_DEST_PFX: Corso_Test_Sanity_
TEST_USER: ${{ github.event.inputs.user != '' && github.event.inputs.user || secrets.CORSO_M365_TEST_USER_ID }}
CORSO_ENABLE_GROUPS: true
defaults:
run:

View File

@ -3,6 +3,7 @@ package backup
import (
"context"
"fmt"
"os"
"strings"
"github.com/alcionai/clues"
@ -39,8 +40,9 @@ var serviceCommands = []func(cmd *cobra.Command) *cobra.Command{
addExchangeCommands,
addOneDriveCommands,
addSharePointCommands,
addGroupsCommands,
addTeamsCommands,
// awaiting release
// addGroupsCommands,
// addTeamsCommands,
}
// AddCommands attaches all `corso backup * *` commands to the parent.
@ -55,6 +57,12 @@ func AddCommands(cmd *cobra.Command) {
for _, addBackupTo := range serviceCommands {
addBackupTo(subCommand)
}
// delete after release
if len(os.Getenv("CORSO_ENABLE_GROUPS")) > 0 {
addGroupsCommands(subCommand)
addTeamsCommands(subCommand)
}
}
}

View File

@ -3,6 +3,7 @@ package export
import (
"context"
"errors"
"os"
"github.com/alcionai/clues"
"github.com/spf13/cobra"
@ -21,8 +22,9 @@ import (
var exportCommands = []func(cmd *cobra.Command) *cobra.Command{
addOneDriveCommands,
addSharePointCommands,
addGroupsCommands,
addTeamsCommands,
// awaiting release
// addGroupsCommands,
// addTeamsCommands,
}
// AddCommands attaches all `corso export * *` commands to the parent.
@ -33,6 +35,12 @@ func AddCommands(cmd *cobra.Command) {
for _, addExportTo := range exportCommands {
addExportTo(exportC)
}
// delete after release
if len(os.Getenv("CORSO_ENABLE_GROUPS")) > 0 {
addGroupsCommands(exportC)
addTeamsCommands(exportC)
}
}
const exportCommand = "export"

View File

@ -2,6 +2,7 @@ package restore
import (
"context"
"os"
"github.com/alcionai/clues"
"github.com/pkg/errors"
@ -20,6 +21,9 @@ var restoreCommands = []func(cmd *cobra.Command) *cobra.Command{
addExchangeCommands,
addOneDriveCommands,
addSharePointCommands,
// awaiting release
// addGroupsCommands,
// addTeamsCommands,
}
// AddCommands attaches all `corso restore * *` commands to the parent.
@ -30,6 +34,12 @@ func AddCommands(cmd *cobra.Command) {
for _, addRestoreTo := range restoreCommands {
addRestoreTo(restoreC)
}
// delete after release
if len(os.Getenv("CORSO_ENABLE_GROUPS")) > 0 {
addGroupsCommands(restoreC)
addTeamsCommands(restoreC)
}
}
const restoreCommand = "restore"