From eaf90f5aead777e25cdf2744396475185c02a564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Thu, 24 Oct 2024 08:59:57 +0200 Subject: [PATCH] schutzbot: shorten the slack notification We are on a quest to reduce clutter on our Slack channels. Thus, I decided to simplify the daily CI notifications: - the link to the edge pipelines got removed, it's now in bookmarks - several words were removed to make the message shorter - the link to the pipeline is now a hyperlink - the whole message should be a one liner - less text is now bold I've also simplified the format in which we send the message. I think that the block format used before makes redundant line-breaks. Unfortunately, the mentions need to be done using user IDs instead of user names. If you ever need to find them, go to the user's profile, click on the three dots and select "Copy member ID". --- schutzbot/slack_notification.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schutzbot/slack_notification.sh b/schutzbot/slack_notification.sh index 5733697bc..e3b9f11bd 100755 --- a/schutzbot/slack_notification.sh +++ b/schutzbot/slack_notification.sh @@ -8,15 +8,15 @@ if [ -z "${SLACK_WEBHOOK_URL:-}" ]; then fi if [ "$3" == "ga" ]; then - MESSAGE="\"GA composes pipeline execution finished with status *$1* $2 \n QE: @atodorov, @jrusz, @tkosciel\n Link to results: $CI_PIPELINE_URL \"" + MESSAGE="\"<$CI_PIPELINE_URL|GA composes pipeline>: *$1* $2, cc <@U01CUGX9L68>, <@U01Q07AHZ9C>, <@U04PYMDRV5H>\"" else COMPOSE_ID=$(cat COMPOSE_ID) COMPOSER_NVR=$(cat COMPOSER_NVR) - MESSAGE="\"Nightly pipeline execution on *$COMPOSE_ID* with *$COMPOSER_NVR* finished with status *$1* $2 \n QE: @atodorov, @jrusz, @tkosciel\n Link to results: $CI_PIPELINE_URL\n For edge testing status please see https://url.corp.redhat.com/edge-pipelines \"" + MESSAGE="\"<$CI_PIPELINE_URL|Nightly pipeline> ($COMPOSE_ID: $COMPOSER_NVR): *$1* $2, cc <@U01CUGX9L68>, <@U01Q07AHZ9C>, <@U04PYMDRV5H>\"" fi curl \ -X POST \ -H 'Content-type: application/json' \ - --data '{"text": "test", "blocks": [ { "type": "section", "text": {"type": "mrkdwn", "text":'"$MESSAGE"'}}]}' \ + --data '{"text": '"$MESSAGE"'}' \ "$SLACK_WEBHOOK_URL"