Skip to content

Commit

Permalink
Upgrading slack api to v1.27.0 and using slack-message instead of json (
Browse files Browse the repository at this point in the history
#20012)

## Description 
Upgrading slack api to v1.27.0 and using slack-message instead of json

# Test Plan
👀
  • Loading branch information
ebmifa authored Oct 24, 2024
1 parent 0de6c86 commit 463aa77
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 109 deletions.
41 changes: 7 additions & 34 deletions .github/workflows/cargo-llvm-cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
echo "slack_id=$(echo ${slack_id} | tr -d '"')" >> $GITHUB_ENV
- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0 # pin@v1.21.0
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # pin@v1.27.0
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SUI_SHA: ${{ env.sui_sha }}
Expand All @@ -160,36 +160,9 @@ jobs:
ONCALL_NAME: ${{ env.oncall_name }}
with:
channel-id: 'code-coverage'
payload: |
{
"text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Sui commit: <https://github.com/MystenLabs/sui/commit/${{ env.SUI_SHA }}|${{ env.SUI_SHA }}>\nSui branch: `${{ env.SUI_BRANCH_NAME }}`\nRun: <${{ env.GH_JOB_LINK }}|${{ github.run_id }}>"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<@${{ env.SLACK_ID }}>, current `${{ env.ONCALL_NAME }}` oncall, you are notified to look over the code coverage <https://app.codecov.io/github/MystenLabs/sui/tree/${{ env.SUI_BRANCH_NAME_URL }}|report> for the `${{ env.SUI_BRANCH_NAME }}` branch in Sui repo, to manually check if there are coverage regressions."
}
}
]
}
slack-message: |
*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`
Sui commit: <https://github.com/MystenLabs/sui/commit/${{ env.SUI_SHA }}|${{ env.SUI_SHA }}>
Sui branch: `${{ env.SUI_BRANCH_NAME }}`
Run: <${{ env.GH_JOB_LINK }}|${{ github.run_id }}>
<@${{ env.SLACK_ID }}>, current `${{ env.ONCALL_NAME }}` oncall, you are notified to look over the code coverage <https://app.codecov.io/github/MystenLabs/sui/tree/${{ env.SUI_BRANCH_NAME_URL }}|report> for the `${{ env.SUI_BRANCH_NAME }}` branch in Sui repo, to manually check if there are coverage regressions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

steps:
- name: Notify Slack of Examples Changes
uses: slackapi/[email protected]
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # pin@v1.27.0
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
Expand Down
28 changes: 4 additions & 24 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,12 @@ jobs:
- uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # Pin v4.1.1

- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # pin@v1.27.0
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
with:
channel-id: 'build-failures-sui'
payload: |
{
"text": "Workflow *${{ github.workflow }}* failed",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Workflow *${{ github.workflow }}* failed"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Logs are here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
slack-message: |
Workflow *${{ github.workflow }}* failed
Logs are here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
22 changes: 6 additions & 16 deletions .github/workflows/release-notes-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,12 @@ jobs:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel-id: '#ext-mysten-release-notes'
payload: |
{
"text": "PR *${{ matrix.pr }}* Release Notes",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*PR* <https://github.com/MystenLabs/sui/pull/${{ matrix.pr }}|${{ matrix.pr }}> by <@${{ env.slack_id }}>\n<@U03LRLPR1QX> and <@U04A8V9E203> please review release notes for upcoming `v${{ needs.get-list-of-prs.outputs.sui_version }}` release.\n *Release Notes:*\n${{ env.release_notes }}"
}
},
{
"type": "divider"
}
]
}
slack-message: |
"PR *${{ matrix.pr }}* Release Notes
*PR* <https://github.com/MystenLabs/sui/pull/${{ matrix.pr }}|${{ matrix.pr }}> by <@${{ env.slack_id }}>
<@U03LRLPR1QX> and <@U04A8V9E203> please review release notes for upcoming `v${{ needs.get-list-of-prs.outputs.sui_version }}` release.
*Release Notes:*
${{ env.release_notes }}
tag:
name: Adding git tag to processed commit
Expand Down
40 changes: 6 additions & 34 deletions .github/workflows/simulator-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
echo "slack_id=$(echo ${slack_id} | tr -d '"')" >> $GITHUB_ENV
- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0 # pin@v1.21.0
uses: slackapi/slack-github-action@34c3fd73326693ef04728f8611669d918a2d781d # pin@v1.19.0
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SUI_SHA: ${{ env.sui_sha }}
Expand All @@ -144,36 +144,8 @@ jobs:
ONCALL_NAME: ${{ env.oncall_name }}
with:
channel-id: 'simtest-nightly'
payload: |
{
"text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Sui commit: <https://github.com/MystenLabs/sui/commit/${{ env.SUI_SHA }}|${{ env.SUI_SHA }}> \nRun: <${{ env.GH_JOB_LINK }}|${{ github.run_id }}>"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<@${{ env.SLACK_ID }}>, current `${{ env.ONCALL_NAME }}` oncall, please debug failures: `tsh ssh ubuntu@simtest-01` and look in the `/home/ubuntu/simtest_logs/{date}` folder for test results"
}
}
]
}
slack-message: |
*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`
Sui commit: <https://github.com/MystenLabs/sui/commit/${{ env.SUI_SHA }}|${{ env.SUI_SHA }}>
Run: <${{ env.GH_JOB_LINK }}|${{ github.run_id }}>
<@${{ env.SLACK_ID }}>, current `${{ env.ONCALL_NAME }}` oncall, please debug failures: `tsh ssh ubuntu@simtest-01` and look in the `/home/ubuntu/simtest_logs/{date}` folder for test results

0 comments on commit 463aa77

Please sign in to comment.