From 3ec6f4e9132ad8edb6ae6fc08ab79164acc3b1b5 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 5 Apr 2024 08:27:46 +0000 Subject: [PATCH] Add Slack alerts for failures on CI workflows (#793) Part of https://www.notion.so/Alerting-for-failing-CI-jobs-d0183b65453947aeab11dbddf989d9c0 Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/793 Co-authored-by: Prathamesh Musale Co-committed-by: Prathamesh Musale --- .../fixturenet-eth-plugeth-arm-test.yml | 16 ++++++++++++++++ .../workflows/fixturenet-eth-plugeth-test.yml | 16 ++++++++++++++++ .gitea/workflows/fixturenet-eth-test.yml | 17 ++++++++++++++++- .gitea/workflows/fixturenet-laconicd-test.yml | 16 ++++++++++++++++ .gitea/workflows/lint.yml | 16 ++++++++++++++++ .gitea/workflows/publish.yml | 16 ++++++++++++++++ .gitea/workflows/test-container-registry.yml | 17 ++++++++++++++++- .gitea/workflows/test-database.yml | 17 ++++++++++++++++- .gitea/workflows/test-deploy.yml | 16 ++++++++++++++++ .gitea/workflows/test-k8s-deploy.yml | 17 ++++++++++++++++- .gitea/workflows/test-webapp.yml | 16 ++++++++++++++++ .gitea/workflows/test.yml | 18 ++++++++++++++++-- .../triggers/fixturenet-laconicd-test | 1 + 13 files changed, 193 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml b/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml index 92ddd5dc..9f12854d 100644 --- a/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml +++ b/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml @@ -43,3 +43,19 @@ jobs: run: ./scripts/build_shiv_package.sh - name: "Run fixturenet-eth tests" run: ./tests/fixturenet-eth-plugeth/run-test.sh + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/fixturenet-eth-plugeth-test.yml b/.gitea/workflows/fixturenet-eth-plugeth-test.yml index 11bca169..8bb4ff8d 100644 --- a/.gitea/workflows/fixturenet-eth-plugeth-test.yml +++ b/.gitea/workflows/fixturenet-eth-plugeth-test.yml @@ -47,3 +47,19 @@ jobs: sleep 5 - name: "Run fixturenet-eth tests" run: ./tests/fixturenet-eth-plugeth/run-test.sh + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/fixturenet-eth-test.yml b/.gitea/workflows/fixturenet-eth-test.yml index 73804df5..e5f7a24f 100644 --- a/.gitea/workflows/fixturenet-eth-test.yml +++ b/.gitea/workflows/fixturenet-eth-test.yml @@ -45,4 +45,19 @@ jobs: sleep 5 - name: "Run fixturenet-eth tests" run: ./tests/fixturenet-eth/run-test.sh - + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/fixturenet-laconicd-test.yml b/.gitea/workflows/fixturenet-laconicd-test.yml index c8c3991e..50012b1d 100644 --- a/.gitea/workflows/fixturenet-laconicd-test.yml +++ b/.gitea/workflows/fixturenet-laconicd-test.yml @@ -48,3 +48,19 @@ jobs: run: ./tests/fixturenet-laconicd/run-test.sh - name: "Run laconic CLI tests" run: ./tests/fixturenet-laconicd/run-cli-test.sh + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index f9be1e6b..d7011b46 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -19,3 +19,19 @@ jobs: python-version: '3.8' - name : "Run flake8" uses: py-actions/flake8@v2 + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index ffbb9937..53bce1c2 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -54,3 +54,19 @@ jobs: # Hack using endsWith to workaround Gitea sometimes sending "publish-test" vs "refs/heads/publish-test" draft: ${{ endsWith('publish-test', github.ref ) }} files: ./laconic-so + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test-container-registry.yml b/.gitea/workflows/test-container-registry.yml index 3358aa09..5cc1a0cc 100644 --- a/.gitea/workflows/test-container-registry.yml +++ b/.gitea/workflows/test-container-registry.yml @@ -51,4 +51,19 @@ jobs: source /opt/bash-utils/cgroup-helper.sh join_cgroup ./tests/container-registry/run-test.sh - + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test-database.yml b/.gitea/workflows/test-database.yml index b925271b..247ed933 100644 --- a/.gitea/workflows/test-database.yml +++ b/.gitea/workflows/test-database.yml @@ -49,4 +49,19 @@ jobs: source /opt/bash-utils/cgroup-helper.sh join_cgroup ./tests/database/run-test.sh - + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test-deploy.yml b/.gitea/workflows/test-deploy.yml index 6e47c82d..8d901daf 100644 --- a/.gitea/workflows/test-deploy.yml +++ b/.gitea/workflows/test-deploy.yml @@ -47,3 +47,19 @@ jobs: sleep 5 - name: "Run deploy tests" run: ./tests/deploy/run-deploy-test.sh + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test-k8s-deploy.yml b/.gitea/workflows/test-k8s-deploy.yml index 7df39132..fa95608c 100644 --- a/.gitea/workflows/test-k8s-deploy.yml +++ b/.gitea/workflows/test-k8s-deploy.yml @@ -51,4 +51,19 @@ jobs: source /opt/bash-utils/cgroup-helper.sh join_cgroup ./tests/k8s-deploy/run-deploy-test.sh - + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test-webapp.yml b/.gitea/workflows/test-webapp.yml index 8b83c606..6a3b1c94 100644 --- a/.gitea/workflows/test-webapp.yml +++ b/.gitea/workflows/test-webapp.yml @@ -49,3 +49,19 @@ jobs: sleep 5 - name: "Run webapp tests" run: ./tests/webapp-test/run-webapp-test.sh + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 193e27c9..9b6e843e 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -47,5 +47,19 @@ jobs: sleep 5 - name: "Run smoke tests" run: ./tests/smoke-test/run-smoke-test.sh - - + - name: Notify Vulcanize Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }} + - name: Notify DeepStack Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/triggers/fixturenet-laconicd-test b/.gitea/workflows/triggers/fixturenet-laconicd-test index f0cb9305..10db7fd7 100644 --- a/.gitea/workflows/triggers/fixturenet-laconicd-test +++ b/.gitea/workflows/triggers/fixturenet-laconicd-test @@ -3,3 +3,4 @@ Trigger Trigger Trigger Trigger +Trigger