@@ -121,14 +121,72 @@ jobs:
121121 run : |
122122 python __main__.py --report-type sentry-issues --project fenix
123123 python __main__.py --report-type sentry-rates --project fenix
124+ - name : Construct JSON for Slack (Android)
125+ id : construct-json-fenix
126+ run : |
127+ python -m api.sentry.utils --file ./sentry_rates.csv --project fenix
128+ ls sentry-slack-fenix.json
129+ echo "has_data=$([ $(wc -l < sentry_rates.csv) -gt 1 ] && echo true || echo false)" >> $GITHUB_OUTPUT
130+ - name : Send health notification to Slack (Android)
131+ id : slack-sentry-fenix
132+ if : steps.construct-json-fenix.outputs.has_data == 'true'
133+ 134+ with :
135+ payload-file-path : " ./sentry-slack-fenix.json"
136+ payload-templated : true
137+ webhook : ${{ secrets.SLACK_WEBHOOK_PRODUCT_HEALTH }}
138+ webhook-type : incoming-webhook
124139
125140 - name : Sentry query (Android Beta)
126141 run : |
127142 python __main__.py --report-type sentry-issues --project fenix-beta
128143 python __main__.py --report-type sentry-rates --project fenix-beta
129-
130- # Note: We have sent the Android and Android Beta notifications to
131- # mobile-alerts-product-health channel.
144+ - name : Construct JSON for Slack (Android Beta)
145+ id : construct-json-fenix-beta
146+ run : |
147+ python -m api.sentry.utils --file ./sentry_rates.csv --project fenix-beta
148+ ls sentry-slack-fenix-beta.json
149+ echo "has_data=$([ $(wc -l < sentry_rates.csv) -gt 1 ] && echo true || echo false)" >> $GITHUB_OUTPUT
150+ - name : Send health notification to Slack (Android Beta)
151+ id : slack-sentry-fenix-beta
152+ if : steps.construct-json-fenix-beta.outputs.has_data == 'true'
153+ 154+ with :
155+ payload-file-path : " ./sentry-slack-fenix-beta.json"
156+ payload-templated : true
157+ webhook : ${{ secrets.SLACK_WEBHOOK_PRODUCT_HEALTH }}
158+ webhook-type : incoming-webhook
159+ - name : Notify Slack on any type of failure
160+ if : failure()
161+ 162+ with :
163+ payload : |
164+ {
165+ "text": ":x: *Sentry report failed*\nWorkflow: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} #${{ github.run_number }}>",
166+ "blocks": [
167+ {
168+ "type": "section",
169+ "text": {
170+ "type": "mrkdwn",
171+ "text": ":x: *Sentry report failed*\nWorkflow: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} #${{ github.run_number }}>"
172+ }
173+ },
174+ {
175+ "type": "divider"
176+ },
177+ {
178+ "type": "context",
179+ "elements": [
180+ {
181+ "type": "mrkdwn",
182+ "text": ":testops-notify: Created by Mobile Test Engineering"
183+ }
184+ ]
185+ }
186+ ]
187+ }
188+ webhook : ${{ secrets.SLACK_WEBHOOK_URL_TEST_ALERTS_SANDBOX }}
189+ webhook-type : incoming-webhook
132190
133191 notify :
134192 name : Send workflow status notification
0 commit comments