Add offline runners info in the Slack report (#19169)
* send slack report for offline runners Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -397,8 +397,12 @@ class Message:
|
||||
ci_title_block = {"type": "section", "text": {"type": "mrkdwn", "text": ci_title}}
|
||||
blocks.append(ci_title_block)
|
||||
|
||||
offline_runners = []
|
||||
if runner_not_available:
|
||||
text = "💔 CI runners are not available! Tests are not run. 😭"
|
||||
result = os.environ.get("OFFLINE_RUNNERS")
|
||||
if result is not None:
|
||||
offline_runners = json.loads(result)
|
||||
elif runner_failed:
|
||||
text = "💔 CI runners have problems! Tests are not run. 😭"
|
||||
elif setup_failed:
|
||||
@@ -413,11 +417,18 @@ class Message:
|
||||
"text": text,
|
||||
},
|
||||
}
|
||||
|
||||
text = ""
|
||||
if len(offline_runners) > 0:
|
||||
text = "\n • " + "\n • ".join(offline_runners)
|
||||
text = f"The following runners are offline:\n{text}\n\n"
|
||||
text += "🙏 Let's fix it ASAP! 🙏"
|
||||
|
||||
error_block_2 = {
|
||||
"type": "section",
|
||||
"text": {
|
||||
"type": "plain_text",
|
||||
"text": "🙏 Let's fix it ASAP! 🙏",
|
||||
"text": text,
|
||||
},
|
||||
"accessory": {
|
||||
"type": "button",
|
||||
|
||||
Reference in New Issue
Block a user