From 2e4ee115a0910b34aaf016ed8925d2dab148709b Mon Sep 17 00:00:00 2001 From: Basilio Bogado <541149+basiliskus@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:16:05 -0800 Subject: [PATCH 1/7] WIP: Added initial workflow step to notify on failure --- .github/workflows/automated-staging-test-run.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/automated-staging-test-run.yml b/.github/workflows/automated-staging-test-run.yml index 95dfb38d1..fbe8ff5bf 100644 --- a/.github/workflows/automated-staging-test-run.yml +++ b/.github/workflows/automated-staging-test-run.yml @@ -17,3 +17,12 @@ jobs: env: AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AUTOMATED_TEST_AZURE_STORAGE_CONNECTION_STRING }} run: ./gradlew rs-e2e:clean rs-e2e:automatedTest + + - name: Send slack notification on test failure + id: slack + if: failure() + uses: slackapi/slack-github-action@v1.27.0 + with: + payload-delimiter: "_" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From d515e996f0f68114bd24d8a1cf64d18e780acf79 Mon Sep 17 00:00:00 2001 From: Basilio Bogado <541149+basiliskus@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:55:35 -0800 Subject: [PATCH 2/7] Update github workflow to test slack incoming webhook --- .github/workflows/automated-staging-test-run.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/automated-staging-test-run.yml b/.github/workflows/automated-staging-test-run.yml index fbe8ff5bf..3b2f6a8e9 100644 --- a/.github/workflows/automated-staging-test-run.yml +++ b/.github/workflows/automated-staging-test-run.yml @@ -19,10 +19,14 @@ jobs: run: ./gradlew rs-e2e:clean rs-e2e:automatedTest - name: Send slack notification on test failure - id: slack - if: failure() - uses: slackapi/slack-github-action@v1.27.0 + uses: slackapi/slack-github-action@v2.0.0 with: - payload-delimiter: "_" - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + text: "*GitHub Action build result*: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + blocks: + - type: "section" + text: + type: "mrkdwn" + text: "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" From 762e3bde285c87eca25350d25b1059ff0db3a99f Mon Sep 17 00:00:00 2001 From: Basilio Bogado <541149+basiliskus@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:52:04 -0800 Subject: [PATCH 3/7] Testing run the step when there is a failure --- .github/workflows/automated-staging-test-run.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/automated-staging-test-run.yml b/.github/workflows/automated-staging-test-run.yml index 3b2f6a8e9..5d85db84d 100644 --- a/.github/workflows/automated-staging-test-run.yml +++ b/.github/workflows/automated-staging-test-run.yml @@ -4,6 +4,7 @@ on: schedule: - cron: "0 2 * * 2-6" # Tuesday to Saturday at 2am UTC - two hours after `automated-staging-test-submit` runs workflow_dispatch: + pull_request: jobs: test_files: @@ -19,6 +20,7 @@ jobs: run: ./gradlew rs-e2e:clean rs-e2e:automatedTest - name: Send slack notification on test failure + if: failure() uses: slackapi/slack-github-action@v2.0.0 with: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} From 918c73133f3cda90b4c75c4fad5f474504b7a743 Mon Sep 17 00:00:00 2001 From: Basilio Bogado <541149+basiliskus@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:03:10 -0800 Subject: [PATCH 4/7] Updated with link to action run URL --- .github/workflows/automated-staging-test-run.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/automated-staging-test-run.yml b/.github/workflows/automated-staging-test-run.yml index 5d85db84d..01b02124c 100644 --- a/.github/workflows/automated-staging-test-run.yml +++ b/.github/workflows/automated-staging-test-run.yml @@ -26,9 +26,4 @@ jobs: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | - text: "*GitHub Action build result*: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" - blocks: - - type: "section" - text: - type: "mrkdwn" - text: "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + text: "*Automated Staging Test Failed!*: https://github.com/CDCgov/trusted-intermediary/actions/runs/${{ github.run_id }}" From 07c707358f2dd616bf57b1a404b3ef4e7a53ec3a Mon Sep 17 00:00:00 2001 From: Basilio Bogado <541149+basiliskus@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:08:19 -0800 Subject: [PATCH 5/7] Removed pull_request trigger --- .github/workflows/automated-staging-test-run.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/automated-staging-test-run.yml b/.github/workflows/automated-staging-test-run.yml index 01b02124c..ec669b045 100644 --- a/.github/workflows/automated-staging-test-run.yml +++ b/.github/workflows/automated-staging-test-run.yml @@ -4,7 +4,6 @@ on: schedule: - cron: "0 2 * * 2-6" # Tuesday to Saturday at 2am UTC - two hours after `automated-staging-test-submit` runs workflow_dispatch: - pull_request: jobs: test_files: @@ -26,4 +25,4 @@ jobs: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook payload: | - text: "*Automated Staging Test Failed!*: https://github.com/CDCgov/trusted-intermediary/actions/runs/${{ github.run_id }}" + text: "Automated Staging RS Integration Test Failed!: https://github.com/CDCgov/trusted-intermediary/actions/runs/${{ github.run_id }}" From 372bce75cd718444e84e3c15320b62bf0089791a Mon Sep 17 00:00:00 2001 From: Basilio Bogado <541149+basiliskus@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:10:58 -0800 Subject: [PATCH 6/7] Testing that step doesn't run on success --- .github/workflows/automated-staging-test-run.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/automated-staging-test-run.yml b/.github/workflows/automated-staging-test-run.yml index ec669b045..0df6e8e66 100644 --- a/.github/workflows/automated-staging-test-run.yml +++ b/.github/workflows/automated-staging-test-run.yml @@ -13,11 +13,6 @@ jobs: - name: Check out the repository uses: actions/checkout@v4 - - name: Run automated tests - env: - AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AUTOMATED_TEST_AZURE_STORAGE_CONNECTION_STRING }} - run: ./gradlew rs-e2e:clean rs-e2e:automatedTest - - name: Send slack notification on test failure if: failure() uses: slackapi/slack-github-action@v2.0.0 From 27ac14fe2448f396bc8f5094fa9179a7d5858f04 Mon Sep 17 00:00:00 2001 From: Basilio Bogado <541149+basiliskus@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:12:58 -0800 Subject: [PATCH 7/7] added back workflow step --- .github/workflows/automated-staging-test-run.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/automated-staging-test-run.yml b/.github/workflows/automated-staging-test-run.yml index 0df6e8e66..ec669b045 100644 --- a/.github/workflows/automated-staging-test-run.yml +++ b/.github/workflows/automated-staging-test-run.yml @@ -13,6 +13,11 @@ jobs: - name: Check out the repository uses: actions/checkout@v4 + - name: Run automated tests + env: + AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AUTOMATED_TEST_AZURE_STORAGE_CONNECTION_STRING }} + run: ./gradlew rs-e2e:clean rs-e2e:automatedTest + - name: Send slack notification on test failure if: failure() uses: slackapi/slack-github-action@v2.0.0