From 1752d1117f213e5313bc09bb0eb94ef15356278b Mon Sep 17 00:00:00 2001 From: Keepers Date: Thu, 8 Feb 2024 14:37:59 -0700 Subject: [PATCH] fix up mergequeue and ci (#21) * fix up mergequeue and ci * rename ci job * spacing out triggers? * fix ci script * fixing up test runner --- .github/actions/publish-website/action.yml | 2 +- .github/actions/teams-message/action.yml | 86 +++++++++++----------- .github/workflows/ci.yml | 50 ++++++++++--- .github/workflows/ci_test_cleanup.yml | 22 +++++- .github/workflows/longevity_test.yml | 5 +- .github/workflows/nightly_test.yml | 5 +- .github/workflows/website-publish.yml | 6 +- 7 files changed, 110 insertions(+), 66 deletions(-) diff --git a/.github/actions/publish-website/action.yml b/.github/actions/publish-website/action.yml index 9910762b0..d31681de1 100644 --- a/.github/actions/publish-website/action.yml +++ b/.github/actions/publish-website/action.yml @@ -23,7 +23,7 @@ runs: uses: aws-actions/configure-aws-credentials@v2 with: role-to-assume: ${{ inputs.aws-iam-role }} - role-session-name: integration-testing + role-session-name: canario-integration-testing aws-region: us-east-1 - name: Add rotbots.txt diff --git a/.github/actions/teams-message/action.yml b/.github/actions/teams-message/action.yml index fac8a37e5..1efb78f87 100644 --- a/.github/actions/teams-message/action.yml +++ b/.github/actions/teams-message/action.yml @@ -43,49 +43,49 @@ runs: curl -X POST \ -H "Content-Type: application/json" \ -d '{ - "type":"message", - "attachments":[ - { - "contentType":"application/vnd.microsoft.card.adaptive", - "contentUrl":null, - "content":{ - "$schema":"http://adaptivecards.io/schemas/adaptive-card.json", - "type":"AdaptiveCard", - "body": [ - { - "type": "TextBlock", - "size": "Medium", - "weight": "Bolder", - "text": "${{ inputs.msg }}", - "color": "Attention" - }, - { - "type": "TextBlock", - "text": "${{ env.JOB }} :: ${{ env.STEP }}", - "wrap": true - } - ], - "actions": [ - { - "type": "Action.OpenUrl", - "title": "Action", - "url": "${{ env.LOGS }}" - }, - { - "type": "Action.OpenUrl", - "title": "Commit", - "url": "${{ env.COMMIT }}" - }, - { - "type": "Action.OpenUrl", - "title": "Ref", - "url": "${{ env.REF }}" - } - ], - "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "version": "1.5" - } + "type":"message", + "attachments":[ + { + "contentType":"application/vnd.microsoft.card.adaptive", + "contentUrl":null, + "content":{ + "$schema":"http://adaptivecards.io/schemas/adaptive-card.json", + "type":"AdaptiveCard", + "body": [ + { + "type": "TextBlock", + "size": "Medium", + "weight": "Bolder", + "text": "Canario - ${{ inputs.msg }}", + "color": "Attention" + }, + { + "type": "TextBlock", + "text": "${{ env.JOB }} :: ${{ env.STEP }}", + "wrap": true + } + ], + "actions": [ + { + "type": "Action.OpenUrl", + "title": "Action", + "url": "${{ env.LOGS }}" + }, + { + "type": "Action.OpenUrl", + "title": "Commit", + "url": "${{ env.COMMIT }}" + }, + { + "type": "Action.OpenUrl", + "title": "Ref", + "url": "${{ env.REF }}" + } + ], + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.5" } - ] + } + ] }' \ ${{ inputs.teams_url }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8fbc6c81..2899b7d90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,15 @@ -name: Build/Release Corso -env: - IMAGE_NAME: ghcr.io/alcionai/canario +name: Build Canario +# holdover from corso +# canario should not build any images +#env: +# IMAGE_NAME: ghcr.io/alcionai/canario on: workflow_dispatch: - + merge_group: pull_request: - push: branches: [main] tags: ["v*.*.*"] - repository_dispatch: types: [ok-to-test-command] @@ -101,7 +101,22 @@ jobs: echo "website-cfid=ESFTEIYTIP7Y3" | tee -a $GITHUB_OUTPUT fi - + Seeing-Things: + environment: Testing + runs-on: ubuntu-latest + steps: + - shell: bash + run: echo "github.ref" + - shell: bash + run: echo ${{ github.ref }} + - shell: bash + run: echo "github.event.merge_queue.head.repo.full_name" + - shell: bash + run: echo ${{ github.event.merge_queue.head.repo.full_name }} + - shell: bash + run: echo "github.repository" + - shell: bash + run: echo ${{ github.repository }} # ---------------------------------------------------------------------------------------------------- # --- Website Linting ----------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------- @@ -130,7 +145,16 @@ jobs: environment: Testing runs-on: ubuntu-latest timeout-minutes: 120 - if: (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') || (needs.precheck.outputs.srcfileschanged == 'true' && github.event.pull_request.head.repo.full_name == github.repository) + if: | + ( + startsWith(github.ref, 'refs/tags/') + || github.ref == 'refs/heads/gh-readonly-queue/main' + || github.ref == 'refs/heads/main' + ) + || ( + needs.precheck.outputs.srcfileschanged == 'true' + && github.event.pull_request.head.repo.full_name == github.repository + ) defaults: run: working-directory: src @@ -160,7 +184,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_IAM_ROLE }} - role-session-name: integration-testing + role-session-name: canario-integration-testing aws-region: us-east-1 # run the tests @@ -231,7 +255,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_IAM_ROLE }} - role-session-name: integration-testing + role-session-name: canario-integration-testing aws-region: us-east-1 # run the tests @@ -325,7 +349,9 @@ jobs: Test-Suite-Fork: needs: [Precheck] environment: Testing - if: (!startsWith(github.ref , 'refs/tags/') && github.ref != 'refs/heads/main') && (needs.precheck.outputs.srcfileschanged == 'true' && github.event.pull_request.head.repo.full_name != github.repository) + # test-suite-fork is a corso build artifact. + if: false + # if: (!startsWith(github.ref , 'refs/tags/') && github.ref != 'refs/heads/main') && (needs.precheck.outputs.srcfileschanged == 'true' && github.event.pull_request.head.repo.full_name != github.repository) runs-on: ubuntu-latest defaults: run: @@ -380,7 +406,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_IAM_ROLE }} - role-session-name: integration-testing + role-session-name: canario-integration-testing aws-region: us-east-1 # run the tests diff --git a/.github/workflows/ci_test_cleanup.yml b/.github/workflows/ci_test_cleanup.yml index 0ea12cf10..b39ff1757 100644 --- a/.github/workflows/ci_test_cleanup.yml +++ b/.github/workflows/ci_test_cleanup.yml @@ -1,13 +1,23 @@ name: CI Test Cleanup on: - workflow_dispatch: - schedule: - # every half hour - - cron: "*/30 * * * *" + # neither of the jobs are currently running (corso already runs them), + # so this action is turned off until we decide it's needed. + # workflow_dispatch: + # schedule: + # every half hour + # - cron: "*/30 * * * *" + # + push: + branches: + does-not-exist-this-forces-the-action-to-not-run jobs: Test-User-Data-Cleanup: environment: Testing + # forced off - this is already running in corso + # we may need to turn this back on if we elect different + # test users compared to the corso repo + if: false runs-on: ubuntu-latest continue-on-error: true strategy: @@ -43,6 +53,10 @@ jobs: Test-Site-Data-Cleanup: environment: Testing + # forced off - this is already running in corso + # we may need to turn this back on if we elect different + # test users compared to the corso repo + if: false runs-on: ubuntu-latest continue-on-error: true strategy: diff --git a/.github/workflows/longevity_test.yml b/.github/workflows/longevity_test.yml index 94883dad7..d649b1fde 100644 --- a/.github/workflows/longevity_test.yml +++ b/.github/workflows/longevity_test.yml @@ -76,8 +76,7 @@ jobs: git checkout ${{ steps.version.outputs.version }} git checkout ${{ github.ref }} -- .github - - run: - + - run: go build -o canario timeout-minutes: 10 - run: mkdir ${CORSO_LOG_DIR} @@ -89,7 +88,7 @@ jobs: timeout-minutes: 10 with: role-to-assume: ${{ secrets.AWS_IAM_ROLE }} - role-session-name: integration-testing + role-session-name: canario-integration-testing aws-region: us-east-1 ########################################################################## diff --git a/.github/workflows/nightly_test.yml b/.github/workflows/nightly_test.yml index e49ce7730..2365fc4aa 100644 --- a/.github/workflows/nightly_test.yml +++ b/.github/workflows/nightly_test.yml @@ -3,8 +3,9 @@ on: workflow_dispatch: schedule: - # Run every day at 04:00 GMT (roughly 8pm PST) - - cron: "0 4 * * *" + # Run every day at 06:00 GMT (roughly 10pm PST) + # corso runs at 04:00 GMT, this is slightly offset to avoid conflicts. + - cron: "0 6 * * *" permissions: # required to retrieve AWS credentials diff --git a/.github/workflows/website-publish.yml b/.github/workflows/website-publish.yml index fa73ab8f6..fb430437f 100644 --- a/.github/workflows/website-publish.yml +++ b/.github/workflows/website-publish.yml @@ -1,6 +1,10 @@ name: Publish website on: - workflow_dispatch: + # workflow_dispatch: + # turned off for now, since canario should not publish the website + push: + branches: + does-not-exist-this-forces-the-action-to-not-run permissions: # required to retrieve AWS credentials