From 455c3a0ec50c8ca8a05ed345e0f92ee091cf133b Mon Sep 17 00:00:00 2001 From: Georgiana Dolocan Date: Thu, 8 Jun 2023 13:40:33 +0300 Subject: [PATCH 1/2] Add step that notifies Slack when jobs in the hub deployement workflow fail --- .github/workflows/deploy-hubs.yaml | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/deploy-hubs.yaml b/.github/workflows/deploy-hubs.yaml index 288967dc56..f621f248d7 100644 --- a/.github/workflows/deploy-hubs.yaml +++ b/.github/workflows/deploy-hubs.yaml @@ -128,6 +128,17 @@ jobs: pr-number.txt comment-body.txt + # https://github.com/ravsamhq/notify-slack-action + # Needs to be added per job + # Once https://github.com/integrations/slack/issues/1563 we can use that instead + - name: Report Status + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + notify_when: "failure" + status: ${{ job.status }} # required + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FAILURES_WEBHOOK_URL }} # This job upgrades the support chart, staging hub, and dask-staging hub (if present) # for clusters in parallel, if those upgrades are required. This job needs the # `generate-jobs` job to have completed and set an output to the @@ -245,6 +256,18 @@ jobs: with open(env_file, "a") as f: f.write(f"failure_{name}={failure}") + # https://github.com/ravsamhq/notify-slack-action + # Needs to be added per job + # Once https://github.com/integrations/slack/issues/1563 we can use that instead + - name: Report Status + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + notify_when: "failure" + status: ${{ job.status }} # required + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FAILURES_WEBHOOK_URL }} + # This jobs reduces the initially planned prod-hub-matrix-jobs deployments by # filtering out any deployment to a cluster with a failed support-and-staging # job. @@ -292,6 +315,18 @@ jobs: with open(env_file, "a") as f: f.write(f"filtered-prod-hub-matrix-jobs={json.dumps(filtered_jobs)}") + # https://github.com/ravsamhq/notify-slack-action + # Needs to be added per job + # Once https://github.com/integrations/slack/issues/1563 we can use that instead + - name: Report Status + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + notify_when: "failure" + status: ${{ job.status }} # required + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FAILURES_WEBHOOK_URL }} + # This job upgrades production hubs on clusters in parallel, if required. This # job needs both the `filter-generate-jobs` to have completed to provide its # output `filtered-prod-hub-matrix-jobs`. It is a list of dictionaries with @@ -341,3 +376,15 @@ jobs: max_attempts: 3 command: | deployer run-hub-health-check ${{ matrix.jobs.cluster_name }} ${{ matrix.jobs.hub_name }} + + # https://github.com/ravsamhq/notify-slack-action + # Needs to be added per job + # Once https://github.com/integrations/slack/issues/1563 we can use that instead + - name: Report Status + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + notify_when: "failure" + status: ${{ job.status }} # required + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FAILURES_WEBHOOK_URL }} From bfe4b1179ba1d75ec3fc9a27e22b677de73548d8 Mon Sep 17 00:00:00 2001 From: Georgiana Dolocan Date: Thu, 8 Jun 2023 13:44:31 +0300 Subject: [PATCH 2/2] Update comment --- .github/workflows/deploy-hubs.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-hubs.yaml b/.github/workflows/deploy-hubs.yaml index f621f248d7..921c7788b9 100644 --- a/.github/workflows/deploy-hubs.yaml +++ b/.github/workflows/deploy-hubs.yaml @@ -130,7 +130,8 @@ jobs: # https://github.com/ravsamhq/notify-slack-action # Needs to be added per job - # Once https://github.com/integrations/slack/issues/1563 we can use that instead + # When https://github.com/integrations/slack/issues/1563 gets implemented, + # we can use that instead - name: Report Status if: always() uses: ravsamhq/notify-slack-action@v2 @@ -258,7 +259,8 @@ jobs: # https://github.com/ravsamhq/notify-slack-action # Needs to be added per job - # Once https://github.com/integrations/slack/issues/1563 we can use that instead + # When https://github.com/integrations/slack/issues/1563 gets implemented, + # we can use that instead - name: Report Status if: always() uses: ravsamhq/notify-slack-action@v2 @@ -317,7 +319,8 @@ jobs: # https://github.com/ravsamhq/notify-slack-action # Needs to be added per job - # Once https://github.com/integrations/slack/issues/1563 we can use that instead + # When https://github.com/integrations/slack/issues/1563 gets implemented, + # we can use that instead - name: Report Status if: always() uses: ravsamhq/notify-slack-action@v2 @@ -379,7 +382,8 @@ jobs: # https://github.com/ravsamhq/notify-slack-action # Needs to be added per job - # Once https://github.com/integrations/slack/issues/1563 we can use that instead + # When https://github.com/integrations/slack/issues/1563 gets implemented, + # we can use that instead - name: Report Status if: always() uses: ravsamhq/notify-slack-action@v2