integrations / slack

Bring your code to the conversations you care about with GitHub's integration for Slack
https://slack.github.com/
MIT License
3.09k stars 486 forks source link

Use slack usernames when referring to GitHub user activity #435

Open elliotblackburn opened 6 years ago

elliotblackburn commented 6 years ago

Loving the integration so far, we just started using it! Since there's a way to authenticate with the plugin via /github login, I was thinking it should be possible to use slack usernames when subscribed alerts are pulled through. For example at the moment we're getting something like the following:

BlueHatbRit
Deleted branch `feature/alert-new-sso-user`

My GitHub username is "BlueHatbRit", but my slack username in the instance of my companies workspace is "elliot". It'd be good if we could instead render:

elliot (BlueHatbRit)
Deleted branch `feature/alert-new-sso-user`

Where clicking on "elliot" might link to my slack profile, and clicking on "BlueHatbRit" might link to my github profile (or both to my github profile).

daneah commented 6 years ago

Would very much like to see this as well. When seeing this information in Slack my likely course of action would be to discuss with that person in chat if I have immediate questions. In GitHub I'm typically interacting at the issue/pull request/repo level rather than the user level.

stale[bot] commented 6 years ago

Is this still relevant? If so, just comment with any updates and we'll leave it open. Otherwise, if there is no further activity, it will be closed.

daneah commented 6 years ago

I still believe this holds value, especially in organizations where there are 1) a fair number of people 2) some people don't have an obvious GitHub username/profile picture. If someone hasn't authenticated with GitHub to Slack, could still default to the current behavior.

wstewartii commented 6 years ago

I could definitely use something similar to this in my place of employment to be able to directly ping a github user on the status of a build rather than just dropping it into a channel. Right now it seems that most people are manually maintaining mappings of github usernames to slack usernames to do this or doing the mapping via email addresses if they match but that's not always the case.

stale[bot] commented 6 years ago

Is this still relevant? If so, just comment with any updates and we'll leave it open. Otherwise, if there is no further activity, it will be closed.

daneah commented 6 years ago

Yep, would still like to see this happen ๐Ÿ˜„

haikalpribadi commented 6 years ago

We thought doing /github signin was meant to connect GitHub and Slack usernames, since the response was: :white_check_mark:Success! @haikal is now connected to @haikalpribadi, but this turned out to be misleading. We were expecting to get notifications in Slack for github conversations/notifications, but that turned out not to be the case. I think this is a major flaw in what would be a very great Slack App - definitely a bug worth solving. Does anyone in @integrations team plan on solving this?

chrismasgsi commented 6 years ago

Seconding the request to connect GitHub usernames to Slack usernames. In our use case, we have pull request and review notifications going to a single Slack channel. Notification come in with only GitHub usernames. It would be great to have a way to map these to Slack usernames and have notifications come in with an @ so that each user gets an individual notification when a pull request or review includes them.

leo150 commented 6 years ago

Exactly the same case. Unless there is no link between GitHub username and Slack username, the "Reviewers" field in opened PR is useless.

haikalpribadi commented 6 years ago

@bkeepers I think this issue should be labelled a bug, rather than a feature. :)

chrismasgsi commented 6 years ago

In the short term, a less onerous work around would be to allow the default subscriptions for a repository to be edited/selected by the user. The connection between a GitHub username and a Slack username works if a Slack user subscribes to the repository from their own channel. It's not great that each user has to subscribe to each repository, but in our use case, we have a small team and less than 20 repositories, so it's an option we might consider. However, our team is only interested in getting notifications for pulls, reviews, and statuses. Currently this requires 3 commands for each repository, because subscribing to the repository gives the user unwanted (in our case) subscriptions to issues, deployments, public, commits and releases. So after subscribing to the repo, the user has to unsubscribe from these notifications, and then subscribe to reviews (not included in the default). If the default notifications were configurable for the repo subscription, this could all be accomplished with a single subscribe command.

To be clear: I think most of us would still prefer that the app could map the GitHub username to the Slack username and issue a Slack mention for that user whenever a GitHub notification would be issued that user. However, making the default notifications configurable for app users, I think would be great in any case, and I think might offer a partial workaround. Submitted for consideration.

gimenete commented 6 years ago

I'm implementing some features and I'm considering implementing direct messages to users when they are marked as reviewers, their pull requests get approved/rejected, etc. You would be able to subscribe to whatever you are interested in.

Would this work for you instead of regular mentions?

elliotblackburn commented 6 years ago

Notifications into slack is a nice idea (personally for me I'd want this turned off though), but the original inspiration for the issue was knowing who is responsible for a commit or a PR. Many people at my organisation have had their github account for a number of years and the username may not bare any relation to their actual name (like mine). It would be really useful to see a branch merge or a commit message in the channel and also know the persons slack username so I know who that relates to.

This would help on-boarding onto teams much easier, and would also stop the user having to mentally parse usernames over to the name they know them by on slack / in person.

For me, this is much less about knowing when I do something, and more about knowing when Susie on the payments team issues a PR with the github username XXDragonXX. That's an extreme example, but even joining a company of 50 people can make it an additional barrier to getting work done "Damn, who made that pull request. I want to go and talk to them in person about for reasons X Y and Z" is the thing I think is most useful.

It's been a long time since I've worked with slack bots, but if a user logs into the github app with slack, there should be access to their slack user ID and their slack username. Keeping that up to date is probably the biggest challenge because, as I recall, a slack username can change without any integration getting a notification. However I'm not sure how frequently people change their slack usernames. I guess this should probably be optional as well, as you could argue it's personal information / a possible information "leak" from the organisations slack. But I believe that's all implementation oriented discussion.

haikalpribadi commented 6 years ago

@gimenete I think that's a great idea!

william-jobike commented 5 years ago

@gimenete here we also demand this feature. Hope to be available soon.

ichiaohsu commented 5 years ago

I am curious what the effect of /github signin? I tried this and Slack told me I successfully connected my GitHub account to Slack account, but it seems there are nothing changed. I could still not receive notification on Slack when my colleagues mention me on GitHub comments.

I'll be grateful if anyone could tell me what /github signin is for.

bdejong commented 5 years ago

๐Ÿ‘ @gimenete any idea if this will be coming or not?

elliotblackburn commented 5 years ago

If you want this to happen, the best thing you can do is submit a PR ๐Ÿ˜„

abinoda commented 5 years ago

Just an FYI that Pull Reminders in the GitHub Marketplace does this.

Users are mentioned in Slack instead of having their GitHub usernames printed and there are individual options for receiving DMs for various event types (comments, replies, review requests, etc).

I'm the maintainer of Pull Reminders, so if pricing is an issue email me at abi@pullreminders.com and I'd be happy to give your team a free account.

cc: @gimenete

alinelea commented 5 years ago

we found a workaround using zapier. I have a zap setup from gmail (github emails) to a slack message. setup for assignments, mentions and PR's. interested if anyone else has found a solution.

chrismasgsi commented 5 years ago

Pull Panda just acquired by GitHub provides pretty full featured Slack integration.

https://pullpanda.com/

Christopher Alexander Schlosser Geographic Systems Inc.


From: Aline notifications@github.com Sent: Wednesday, July 10, 2019 2:48:29 PM To: integrations/slack Cc: Christopher Alexander; Mention Subject: Re: [integrations/slack] Use slack usernames when referring to GitHub user activity (#435)

we found a workaround using zapier. I have a zap setup from gmail (github emails) to a slack message. setup for assignments, mentions and PR's. interested if anyone else has found a solution.

โ€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/integrations/slack/issues/435?email_source=notifications&email_token=AJEOZIDQ4ENPW3J2Y7RUCODP6ZKK3A5CNFSM4EUJVLW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZU2XPA#issuecomment-510241724, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJEOZIHQR3V4YTN2TB5JGCLP6ZKK3ANCNFSM4EUJVLWQ.

littlehome-eugene commented 4 years ago

Hello we upgraded github account just for pullpanda https://github.com/integrations/slack/issues/435#issuecomment-452199256

We want to get notified via slack when users are mentioned in github issues.

We tried every conceivable combination desparately hoping to make it work but there's just not much documentation how to do this, and I'm not sure if it's even possible.

Please share us how to do this.. @abinoda

hediet commented 4 years ago

We would also love to have this. So sad that pull panda has been acquired and shut down by github, without this feature being integrated into github.

ashley-hurkoo commented 4 years ago

So disappointed with this. Just migrated from bitbucket to github to find out that the bitbucket slack integration is way better and this is not only regarding usernames but slack integration such as integration with other CI such as CircleCI & Bitrise is richer out of the box by merely just hooking up slack with bitbucket.

abinoda commented 4 years ago

Have you all seen https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/managing-scheduled-reminders-for-your-team

hlascelles commented 4 years ago

That looks like it does a chunk of what we want, but I'd prefer to see what @gimenete was talking about, and have direct slack chats, rather than group chats with a mention.

daneah commented 4 years ago

It would seem this has grown into a larger request for a set of features than the original intent, which was something like "when you mention someone in Slack regarding GitHub activity, use their Slack mention name instead of their GitHub username."

Scheduled reminders have given us pretty much everything we need, on our end.

elliotblackburn commented 4 years ago

It would seem this has grown into a larger request for a set of features than the original intent, which was something like "when you mention someone in Slack regarding GitHub activity, use their Slack mention name instead of their GitHub username."

Yeah it does seem to have gone that way, I'm sure some of these suggestions are valid but it might be worth people splitting those out into separate issues if they're still wanted. Then the contributors and maintainers can discuss those separately and see them clearly.

I'm of the same mind as you @daneah, for the most part scheduled reminders are great. Still my onw request is that the slack integration use slack usernames. The org I work in at the moment has 100's or possibly even 1000's of engineers. Tracing a github handle to a slack handle is substantial effort and if even some of that could be solved within this integration, that would be amazing.

satyasreem commented 3 years ago

I am needing this as well. would be a cool way to call out the the user in slack regarding their recent commit

przemek-oc commented 3 years ago

+1

ElZombieIsra commented 3 years ago

This is a really great feature that would add a lot to this integration. +1

75asa commented 3 years ago

+1

ry4nolson commented 3 years ago

+1

andreibacanu-uipath commented 3 years ago

+1

GiancarlosIO commented 3 years ago

+1 please

chlee1016 commented 3 years ago

This feature is exactly what our team need. +1

eliotanke commented 3 years ago

+1

rkhir commented 3 years ago

+1

bebule commented 3 years ago

+1

ccogan-lh commented 3 years ago

+1

TomSB1423 commented 3 years ago

This would be so useful! +1

JohnnP commented 3 years ago

I agree. This could help us +1.

joshua-cannon-techlabs commented 3 years ago

It's sad to see the prior art had this feature but is retired: https://pullreminders.com/

jarrpa commented 3 years ago

Three years old and still not even an acknowledgement?? Come on, this should be a fundamental feature of the integration. :stuck_out_tongue: Who can we shake down for at least a comment on this?

i.e. +1

ohadzer commented 2 years ago

I agree. This could help us +1.

nyxz commented 2 years ago

We just integrated the bot in our slack and that was the first thing that I noticed - creating new pull requests on GitHub doesn't sent me notification in slack which is why I wanted to use it initially. Previously we used the BitBucket's bot and we are kind of used to that flow. I guess one can workaround that by using Slack's keywords to enable notifications on mentions but that's not ideal. This is one of the oldest top requested features - soon to be 4 yo. I guess this one is related #651

mjhipp commented 2 years ago

Have you all seen help.github.com/en/github/setting-up-and-managing-organizations-and-teams/managing-scheduled-reminders-for-your-team

I have just set up pull request "scheduled reminders" for my team and it looks like using /github signin successfully links your slack name to your github login. The members on my team who have connected their accounts get @mentioned to their slack handle rather than GitHub username. Not the same as the GitHub notifications, but it is good for PR request reminders.

benoittgt commented 1 year ago

As @mjhipp said the scheduled reminders is a good move. Same with for example "Pull request opened" where reviewers or assigned are properly mapped. But on all notifications the initial text of the message do not properly map the Github nickname. I think the biggest part has been done but there is some part that are still missing.

Capture_dโ€™eฬcran_2022-11-14_aฬ€_11_59_17

Also a little bit out of thread but still because I need to know the mapping betweem Github and Slack for internal tools. I would love to see a Github API for Github Integrations.

On /integrations/slack

{
  "orgnanisations": [
    {
      "name": "myorg",
      "channels": [
        {
          "name": "#bot-github",
          "id": "C1234567890"
        }
      ],
      "mapped_users": [
        {
          "github": "benoittgt",
          "slack": "benoit"
        }
      ]
    }
  ]
}
bewuethr commented 1 year ago

I just noticed that when I tagged a few users on a GitHub discussion, with their GitHub handles, the Slack notification for it used the Slack handles! The README mentions this, and it seems to have been added in February. I wonder if that addresses some of the issues in this thread?

The one thing I'd love to have still is an automatic GitHub-to-Slack handle mapping when I post a Slack message directly via API, but using GitHub information. Currently, we have to manually map from GitHub usernames to Slack handles for this.

felipecao commented 1 year ago

Does anyone whether after doing a /github signin on Slack the person's Slack ID becomes available somewhere under the github.actor context?

For instance, i have a workflow using rtCamp/action-slack-notify to send out notifications and i'd like to tag someone on a message (see example below).

In my case, the github.actor piece outputs felipecao as a plain text, whereas what I'd really like is to receive a notification tagging me (which is what the <@U01TC0KNKQQ> part does, in a hardcoded way)

      - name: Fire message
        uses: rtCamp/action-slack-notify@v2
        env:
          SLACK_CHANNEL: releases
          SLACK_MESSAGE: "<@${{ github.actor }}> <@U01TC0KNKQQ> hey check this out"
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

If I could do something like <@${{ github.actor.slack_id }}> that would be perfect, but i don't know if this slack <> github mapping is exposed somehow.