Skip to content

Comments

feat(nimbus): Send channel notifications in slack DMs#14179

Merged
yashikakhurana merged 4 commits intomainfrom
14173
Dec 16, 2025
Merged

feat(nimbus): Send channel notifications in slack DMs#14179
yashikakhurana merged 4 commits intomainfrom
14173

Conversation

@yashikakhurana
Copy link
Contributor

Because

  • We noticed that if the user is not in the slack channel, tagging user won't notify them

This commit

  • Sends DMs to the users as well referencing the slack channel message
  • In case it's not able to reference the channel message, it will still send the notification

Fixes #14173

Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, simple logic, good test coverage, let's give it a go 🎉 thnx @yashikakhurana 🙏

Comment on lines 18 to 32
def _lookup_users(client, emails):
mentions = []
user_ids = []
for email in emails:
if not email:
continue
try:
response = client.users_lookupByEmail(email=email)
mentions.append(f"<@{response['user']['id']}>")
user_id = response["user"]["id"]
mentions.append(f"<@{user_id}>")
user_ids.append(user_id)
except SlackApiError as e:
logger.warning(f"Could not find Slack user for {email}: {e}")
continue
return " ".join(mentions)
return " ".join(mentions), user_ids
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean I'd probably keep this function just to lookup and return the user ids and move constructing the mentions elsewhere rather than fold them both into one func

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure i can do that change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay done!! 🎉

@yashikakhurana
Copy link
Contributor Author

yashikakhurana commented Dec 11, 2025

I am blocking this one as pending on security review (to use updated permissions), once we get the approval will merge this

@yashikakhurana
Copy link
Contributor Author

okay another RRA done, got approval from both security and slack app manager, lets merge this now

@yashikakhurana yashikakhurana added this pull request to the merge queue Dec 16, 2025
github-merge-queue bot pushed a commit that referenced this pull request Dec 16, 2025
Because

- We noticed that if the user is not in the slack channel, tagging user
won't notify them

This commit

- Sends DMs to the users as well referencing the slack channel message
- In case it's not able to reference the channel message, it will still
send the notification

Fixes #14173
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 16, 2025
@yashikakhurana yashikakhurana added this pull request to the merge queue Dec 16, 2025
Merged via the queue into main with commit bd72b54 Dec 16, 2025
18 checks passed
@yashikakhurana yashikakhurana deleted the 14173 branch December 16, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send slack notifications in users DM

2 participants