From 80d271ba9f5742a02ac4f09e658e2006fabd6a91 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 23 Apr 2025 10:26:58 -0400 Subject: [PATCH 1/4] alerts --- .github/workflows/dbt_alter_gha_task.yml | 7 ++ .github/workflows/dbt_docs_update.yml | 7 ++ .github/workflows/dbt_run_adhoc.yml | 8 ++ .github/workflows/dbt_run_atlas.yml | 7 ++ .github/workflows/dbt_run_deployment.yml | 74 ------------------- .github/workflows/dbt_run_dev_refresh.yml | 7 ++ .../workflows/dbt_run_full_observability.yml | 7 ++ .github/workflows/dbt_run_observability.yml | 7 ++ .github/workflows/dbt_run_scheduled.yml | 7 ++ .../dbt_run_scheduled_non_realtime.yml | 7 ++ .../workflows/dbt_run_streamline_history.yml | 7 ++ ...treamline_realtime_blocks_transactions.yml | 8 ++ ...bt_run_streamline_realtime_tx_receipts.yml | 7 ++ .../dbt_run_streamline_traces_history.yml | 7 ++ .github/workflows/dbt_test_daily.yml | 7 ++ .github/workflows/dbt_test_tasks.yml | 7 ++ .github/workflows/dbt_test_weekly.yml | 7 ++ .github/workflows/slack_notify.yml | 27 +++++++ python_scripts/slack_alert.py | 74 +++++++++++++++++++ 19 files changed, 215 insertions(+), 74 deletions(-) delete mode 100644 .github/workflows/dbt_run_deployment.yml create mode 100644 .github/workflows/slack_notify.yml create mode 100644 python_scripts/slack_alert.py diff --git a/.github/workflows/dbt_alter_gha_task.yml b/.github/workflows/dbt_alter_gha_task.yml index 5f42a74..da864ff 100644 --- a/.github/workflows/dbt_alter_gha_task.yml +++ b/.github/workflows/dbt_alter_gha_task.yml @@ -58,3 +58,10 @@ jobs: - name: Run DBT Jobs run: | dbt run-operation fsc_utils.alter_gha_task --args '{ "task_name": "TRIGGER_${{ env.WORKFLOW_NAME_UPPER }}", "task_action": "${{ inputs.task_action }}" }' + + notify-failure: + needs: [run_dbt_jobs] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_docs_update.yml b/.github/workflows/dbt_docs_update.yml index 8a508c0..04689c9 100644 --- a/.github/workflows/dbt_docs_update.yml +++ b/.github/workflows/dbt_docs_update.yml @@ -73,3 +73,10 @@ jobs: - name: push changes to docs run: | git push -f --set-upstream origin docs + + notify-failure: + needs: [dbt] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_adhoc.yml b/.github/workflows/dbt_run_adhoc.yml index 6ba13f9..499ceef 100644 --- a/.github/workflows/dbt_run_adhoc.yml +++ b/.github/workflows/dbt_run_adhoc.yml @@ -67,3 +67,11 @@ jobs: - name: Run DBT Jobs run: | ${{ inputs.dbt_command }} + + + notify-failure: + needs: [run_dbt_jobs] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_atlas.yml b/.github/workflows/dbt_run_atlas.yml index 68f9b04..8d568a7 100644 --- a/.github/workflows/dbt_run_atlas.yml +++ b/.github/workflows/dbt_run_atlas.yml @@ -54,3 +54,10 @@ jobs: path: | logs target + + notify-failure: + needs: [dbt] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_deployment.yml b/.github/workflows/dbt_run_deployment.yml deleted file mode 100644 index e0467ad..0000000 --- a/.github/workflows/dbt_run_deployment.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: dbt_run_deployment -run-name: dbt_run_deployment - -on: - workflow_dispatch: - branches: - - "main" - inputs: - warehouse: - type: choice - description: Snowflake warehouse - required: true - options: - - DBT - - DBT_CLOUD - - DBT_EMERGENCY - default: DBT - dbt_command: - type: string - description: "DBT Run Command" - required: true - -env: - USE_VARS: "${{ vars.USE_VARS }}" - DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" - DBT_VERSION: "${{ vars.DBT_VERSION }}" - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ inputs.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: false - - - -jobs: - dbt: - runs-on: ubuntu-latest - environment: - name: workflow_prod - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: Run DBT Jobs - run: | - ${{ inputs.dbt_command }} - - - name: Run datashare model - run: | - cnt=$(dbt ls -m fsc_utils.datashare._datashare___create_gold | wc -l ); if [ $cnt -eq 1 ]; then dbt run -m fsc_utils.datashare._datashare___create_gold; fi; - dbt run-operation run_query --args "{sql: call admin.datashare.sp_grant_share_permissions('${{ env.DATABASE }}')}" - - - name: Store logs - uses: actions/upload-artifact@v4 - with: - name: dbt-logs - path: | - logs - target diff --git a/.github/workflows/dbt_run_dev_refresh.yml b/.github/workflows/dbt_run_dev_refresh.yml index cfcc3d1..8d8bb3b 100644 --- a/.github/workflows/dbt_run_dev_refresh.yml +++ b/.github/workflows/dbt_run_dev_refresh.yml @@ -55,3 +55,10 @@ jobs: path: | logs target + + notify-failure: + needs: [dbt] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_full_observability.yml b/.github/workflows/dbt_run_full_observability.yml index bb2ea71..79a8a72 100644 --- a/.github/workflows/dbt_run_full_observability.yml +++ b/.github/workflows/dbt_run_full_observability.yml @@ -46,3 +46,10 @@ jobs: - name: Run DBT Jobs run: | dbt run --threads 2 --vars '{"OBSERV_FULL_TEST":True}' -m tag:observability + + notify-failure: + needs: [run_dbt_jobs] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_observability.yml b/.github/workflows/dbt_run_observability.yml index 4c5cd4e..e8418d2 100644 --- a/.github/workflows/dbt_run_observability.yml +++ b/.github/workflows/dbt_run_observability.yml @@ -46,3 +46,10 @@ jobs: - name: Run DBT Jobs run: | dbt run --threads 2 --vars '{"OBSERV_FULL_TEST":False}' -m tag:observability + + notify-failure: + needs: [run_dbt_jobs] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled.yml b/.github/workflows/dbt_run_scheduled.yml index bb57d23..499c36b 100644 --- a/.github/workflows/dbt_run_scheduled.yml +++ b/.github/workflows/dbt_run_scheduled.yml @@ -54,3 +54,10 @@ jobs: path: | logs target + + notify-failure: + needs: [dbt] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_scheduled_non_realtime.yml b/.github/workflows/dbt_run_scheduled_non_realtime.yml index 6f8d10a..8e176c7 100644 --- a/.github/workflows/dbt_run_scheduled_non_realtime.yml +++ b/.github/workflows/dbt_run_scheduled_non_realtime.yml @@ -45,3 +45,10 @@ jobs: - name: Run DBT Jobs run: | dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "tag:non_realtime" + + notify-failure: + needs: [run_dbt_jobs] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_history.yml b/.github/workflows/dbt_run_streamline_history.yml index 8fad571..97f43ac 100644 --- a/.github/workflows/dbt_run_streamline_history.yml +++ b/.github/workflows/dbt_run_streamline_history.yml @@ -51,3 +51,10 @@ jobs: path: | logs target + + notify-failure: + needs: [dbt] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_realtime_blocks_transactions.yml b/.github/workflows/dbt_run_streamline_realtime_blocks_transactions.yml index 3b6d2a2..f77b333 100644 --- a/.github/workflows/dbt_run_streamline_realtime_blocks_transactions.yml +++ b/.github/workflows/dbt_run_streamline_realtime_blocks_transactions.yml @@ -54,3 +54,11 @@ jobs: path: | logs target + + + notify-failure: + needs: [dbt] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_realtime_tx_receipts.yml b/.github/workflows/dbt_run_streamline_realtime_tx_receipts.yml index 4b054bf..a438981 100644 --- a/.github/workflows/dbt_run_streamline_realtime_tx_receipts.yml +++ b/.github/workflows/dbt_run_streamline_realtime_tx_receipts.yml @@ -54,3 +54,10 @@ jobs: path: | logs target + + notify-failure: + needs: [dbt] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_streamline_traces_history.yml b/.github/workflows/dbt_run_streamline_traces_history.yml index cf4f2de..c7adc16 100644 --- a/.github/workflows/dbt_run_streamline_traces_history.yml +++ b/.github/workflows/dbt_run_streamline_traces_history.yml @@ -54,3 +54,10 @@ jobs: path: | logs target + + notify-failure: + needs: [dbt] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_test_daily.yml b/.github/workflows/dbt_test_daily.yml index fba5876..f1026a2 100644 --- a/.github/workflows/dbt_test_daily.yml +++ b/.github/workflows/dbt_test_daily.yml @@ -51,3 +51,10 @@ jobs: - name: Log test results run: | python python_scripts/test_alert/dbt_test_alert.py + + notify-failure: + needs: [run_dbt_jobs] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_test_tasks.yml b/.github/workflows/dbt_test_tasks.yml index d9a9781..e3a1d68 100644 --- a/.github/workflows/dbt_test_tasks.yml +++ b/.github/workflows/dbt_test_tasks.yml @@ -42,3 +42,10 @@ jobs: - name: Run DBT Jobs run: | dbt test -m models/github_actions/github_actions__current_task_status.sql + + notify-failure: + needs: [run_dbt_jobs] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_test_weekly.yml b/.github/workflows/dbt_test_weekly.yml index a1f3c55..906a7cf 100644 --- a/.github/workflows/dbt_test_weekly.yml +++ b/.github/workflows/dbt_test_weekly.yml @@ -51,3 +51,10 @@ jobs: - name: Log test results run: | python python_scripts/test_alert/dbt_test_alert.py + + notify-failure: + needs: [run_dbt_jobs] + if: failure() + uses: ./.github/workflows/slack_notify.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/slack_notify.yml b/.github/workflows/slack_notify.yml new file mode 100644 index 0000000..1866ba2 --- /dev/null +++ b/.github/workflows/slack_notify.yml @@ -0,0 +1,27 @@ +name: Slack Notification +on: + workflow_call: + secrets: + SLACK_WEBHOOK_URL: + required: true + +jobs: + notify: + runs-on: ubuntu-latest + environment: workflow_prod + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install dependencies + run: pip install requests + + - name: Send Slack notification + run: python python/slack_alert.py + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/python_scripts/slack_alert.py b/python_scripts/slack_alert.py new file mode 100644 index 0000000..4e624f7 --- /dev/null +++ b/python_scripts/slack_alert.py @@ -0,0 +1,74 @@ +import requests +import os +import sys + +def create_message(): + """Creates a simple failure notification message with repo, workflow name, and URL""" + + # Get GitHub environment variables + repository = os.environ.get('GITHUB_REPOSITORY', 'Unknown repository') + repo_name = repository.split('/')[-1] if '/' in repository else repository + workflow_name = os.environ.get('GITHUB_WORKFLOW', 'Unknown workflow') + run_id = os.environ.get('GITHUB_RUN_ID', '') + server_url = os.environ.get('GITHUB_SERVER_URL', 'https://github.com') + + # Build the workflow URL + workflow_url = f"{server_url}/{repository}/actions/runs/{run_id}" + + message_body = { + "text": f"Failure in {repo_name}", + "attachments": [ + { + "color": "#f44336", # Red color for failures + "fields": [ + { + "title": "Repository", + "value": repository, + "short": True + }, + { + "title": "Workflow", + "value": workflow_name, + "short": True + } + ], + "actions": [ + { + "type": "button", + "text": "View Workflow Run", + "style": "primary", + "url": workflow_url + } + ], + "footer": "GitHub Actions" + } + ] + } + + return message_body + +def send_alert(webhook_url): + """Sends a failure notification to Slack""" + + message = create_message() + + try: + response = requests.post(webhook_url, json=message) + + if response.status_code == 200: + print("Successfully sent Slack notification") + else: + print(f"Failed to send Slack notification: {response.status_code} {response.text}") + sys.exit(1) + except Exception as e: + print(f"Error sending Slack notification: {str(e)}") + sys.exit(1) + +if __name__ == '__main__': + webhook_url = os.environ.get("SLACK_WEBHOOK_URL") + + if not webhook_url: + print("ERROR: SLACK_WEBHOOK_URL environment variable is required") + sys.exit(1) + + send_alert(webhook_url) \ No newline at end of file From 4a5000a8be39916def55a730f957dcf72db3cef7 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 23 Apr 2025 10:32:10 -0400 Subject: [PATCH 2/4] evm --- .github/workflows/dbt_alter_gha_task.yml | 2 +- .github/workflows/dbt_docs_update.yml | 2 +- .github/workflows/dbt_run_adhoc.yml | 2 +- .github/workflows/dbt_run_atlas.yml | 2 +- .github/workflows/dbt_run_full_observability.yml | 2 +- .github/workflows/dbt_run_observability.yml | 2 +- .github/workflows/dbt_run_scheduled.yml | 2 +- .github/workflows/dbt_run_scheduled_non_realtime.yml | 2 +- .github/workflows/dbt_run_streamline_history.yml | 2 +- .../dbt_run_streamline_realtime_blocks_transactions.yml | 2 +- .github/workflows/dbt_run_streamline_realtime_tx_receipts.yml | 2 +- .github/workflows/dbt_run_streamline_traces_history.yml | 2 +- .github/workflows/dbt_test_daily.yml | 2 +- .github/workflows/dbt_test_tasks.yml | 2 +- .github/workflows/dbt_test_weekly.yml | 2 +- .github/workflows/slack_notify.yml | 4 ++-- python_scripts/slack_alert.py | 4 ++-- 17 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/dbt_alter_gha_task.yml b/.github/workflows/dbt_alter_gha_task.yml index da864ff..eae40eb 100644 --- a/.github/workflows/dbt_alter_gha_task.yml +++ b/.github/workflows/dbt_alter_gha_task.yml @@ -64,4 +64,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_docs_update.yml b/.github/workflows/dbt_docs_update.yml index 04689c9..5072f54 100644 --- a/.github/workflows/dbt_docs_update.yml +++ b/.github/workflows/dbt_docs_update.yml @@ -79,4 +79,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_adhoc.yml b/.github/workflows/dbt_run_adhoc.yml index 499ceef..0ca9815 100644 --- a/.github/workflows/dbt_run_adhoc.yml +++ b/.github/workflows/dbt_run_adhoc.yml @@ -74,4 +74,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_atlas.yml b/.github/workflows/dbt_run_atlas.yml index 8d568a7..fc67997 100644 --- a/.github/workflows/dbt_run_atlas.yml +++ b/.github/workflows/dbt_run_atlas.yml @@ -60,4 +60,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_full_observability.yml b/.github/workflows/dbt_run_full_observability.yml index 79a8a72..79158a1 100644 --- a/.github/workflows/dbt_run_full_observability.yml +++ b/.github/workflows/dbt_run_full_observability.yml @@ -52,4 +52,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_observability.yml b/.github/workflows/dbt_run_observability.yml index e8418d2..8219e82 100644 --- a/.github/workflows/dbt_run_observability.yml +++ b/.github/workflows/dbt_run_observability.yml @@ -52,4 +52,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled.yml b/.github/workflows/dbt_run_scheduled.yml index 499c36b..023e701 100644 --- a/.github/workflows/dbt_run_scheduled.yml +++ b/.github/workflows/dbt_run_scheduled.yml @@ -60,4 +60,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_scheduled_non_realtime.yml b/.github/workflows/dbt_run_scheduled_non_realtime.yml index 8e176c7..22e98d3 100644 --- a/.github/workflows/dbt_run_scheduled_non_realtime.yml +++ b/.github/workflows/dbt_run_scheduled_non_realtime.yml @@ -51,4 +51,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_history.yml b/.github/workflows/dbt_run_streamline_history.yml index 97f43ac..7281f01 100644 --- a/.github/workflows/dbt_run_streamline_history.yml +++ b/.github/workflows/dbt_run_streamline_history.yml @@ -57,4 +57,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_realtime_blocks_transactions.yml b/.github/workflows/dbt_run_streamline_realtime_blocks_transactions.yml index f77b333..d9b25c4 100644 --- a/.github/workflows/dbt_run_streamline_realtime_blocks_transactions.yml +++ b/.github/workflows/dbt_run_streamline_realtime_blocks_transactions.yml @@ -61,4 +61,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_realtime_tx_receipts.yml b/.github/workflows/dbt_run_streamline_realtime_tx_receipts.yml index a438981..e9ac3f7 100644 --- a/.github/workflows/dbt_run_streamline_realtime_tx_receipts.yml +++ b/.github/workflows/dbt_run_streamline_realtime_tx_receipts.yml @@ -60,4 +60,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_streamline_traces_history.yml b/.github/workflows/dbt_run_streamline_traces_history.yml index c7adc16..3bae2d5 100644 --- a/.github/workflows/dbt_run_streamline_traces_history.yml +++ b/.github/workflows/dbt_run_streamline_traces_history.yml @@ -60,4 +60,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_test_daily.yml b/.github/workflows/dbt_test_daily.yml index f1026a2..7602fef 100644 --- a/.github/workflows/dbt_test_daily.yml +++ b/.github/workflows/dbt_test_daily.yml @@ -57,4 +57,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_test_tasks.yml b/.github/workflows/dbt_test_tasks.yml index e3a1d68..bcfc912 100644 --- a/.github/workflows/dbt_test_tasks.yml +++ b/.github/workflows/dbt_test_tasks.yml @@ -48,4 +48,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_test_weekly.yml b/.github/workflows/dbt_test_weekly.yml index 906a7cf..f5fd760 100644 --- a/.github/workflows/dbt_test_weekly.yml +++ b/.github/workflows/dbt_test_weekly.yml @@ -57,4 +57,4 @@ jobs: if: failure() uses: ./.github/workflows/slack_notify.yml secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/slack_notify.yml b/.github/workflows/slack_notify.yml index 1866ba2..0d93718 100644 --- a/.github/workflows/slack_notify.yml +++ b/.github/workflows/slack_notify.yml @@ -2,7 +2,7 @@ name: Slack Notification on: workflow_call: secrets: - SLACK_WEBHOOK_URL: + EVM_SLACK_WEBHOOK_URL: required: true jobs: @@ -24,4 +24,4 @@ jobs: - name: Send Slack notification run: python python/slack_alert.py env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + EVM_SLACK_WEBHOOK_URL: ${{ secrets.EVM_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/python_scripts/slack_alert.py b/python_scripts/slack_alert.py index 4e624f7..5449abf 100644 --- a/python_scripts/slack_alert.py +++ b/python_scripts/slack_alert.py @@ -65,10 +65,10 @@ def send_alert(webhook_url): sys.exit(1) if __name__ == '__main__': - webhook_url = os.environ.get("SLACK_WEBHOOK_URL") + webhook_url = os.environ.get("EVM_SLACK_WEBHOOK_URL") if not webhook_url: - print("ERROR: SLACK_WEBHOOK_URL environment variable is required") + print("ERROR: EVM_SLACK_WEBHOOK_URL environment variable is required") sys.exit(1) send_alert(webhook_url) \ No newline at end of file From 433d49a878ca64ab4aa7819230d314924708ed84 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 23 Apr 2025 14:31:00 -0400 Subject: [PATCH 3/4] folder --- {python_scripts => python}/slack_alert.py | 0 {python_scripts => python}/test_alert/dbt_test_alert.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {python_scripts => python}/slack_alert.py (100%) rename {python_scripts => python}/test_alert/dbt_test_alert.py (100%) diff --git a/python_scripts/slack_alert.py b/python/slack_alert.py similarity index 100% rename from python_scripts/slack_alert.py rename to python/slack_alert.py diff --git a/python_scripts/test_alert/dbt_test_alert.py b/python/test_alert/dbt_test_alert.py similarity index 100% rename from python_scripts/test_alert/dbt_test_alert.py rename to python/test_alert/dbt_test_alert.py From 0e4b34c9c116c46c11ac9c7e4e05b941eb5bf418 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 23 Apr 2025 14:32:39 -0400 Subject: [PATCH 4/4] path --- .github/workflows/dbt_test_daily.yml | 4 ---- .github/workflows/dbt_test_weekly.yml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/.github/workflows/dbt_test_daily.yml b/.github/workflows/dbt_test_daily.yml index 7602fef..96befdc 100644 --- a/.github/workflows/dbt_test_daily.yml +++ b/.github/workflows/dbt_test_daily.yml @@ -48,10 +48,6 @@ jobs: dbt test --exclude tag:full_test --models tag:recent_test continue-on-error: true - - name: Log test results - run: | - python python_scripts/test_alert/dbt_test_alert.py - notify-failure: needs: [run_dbt_jobs] if: failure() diff --git a/.github/workflows/dbt_test_weekly.yml b/.github/workflows/dbt_test_weekly.yml index f5fd760..5af2efe 100644 --- a/.github/workflows/dbt_test_weekly.yml +++ b/.github/workflows/dbt_test_weekly.yml @@ -48,10 +48,6 @@ jobs: dbt test --exclude tag:recent_test --models tag:full_test continue-on-error: true - - name: Log test results - run: | - python python_scripts/test_alert/dbt_test_alert.py - notify-failure: needs: [run_dbt_jobs] if: failure()