From 3a59fc5b9ae13876d98b916af87fcfc57b885cfa Mon Sep 17 00:00:00 2001 From: jimchamp <28732543+jimchamp@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:06:23 -0700 Subject: [PATCH] Fix broken Slack digest for new comments (#9455) * Correctly compare GitHub username to lead label * Parenthesize generator expression * Set `next` default to empty string * Actually paranthesize generator expression --------- Co-authored-by: jchamp Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Mek Co-authored-by: Scott Barnes --- scripts/gh_scripts/issue_comment_bot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/gh_scripts/issue_comment_bot.py b/scripts/gh_scripts/issue_comment_bot.py index d5651c5ee97..edf1dd61307 100755 --- a/scripts/gh_scripts/issue_comment_bot.py +++ b/scripts/gh_scripts/issue_comment_bot.py @@ -217,7 +217,12 @@ def comment_on_thread(message: str): if lead['leadLabel'] == i['lead_label'] ) slack_id = next( - lead['slackId'] for lead in leads if lead['leadLabel'] == username + ( + lead['slackId'] # type: ignore[syntax] + for lead in leads + if lead['leadLabel'] == f'Lead: @{username}' + ), + '', ) if slack_id: message += f'Lead: {slack_id}\n'