-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore: add TBP failures to postgres channel #36630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -499,3 +499,32 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||
| --header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --header 'Content-Type: application/json; charset=utf-8' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --data-raw "$body" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| notify-slack-for-pg: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: ci-test-result | ||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ( failure() && github.ref == 'refs/heads/pg' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Notify failure on workflow run and on Slack | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| set -o errexit | ||||||||||||||||||||||||||||||||||||||||||||||||||
| set -o nounset | ||||||||||||||||||||||||||||||||||||||||||||||||||
| set -o xtrace | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| run_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| slack_message="🚨 TBP workflow failed in <$run_url|${{ vars.EDITION }} attempt ${{ github.run_attempt }} (run ${{ github.run_id }})>." | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # This is the ChannelId of the pro-postgres-sync channel. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| body="$(jq -nc \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --arg channel C07JMLWEXDJ \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --arg text "$slack_message" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| '$ARGS.named' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| )" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -v https://slack.com/api/chat.postMessage \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --fail-with-body \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --header 'Content-Type: application/json; charset=utf-8' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --data-raw "$body" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+502
to
+530
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Class, let's examine this new addition to our workflow! Now, pay attention to how we've expanded our communication strategy. We're not just notifying one channel anymore, but two! This is like sending a note home to both your parents and your grandparents. Let's break it down:
However, there's room for improvement:
Let's make these small adjustments: - curl --version
curl -v https://slack.com/api/chat.postMessage \
+ --fail-with-body \
--header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw "$body"Can anyone tell me why these changes will make our code better? 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.