Skip to content

Commit 7da8d07

Browse files
committed
ping channel instead of each individual reviewer for cr
1 parent a104f8f commit 7da8d07

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/backend/src/utils/slack.utils.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -649,15 +649,14 @@ export const sendStandardCRCreatedNotification = async (
649649
const adminSlackIds = admins.map((a) => a.userSettings?.slackId).filter((id): id is string => !!id);
650650

651651
const allSlackIds = new Set([...headSlackIds, ...adminSlackIds, ...(reviewerSlackId ? [reviewerSlackId] : [])]);
652-
const allMentions = [...allSlackIds].map((id) => `<@${id}>`).join(' ');
653652

654-
if (allMentions) {
655-
const reviewMsg = `${allMentions} Your review has been requested on CR #${cr.identifier}!`;
656-
const crLink = `https://finishlinebyner.com/cr/${cr.crId}`;
657-
await Promise.all(
658-
notifications.map((n) => replyToMessageInThread(n.channelId, n.ts, reviewMsg, crLink, `View CR #${cr.identifier}`))
659-
);
660-
}
653+
const reviewMsg = reviewerSlackId
654+
? `<!channel> <@${reviewerSlackId}> Your review has been requested on CR #${cr.identifier}!`
655+
: `<!channel> Your review has been requested on CR #${cr.identifier}!`;
656+
const crLink = `https://finishlinebyner.com/cr/${cr.crId}`;
657+
await Promise.all(
658+
notifications.map((n) => replyToMessageInThread(n.channelId, n.ts, reviewMsg, crLink, `View CR #${cr.identifier}`))
659+
);
661660

662661
// Send the approve button as an ephemeral message to each head and requested reviewer,
663662
// so only authorized approvers see it. reviewChangeRequest still enforces auth on click.

0 commit comments

Comments
 (0)