From a2eceac11e25ff11de5d507a8f316510d2b0ff40 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Sat, 26 Dec 2020 21:26:09 +0100 Subject: [PATCH 01/27] Add Slack notifications to the github actions workflow --- .github/workflows/ci.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6e309ce21b..623dc076dd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -73,6 +73,15 @@ jobs: # Name of the user who is running the CI (on GitHub Actions this is 'runner') ST2_CI_USER: 'runner' steps: + - name: CI Run Start Slack Notification + id: stackstorm_community_slack + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + uses: voxmedia/github-action-slack-notify-build@v1 + with: + channel: ghci-integration + status: STARTING + color: warning - name: Custom Environment Setup # built-in GitHub Actions environment variables # https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables @@ -173,6 +182,26 @@ jobs: if: "${{ success() && ((env.TASK == 'ci-unit') || (env.TASK == 'ci-integration')) && (env.ENABLE_COVERAGE == 'yes') }}" run: | ./scripts/travis/submit-codecov-coverage.sh + - name: CI Run Success Slack Notification + if: success() + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + uses: voxmedia/github-action-slack-notify-build@v1 + with: + channel: ghci-integration + message_id: ${{ steps.stackstorm_community_slack.outputs.message_id }} + status: SUCCESS + color: good + - name: CI Run Success Slack Notification + if: failure() + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + uses: voxmedia/github-action-slack-notify-build@v1 + with: + channel: ghci-integration + message_id: ${{ steps.stackstorm_community_slack.outputs.message_id }} + status: FAILED + color: danger # HELPER FOR FUTURE DEVELOPERS: # If your GitHub Actions job is failing and you need to debug it, by default there is From 970c355e6d3f518fb2bcfc6779d847a35840738d Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Sat, 26 Dec 2020 21:34:51 +0100 Subject: [PATCH 02/27] Remove tag filter to run actions --- .github/workflows/ci.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 623dc076dd..8048ab2be9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,8 +3,6 @@ name: ci on: push: branches: ['*'] - tags: - - v* pull_request: type: [opened, reopened, edited] schedule: From d7898b31e770e77a8f222ad198ef40c5770dd830 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Wed, 30 Dec 2020 22:35:06 +0100 Subject: [PATCH 03/27] Trigger Slack notifications only for failures on the master branch --- .github/workflows/ci.yaml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8048ab2be9..58e6ccb83c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -71,15 +71,6 @@ jobs: # Name of the user who is running the CI (on GitHub Actions this is 'runner') ST2_CI_USER: 'runner' steps: - - name: CI Run Start Slack Notification - id: stackstorm_community_slack - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1 - with: - channel: ghci-integration - status: STARTING - color: warning - name: Custom Environment Setup # built-in GitHub Actions environment variables # https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables @@ -181,17 +172,7 @@ jobs: run: | ./scripts/travis/submit-codecov-coverage.sh - name: CI Run Success Slack Notification - if: success() - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1 - with: - channel: ghci-integration - message_id: ${{ steps.stackstorm_community_slack.outputs.message_id }} - status: SUCCESS - color: good - - name: CI Run Success Slack Notification - if: failure() + if: ${{ failure() && github.ref == 'refs/head/master' env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} uses: voxmedia/github-action-slack-notify-build@v1 From 57a3db4e5f2795c2fc49001ec7f9cdd52c0f7cb4 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Wed, 30 Dec 2020 22:37:55 +0100 Subject: [PATCH 04/27] Slack notification is triggered on failures not on success --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 58e6ccb83c..fe21747705 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -171,7 +171,7 @@ jobs: if: "${{ success() && ((env.TASK == 'ci-unit') || (env.TASK == 'ci-integration')) && (env.ENABLE_COVERAGE == 'yes') }}" run: | ./scripts/travis/submit-codecov-coverage.sh - - name: CI Run Success Slack Notification + - name: CI Run Failure Slack Notification if: ${{ failure() && github.ref == 'refs/head/master' env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From 197f1405155f15f7065baad55172eb50fa191b4c Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Wed, 30 Dec 2020 22:39:37 +0100 Subject: [PATCH 05/27] Fix expression on the slack notifications for gh actions --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fe21747705..c160b00e92 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -172,7 +172,7 @@ jobs: run: | ./scripts/travis/submit-codecov-coverage.sh - name: CI Run Failure Slack Notification - if: ${{ failure() && github.ref == 'refs/head/master' + if: ${{ failure() && github.ref == 'refs/head/master' }} env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} uses: voxmedia/github-action-slack-notify-build@v1 From a23ab67a3aec7e1b8f2ca13e14aaf63533aac2b2 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Wed, 30 Dec 2020 23:51:59 +0100 Subject: [PATCH 06/27] Fix typo on the master reference for the slack notifications --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c160b00e92..7bb79079b7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -172,7 +172,7 @@ jobs: run: | ./scripts/travis/submit-codecov-coverage.sh - name: CI Run Failure Slack Notification - if: ${{ failure() && github.ref == 'refs/head/master' }} + if: ${{ failure() && github.ref == 'refs/heads/master' }} env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} uses: voxmedia/github-action-slack-notify-build@v1 From 4c01bb8c80300816b2cf9f99acfda03f6ee3c25a Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Thu, 31 Dec 2020 23:19:07 +0100 Subject: [PATCH 07/27] Test new slack action --- .github/workflows/ci.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7bb79079b7..2da4f71d85 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -172,15 +172,14 @@ jobs: run: | ./scripts/travis/submit-codecov-coverage.sh - name: CI Run Failure Slack Notification - if: ${{ failure() && github.ref == 'refs/heads/master' }} + if: ${{ success() && github.ref == 'refs/pull/1/merge' }} env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1 + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + uses: 8398a7/action-slack@v3 with: channel: ghci-integration - message_id: ${{ steps.stackstorm_community_slack.outputs.message_id }} - status: FAILED - color: danger + fields: repo,message,commit,author,action,eventName,ref,workflow,job,took + status: ${{ job.status }} # HELPER FOR FUTURE DEVELOPERS: # If your GitHub Actions job is failing and you need to debug it, by default there is From e03f8a424a268be208023de242410e7e88bd4e14 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Thu, 31 Dec 2020 23:25:28 +0100 Subject: [PATCH 08/27] Test slack notification delayed by needs --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2da4f71d85..9745b32160 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -172,6 +172,7 @@ jobs: run: | ./scripts/travis/submit-codecov-coverage.sh - name: CI Run Failure Slack Notification + needs: [ 'ci-checks', 'ci-compile', 'ci-packs-tests', 'ci-unit' ] if: ${{ success() && github.ref == 'refs/pull/1/merge' }} env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 973f031d76fdef885a0afa06e3384bbcb31a1191 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Thu, 31 Dec 2020 23:46:21 +0100 Subject: [PATCH 09/27] Test slack notification with seperated job --- .github/workflows/ci.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9745b32160..afad834ee5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -70,6 +70,8 @@ jobs: # Name of the user who is running the CI (on GitHub Actions this is 'runner') ST2_CI_USER: 'runner' + outputs: + job_status: "{{ job.status }}" steps: - name: Custom Environment Setup # built-in GitHub Actions environment variables @@ -171,9 +173,14 @@ jobs: if: "${{ success() && ((env.TASK == 'ci-unit') || (env.TASK == 'ci-integration')) && (env.ENABLE_COVERAGE == 'yes') }}" run: | ./scripts/travis/submit-codecov-coverage.sh + slack-notification: + name: Slack notification for failed master builds + needs: ci + runs-on: ubuntu-latest + steps: - name: CI Run Failure Slack Notification - needs: [ 'ci-checks', 'ci-compile', 'ci-packs-tests', 'ci-unit' ] - if: ${{ success() && github.ref == 'refs/pull/1/merge' }} + #if: ${{ success() && github.ref == 'refs/pull/1/merge' }} + if: "needs.ci.outputs.job_status=='success'" env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} uses: 8398a7/action-slack@v3 From f5c42bd3e94c03bf8cce8bf6dc579d9de8209caa Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Fri, 1 Jan 2021 00:38:55 +0100 Subject: [PATCH 10/27] Use ${{}} syntax for job status --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index afad834ee5..3816067a69 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -71,7 +71,7 @@ jobs: # Name of the user who is running the CI (on GitHub Actions this is 'runner') ST2_CI_USER: 'runner' outputs: - job_status: "{{ job.status }}" + job_status: "${{ job.status }}" steps: - name: Custom Environment Setup # built-in GitHub Actions environment variables @@ -180,7 +180,7 @@ jobs: steps: - name: CI Run Failure Slack Notification #if: ${{ success() && github.ref == 'refs/pull/1/merge' }} - if: "needs.ci.outputs.job_status=='success'" + if: ${{ always() && needs.ci.outputs.job_status=='success' env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} uses: 8398a7/action-slack@v3 From 6423484eebdc606bd55a5e534552b1ef18df5fe1 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Fri, 1 Jan 2021 00:41:49 +0100 Subject: [PATCH 11/27] Add missing closing --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3816067a69..b5ca9409df 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -180,7 +180,7 @@ jobs: steps: - name: CI Run Failure Slack Notification #if: ${{ success() && github.ref == 'refs/pull/1/merge' }} - if: ${{ always() && needs.ci.outputs.job_status=='success' + if: ${{ always() && needs.ci.outputs.job_status=='success' }} env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} uses: 8398a7/action-slack@v3 From 62e65e0a4433712dee4125728c577923d733b7bc Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Fri, 1 Jan 2021 01:00:40 +0100 Subject: [PATCH 12/27] Break lint checks to test notifications on failures --- .github/workflows/ci.yaml | 2 +- st2common/tests/unit/test_action_db_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b5ca9409df..650f2512c9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -180,7 +180,7 @@ jobs: steps: - name: CI Run Failure Slack Notification #if: ${{ success() && github.ref == 'refs/pull/1/merge' }} - if: ${{ always() && needs.ci.outputs.job_status=='success' }} + if: ${{ always() && needs.ci.outputs.job_status=='failure' }} env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} uses: 8398a7/action-slack@v3 diff --git a/st2common/tests/unit/test_action_db_utils.py b/st2common/tests/unit/test_action_db_utils.py index ba2dcef018..edb16d61fd 100644 --- a/st2common/tests/unit/test_action_db_utils.py +++ b/st2common/tests/unit/test_action_db_utils.py @@ -42,7 +42,7 @@ class ActionDBUtilsTestCase(DbTestCase): liveaction_db = None @classmethod - def setUpClass(cls): + def setUpClass(cls) : super(ActionDBUtilsTestCase, cls).setUpClass() ActionDBUtilsTestCase._setup_test_models() From ab3fc4631e1f86a2fb8290fedee88e0d724403b4 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Fri, 1 Jan 2021 01:20:54 +0100 Subject: [PATCH 13/27] Remove always from slack gha notification --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 650f2512c9..2d190a26d4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,9 +26,9 @@ jobs: - name: 'Pack Tests' task: 'ci-packs-tests' python-version: '3.6' - - name: 'Unit Tests' - task: 'ci-unit' - python-version: '3.6' + #- name: 'Unit Tests' + # task: 'ci-unit' + # python-version: '3.6' # Integration tests are not working yet, still done in Travis # - name: 'Integration Tests' # task: 'ci-integration' @@ -180,14 +180,14 @@ jobs: steps: - name: CI Run Failure Slack Notification #if: ${{ success() && github.ref == 'refs/pull/1/merge' }} - if: ${{ always() && needs.ci.outputs.job_status=='failure' }} + if: ${{ needs.ci.outputs.job_status=='failure' }} env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} uses: 8398a7/action-slack@v3 with: channel: ghci-integration - fields: repo,message,commit,author,action,eventName,ref,workflow,job,took - status: ${{ job.status }} + fields: repo,message,commit,author,action,workflow + status: ${{ needs.ci.outputs.job_status }} # HELPER FOR FUTURE DEVELOPERS: # If your GitHub Actions job is failing and you need to debug it, by default there is From 2a985609b25b0d4ca1eeaf89b4999b4154b42621 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Fri, 1 Jan 2021 01:33:26 +0100 Subject: [PATCH 14/27] Debug ci job status --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2d190a26d4..eba62287b1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -178,6 +178,9 @@ jobs: needs: ci runs-on: ubuntu-latest steps: + - name: Print ci job status + run: + echo ${{ jobs.ci.outputs.job_status }} - name: CI Run Failure Slack Notification #if: ${{ success() && github.ref == 'refs/pull/1/merge' }} if: ${{ needs.ci.outputs.job_status=='failure' }} From eff50931ce41165265c7ab07efabcfc6747608cc Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Fri, 1 Jan 2021 01:43:34 +0100 Subject: [PATCH 15/27] Switch to workflow conclusion --- .github/workflows/ci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eba62287b1..a7f2e8243e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -178,19 +178,19 @@ jobs: needs: ci runs-on: ubuntu-latest steps: - - name: Print ci job status - run: - echo ${{ jobs.ci.outputs.job_status }} + - name: Workflow conclusion + # this creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs + uses: technote-space/workflow-conclusion-action@v2 - name: CI Run Failure Slack Notification #if: ${{ success() && github.ref == 'refs/pull/1/merge' }} - if: ${{ needs.ci.outputs.job_status=='failure' }} + if: env.WORKFLOW_CONCLUSION == 'failure' env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} uses: 8398a7/action-slack@v3 with: channel: ghci-integration fields: repo,message,commit,author,action,workflow - status: ${{ needs.ci.outputs.job_status }} + status: failure # HELPER FOR FUTURE DEVELOPERS: # If your GitHub Actions job is failing and you need to debug it, by default there is From 42e0453dee95cab68d489c172757ec344efa1b08 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Fri, 1 Jan 2021 01:49:45 +0100 Subject: [PATCH 16/27] Always run the workflow conclusion --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a7f2e8243e..f4d2ae5c9f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -179,6 +179,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Workflow conclusion + if: always() # this creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs uses: technote-space/workflow-conclusion-action@v2 - name: CI Run Failure Slack Notification From 97acccaa7abe597aa48293b191161692d7a42e4f Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Fri, 1 Jan 2021 01:55:19 +0100 Subject: [PATCH 17/27] Always run the slack job --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f4d2ae5c9f..c7bc6fa58a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -175,11 +175,11 @@ jobs: ./scripts/travis/submit-codecov-coverage.sh slack-notification: name: Slack notification for failed master builds + if: always() needs: ci runs-on: ubuntu-latest steps: - name: Workflow conclusion - if: always() # this creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs uses: technote-space/workflow-conclusion-action@v2 - name: CI Run Failure Slack Notification From 1edc1f015b9fc8685005b453be2eb47342cb0e85 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Fri, 1 Jan 2021 02:02:53 +0100 Subject: [PATCH 18/27] Drop whole debug and info messages and no longer needed outputs --- .github/workflows/ci.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c7bc6fa58a..65b2e007bc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,9 +26,9 @@ jobs: - name: 'Pack Tests' task: 'ci-packs-tests' python-version: '3.6' - #- name: 'Unit Tests' - # task: 'ci-unit' - # python-version: '3.6' + - name: 'Unit Tests' + task: 'ci-unit' + python-version: '3.6' # Integration tests are not working yet, still done in Travis # - name: 'Integration Tests' # task: 'ci-integration' @@ -70,8 +70,6 @@ jobs: # Name of the user who is running the CI (on GitHub Actions this is 'runner') ST2_CI_USER: 'runner' - outputs: - job_status: "${{ job.status }}" steps: - name: Custom Environment Setup # built-in GitHub Actions environment variables @@ -180,11 +178,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Workflow conclusion - # this creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs + # this step creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs uses: technote-space/workflow-conclusion-action@v2 - name: CI Run Failure Slack Notification - #if: ${{ success() && github.ref == 'refs/pull/1/merge' }} - if: env.WORKFLOW_CONCLUSION == 'failure' + if: ${{ env.WORKFLOW_CONCLUSION == 'failure' && github.ref == 'refs/pull/1/merge' }} env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} uses: 8398a7/action-slack@v3 From 6571981ec46d74d841023ec6dbc0f93639e16bd3 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Fri, 1 Jan 2021 22:27:04 +0100 Subject: [PATCH 19/27] Fix lint checks to pass the tests again --- st2common/tests/unit/test_action_db_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st2common/tests/unit/test_action_db_utils.py b/st2common/tests/unit/test_action_db_utils.py index edb16d61fd..ba2dcef018 100644 --- a/st2common/tests/unit/test_action_db_utils.py +++ b/st2common/tests/unit/test_action_db_utils.py @@ -42,7 +42,7 @@ class ActionDBUtilsTestCase(DbTestCase): liveaction_db = None @classmethod - def setUpClass(cls) : + def setUpClass(cls): super(ActionDBUtilsTestCase, cls).setUpClass() ActionDBUtilsTestCase._setup_test_models() From 76ca3cd528be31630a542fe2ffca9da722b79ce2 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Sun, 3 Jan 2021 23:44:25 +0100 Subject: [PATCH 20/27] Add the tags filter again and change the slack settings to match the st2 workspace --- .github/workflows/ci.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 65b2e007bc..563ed9f8ac 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,6 +3,8 @@ name: ci on: push: branches: ['*'] + tags: + - v* pull_request: type: [opened, reopened, edited] schedule: @@ -181,12 +183,12 @@ jobs: # this step creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs uses: technote-space/workflow-conclusion-action@v2 - name: CI Run Failure Slack Notification - if: ${{ env.WORKFLOW_CONCLUSION == 'failure' && github.ref == 'refs/pull/1/merge' }} + if: ${{ env.WORKFLOW_CONCLUSION == 'failure' && github.ref == 'refs/heads/master' }} env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} uses: 8398a7/action-slack@v3 with: - channel: ghci-integration + channel: development fields: repo,message,commit,author,action,workflow status: failure From 6fc8eab2b7413d26ac560623a4b6b22cdcc3f5f1 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Sun, 3 Jan 2021 23:57:52 +0100 Subject: [PATCH 21/27] Revert "Add the tags filter again and change the slack settings to match the st2 workspace" This reverts commit 76ca3cd528be31630a542fe2ffca9da722b79ce2. --- .github/workflows/ci.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 563ed9f8ac..65b2e007bc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,8 +3,6 @@ name: ci on: push: branches: ['*'] - tags: - - v* pull_request: type: [opened, reopened, edited] schedule: @@ -183,12 +181,12 @@ jobs: # this step creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs uses: technote-space/workflow-conclusion-action@v2 - name: CI Run Failure Slack Notification - if: ${{ env.WORKFLOW_CONCLUSION == 'failure' && github.ref == 'refs/heads/master' }} + if: ${{ env.WORKFLOW_CONCLUSION == 'failure' && github.ref == 'refs/pull/1/merge' }} env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} uses: 8398a7/action-slack@v3 with: - channel: development + channel: ghci-integration fields: repo,message,commit,author,action,workflow status: failure From b7cfb4517bc63a7e21c6df1a32aa7e52a734de66 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Sun, 3 Jan 2021 23:59:26 +0100 Subject: [PATCH 22/27] Revert "Fix lint checks to pass the tests again" to break the lint checks again This reverts commit 6571981ec46d74d841023ec6dbc0f93639e16bd3. --- st2common/tests/unit/test_action_db_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st2common/tests/unit/test_action_db_utils.py b/st2common/tests/unit/test_action_db_utils.py index ba2dcef018..edb16d61fd 100644 --- a/st2common/tests/unit/test_action_db_utils.py +++ b/st2common/tests/unit/test_action_db_utils.py @@ -42,7 +42,7 @@ class ActionDBUtilsTestCase(DbTestCase): liveaction_db = None @classmethod - def setUpClass(cls): + def setUpClass(cls) : super(ActionDBUtilsTestCase, cls).setUpClass() ActionDBUtilsTestCase._setup_test_models() From 74cb78f68234929b2cfc9a042e9204f56def2524 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Mon, 4 Jan 2021 00:36:27 +0100 Subject: [PATCH 23/27] Switch back to the inital slack container for a shorter and more precise message --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 65b2e007bc..40ae1c5c5c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -183,12 +183,12 @@ jobs: - name: CI Run Failure Slack Notification if: ${{ env.WORKFLOW_CONCLUSION == 'failure' && github.ref == 'refs/pull/1/merge' }} env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - uses: 8398a7/action-slack@v3 + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + uses: voxmedia/github-action-slack-notify-build@v1 with: channel: ghci-integration - fields: repo,message,commit,author,action,workflow - status: failure + status: FAILED + color: danger # HELPER FOR FUTURE DEVELOPERS: # If your GitHub Actions job is failing and you need to debug it, by default there is From b0248ccedad793730934fde4afcfdf48be5fbca5 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Mon, 4 Jan 2021 01:01:47 +0100 Subject: [PATCH 24/27] Trigger Slack Notification for master builds only --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 40ae1c5c5c..ba0f1b1469 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -181,7 +181,7 @@ jobs: # this step creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs uses: technote-space/workflow-conclusion-action@v2 - name: CI Run Failure Slack Notification - if: ${{ env.WORKFLOW_CONCLUSION == 'failure' && github.ref == 'refs/pull/1/merge' }} + if: ${{ env.WORKFLOW_CONCLUSION == 'failure' && github.ref == 'refs/heads/master' }} env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} uses: voxmedia/github-action-slack-notify-build@v1 From 92af07e7aa7d92a096647e835afb8b649b69da6f Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Mon, 4 Jan 2021 01:36:14 +0100 Subject: [PATCH 25/27] Revert "Revert "Fix lint checks to pass the tests again" to break the lint checks again" to fix them again This reverts commit b7cfb4517bc63a7e21c6df1a32aa7e52a734de66. --- st2common/tests/unit/test_action_db_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st2common/tests/unit/test_action_db_utils.py b/st2common/tests/unit/test_action_db_utils.py index edb16d61fd..ba2dcef018 100644 --- a/st2common/tests/unit/test_action_db_utils.py +++ b/st2common/tests/unit/test_action_db_utils.py @@ -42,7 +42,7 @@ class ActionDBUtilsTestCase(DbTestCase): liveaction_db = None @classmethod - def setUpClass(cls) : + def setUpClass(cls): super(ActionDBUtilsTestCase, cls).setUpClass() ActionDBUtilsTestCase._setup_test_models() From 177e37832f90a6e9e907ef2a94e4f1febd08e634 Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Mon, 4 Jan 2021 01:37:16 +0100 Subject: [PATCH 26/27] Add the tags filter again --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ba0f1b1469..16fb8c690a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,6 +3,8 @@ name: ci on: push: branches: ['*'] + tags: + - v* pull_request: type: [opened, reopened, edited] schedule: From 43fe60554999a046364e8ca4537524003b4c60bc Mon Sep 17 00:00:00 2001 From: Eugen Cusmaunsa Date: Thu, 14 Jan 2021 20:51:19 +0000 Subject: [PATCH 27/27] Use the 'development' channel for GH Actions Slack notifications --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 16fb8c690a..43673893f3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -188,7 +188,7 @@ jobs: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} uses: voxmedia/github-action-slack-notify-build@v1 with: - channel: ghci-integration + channel: development status: FAILED color: danger