Skip to content

Commit

Permalink
ci: Update slack reporting for XTS failure and CITR build promotion (#…
Browse files Browse the repository at this point in the history
…16760)

Signed-off-by: Roger Barker <[email protected]>
  • Loading branch information
rbarkerSL authored Nov 26, 2024
1 parent df149d7 commit fe79dfa
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/zxcron-extended-test-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ jobs:
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
env:
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CITR_WEBHOOK }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CITR_FAILURES_WEBHOOK }}
with:
payload: |
{
"attachments": [
{
"color": "#7647cd",
"color": "#FF0000",
"blocks": [
{
"type": "header",
Expand Down
78 changes: 75 additions & 3 deletions .github/workflows/zxcron-promote-build-candidate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
echo "build-candidate-commit=${CANDIDATE_COMMIT}" >> "${GITHUB_OUTPUT}"
echo "### Build Candidate Found" >> "${GITHUB_STEP_SUMMARY}"
echo "build-candidate-commit=${CANDIDATE_COMMIT}" >> "${GITHUB_STEP_SUMMARY}"
echo "build_candidate_tag=${CANDIDATE_TAG}" >> "${GITHUB_STEP_SUMMARY}"
echo "build-candidate-tag=${CANDIDATE_TAG}" >> "${GITHUB_STEP_SUMMARY}"
else
gh run cancel "${{ github.run_id }}"
fi
Expand All @@ -94,6 +94,8 @@ jobs:
name: Promote Build Candidate
runs-on: network-node-linux-medium
needs: determine-build-candidate
outputs:
build-candidate-tag: ${{ steps.tag-build-candidate.outputs.build-candidate-tag }}
if: ${{ needs.determine-build-candidate.result == 'success' && needs.determine-build-candidate.outputs.build-candidate-exists == 'true' }}
steps:
- name: Harden Runner
Expand Down Expand Up @@ -121,12 +123,14 @@ jobs:
passphrase: ${{ secrets.SVCS_GPG_KEY_PASSPHRASE }}

- name: Tag Build Candidate
id: tag-build-candidate
env:
BUILD_INDEX: ${{ vars.XTS_BUILD_PROMOTION_INDEX }}
run: |
BUILD_TAG="$(printf "build-%05d" "${BUILD_INDEX}")"
git tag --annotate ${BUILD_TAG} --message "chore: tagging commit for build promotion"
git push --set-upstream origin --tags
echo "build-candidate-tag=${BUILD_TAG}" >> "${GITHUB_OUTPUT}"
echo "### Build Promotion Tag Information" >> "${GITHUB_STEP_SUMMARY}"
echo "build-tag=${BUILD_TAG}" >> "${GITHUB_STEP_SUMMARY}"
Expand All @@ -145,6 +149,74 @@ jobs:
echo "### Preview Next Build Tag" >> "${GITHUB_STEP_SUMMARY}"
echo "Next build tag is: ${NEXT_BUILD_TAG}" >> "${GITHUB_STEP_SUMMARY}"
report-promotion:
name: Report Build Promotion
runs-on: network-node-linux-medium
needs:
- determine-build-candidate
- promote-build-candidate
if: ${{ needs.promote-build-candidate.result == 'success' &&
needs.determine-build-candidate.result == 'success' &&
needs.determine-build-candidate.outputs.build-candidate-exists == 'true' }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Report Promoted Build
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
env:
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CITR_OPERATIONS_WEBHOOK }}
with:
payload: |
{
"attachments": [
{
"color": "#00FF00",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":grey_exclamation: Hedera Services - XTS Candidate Promoted for Single Day Performance/Longevity Tests",
"emoji": true
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Build Candidate Promotion Succeeded. See details below.*"
},
"fields": [
{
"type": "plain_text",
"text": "Build Candidate Commit"
},
{
"type": "plain_text",
"text": "${{ needs.determine-build-candidate.outputs.build-candidate-commit }}"
},
{
"type": "plain_text",
"text": "Promoted Build Tag"
},
{
"type": "plain_text",
"text": "${{ needs.promote-build-candidate.outputs.build-candidate-tag }}"
}
]
}
]
}
]
}
report-failure:
name: Report XTS execution failure
runs-on: network-node-linux-medium
Expand All @@ -162,13 +234,13 @@ jobs:
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
env:
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CITR_WEBHOOK }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CITR_FAILURES_WEBHOOK }}
with:
payload: |
{
"attachments": [
{
"color": "#7647cd",
"color": "#FF0000",
"blocks": [
{
"type": "header",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zxf-prepare-extended-test-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ jobs:
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
env:
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CITR_WEBHOOK }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CITR_FAILURES_WEBHOOK }}
with:
payload: |
{
"attachments": [
{
"color": "#7647cd",
"color": "#FF0000",
"blocks": [
{
"type": "header",
Expand Down

0 comments on commit fe79dfa

Please sign in to comment.