Skip to content

Commit

Permalink
try notification in reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Aug 8, 2024
1 parent 513943d commit 986a29d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/client-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ contains(join(needs.*.result, ','), 'failure') && format('Some tests failed, notifying <!subteam^{0}|bix-scale-eng>', secrets.COMPAT_SLACK_NOTIFICATION_HANDLE) || 'All Good!' }}"
"text": "${{ contains(join(needs.*.result, ','), 'failure') && format('Some tests failed, notifying <!subteam^{0}|{0}>', secrets.COMPAT_SLACK_NOTIFICATION_HANDLE) || 'All Good!' }}"
}
},
{
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/integration-tests-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
runs-on: ubuntu22.04-16cores-64GB
steps:
- name: Collect Metrics
if: ${{ 'true' == 'false' }}
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1
with:
Expand All @@ -32,28 +31,24 @@ jobs:
this-job-name: Publish Integration Test Image
continue-on-error: true
- name: Checkout the repo
if: ${{ 'true' == 'false' }}
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup Other Tags If Not Workflow Dispatch
id: tags
# if: github.event_name != 'workflow_dispatch'
if: ${{ 'true' == 'false' }}
if: github.event_name != 'workflow_dispatch'
run: |
echo "other_tags=${ECR_TAG}" >> $GITHUB_OUTPUT
- name: Build Image
if: ${{ 'true' == 'false' }}
uses: ./.github/actions/build-test-image
with:
other_tags: ${{ steps.tags.outputs.other_tags }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
- name: Notify Slack
if: always()
# Only run this notification for merge to develop failures
# if: failure() && github.event_name != 'workflow_dispatch'
if: failure() && github.event_name != 'workflow_dispatch'
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
env:
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ jobs:
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }}
with:
channel-id: "#team-test-tooling-internal"
slack-message: ":x: :mild-panic-intensifies: Node Migration Tests Failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}"
slack-message: ":x: :mild-panic-intensifies: Node Migration Tests Failed: \n${{ format('https://github.com/{0}/actions/runs/{1}', github.repository, github.run_id) }}\n${{ format('Notifying <!subteam^{0}|{0}>', secrets.GUARDIAN_SLACK_NOTIFICATION_HANDLE) }}"

## Solana Section
get_solana_sha:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/run-e2e-tests-reusable-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ on:
description: 'Name of the slack notification'
required: false
type: string
slack_notification_after_tests_recipient_handle:
description: 'Slack handle of the person or group to notify'
required: false
type: string
test_log_upload_on_failure:
description: 'Set to "true" to upload the test log on failure as Github artifact'
required: false
Expand Down Expand Up @@ -650,7 +654,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ inputs.slack_notification_after_tests_name }} - ${{ steps.combine_results.outputs.result == 'failure' && 'Failed :x:' || steps.combine_results.outputs.result == 'cancelled' && 'Cancelled :warning:' || 'Passed :white_check_mark:' }}"
"text": "${{ inputs.slack_notification_after_tests_name }} - ${{ steps.combine_results.outputs.result == 'failure' && 'Failed :x:' || steps.combine_results.outputs.result == 'cancelled' && 'Cancelled :warning:' || 'Passed :white_check_mark:' }}${{ inputs.slack_notification_after_tests_recipient_handle != '' && format('\nNotifying {0}', inputs.slack_notification_after_tests_recipient_handle) }}"
}
},
{
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/run-selected-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ on:
test_secrets_override_key:
description: 'Enter the secret key to override test secrets'
required: false
type: string
# TODO: Uncomment once Test Config does not have any secrets. Related ticket https://smartcontract-it.atlassian.net/browse/TT-1392
type: string
# TODO: Uncomment once Test Config does not have any secrets. Related ticket https://smartcontract-it.atlassian.net/browse/TT-1392
# test_config_override_base64:
# required: false
# description: The base64-encoded test config override
# type: string
# type: string
enable_check_test_configurations:
description: 'Set to "true" to enable check-test-configurations job'
required: false
Expand All @@ -29,13 +29,13 @@ on:
with_existing_remote_runner_version:
description: 'Use the existing remote runner version for k8s tests. Example: "d3bf5044af33e08be788a2df31c4a745cf69d787"'
required: false
type: string
type: string
workflow_run_name:
description: 'Enter the name of the workflow run'
default: 'Run E2E Tests'
required: false
type: string

run-name: ${{ inputs.workflow_run_name }}

jobs:
Expand All @@ -45,11 +45,15 @@ jobs:
with:
chainlink_version: ${{ github.event.inputs.chainlink_version }}
test_ids: ${{ github.event.inputs.test_ids }}
# TODO: Uncomment once Test Config does not have any secrets. Related ticket https://smartcontract-it.atlassian.net/browse/TT-1392
# TODO: Uncomment once Test Config does not have any secrets. Related ticket https://smartcontract-it.atlassian.net/browse/TT-1392
# test_config_override_base64: ${{ github.event.inputs.test_config_override_base64 }}
with_existing_remote_runner_version: ${{ github.event.inputs.with_existing_remote_runner_version }}
# Use fromJSON to convert string to boolean. More info: https://github.com/actions/runner/issues/2206#issuecomment-1532246677
enable_check_test_configurations: ${{ fromJSON(github.event.inputs.enable_check_test_configurations) }}
slack_notification_after_tests: true
slack_notification_after_tests_channel_id: "#team-test-tooling-internal"
slack_notification_after_tests_name: "Selected E2E Tests"
slack_notification_after_tests_recipient_handle: ${{ format('<!subteam^{0}|{0}>', secrets.GUARDIAN_SLACK_NOTIFICATION_HANDLE) }}
secrets:
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
Expand All @@ -61,7 +65,7 @@ jobs:
GRAFANA_INTERNAL_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
GRAFANA_INTERNAL_HOST: ${{ secrets.GRAFANA_INTERNAL_HOST }}
GRAFANA_INTERNAL_URL_SHORTENER_TOKEN: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN: ${{ secrets.AWS_OIDC_IAM_ROLE_VALIDATION_PROD_ARN }}
AWS_API_GW_HOST_GRAFANA: ${{ secrets.AWS_API_GW_HOST_GRAFANA }}
Expand Down

0 comments on commit 986a29d

Please sign in to comment.