From dc8ec86dd3e54a880b80886bd3edffeca3ff7b1e Mon Sep 17 00:00:00 2001 From: Georgi Matev Date: Wed, 15 Mar 2023 19:51:49 -0400 Subject: [PATCH] Integrate Exchange retention reset in CI (#2807) Adds retention to current CI action --- #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [x] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup #### Issue(s) #### Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- .github/actions/purge-m365-user-data/action.yml | 10 ++++++++++ .github/workflows/ci_test_cleanup.yml | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/.github/actions/purge-m365-user-data/action.yml b/.github/actions/purge-m365-user-data/action.yml index c0f8d1811..c1b908adb 100644 --- a/.github/actions/purge-m365-user-data/action.yml +++ b/.github/actions/purge-m365-user-data/action.yml @@ -43,6 +43,16 @@ runs: run: | ./foldersAndItems.ps1 -WellKnownRoot root -User ${{ inputs.user }} -FolderPrefixPurge ${{ inputs.folder-prefix }} -FolderBeforePurge ${{ inputs.older-than }} + - name: Reset retention for all mailboxes to 0 + if: ${{ inputs.folder-prefix == '' && inputs.user == '' }} + shell: pwsh + working-directory: ./src/cmd/purge/scripts + env: + M365TENANT_ADMIN_USER: ${{ inputs.m365-admin-user }} + M365TENANT_ADMIN_PASSWORD: ${{ inputs.m365-admin-password }} + run: | + ./setRetention.ps1 + - name: Run the static purge script set if: ${{ inputs.folder-prefix == '' }} shell: pwsh diff --git a/.github/workflows/ci_test_cleanup.yml b/.github/workflows/ci_test_cleanup.yml index 41dc064c9..694ec365c 100644 --- a/.github/workflows/ci_test_cleanup.yml +++ b/.github/workflows/ci_test_cleanup.yml @@ -13,6 +13,11 @@ jobs: matrix: folder: [Corso_Restore_, TestRestore, testfolder, incrementals_ci_, Alcion_Restore_, ''] user: [CORSO_M365_TEST_USER_ID, CORSO_SECONDARY_M365_TEST_USER_ID, EXT_SDK_TEST_USER_ID] + # jobs are expanded per user. Try to run 2 jobs per active user at a time + max-parallel: 6 + include: + - folder: "" + user: "" steps: - uses: actions/checkout@v3 @@ -37,3 +42,5 @@ jobs: azure-client-id: ${{ secrets.CLIENT_ID }} azure-client-secret: ${{ secrets.CLIENT_SECRET }} azure-tenant-id: ${{ secrets.TENANT_ID }} + m365-admin-user: ${{ secrets.M365_TENANT_ADMIN_USER }} + m365-admin-password: ${{ secrets.M365_TENANT_ADMIN_PASSWORD }}